Ignore:
Timestamp:
Jun 2, 2010, 4:17:17 PM (16 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, 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
Children:
3610bb
Parents:
584a2a
git-author:
Frederik Heber <heber@…> (06/02/10 15:41:52)
git-committer:
Frederik Heber <heber@…> (06/02/10 16:17:17)
Message:

Case 'd' is now handled by CommandLineUI (RepeatBoxAction).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MapOfActions.cpp

    r584a2a re30ce8  
    153153  TypeMap["remove-atom"] = Atom;
    154154  TypeMap["remove-sphere"] = Atom;
    155   TypeMap["repeat-box"] = ListOfInts;
     155  TypeMap["repeat-box"] = Vector;
    156156  TypeMap["rotate-to-pas"] = Molecule;
    157157  TypeMap["save-adjacency"] = String;
     
    165165  TypeMap["verlet-integrate"] = String;
    166166  TypeMap["verbose"] = Integer;
     167
    167168  // value types for the values
    168169  TypeMap["bin-output-file"] = String;
     
    180181  TypeMap["periodic"] = Boolean;
    181182  TypeMap["position"] = Vector;
     183
     184  // default values for any action that needs one (always string!)
     185  DefaultValue["molecule-by-id"] = "-1";
     186
    182187
    183188  // list of generic actions
     
    210215//  generic.insert("remove-atom");
    211216//  generic.insert("remove-sphere");
     217    generic.insert("repeat-box");
    212218//  generic.insert("rotate-to-pas");
    213219//      generic.insert("save-adjacency");
     
    271277          case Boolean:
    272278            ListRunner->second->add_options()
    273               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< bool >(), getDescription(*OptionRunner).c_str())
     279              (getKeyAndShortForm(*OptionRunner).c_str(),
     280                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     281                        po::value< bool >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
     282                        po::value< bool >(),
     283                  getDescription(*OptionRunner).c_str())
    274284              ;
    275285            break;
    276286          case Integer:
    277287            ListRunner->second->add_options()
    278               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
     288              (getKeyAndShortForm(*OptionRunner).c_str(),
     289                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     290                        po::value< int >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
     291                        po::value< int >(),
     292                  getDescription(*OptionRunner).c_str())
    279293              ;
    280294            break;
    281295          case ListOfInts:
    282296            ListRunner->second->add_options()
    283               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >()->multitoken(), getDescription(*OptionRunner).c_str())
     297              (getKeyAndShortForm(*OptionRunner).c_str(),
     298                  po::value< vector<int> >()->multitoken(),
     299                  getDescription(*OptionRunner).c_str())
    284300              ;
    285301            break;
    286302          case Double:
    287303            ListRunner->second->add_options()
    288               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< double >(), getDescription(*OptionRunner).c_str())
     304              (getKeyAndShortForm(*OptionRunner).c_str(),
     305                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     306                        po::value< double >()->default_value(atof(DefaultValue[*OptionRunner].c_str())) :
     307                        po::value< double >(),
     308                  getDescription(*OptionRunner).c_str())
    289309              ;
    290310            break;
    291311          case ListOfDoubles:
    292312            ListRunner->second->add_options()
    293               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<double> >()->multitoken(), getDescription(*OptionRunner).c_str())
     313              (getKeyAndShortForm(*OptionRunner).c_str(),
     314                  po::value< vector<double> >()->multitoken(),
     315                  getDescription(*OptionRunner).c_str())
    294316              ;
    295317            break;
    296318          case String:
    297319            ListRunner->second->add_options()
    298               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< std::string >(), getDescription(*OptionRunner).c_str())
     320              (getKeyAndShortForm(*OptionRunner).c_str(),
     321                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     322                        po::value< std::string >()->default_value(DefaultValue[*OptionRunner]) :
     323                        po::value< std::string >(),
     324                  getDescription(*OptionRunner).c_str())
    299325              ;
    300326            break;
    301327          case Axis:
    302328            ListRunner->second->add_options()
    303               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
     329              (getKeyAndShortForm(*OptionRunner).c_str(),
     330                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     331                        po::value< int >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
     332                        po::value< int >(),
     333                  getDescription(*OptionRunner).c_str())
    304334              ;
    305335            break;
    306336          case Vector:
    307337            ListRunner->second->add_options()
    308               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<double> >()->multitoken(), getDescription(*OptionRunner).c_str())
     338              (getKeyAndShortForm(*OptionRunner).c_str(),
     339                  po::value< vector<double> >()->multitoken(),
     340                  getDescription(*OptionRunner).c_str())
    309341              ;
    310342            break;
    311343          case Box:
    312344            ListRunner->second->add_options()
    313               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<double> >(), getDescription(*OptionRunner).c_str())
     345              (getKeyAndShortForm(*OptionRunner).c_str(),
     346                  po::value< vector<double> >(),
     347                  getDescription(*OptionRunner).c_str())
    314348              ;
    315349            break;
    316350          case Molecule:
    317351            ListRunner->second->add_options()
    318               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
     352              (getKeyAndShortForm(*OptionRunner).c_str(),
     353                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     354                        po::value< int >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
     355                        po::value< int >(),
     356                  getDescription(*OptionRunner).c_str())
    319357              ;
    320358            break;
    321359          case ListOfMolecules:
    322360            ListRunner->second->add_options()
    323               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >()->multitoken(), getDescription(*OptionRunner).c_str())
     361              (getKeyAndShortForm(*OptionRunner).c_str(),
     362                  po::value< vector<int> >()->multitoken(),
     363                  getDescription(*OptionRunner).c_str())
    324364              ;
    325365            break;
    326366          case Atom:
    327367            ListRunner->second->add_options()
    328               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
     368              (getKeyAndShortForm(*OptionRunner).c_str(),
     369                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     370                        po::value< int >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
     371                        po::value< int >(),
     372                  getDescription(*OptionRunner).c_str())
    329373              ;
    330374            break;
    331375          case ListOfAtoms:
    332376            ListRunner->second->add_options()
    333               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >()->multitoken(), getDescription(*OptionRunner).c_str())
     377              (getKeyAndShortForm(*OptionRunner).c_str(),
     378                  po::value< vector<int> >()->multitoken(),
     379                  getDescription(*OptionRunner).c_str())
    334380              ;
    335381            break;
    336382          case Element:
    337383            ListRunner->second->add_options()
    338               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
     384              (getKeyAndShortForm(*OptionRunner).c_str(),
     385                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
     386                        po::value< int >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
     387                        po::value< int >(),
     388                  getDescription(*OptionRunner).c_str())
    339389              ;
    340390            break;
    341391          case ListOfElements:
    342392            ListRunner->second->add_options()
    343               (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >()->multitoken(), getDescription(*OptionRunner).c_str())
     393              (getKeyAndShortForm(*OptionRunner).c_str(),
     394                  po::value< vector<int> >()->multitoken(),
     395                  getDescription(*OptionRunner).c_str())
    344396              ;
    345397            break;
Note: See TracChangeset for help on using the changeset viewer.