Changeset 54b953 for src


Ignore:
Timestamp:
Jun 11, 2010, 12:20:08 PM (15 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:
77de81
Parents:
f0a3ec
git-author:
Frederik Heber <heber@…> (06/11/10 10:39:39)
git-committer:
Frederik Heber <heber@…> (06/11/10 12:20:08)
Message:

Case 'E' is now handled by CommandLineUI.

  • TESTFIX: --element is required now.
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AtomAction/ChangeElementAction.cpp

    rf0a3ec r54b953  
    3636  std::vector<element *> elements;
    3737
    38   dialog->queryElement(NAME, &elements, MapOfActions::getInstance().getDescription(NAME));
    39   dialog->queryAtom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));
     38  dialog->queryAtom(NAME, &first, MapOfActions::getInstance().getDescription(NAME));
     39  dialog->queryElement("element", &elements, MapOfActions::getInstance().getDescription("element"));
    4040
    4141  if(dialog->display()) {
    4242    delete dialog;
    4343    ASSERT(elements.size() == 1, "Unequal to one element specified when changing an atom's element");
     44    ASSERT(first != NULL, "No valid atom specified");
    4445    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elements.at(0) << "." << endl);
    4546    if (elements.at(0) != NULL) {
  • src/Actions/MapOfActions.cpp

    rf0a3ec r54b953  
    103103  DescriptionMap["version"] = "show version";
    104104  // keys for values
     105  DescriptionMap["atom-by-id"] = "index of an atom";
    105106  DescriptionMap["bin-output-file"] = "name of the bin output file";
    106107  DescriptionMap["bin-end"] = "start of the last bin";
     
    170171  TypeMap["center-in-box"] = Box;
    171172  TypeMap["change-box"] = Box;
    172   TypeMap["change-element"] = Element;
     173  TypeMap["change-element"] = Atom;
    173174  TypeMap["change-molname"] = String;
    174175  TypeMap["convex-envelope"] = Molecule;
     
    203204
    204205  // value types for the values
     206  TypeMap["atom-by-id"] = Atom;
    205207  TypeMap["bin-output-file"] = String;
    206208  TypeMap["bin-end"] = Double;
     
    225227  DefaultValue["bin-width"] = "0.5";
    226228  DefaultValue["fastparsing"] = "0";
     229  DefaultValue["atom-by-id"] = "-1";
    227230  DefaultValue["molecule-by-id"] = "-1";
    228231  DefaultValue["periodic"] = "0";
     
    239242        generic.insert("change-box");
    240243//  generic.insert("change-molname");
    241 //      generic.insert("change-element");
     244        generic.insert("change-element");
    242245//  generic.insert("convex-envelope");
    243246        generic.insert("default-molname");
     
    282285
    283286    // hidden arguments
     287  generic.insert("atom-by-id");
    284288  generic.insert("bin-end");
    285289  generic.insert("bin-output-file");
  • src/builder.cpp

    rf0a3ec r54b953  
    18041804            case 'E':
    18051805              if (ExitFlag == 0) ExitFlag = 1;
    1806               if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr+1][0] == '-')) {
     1806              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr]))) {
    18071807                ExitFlag = 255;
    1808                 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl);
     1808                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> --element <Z>" << endl);
    18091809                performCriticalExit();
    18101810              } else {
    1811                 mol->getAtomCount();
    1812                 SaveFlag = true;
    1813                 DoLog(1) && (Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl);
    1814                 first = mol->FindAtom(atoi(argv[argptr]));
    1815                 first->type = periode->FindElement(atoi(argv[argptr+1]));
    1816                 argptr+=2;
     1811                ArgcList.insert(argptr-1);
     1812                ArgcList.insert(argptr);
     1813                ArgcList.insert(argptr+1);
     1814                ArgcList.insert(argptr+2);
     1815                argptr+=3;
    18171816              }
    18181817              break;
Note: See TracChangeset for help on using the changeset viewer.