Ignore:
Timestamp:
Jun 27, 2014, 9:32:03 PM (11 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:
c73e35
Parents:
0b6b77
git-author:
Frederik Heber <heber@…> (06/19/14 13:56:27)
git-committer:
Frederik Heber <heber@…> (06/27/14 21:32:03)
Message:

All Actions now give correct failure status via STATUS() macro.

Location:
src/Actions/MoleculeAction
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MoleculeAction/BondFileAction.cpp

    r0b6b77 r26b4d62  
    6767    mol->getBondCount();
    6868    return Action::success;
    69   } else
     69  } else {
     70    STATUS("There is not exactly one molecule selected.");
    7071    return Action::failure;
     72  }
    7173}
    7274
     
    7779//  state->mol->setName(state->lastName);
    7880
     81  STATUS("Undo for MoleculeBondFileAction not implemented.");
    7982  return Action::failure;
    8083}
    8184
    8285ActionState::ptr MoleculeBondFileAction::performRedo(ActionState::ptr _state){
     86  STATUS("Redo for MoleculeBondFileAction not implemented.");
    8387  return Action::failure;
    8488}
  • src/Actions/MoleculeAction/ChangeBondAngleAction.cpp

    r0b6b77 r26b4d62  
    120120  const std::vector< atom *> atoms = World::getInstance().getSelectedAtoms();
    121121  if (atoms.size() != 3) {
    122     ELOG(1, "Exactly three atoms must be selected.");
     122    STATUS("Exactly three atoms must be selected.");
    123123    return Action::failure;
    124124  }
    125125  // check precondition: linearly bonded atoms
    126126  const std::vector<size_t> indices = sortIndicesFromCentralAtom(atoms);
    127   if (indices.size() != 3)
     127  if (indices.size() != 3) {
     128    STATUS("Selected atoms must be linearly bonded/form a chain");
    128129    return Action::failure;
     130  }
    129131  const molecule *mol = atoms[0]->getMolecule();
    130132  if ((mol != atoms[1]->getMolecule()) || (mol != atoms[2]->getMolecule())) {
    131     ELOG(1, "The two selected atoms must belong to the same molecule.");
     133    STATUS("The two selected atoms must belong to the same molecule.");
    132134    return Action::failure;
    133135  }
  • src/Actions/MoleculeAction/ChangeNameAction.cpp

    r0b6b77 r26b4d62  
    5757    mol->setName(params.name.get());
    5858    return ActionState::ptr(new MoleculeChangeNameState(mol,params));
    59   } else
     59  } else {
     60    STATUS("There must be exactly one molecule selected.");
    6061    return Action::failure;
     62  }
    6163}
    6264
  • src/Actions/MoleculeAction/FillVoidWithMoleculeAction.cpp

    r0b6b77 r26b4d62  
    6262ActionState::ptr MoleculeFillVoidWithMoleculeAction::performCall() {
    6363  if (!boost::filesystem::exists(params.fillername.get())) {
    64     ELOG(1, "File with filler molecule " << params.fillername.get() << " does not exist!");
     64    STATUS("File with filler molecule "+params.fillername.get().string()+" does not exist!");
    6565    return Action::failure;
    6666  }
     
    152152  //MoleculeFillVoidWithMoleculeState *state = assert_cast<MoleculeFillVoidWithMoleculeState*>(_state.get());
    153153
     154  STATUS("Redo for MoleculeFillVoidWithMoleculeAction not implemented.");
    154155  return Action::failure;
    155156  //return ActionState::ptr(_state);
  • src/Actions/MoleculeAction/FillWithMoleculeAction.cpp

    r0b6b77 r26b4d62  
    156156  //MoleculeFillWithMoleculeState *state = assert_cast<MoleculeFillWithMoleculeState*>(_state.get());
    157157
     158  STATUS("Redo of MoleculeFillWithMoleculeAction not implemented.");
    158159  return Action::failure;
    159160  //return ActionState::ptr(_state);
  • src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp

    r0b6b77 r26b4d62  
    7474//  state->mol->setName(state->lastName);
    7575
     76  STATUS("Undo of MoleculeLinearInterpolationofTrajectoriesAction not implemented.");
    7677  return Action::failure;
    7778}
  • src/Actions/MoleculeAction/LoadAction.cpp

    r0b6b77 r26b4d62  
    6060  // parsing file if present
    6161  if (!boost::filesystem::exists(params.filename.get())) {
    62     LOG(1, "Specified input file " << params.filename.get() << " not found.");
     62    STATUS("Specified input file "+params.filename.get().string()+" not found.");
    6363    return Action::failure;
    6464  } else {
     
    7373      FilenamePrefix = params.filename.get().stem().string();
    7474    } else {
    75       ELOG(1, "Input file does not have a suffix, cannot recognize format.");
     75      STATUS("Input file does not have a suffix, cannot recognize format.");
    7676      return Action::failure;
    7777    }
  • src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp

    r0b6b77 r26b4d62  
    5757  // check whether a molecule is selected
    5858  std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
    59   if (selectedMolecules.size() == 0)
     59  if (selectedMolecules.size() == 0) {
     60    STATUS("There are need to be some molecules selected.");
    6061    return Action::failure;
     62  }
    6163
    6264  // go through all selected molecules
    6365  BOOST_FOREACH(molecule *mol, selectedMolecules) {
    6466    // check whether Axis is valid
    65     if (params.Axis.get().IsZero())
     67    if (params.Axis.get().IsZero()) {
     68      STATUS("Rotation Axis must not be zero.");
    6669      return Action::failure;
     70    }
    6771
    6872    // convert from degrees to radian
  • src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp

    r0b6b77 r26b4d62  
    7878//  state->mol->setName(state->lastName);
    7979
     80  STATUS("Undo of MoleculeRotateToPrincipalAxisSystemAction not implemented.");
    8081  return Action::failure;
    8182}
    8283
    8384ActionState::ptr MoleculeRotateToPrincipalAxisSystemAction::performRedo(ActionState::ptr _state){
     85  STATUS("Redo of MoleculeRotateToPrincipalAxisSystemAction not implemented.");
    8486  return Action::failure;
    8587}
  • src/Actions/MoleculeAction/SaveAdjacencyAction.cpp

    r0b6b77 r26b4d62  
    8282//  state->mol->setName(state->lastName);
    8383
     84  STATUS("Undo of MoleculeSaveAdjacencyAction not implemented.");
    8485  return Action::failure;
    8586}
  • src/Actions/MoleculeAction/SaveBondsAction.cpp

    r0b6b77 r26b4d62  
    7070//  state->mol->setName(state->lastName);
    7171
     72  STATUS("Undo of MoleculeSaveBondsAction not implemented.");
    7273  return Action::failure;
    7374}
  • src/Actions/MoleculeAction/SaveSelectedMoleculesAction.cpp

    r0b6b77 r26b4d62  
    6363      FilenamePrefix = params.filename.get().stem().string();
    6464  } else {
    65     ELOG(1, "Output file does not have a suffix, cannot recognize format.");
     65    STATUS("Output file does not have a suffix, cannot recognize format.");
    6666    return Action::failure;
    6767  }
     
    7474    FormatParserStorage::getInstance().saveSelectedMolecules(output, FilenameSuffix);
    7575  } else {
    76     ELOG(1, "Could not open file " << params.filename.get() << ".");
     76    STATUS("Could not open file "+params.filename.get().string()+".");
    7777  }
    7878  output.close();
     
    8484//  ParserSaveXyzState *state = assert_cast<ParserSaveXyzState*>(_state.get());
    8585
    86   return Action::failure;
     86  return Action::success;
    8787//  string newName = state->mol->getName();
    8888//  state->mol->setName(state->lastName);
     
    9292
    9393ActionState::ptr MoleculeSaveSelectedMoleculesAction::performRedo(ActionState::ptr _state){
    94   return Action::failure;
     94  return Action::success;
    9595//  // Undo and redo have to do the same for this action
    9696//  return performUndo(_state);
  • src/Actions/MoleculeAction/SaveTemperatureAction.cpp

    r0b6b77 r26b4d62  
    6363  const size_t MDSteps = set.getMaxTrajectorySize();
    6464  OutputTemperature<std::vector<atom *> > writer(set);
    65   if (output.fail() || !writer((ofstream * const) &output, 0, MDSteps))
    66     LOG(2, "File could not be written.");
    67   else
     65  if (output.fail() || !writer((ofstream * const) &output, 0, MDSteps)) {
     66    STATUS("File could not be written.");
     67    return Action::failure;
     68  } else
    6869    LOG(2, "File stored.");
    6970  output.close();
     
    7778//  state->mol->setName(state->lastName);
    7879
    79   return Action::failure;
     80  return Action::success;
    8081}
    8182
  • src/Actions/MoleculeAction/StretchBondAction.cpp

    r0b6b77 r26b4d62  
    5858  const std::vector< atom *> atoms = World::getInstance().getSelectedAtoms();
    5959  if (atoms.size() != 2) {
    60     ELOG(1, "Exactly two atoms must be selected.");
     60    STATUS("Exactly two atoms must be selected.");
    6161    return Action::failure;
    6262  }
    6363  const molecule *mol = atoms[0]->getMolecule();
    6464  if (mol != atoms[1]->getMolecule()) {
    65     ELOG(1, "The two selected atoms must belong to the same molecule.");
     65    STATUS("The two selected atoms must belong to the same molecule.");
    6666    return Action::failure;
    6767  }
  • src/Actions/MoleculeAction/SuspendInWaterAction.cpp

    r0b6b77 r26b4d62  
    7474//  state->mol->setName(state->lastName);
    7575
     76  STATUS("Undo of MoleculeSuspendInWaterAction not implemented.");
    7677  return Action::failure;
    7778}
  • src/Actions/MoleculeAction/VerletIntegrationAction.cpp

    r0b6b77 r26b4d62  
    8989//  state->mol->setName(state->lastName);
    9090
     91  STATUS("Undo of MoleculeVerletIntegrationAction not implemented.");
    9192  return Action::failure;
    9293}
    9394
    9495ActionState::ptr MoleculeVerletIntegrationAction::performRedo(ActionState::ptr _state){
     96  STATUS("Rddo of MoleculeVerletIntegrationAction not implemented.");
    9597  return Action::failure;
    9698}
Note: See TracChangeset for help on using the changeset viewer.