Changeset bf87c2 for src/UIElements/TextUI
- Timestamp:
- Jul 17, 2017, 12:28:51 PM (8 years ago)
- Branches:
- Action_Thermostats, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults
- Children:
- 3bd4a66
- Parents:
- 9346af
- git-author:
- Frederik Heber <frederik.heber@…> (07/06/17 22:18:13)
- git-committer:
- Frederik Heber <frederik.heber@…> (07/17/17 12:28:51)
- Location:
- src/UIElements/TextUI/Query
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/TextUI/Query/AtomTextQuery.cpp
r9346af rbf87c2 51 51 TextDialog::AtomTextQuery::~AtomTextQuery() {} 52 52 53 boolTextDialog::AtomTextQuery::handle() {53 void TextDialog::AtomTextQuery::handle() { 54 54 int idxOfAtom=-1; 55 55 bool badInput = false; … … 74 74 } while(badInput); 75 75 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 76 return(idxOfAtom!=-1);76 handleSuccess = (idxOfAtom!=-1); 77 77 } 78 78 -
src/UIElements/TextUI/Query/AtomsTextQuery.cpp
r9346af rbf87c2 52 52 TextDialog::AtomsTextQuery::~AtomsTextQuery() {} 53 53 54 boolTextDialog::AtomsTextQuery::handle() {54 void TextDialog::AtomsTextQuery::handle() { 55 55 int idxOfAtom=-1; 56 56 std::cout << getDescription() << ": "; … … 83 83 } 84 84 85 return(idxOfAtom!=-1);85 handleSuccess = (idxOfAtom!=-1); 86 86 } 87 87 -
src/UIElements/TextUI/Query/BooleanTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::BooleanTextQuery::~BooleanTextQuery() {} 50 50 51 boolTextDialog::BooleanTextQuery::handle() {51 void TextDialog::BooleanTextQuery::handle() { 52 52 bool badInput = false; 53 53 char input = ' '; … … 69 69 // clear the input buffer of anything still in the line 70 70 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 71 returntrue;71 handleSuccess = true; 72 72 } 73 73 -
src/UIElements/TextUI/Query/DoubleTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::DoubleTextQuery::~DoubleTextQuery() {} 50 50 51 boolTextDialog::DoubleTextQuery::handle() {51 void TextDialog::DoubleTextQuery::handle() { 52 52 bool badInput = false; 53 53 do{ … … 63 63 }while(badInput); 64 64 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 65 returntrue;65 handleSuccess = true; 66 66 } 67 67 -
src/UIElements/TextUI/Query/DoublesTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::DoublesTextQuery::~DoublesTextQuery() {} 50 50 51 boolTextDialog::DoublesTextQuery::handle() {51 void TextDialog::DoublesTextQuery::handle() { 52 52 std::cout << getDescription() << ": "; 53 53 std::string line; … … 70 70 } 71 71 72 returntrue;72 handleSuccess = true; 73 73 } 74 74 -
src/UIElements/TextUI/Query/ElementTextQuery.cpp
r9346af rbf87c2 53 53 {} 54 54 55 boolTextDialog::ElementTextQuery::handle() {55 void TextDialog::ElementTextQuery::handle() { 56 56 bool badInput=false; 57 57 bool aborted = false; … … 107 107 }while(badInput); 108 108 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 109 return!aborted;109 handleSuccess = !aborted; 110 110 } 111 111 -
src/UIElements/TextUI/Query/ElementsTextQuery.cpp
r9346af rbf87c2 57 57 {} 58 58 59 boolTextDialog::ElementsTextQuery::handle() {59 void TextDialog::ElementsTextQuery::handle() { 60 60 std::string shorthand; 61 61 int Z=-1; … … 99 99 } 100 100 101 return(Z!=-1);101 handleSuccess = (Z!=-1); 102 102 } 103 103 -
src/UIElements/TextUI/Query/EmptyTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::EmptyTextQuery::~EmptyTextQuery() {} 50 50 51 boolTextDialog::EmptyTextQuery::handle() {51 void TextDialog::EmptyTextQuery::handle() { 52 52 cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n"; 53 return true;53 return; 54 54 } 55 55 -
src/UIElements/TextUI/Query/FileTextQuery.cpp
r9346af rbf87c2 52 52 TextDialog::FileTextQuery::~FileTextQuery() {} 53 53 54 boolTextDialog::FileTextQuery::handle() {54 void TextDialog::FileTextQuery::handle() { 55 55 bool badInput = false; 56 56 do{ … … 67 67 } while(badInput); 68 68 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 69 returntrue;69 handleSuccess = true; 70 70 } 71 71 -
src/UIElements/TextUI/Query/FilesTextQuery.cpp
r9346af rbf87c2 52 52 TextDialog::FilesTextQuery::~FilesTextQuery() {} 53 53 54 boolTextDialog::FilesTextQuery::handle() {54 void TextDialog::FilesTextQuery::handle() { 55 55 bool badInput = false; 56 56 bool continueflag = true; … … 78 78 } while(continueflag); 79 79 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 80 returntrue;80 handleSuccess = true; 81 81 } 82 82 -
src/UIElements/TextUI/Query/IntTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::IntTextQuery::~IntTextQuery() {} 50 50 51 boolTextDialog::IntTextQuery::handle() {51 void TextDialog::IntTextQuery::handle() { 52 52 bool badInput = false; 53 53 do{ … … 64 64 // clear the input buffer of anything still in the line 65 65 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 66 returntrue;66 handleSuccess = true; 67 67 } 68 68 -
src/UIElements/TextUI/Query/IntsTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::IntsTextQuery::~IntsTextQuery() {} 50 50 51 boolTextDialog::IntsTextQuery::handle() {51 void TextDialog::IntsTextQuery::handle() { 52 52 std::cout << getDescription() << ": "; 53 53 std::string line; … … 70 70 } 71 71 72 returntrue;72 handleSuccess = true; 73 73 } 74 74 -
src/UIElements/TextUI/Query/KeyValuePairTextQuery.cpp
r9346af rbf87c2 50 50 TextDialog::KeyValuePairTextQuery::~KeyValuePairTextQuery() {} 51 51 52 boolTextDialog::KeyValuePairTextQuery::handle() {52 void TextDialog::KeyValuePairTextQuery::handle() { 53 53 std::cout << getDescription() << ": "; 54 54 getline(std::cin,temp); 55 returntrue;55 handleSuccess = true; 56 56 } 57 57 -
src/UIElements/TextUI/Query/KeyValuePairsTextQuery.cpp
r9346af rbf87c2 50 50 TextDialog::KeyValuePairsTextQuery::~KeyValuePairsTextQuery() {} 51 51 52 boolTextDialog::KeyValuePairsTextQuery::handle() {52 void TextDialog::KeyValuePairsTextQuery::handle() { 53 53 std::cout << getDescription() << ": "; 54 54 std::string temp_element; … … 65 65 temp.push_back(std::string(olditer, temp_element.end())); 66 66 67 returntrue;67 handleSuccess = true; 68 68 } 69 69 -
src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
r9346af rbf87c2 52 52 TextDialog::MoleculeTextQuery::~MoleculeTextQuery() {} 53 53 54 boolTextDialog::MoleculeTextQuery::handle() {54 void TextDialog::MoleculeTextQuery::handle() { 55 55 int idxOfMol=0; 56 56 bool badInput = false; … … 75 75 } while(badInput); 76 76 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 77 return(idxOfMol!=-1);77 handleSuccess = (idxOfMol!=-1); 78 78 } 79 79 -
src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
r9346af rbf87c2 52 52 TextDialog::MoleculesTextQuery::~MoleculesTextQuery() {} 53 53 54 boolTextDialog::MoleculesTextQuery::handle() {54 void TextDialog::MoleculesTextQuery::handle() { 55 55 int idxOfMol=-1; 56 56 std::cout << getDescription() << ": "; … … 83 83 } 84 84 85 return(idxOfMol!=-1);85 handleSuccess = (idxOfMol!=-1); 86 86 } 87 87 -
src/UIElements/TextUI/Query/RealSpaceMatrixTextQuery.cpp
r9346af rbf87c2 51 51 {} 52 52 53 boolTextDialog::RealSpaceMatrixTextQuery::handle() {53 void TextDialog::RealSpaceMatrixTextQuery::handle() { 54 54 std::cout << getTitle(); 55 55 … … 70 70 temp.set(2,1, dtemp[4]); 71 71 temp.set(2,2, dtemp[5]); 72 returntrue;72 handleSuccess = true; 73 73 } 74 74 -
src/UIElements/TextUI/Query/StringTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::StringTextQuery::~StringTextQuery() {} 50 50 51 boolTextDialog::StringTextQuery::handle() {51 void TextDialog::StringTextQuery::handle() { 52 52 std::cout << getDescription() << ": "; 53 53 getline(std::cin,temp); 54 returntrue;54 handleSuccess = true; 55 55 } 56 56 -
src/UIElements/TextUI/Query/StringsTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::StringsTextQuery::~StringsTextQuery() {} 50 50 51 boolTextDialog::StringsTextQuery::handle() {51 void TextDialog::StringsTextQuery::handle() { 52 52 std::cout << getDescription() << ": "; 53 53 std::string temp_element; … … 64 64 temp.push_back(std::string(olditer, temp_element.end())); 65 65 66 returntrue;66 handleSuccess = true; 67 67 } 68 68 -
src/UIElements/TextUI/Query/TextQuery.hpp
r9346af rbf87c2 21 21 EmptyTextQuery(const std::string &_title, const std::string &_description = NULL); 22 22 virtual ~EmptyTextQuery(); 23 virtual boolhandle();23 virtual void handle(); 24 24 }; 25 25 … … 28 28 VectorTextQuery(Parameter<Vector> &_param, const std::string &_title, const std::string &_description = ""); 29 29 virtual ~VectorTextQuery(); 30 virtual boolhandle();30 virtual void handle(); 31 31 }; 32 32 … … 35 35 VectorsTextQuery(Parameter< std::vector<Vector> > &_param, const std::string &_title, const std::string &_description = ""); 36 36 virtual ~VectorsTextQuery(); 37 virtual boolhandle();37 virtual void handle(); 38 38 }; 39 39 -
src/UIElements/TextUI/Query/UnsignedIntTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::UnsignedIntTextQuery::~UnsignedIntTextQuery() {} 50 50 51 boolTextDialog::UnsignedIntTextQuery::handle() {51 void TextDialog::UnsignedIntTextQuery::handle() { 52 52 bool badInput = false; 53 53 do{ … … 64 64 // clear the input buffer of anything still in the line 65 65 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 66 returntrue;66 handleSuccess = true; 67 67 } 68 68 -
src/UIElements/TextUI/Query/UnsignedIntsTextQuery.cpp
r9346af rbf87c2 49 49 TextDialog::UnsignedIntsTextQuery::~UnsignedIntsTextQuery() {} 50 50 51 boolTextDialog::UnsignedIntsTextQuery::handle() {51 void TextDialog::UnsignedIntsTextQuery::handle() { 52 52 std::cout << getDescription() << ": "; 53 53 std::string line; … … 70 70 } 71 71 72 returntrue;72 handleSuccess = true; 73 73 } 74 74 -
src/UIElements/TextUI/Query/VectorTextQuery.cpp
r9346af rbf87c2 53 53 {} 54 54 55 boolTextDialog::VectorTextQuery::handle() {55 void TextDialog::VectorTextQuery::handle() { 56 56 std::cout << getDescription() << std::endl; 57 57 const RealSpaceMatrix &M = World::getInstance().getDomain().getM(); … … 83 83 84 84 // check vector 85 returntrue;85 handleSuccess = true; 86 86 } 87 87 -
src/UIElements/TextUI/Query/VectorsTextQuery.cpp
r9346af rbf87c2 54 54 {} 55 55 56 boolTextDialog::VectorsTextQuery::handle() {56 void TextDialog::VectorsTextQuery::handle() { 57 57 std::stringstream output; 58 58 std::cout << getDescription() << std::endl; … … 83 83 } 84 84 85 returntrue;85 handleSuccess = true; 86 86 } 87 87
Note:
See TracChangeset
for help on using the changeset viewer.