source: src/UIElements/CommandLineUI/CommandLineWindow.cpp@ 6866aa

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 Candidate_v1.7.0 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 6866aa was 77b2d7, checked in by Frederik Heber <heber@…>, 15 years ago

Cases 't' and 'T' are now handled by CommandLineUI.

  • TESTFIX: both cases have "--molecule-by-id 0 --periodic 0/1" added.
  • ParseCommandLineOptions()- case 'T' removed as is handled by --periodic switch.
  • added missing Action instantiation to CommandLineWindow::populateMoleculeActions().
  • Property mode set to 100644
File size: 5.2 KB
RevLine 
[a2ab15]1/*
2 * CommandLineWindow.cpp
3 *
4 * Created on: May 8, 2010
5 * Author: heber
6 */
7
8#include <boost/bind.hpp>
9
[5079a0]10#include "CommandLineUI/CommandLineWindow.hpp"
11#include "CommandLineUI/CommandLineStatusIndicator.hpp"
[a2ab15]12
[4380af]13#include "Actions/ActionRegistry.hpp"
[104524]14#include "Actions/AnalysisAction/MolecularVolumeAction.hpp"
[97ebf8]15#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
[104524]16#include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
[97ebf8]17#include "Actions/AtomAction/AddAction.hpp"
18#include "Actions/AtomAction/ChangeElementAction.hpp"
19#include "Actions/AtomAction/RemoveAction.hpp"
20#include "Actions/CmdAction/BondLengthTableAction.hpp"
21#include "Actions/CmdAction/ElementDbAction.hpp"
22#include "Actions/CmdAction/FastParsingAction.hpp"
[d893f79]23#include "Actions/CmdAction/HelpAction.hpp"
[97ebf8]24#include "Actions/CmdAction/VerboseAction.hpp"
[50dfda]25#include "Actions/CmdAction/VersionAction.hpp"
[97ebf8]26#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
27#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
[e4b5de]28#include "Actions/FragmentationAction/FragmentationAction.hpp"
[97ebf8]29#include "Actions/MoleculeAction/BondFileAction.hpp"
30#include "Actions/MoleculeAction/ChangeNameAction.hpp"
31#include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
32#include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
33#include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
34#include "Actions/MoleculeAction/SaveBondsAction.hpp"
35#include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
[77b2d7]36#include "Actions/MoleculeAction/TranslateAction.hpp"
[97ebf8]37#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
[d893f79]38#include "Actions/ParserAction/LoadXyzAction.hpp"
39#include "Actions/ParserAction/SaveXyzAction.hpp"
[97ebf8]40#include "Actions/TesselationAction/ConvexEnvelopeAction.hpp"
41#include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp"
42#include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
43#include "Actions/WorldAction/BoundInBoxAction.hpp"
44#include "Actions/WorldAction/CenterInBoxAction.hpp"
45#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
46#include "Actions/WorldAction/ChangeBoxAction.hpp"
47#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
48#include "Actions/WorldAction/RepeatBoxAction.hpp"
49#include "Actions/WorldAction/ScaleBoxAction.hpp"
50#include "Actions/WorldAction/SetDefaultNameAction.hpp"
51#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
[4380af]52#include "CommandLineParser.hpp"
[d893f79]53
[a2ab15]54#include <iostream>
55
56using namespace std;
57
58// TODO: see what code can be moved to a base class for Graphic and CommandLine Windows
[d893f79]59CommandLineWindow::CommandLineWindow()
[a2ab15]60{
[d893f79]61 // create and register all command line callable actions
[97ebf8]62 populateAnalysisActions();
[50dfda]63 populateAtomActions();
64 populateCmdActions();
65 populateFragmentationActions();
66 populateMoleculeActions();
[d893f79]67 populateParserActions();
[50dfda]68 populateTesselationActions();
[97ebf8]69 populateWorldActions();
[a2ab15]70
71 // Add status indicators etc...
72 statusIndicator = new CommandLineStatusIndicator();
73}
74
75CommandLineWindow::~CommandLineWindow()
76{
77 delete statusIndicator;
78}
79
80void CommandLineWindow::display() {
[4380af]81 // go through all possible actions
[7e6b00]82 for (std::list<std::string>::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) {
83 cout << "Checking presence of " << *CommandRunner << endl;
84 if (ActionRegistry::getInstance().isActionByNamePresent(*CommandRunner))
85 ActionRegistry::getInstance().getActionByName(*CommandRunner)->call();
[4380af]86 }
[a2ab15]87}
[d893f79]88
[97ebf8]89void CommandLineWindow::populateAnalysisActions()
90{
[104524]91 new AnalysisMolecularVolumeAction();
[97ebf8]92 new AnalysisPairCorrelationAction();
[104524]93 new AnalysisPrincipalAxisSystemAction();
[97ebf8]94}
95
[50dfda]96void CommandLineWindow::populateAtomActions()
97{
[97ebf8]98 new AtomAddAction();
99 new AtomChangeElementAction();
100 new AtomRemoveAction();
[50dfda]101}
102
103void CommandLineWindow::populateCmdActions()
[d893f79]104{
[97ebf8]105 new CommandLineBondLengthTableAction();
106 new CommandLineElementDbAction();
107 new CommandLineFastParsingAction();
[e3ecc1a]108 new CommandLineHelpAction();
[97ebf8]109 new CommandLineVerboseAction();
[50dfda]110 new CommandLineVersionAction();
111}
112
113void CommandLineWindow::populateFragmentationActions()
114{
[97ebf8]115 new FragmentationDepthFirstSearchAction();
[e4b5de]116 new FragmentationFragmentationAction();
117 new FragmentationSubgraphDissectionAction();
[50dfda]118}
119
120void CommandLineWindow::populateMoleculeActions()
121{
[97ebf8]122 new MoleculeBondFileAction();
123 new MoleculeChangeNameAction();
124 new MoleculeFillWithMoleculeAction();
125 new MoleculeLinearInterpolationofTrajectoriesAction();
126 new MoleculeSaveAdjacencyAction();
127 new MoleculeSaveBondsAction();
128 new MoleculeSaveTemperatureAction();
[77b2d7]129 new MoleculeTranslateAction();
[97ebf8]130 new MoleculeVerletIntegrationAction();
[50dfda]131}
132
133void CommandLineWindow::populateParserActions()
134{
[d893f79]135 new ParserLoadXyzAction();
136 new ParserSaveXyzAction();
137}
138
[50dfda]139void CommandLineWindow::populateTesselationActions()
140{
[97ebf8]141 new TesselationConvexEnvelopeAction();
142 new TesselationNonConvexEnvelopeAction();
[50dfda]143}
144
[97ebf8]145void CommandLineWindow::populateWorldActions()
146{
147 new WorldAddEmptyBoundaryAction();
148 new WorldBoundInBoxAction();
149 new WorldCenterInBoxAction();
150 new WorldCenterOnEdgeAction();
151 new WorldChangeBoxAction();
152 new WorldRemoveSphereOfAtomsAction();
153 new WorldRepeatBoxAction();
154 new WorldScaleBoxAction();
155 new WorldSetDefaultNameAction();
156 new WorldSetGaussianBasisAction();
157}
Note: See TracBrowser for help on using the repository browser.