source: src/UIElements/CommandLineUI/CommandLineWindow.cpp@ 980dd6

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 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 980dd6 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
Line 
1/*
2 * CommandLineWindow.cpp
3 *
4 * Created on: May 8, 2010
5 * Author: heber
6 */
7
8#include <boost/bind.hpp>
9
10#include "CommandLineUI/CommandLineWindow.hpp"
11#include "CommandLineUI/CommandLineStatusIndicator.hpp"
12
13#include "Actions/ActionRegistry.hpp"
14#include "Actions/AnalysisAction/MolecularVolumeAction.hpp"
15#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
16#include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
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"
23#include "Actions/CmdAction/HelpAction.hpp"
24#include "Actions/CmdAction/VerboseAction.hpp"
25#include "Actions/CmdAction/VersionAction.hpp"
26#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
27#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
28#include "Actions/FragmentationAction/FragmentationAction.hpp"
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"
36#include "Actions/MoleculeAction/TranslateAction.hpp"
37#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
38#include "Actions/ParserAction/LoadXyzAction.hpp"
39#include "Actions/ParserAction/SaveXyzAction.hpp"
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"
52#include "CommandLineParser.hpp"
53
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
59CommandLineWindow::CommandLineWindow()
60{
61 // create and register all command line callable actions
62 populateAnalysisActions();
63 populateAtomActions();
64 populateCmdActions();
65 populateFragmentationActions();
66 populateMoleculeActions();
67 populateParserActions();
68 populateTesselationActions();
69 populateWorldActions();
70
71 // Add status indicators etc...
72 statusIndicator = new CommandLineStatusIndicator();
73}
74
75CommandLineWindow::~CommandLineWindow()
76{
77 delete statusIndicator;
78}
79
80void CommandLineWindow::display() {
81 // go through all possible actions
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();
86 }
87}
88
89void CommandLineWindow::populateAnalysisActions()
90{
91 new AnalysisMolecularVolumeAction();
92 new AnalysisPairCorrelationAction();
93 new AnalysisPrincipalAxisSystemAction();
94}
95
96void CommandLineWindow::populateAtomActions()
97{
98 new AtomAddAction();
99 new AtomChangeElementAction();
100 new AtomRemoveAction();
101}
102
103void CommandLineWindow::populateCmdActions()
104{
105 new CommandLineBondLengthTableAction();
106 new CommandLineElementDbAction();
107 new CommandLineFastParsingAction();
108 new CommandLineHelpAction();
109 new CommandLineVerboseAction();
110 new CommandLineVersionAction();
111}
112
113void CommandLineWindow::populateFragmentationActions()
114{
115 new FragmentationDepthFirstSearchAction();
116 new FragmentationFragmentationAction();
117 new FragmentationSubgraphDissectionAction();
118}
119
120void CommandLineWindow::populateMoleculeActions()
121{
122 new MoleculeBondFileAction();
123 new MoleculeChangeNameAction();
124 new MoleculeFillWithMoleculeAction();
125 new MoleculeLinearInterpolationofTrajectoriesAction();
126 new MoleculeSaveAdjacencyAction();
127 new MoleculeSaveBondsAction();
128 new MoleculeSaveTemperatureAction();
129 new MoleculeTranslateAction();
130 new MoleculeVerletIntegrationAction();
131}
132
133void CommandLineWindow::populateParserActions()
134{
135 new ParserLoadXyzAction();
136 new ParserSaveXyzAction();
137}
138
139void CommandLineWindow::populateTesselationActions()
140{
141 new TesselationConvexEnvelopeAction();
142 new TesselationNonConvexEnvelopeAction();
143}
144
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.