Changeset 838cd0


Ignore:
Timestamp:
Oct 6, 2011, 4:06:10 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Branches:
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
Children:
12948c
Parents:
65487f
git-author:
Frederik Heber <heber@…> (09/02/11 09:21:45)
git-committer:
Frederik Heber <heber@…> (10/06/11 16:06:10)
Message:

Added new Query for unsigned int.

  • this is preparatory to switch select-atom-by-id to true atomId_t query.
Location:
src
Files:
6 added
16 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/unittests/stubs/DummyUI.hpp

    r65487f r838cd0  
    2727  virtual void queryInt(const char *, std::string = ""){}
    2828  virtual void queryInts(const char *, std::string = ""){}
     29  virtual void queryUnsignedInt(const char *, std::string = ""){}
    2930  virtual void queryString(const char*, std::string = ""){}
    3031  virtual void queryStrings(const char*, std::string = ""){}
  • src/UIElements/CommandLineUI/CommandLineDialog.cpp

    r65487f r838cd0  
    4646void CommandLineDialog::queryInts(const char* title, string _description){
    4747  registerQuery(new IntsCommandLineQuery(title, _description));
     48}
     49
     50void CommandLineDialog::queryUnsignedInt(const char* title, string _description){
     51  registerQuery(new UnsignedIntCommandLineQuery(title, _description));
    4852}
    4953
  • src/UIElements/CommandLineUI/CommandLineDialog.hpp

    r65487f r838cd0  
    3636  virtual void queryInt(const char *, std::string = "");
    3737  virtual void queryInts(const char *, std::string = "");
     38  virtual void queryUnsignedInt(const char *, std::string = "");
    3839  virtual void queryBoolean(const char *, std::string = "");
    3940  virtual void queryString(const char*, std::string = "");
     
    7273  class StringCommandLineQuery;
    7374  class StringsCommandLineQuery;
     75  class UnsignedIntCommandLineQuery;
    7476  class VectorCommandLineQuery;
    7577  class VectorsCommandLineQuery;
  • src/UIElements/CommandLineUI/CommandLineParser.cpp

    r65487f r838cd0  
    231231//                  po::value < std::vector<int> >()->default_value(boost::lexical_cast< std::vector<int> >(currentOption->getDefaultValue().c_str())) :
    232232                  po::value < std::vector<int> >()->multitoken(),
     233                  currentOption->getDescription().c_str())
     234        ;
     235      break;
     236    case TypeEnumContainer::UnsignedIntegerType:
     237      OptionList->add_options()
     238        (currentOption->getKeyAndShortForm().c_str(),
     239            currentOption->hasDefaultValue() ?
     240                  po::value < unsigned int >()->default_value(boost::lexical_cast<unsigned int>(currentOption->getDefaultValue().c_str())) :
     241                  po::value < unsigned int >(),
    233242                  currentOption->getDescription().c_str())
    234243        ;
  • src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp

    r65487f r838cd0  
    3535  IntsCommandLineQuery(std::string title, std::string _description = "");
    3636  virtual ~IntsCommandLineQuery();
     37  virtual bool handle();
     38};
     39
     40class CommandLineDialog::UnsignedIntCommandLineQuery : public Dialog::UnsignedIntQuery {
     41public:
     42  UnsignedIntCommandLineQuery(std::string title, std::string _description = "");
     43  virtual ~UnsignedIntCommandLineQuery();
    3744  virtual bool handle();
    3845};
  • src/UIElements/CommandLineUI/TypeEnumContainer.cpp

    r65487f r838cd0  
    5252  TypeEnumMap[&typeid(int)] = IntegerType;
    5353  TypeEnumMap[&typeid(std::vector<int>)] = ListOfIntegersType;
     54  TypeEnumMap[&typeid(unsigned int)] = UnsignedIntegerType;
    5455  TypeEnumMap[&typeid(double)] = DoubleType;
    5556  TypeEnumMap[&typeid(std::vector<double>)] = ListOfDoublesType;
  • src/UIElements/CommandLineUI/TypeEnumContainer.hpp

    r65487f r838cd0  
    3333        IntegerType,
    3434        ListOfIntegersType,
     35        UnsignedIntegerType,
    3536        DoubleType,
    3637        ListOfDoublesType,
  • src/UIElements/Dialog.cpp

    r65487f r838cd0  
    106106}
    107107
     108template <> void Dialog::query<unsigned int>(const char *token, std::string description)
     109{
     110  queryUnsignedInt(token, description);
     111}
     112
    108113template <> void Dialog::query<double>(const char *token, std::string description)
    109114{
  • src/UIElements/Dialog.hpp

    r65487f r838cd0  
    160160  virtual void queryInt(const char *, std::string = "")=0;
    161161  virtual void queryInts(const char *, std::string = "")=0;
     162  virtual void queryUnsignedInt(const char *, std::string = "")=0;
    162163  virtual void queryDouble(const char*, std::string = "")=0;
    163164  virtual void queryDoubles(const char*, std::string = "")=0;
     
    276277  };
    277278
     279  class UnsignedIntQuery : public Query {
     280  public:
     281    UnsignedIntQuery(std::string title, std::string _description = "");
     282    virtual ~UnsignedIntQuery();
     283    virtual bool handle()=0;
     284    virtual void setResult();
     285  protected:
     286    unsigned int tmp;
     287  };
     288
    278289  class DoubleQuery : public Query {
    279290  public:
  • src/UIElements/Makefile.am

    r65487f r838cd0  
    1818  UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp \
    1919  UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp \
     20  UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp \
    2021  UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp \
    2122  UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp \
     
    8586  UIElements/TextUI/Query/StringTextQuery.cpp \
    8687  UIElements/TextUI/Query/StringsTextQuery.cpp \
     88  UIElements/TextUI/Query/UnsignedIntTextQuery.cpp \
    8789  UIElements/TextUI/Query/VectorTextQuery.cpp \
    8890  UIElements/TextUI/Query/VectorsTextQuery.cpp \
     
    134136  UIElements/Query/StringQuery.cpp \
    135137  UIElements/Query/StringsQuery.cpp \
     138  UIElements/Query/UnsignedIntQuery.cpp \
    136139  UIElements/Query/VectorQuery.cpp \
    137140  UIElements/Query/VectorsQuery.cpp \
     
    162165  UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp \
    163166  UIElements/Qt4/Pipe/StringQtQueryPipe.cpp \
     167  UIElements/Qt4/Pipe/UnsignedIntQtQueryPipe.cpp \
    164168  UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp \
    165169  UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp \
     
    181185  UIElements/Qt4/Query/StringQtQuery.cpp \
    182186  UIElements/Qt4/Query/StringsQtQuery.cpp \
     187  UIElements/Qt4/Query/UnsignedIntQtQuery.cpp \
    183188  UIElements/Qt4/Query/VectorQtQuery.cpp \
    184189  UIElements/Qt4/Query/VectorsQtQuery.cpp \
     
    215220  UIElements/Qt4/Pipe/RandomNumberDistribution_ParametersQtQueryPipe.hpp \
    216221  UIElements/Qt4/Pipe/StringQtQueryPipe.hpp \
     222  UIElements/Qt4/Pipe/UnsignedIntQtQueryPipe.hpp \
    217223  UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp \
    218224  UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp \
  • src/UIElements/Qt4/QtDialog.cpp

    r65487f r838cd0  
    110110}
    111111
     112void QtDialog::queryUnsignedInt(const char *title,string)
     113{
     114  registerQuery(new UnsignedIntQtQuery(title,inputLayout,this));
     115}
     116
    112117void QtDialog::queryDouble(const char* title,string)
    113118{
  • src/UIElements/Qt4/QtDialog.hpp

    r65487f r838cd0  
    3636  virtual void queryInt(const char *,std::string = "");
    3737  virtual void queryInts(const char *,std::string = "");
     38  virtual void queryUnsignedInt(const char *,std::string = "");
    3839  virtual void queryDouble(const char*,std::string = "");
    3940  virtual void queryDoubles(const char*,std::string = "");
     
    7374  class StringQtQuery;
    7475  class StringsQtQuery;
     76  class UnsignedIntQtQuery;
    7577  class VectorQtQuery;
    7678  class VectorsQtQuery;
  • src/UIElements/Qt4/Query/QtQuery.hpp

    r65487f r838cd0  
    4747class StringQtQueryPipe;
    4848class StringsQtQueryPipe;
     49class UnsignedIntQtQueryPipe;
    4950class VectorQtQueryPipe;
    5051class VectorsQtQueryPipe;
     
    279280};
    280281
     282class QtDialog::UnsignedIntQtQuery : public Dialog::UnsignedIntQuery {
     283public:
     284  UnsignedIntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
     285  virtual ~UnsignedIntQtQuery();
     286  virtual bool handle();
     287private:
     288  QBoxLayout *parent;
     289  QBoxLayout *thisLayout;
     290  QLabel *titleLabel;
     291  QSpinBox *inputBox;
     292
     293  UnsignedIntQtQueryPipe *pipe;
     294};
     295
    281296class QtDialog::VectorQtQuery : public Dialog::VectorQuery {
    282297public:
  • src/UIElements/TextUI/Query/TextQuery.hpp

    r65487f r838cd0  
    129129};
    130130
     131class TextDialog::UnsignedIntTextQuery : public Dialog::UnsignedIntQuery {
     132public:
     133  UnsignedIntTextQuery(std::string title, std::string _description = NULL);
     134  virtual ~UnsignedIntTextQuery();
     135  virtual bool handle();
     136};
     137
    131138class TextDialog::VectorTextQuery : public Dialog::VectorQuery {
    132139public:
  • src/UIElements/TextUI/TextDialog.cpp

    r65487f r838cd0  
    4848void TextDialog::queryInts(const char* title, std::string description){
    4949  registerQuery(new IntsTextQuery(title,description));
     50}
     51
     52void TextDialog::queryUnsignedInt(const char* title, std::string description){
     53  registerQuery(new UnsignedIntTextQuery(title,description));
    5054}
    5155
  • src/UIElements/TextUI/TextDialog.hpp

    r65487f r838cd0  
    3434  virtual void queryInt(const char *, std::string = "");
    3535  virtual void queryInts(const char *, std::string = "");
     36  virtual void queryUnsignedInt(const char *, std::string = "");
    3637  virtual void queryString(const char*, std::string = "");
    3738  virtual void queryStrings(const char*, std::string = "");
     
    7071  class StringTextQuery;
    7172  class StringsTextQuery;
     73  class UnsignedIntTextQuery;
    7274  class VectorTextQuery;
    7375  class VectorsTextQuery;
Note: See TracChangeset for help on using the changeset viewer.