Changeset f4b6bc9 for src/UIElements/CommandLineUI
- Timestamp:
- Apr 4, 2018, 4:59:24 PM (7 years ago)
- Branches:
- Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
- Children:
- 0aae02
- Parents:
- 775f3f
- git-author:
- Frederik Heber <frederik.heber@…> (07/06/17 22:18:13)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/04/18 16:59:24)
- Location:
- src/UIElements/CommandLineUI/Query
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
r775f3f rf4b6bc9 55 55 CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {} 56 56 57 boolCommandLineDialog::AtomCommandLineQuery::handle() {57 void CommandLineDialog::AtomCommandLineQuery::handle() { 58 58 int IdxOfAtom = -1; 59 59 if (CommandLineParser::getInstance().vm.count(getTitle())) { … … 62 62 } catch(boost::bad_any_cast &e) { 63 63 IdxOfAtom = -1; 64 return false;64 return; 65 65 } 66 66 temp = const_cast<const World &>(World::getInstance()).getAtom(AtomById(IdxOfAtom)); 67 returntrue;67 handleSuccess = true; 68 68 } 69 return false;70 69 } 71 70 -
src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
r775f3f rf4b6bc9 50 50 CommandLineDialog::AtomsCommandLineQuery::~AtomsCommandLineQuery() {} 51 51 52 boolCommandLineDialog::AtomsCommandLineQuery::handle() {52 void CommandLineDialog::AtomsCommandLineQuery::handle() { 53 53 std::vector<int> IdxOfAtom; 54 54 if (CommandLineParser::getInstance().vm.count(getTitle())) { … … 57 57 } catch(boost::bad_any_cast &e) { 58 58 IdxOfAtom.clear(); 59 return false;59 return; 60 60 } 61 61 const atom *temp_element; … … 65 65 temp.push_back(temp_element); 66 66 } 67 return true;67 handleSuccess = true; return; 68 68 } 69 return false;70 69 } 71 70 -
src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {} 48 48 49 boolCommandLineDialog::BooleanCommandLineQuery::handle() {49 void CommandLineDialog::BooleanCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp = false; 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp
r775f3f rf4b6bc9 21 21 EmptyCommandLineQuery(const std::string &_title, const std::string &_description = ""); 22 22 virtual ~EmptyCommandLineQuery(); 23 virtual boolhandle();23 virtual void handle(); 24 24 }; 25 25 … … 28 28 VectorCommandLineQuery(Parameter<Vector> &_param, const std::string &_title, const std::string &_description = ""); 29 29 virtual ~VectorCommandLineQuery(); 30 virtual boolhandle();30 virtual void handle(); 31 31 }; 32 32 … … 35 35 VectorsCommandLineQuery(Parameter< std::vector<Vector> > &_param, const std::string &_title, const std::string &_description = ""); 36 36 virtual ~VectorsCommandLineQuery(); 37 virtual boolhandle();37 virtual void handle(); 38 38 }; 39 39 -
src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
r775f3f rf4b6bc9 48 48 CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {} 49 49 50 boolCommandLineDialog::DoubleCommandLineQuery::handle() {50 void CommandLineDialog::DoubleCommandLineQuery::handle() { 51 51 if (CommandLineParser::getInstance().vm.count(getTitle())) { 52 52 try { … … 54 54 } catch(boost::bad_any_cast &e) { 55 55 temp = 0.; 56 return false;56 return; 57 57 } 58 return true;58 handleSuccess = true; return; 59 59 } 60 return false;61 60 } 62 61 -
src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::DoublesCommandLineQuery::~DoublesCommandLineQuery() {} 48 48 49 boolCommandLineDialog::DoublesCommandLineQuery::handle() {49 void CommandLineDialog::DoublesCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp.clear(); 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
r775f3f rf4b6bc9 53 53 {} 54 54 55 boolCommandLineDialog::ElementCommandLineQuery::handle() {55 void CommandLineDialog::ElementCommandLineQuery::handle() { 56 56 // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector? 57 57 periodentafel *periode = World::getInstance().getPeriode(); … … 68 68 } 69 69 } catch(boost::bad_any_cast &e) { 70 return false;70 return; 71 71 } 72 72 ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery"); 73 return true;73 handleSuccess = true; return; 74 74 } 75 return false;76 75 } 77 76 -
src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
r775f3f rf4b6bc9 68 68 } 69 69 70 boolCommandLineDialog::ElementsCommandLineQuery::handle() {70 void CommandLineDialog::ElementsCommandLineQuery::handle() { 71 71 // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector? 72 72 if (CommandLineParser::getInstance().vm.count(getTitle())) { … … 80 80 temp = getElementsFromInput<std::string>(AllArguments); 81 81 } catch(boost::bad_lexical_cast &e) { 82 return false;82 return; 83 83 } 84 84 } 85 85 } catch(boost::bad_any_cast &e) { 86 return false;86 return; 87 87 } 88 88 if (temp.empty()) 89 return false;89 return; 90 90 else 91 return true;91 handleSuccess = true; return; 92 92 } 93 return false;94 93 } 95 94 -
src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp
r775f3f rf4b6bc9 48 48 CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {} 49 49 50 boolCommandLineDialog::EmptyCommandLineQuery::handle() {50 void CommandLineDialog::EmptyCommandLineQuery::handle() { 51 51 cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n"; 52 return true;53 52 } 54 53 -
src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::FileCommandLineQuery::~FileCommandLineQuery() {} 48 48 49 boolCommandLineDialog::FileCommandLineQuery::handle() {49 void CommandLineDialog::FileCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp = std::string(""); 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/FilesCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::FilesCommandLineQuery::~FilesCommandLineQuery() {} 48 48 49 boolCommandLineDialog::FilesCommandLineQuery::handle() {49 void CommandLineDialog::FilesCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp.clear(); 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {} 48 48 49 boolCommandLineDialog::IntCommandLineQuery::handle() {49 void CommandLineDialog::IntCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp = 0; 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::IntsCommandLineQuery::~IntsCommandLineQuery() {} 48 48 49 boolCommandLineDialog::IntsCommandLineQuery::handle() {49 void CommandLineDialog::IntsCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp.clear(); 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/KeyValuePairCommandLineQuery.cpp
r775f3f rf4b6bc9 49 49 CommandLineDialog::KeyValuePairCommandLineQuery::~KeyValuePairCommandLineQuery() {} 50 50 51 boolCommandLineDialog::KeyValuePairCommandLineQuery::handle() {51 void CommandLineDialog::KeyValuePairCommandLineQuery::handle() { 52 52 if (CommandLineParser::getInstance().vm.count(getTitle())) { 53 53 try { … … 55 55 } catch(boost::bad_any_cast &e) { 56 56 temp = KeyValuePair(std::string("")); 57 return false;57 return; 58 58 } 59 return true;59 handleSuccess = true; return; 60 60 } 61 return false;62 61 } 63 62 -
src/UIElements/CommandLineUI/Query/KeyValuePairsCommandLineQuery.cpp
r775f3f rf4b6bc9 48 48 CommandLineDialog::KeyValuePairsCommandLineQuery::~KeyValuePairsCommandLineQuery() {} 49 49 50 boolCommandLineDialog::KeyValuePairsCommandLineQuery::handle() {50 void CommandLineDialog::KeyValuePairsCommandLineQuery::handle() { 51 51 if (CommandLineParser::getInstance().vm.count(getTitle())) { 52 52 try { … … 54 54 } catch(boost::bad_any_cast &e) { 55 55 temp.clear(); 56 return false;56 return; 57 57 } 58 return true;58 handleSuccess = true; return; 59 59 } 60 return false;60 return; 61 61 } 62 62 -
src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
r775f3f rf4b6bc9 50 50 CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {} 51 51 52 boolCommandLineDialog::MoleculeCommandLineQuery::handle() {52 void CommandLineDialog::MoleculeCommandLineQuery::handle() { 53 53 int IdxOfMol = -1; 54 54 if (CommandLineParser::getInstance().vm.count(getTitle())) { … … 57 57 } catch(boost::bad_any_cast &e) { 58 58 IdxOfMol = -1; 59 return false;59 return; 60 60 } 61 61 temp = const_cast<const World &>(World::getInstance()).getMolecule(MoleculeById(IdxOfMol)); 62 return true;62 handleSuccess = true; return; 63 63 } 64 return false;65 64 } 66 65 -
src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
r775f3f rf4b6bc9 51 51 CommandLineDialog::MoleculesCommandLineQuery::~MoleculesCommandLineQuery() {} 52 52 53 boolCommandLineDialog::MoleculesCommandLineQuery::handle() {53 void CommandLineDialog::MoleculesCommandLineQuery::handle() { 54 54 std::vector<int> IdxOfMol; 55 55 if (CommandLineParser::getInstance().vm.count(getTitle())) { … … 58 58 } catch(boost::bad_any_cast &e) { 59 59 IdxOfMol.clear(); 60 return false;60 return; 61 61 } 62 62 for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) { … … 66 66 temp.push_back(temp_element); 67 67 } 68 return true;68 handleSuccess = true; return; 69 69 } 70 return false;71 70 } 72 71 -
src/UIElements/CommandLineUI/Query/RealSpaceMatrixCommandLineQuery.cpp
r775f3f rf4b6bc9 50 50 {} 51 51 52 boolCommandLineDialog::RealSpaceMatrixCommandLineQuery::handle() {52 void CommandLineDialog::RealSpaceMatrixCommandLineQuery::handle() { 53 53 RealSpaceMatrixValue _temp; 54 54 if (CommandLineParser::getInstance().vm.count(getTitle())) { … … 58 58 for (size_t i=0;i<(NDIM*(NDIM+1))/2;++i) 59 59 _temp.matrix[i] = 0.; 60 return false;60 return; 61 61 } 62 62 temp = _temp.toRealSpaceMatrix(); 63 return true;63 handleSuccess = true; return; 64 64 } 65 return false;66 65 } 67 66 -
src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {} 48 48 49 boolCommandLineDialog::StringCommandLineQuery::handle() {49 void CommandLineDialog::StringCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp = std::string(""); 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::StringsCommandLineQuery::~StringsCommandLineQuery() {} 48 48 49 boolCommandLineDialog::StringsCommandLineQuery::handle() {49 void CommandLineDialog::StringsCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp.clear(); 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::UnsignedIntCommandLineQuery::~UnsignedIntCommandLineQuery() {} 48 48 49 boolCommandLineDialog::UnsignedIntCommandLineQuery::handle() {49 void CommandLineDialog::UnsignedIntCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp = -1; 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp
r775f3f rf4b6bc9 47 47 CommandLineDialog::UnsignedIntsCommandLineQuery::~UnsignedIntsCommandLineQuery() {} 48 48 49 boolCommandLineDialog::UnsignedIntsCommandLineQuery::handle() {49 void CommandLineDialog::UnsignedIntsCommandLineQuery::handle() { 50 50 if (CommandLineParser::getInstance().vm.count(getTitle())) { 51 51 try { … … 53 53 } catch(boost::bad_any_cast &e) { 54 54 temp.clear(); 55 return false;55 return; 56 56 } 57 return true;57 handleSuccess = true; return; 58 58 } 59 return false;60 59 } 61 60 -
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
r775f3f rf4b6bc9 52 52 {} 53 53 54 boolCommandLineDialog::VectorCommandLineQuery::handle() {54 void CommandLineDialog::VectorCommandLineQuery::handle() { 55 55 VectorValue temporary; 56 56 if (CommandLineParser::getInstance().vm.count(getTitle())) { 57 57 temporary = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 58 58 temp = temporary.vectorstring; 59 return true;59 handleSuccess = true; return; 60 60 } 61 return false;62 61 } 63 62 -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
r775f3f rf4b6bc9 52 52 {} 53 53 54 boolCommandLineDialog::VectorsCommandLineQuery::handle() {54 void CommandLineDialog::VectorsCommandLineQuery::handle() { 55 55 std::vector<std::string> temporary; 56 56 std::stringstream output; 57 57 if (CommandLineParser::getInstance().vm.count(getTitle())) { 58 58 temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >(); 59 return true;59 handleSuccess = true; return; 60 60 } 61 return false;62 61 } 63 62
Note:
See TracChangeset
for help on using the changeset viewer.