Changes in / [95e6b1:61951b]


Ignore:
Files:
3 deleted
18 edited

Legend:

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

    r95e6b1 r61951b  
    1010#include "Actions/AtomAction/AddAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "Descriptors/AtomIdDescriptor.hpp"
    1312#include "atom.hpp"
    1413#include "element.hpp"
     
    2726#include "UIElements/Dialog.hpp"
    2827#include "Actions/ValueStorage.hpp"
    29 
    30 // memento to remember the state when undoing
    31 
    32 class AtomAddState : public ActionState {
    33 public:
    34   AtomAddState(const Vector &_position, const element *_elemental, const atomId_t _id) :
    35     position(_position),
    36     elemental(_elemental),
    37     id(_id)
    38   {}
    39   Vector position;
    40   const element *elemental;
    41   atomId_t id;
    42 };
    4328
    4429const char AtomAddAction::NAME[] = "add-atom";
     
    8570    (*iter)->AddAtom(first);
    8671  }
    87   return Action::state_ptr(new AtomAddState(position, elemental, first->getId()));
     72  return Action::success;
    8873}
    8974
    9075Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) {
    91   AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
     76//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    9277
    93   DoLog(1) && (Log() << Verbose(1) << "Removing atom with id " << state->id << "." << endl);
    94   World::getInstance().destroyAtom(state->id);
    95 
    96   return Action::state_ptr(_state);
     78  return Action::failure;
     79//  string newName = state->mol->getName();
     80//  state->mol->setName(state->lastName);
     81//
     82//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
    9783}
    9884
    9985Action::state_ptr AtomAddAction::performRedo(Action::state_ptr _state){
    100   AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
    101 
    102   atom * first = World::getInstance().createAtom();
    103   first->setType(state->elemental);
    104   first->setPosition(state->position);
    105   DoLog(1) && (Log() << Verbose(1) << "Re-adding new atom with element " << state->elemental->getName() << " at " << state->position << "." << endl);
    106   // TODO: remove when all of World's atoms are stored.
    107   std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
    108   if (!molecules.empty()) {
    109     std::vector<molecule *>::iterator iter = molecules.begin();
    110     (*iter)->AddAtom(first);
    111   }
    112   if (first->getId() != state->id)
    113     if (!first->changeId(state->id))
    114       return Action::failure;
    115   return Action::state_ptr(_state);
     86  return Action::failure;
    11687}
    11788
    11889bool AtomAddAction::canUndo() {
    119   return true;
     90  return false;
    12091}
    12192
    12293bool AtomAddAction::shouldUndo() {
    123   return true;
     94  return false;
    12495}
    12596
  • src/Actions/AtomAction/ChangeElementAction.cpp

    r95e6b1 r61951b  
    1010#include "Actions/AtomAction/ChangeElementAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
    12 #include "Descriptors/AtomIdDescriptor.hpp"
    1312#include "atom.hpp"
    1413#include "element.hpp"
     
    2019
    2120#include <iostream>
    22 #include <map>
    2321#include <string>
    2422
     
    2826#include "UIElements/Dialog.hpp"
    2927#include "Actions/ValueStorage.hpp"
    30 
    31 typedef std::map<int, const element *> ElementMap;
    32 
    33 // memento to remember the state when undoing
    34 
    35 class AtomChangeElementState : public ActionState {
    36 public:
    37   AtomChangeElementState(ElementMap _Elements, const element *_elemental) :
    38     Elements(_Elements),
    39     elemental(_elemental)
    40   {}
    41   ElementMap Elements;
    42   const element *elemental;
    43 };
    4428
    4529const char AtomChangeElementAction::NAME[] = "change-element";
     
    7256  ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
    7357
    74   // create undo state
    75   ElementMap Elements;
    76   for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    77     Elements.insert(std::pair<int, const element *> (iter->second->getId(), iter->second->getType()));
    78   }
    79   AtomChangeElementState *UndoState = new AtomChangeElementState(Elements, elemental);
    80 
    8158  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    8259    first = iter->second;
     
    8764    mol->AddAtom(first);  // add atom to ensure correctness of formula
    8865  }
    89   return Action::state_ptr(UndoState);
     66  return Action::success;
    9067}
    9168
    9269Action::state_ptr AtomChangeElementAction::performUndo(Action::state_ptr _state) {
    93   AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
    94   atom *first = NULL;
    95   molecule *mol = NULL;
     70//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    9671
    97   for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
    98     first = World::getInstance().getAtom(AtomById(iter->first));
    99     mol = first->getMolecule();
    100     first->removeFromMolecule(); // remove atom
    101     first->setType(iter->second);
    102     mol->AddAtom(first);  // add atom to ensure correctness of formula
    103   }
    104 
    105   return Action::state_ptr(_state);
     72  return Action::failure;
     73//  string newName = state->mol->getName();
     74//  state->mol->setName(state->lastName);
     75//
     76//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
    10677}
    10778
    10879Action::state_ptr AtomChangeElementAction::performRedo(Action::state_ptr _state){
    109   AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
    110   atom *first = NULL;
    111   molecule *mol = NULL;
    112 
    113   for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
    114     first = World::getInstance().getAtom(AtomById(iter->first));
    115     mol = first->getMolecule();
    116     first->removeFromMolecule(); // remove atom
    117     first->setType(state->elemental);
    118     mol->AddAtom(first);  // add atom to ensure correctness of formula
    119   }
    120 
    121   return Action::state_ptr(_state);
     80  return Action::failure;
    12281}
    12382
    12483bool AtomChangeElementAction::canUndo() {
    125   return true;
     84  return false;
    12685}
    12786
    12887bool AtomChangeElementAction::shouldUndo() {
    129   return true;
     88  return false;
    13089}
    13190
  • src/Actions/AtomAction/RemoveAction.cpp

    r95e6b1 r61951b  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
    13 #include "AtomicInfo.hpp"
    1413#include "Descriptors/AtomDescriptor.hpp"
    1514#include "Helpers/Log.hpp"
     
    2625#include "UIElements/Dialog.hpp"
    2726#include "Actions/ValueStorage.hpp"
    28 
    29 // memento to remember the state when undoing
    30 
    31 class AtomRemoveState : public ActionState {
    32 public:
    33   AtomRemoveState(std::vector<AtomicInfo> _Walkers) :
    34     Walkers(_Walkers)
    35   {}
    36   std::vector<AtomicInfo> Walkers;
    37 };
    3827
    3928const char AtomRemoveAction::NAME[] = "remove-atom";
     
    6150  atom *first = NULL;
    6251
    63   // create undo state
    64   std::vector<AtomicInfo> Walkers;
    65   for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    66     Walkers.push_back(AtomicInfo(*(iter->second)));
    67   }
    68   AtomRemoveState *UndoState = new AtomRemoveState(Walkers);
    69 
    70   // remove all selected atoms
    71 //  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     52  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
    7253  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    7354    first = iter->second;
    7455    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl);
    75 //    // TODO: this is not necessary when atoms and their storing to file are handled by the World
    76 //    // simply try to erase in every molecule found
    77 //    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
    78 //      (*iter)->erase(first);
    79 //    }
     56    // TODO: this is not necessary when atoms and their storing to file are handled by the World
     57    // simply try to erase in every molecule found
     58    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
     59      (*iter)->erase(first);
     60    }
    8061    World::getInstance().destroyAtom(first);
    8162  }
    82   return Action::state_ptr(UndoState);
     63  return Action::success;
    8364}
    8465
    8566Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) {
    86   AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
     67//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    8768
    88   size_t i=0;
    89   for (; i<state->Walkers.size(); ++i) {
    90     // re-create the atom
    91     DoLog(1) && (Log() << Verbose(1) << "Re-adding atom " << state->Walkers[i].getId() << "." << endl);
    92     atom *Walker = World::getInstance().createAtom();
    93     if (!state->Walkers[i].setAtom(*Walker)) {
    94       DoeLog(1) && (eLog() << Verbose(1) << "Failed to set id." << endl);
    95       World::getInstance().destroyAtom(Walker);
    96       break;
    97     }
    98   }
    99   if (i<state->Walkers.size()) {
    100     // remove all previous ones, too
    101     for (size_t j=0;j<i;++j)
    102       World::getInstance().destroyAtom(state->Walkers[j].getId());
    103     // and announce the failure of the undo
    104     return Action::failure;
    105   }
    106   return Action::state_ptr(_state);
     69  return Action::failure;
     70//  string newName = state->mol->getName();
     71//  state->mol->setName(state->lastName);
     72//
     73//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
    10774}
    10875
    10976Action::state_ptr AtomRemoveAction::performRedo(Action::state_ptr _state){
    110   AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
    111 
    112   // simple remove again all previously added atoms
    113   for (size_t i=0; i<state->Walkers.size(); ++i) {
    114     DoLog(1) && (Log() << Verbose(1) << "Re-removing atom " << state->Walkers[i].getId() << "." << endl);
    115     World::getInstance().destroyAtom(state->Walkers[i].getId());
    116   }
    117 
    118   return Action::state_ptr(_state);
     77  return Action::failure;
    11978}
    12079
    12180bool AtomRemoveAction::canUndo() {
    122   return true;
     81  return false;
    12382}
    12483
    12584bool AtomRemoveAction::shouldUndo() {
    126   return true;
     85  return false;
    12786}
    12887
  • src/Actions/CmdAction/FastParsingAction.cpp

    r95e6b1 r61951b  
    2828class CommandLineFastParsingState : public ActionState {
    2929public:
    30   CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) :
    31     oldvalue(_oldvalue),
    32     newvalue(_newvalue)
     30  CommandLineFastParsingState(bool _bool) :
     31    boolean(_bool)
    3332  {}
    34   bool oldvalue;
    35   bool newvalue;
     33  bool boolean;
    3634};
    3735
     
    6058
    6159Action::state_ptr CommandLineFastParsingAction::performCall() {
     60
    6261  config *configuration = World::getInstance().getConfig();
    63   bool oldvalue = configuration->FastParsing;
    64   bool newvalue;
    65   ValueStorage::getInstance().queryCurrentValue(NAME, newvalue);
    66   configuration->FastParsing = newvalue;
     62  ValueStorage::getInstance().queryCurrentValue(NAME, configuration->FastParsing);
    6763  if (configuration->FastParsing)
    6864    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    6965  else
    7066    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    71   return Action::state_ptr(new CommandLineFastParsingState(oldvalue, newvalue));
     67  return Action::success;
    7268}
    7369
     
    7672
    7773  config *configuration = World::getInstance().getConfig();
    78   configuration->FastParsing = state->oldvalue;
    79   if (configuration->FastParsing)
    80     DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    81   else
    82     DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
     74  configuration->FastParsing = state->boolean;
    8375
    84   return Action::state_ptr(_state);
     76  return Action::state_ptr(new CommandLineFastParsingState(!state->boolean));
    8577}
    8678
    8779Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){
    88   CommandLineFastParsingState *state = assert_cast<CommandLineFastParsingState*>(_state.get());
    89 
    90   config *configuration = World::getInstance().getConfig();
    91   configuration->FastParsing = state->newvalue;
    92   if (configuration->FastParsing)
    93     DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    94   else
    95     DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    96 
    97   return Action::state_ptr(_state);
     80  return performUndo(_state);
    9881}
    9982
  • src/Actions/CmdAction/VerboseAction.cpp

    r95e6b1 r61951b  
    2626class CommandLineVerboseState : public ActionState {
    2727public:
    28   CommandLineVerboseState(const int _oldverbosity, const int _newverbosity) :
    29     oldverbosity(_oldverbosity),
    30     newverbosity(_newverbosity)
     28  CommandLineVerboseState(int _verbosity) :
     29    verbosity(_verbosity)
    3130  {}
    32   int oldverbosity;
    33   int newverbosity;
     31  int verbosity;
    3432};
    3533
     
    5856
    5957Action::state_ptr CommandLineVerboseAction::performCall() {
    60   int oldverbosity = getVerbosity();
    61   int newverbosity = 2;
     58  int verbosity = 2;
    6259
    63   ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity);
     60  ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
    6461
    65   if (oldverbosity != newverbosity) {
    66     CommandLineVerboseState *UndoState = new CommandLineVerboseState(oldverbosity, newverbosity);
    67     setVerbosity(newverbosity);
    68     DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << oldverbosity << " to " << newverbosity << "." << endl);
    69     return Action::state_ptr(UndoState);
    70   } else {
    71     DoLog(0) && (Log() << Verbose(0) << "Verbosity remains unchanged at " << oldverbosity << "." << endl);
    72     return Action::failure;
    73   }
     62  setVerbosity(verbosity);
     63  DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
     64  return Action::success;
    7465}
    7566
     
    7768  CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
    7869
    79   DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->newverbosity << " to " << state->oldverbosity << "." << endl);
    80   setVerbosity(state->oldverbosity);
     70  int verbosity = 2;
     71  ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
    8172
    82   return Action::state_ptr(_state);
     73  setVerbosity(state->verbosity);
     74  return Action::state_ptr(new CommandLineVerboseState(verbosity));
    8375}
    8476
    8577Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){
    86   CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
    87 
    88   DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->oldverbosity << " to " << state->newverbosity << "." << endl);
    89   setVerbosity(state->newverbosity);
    90 
    91   return Action::state_ptr(_state);
     78  return performUndo(_state);
    9279}
    9380
  • src/Actions/WorldAction/SetDefaultNameAction.cpp

    r95e6b1 r61951b  
    6262
    6363  defaultname = World::getInstance().getDefaultName();
    64   WorldSetDefaultNameState *UndoState = new WorldSetDefaultNameState(defaultname);
    6564  ValueStorage::getInstance().queryCurrentValue(NAME, defaultname);
    6665
    6766  World::getInstance().setDefaultName(defaultname);
    6867  DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    69   return Action::state_ptr(UndoState);
     68  return Action::success;
    7069}
    7170
     
    7574  string newName = World::getInstance().getDefaultName();
    7675  World::getInstance().setDefaultName(state->lastName);
    77   DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    7876
    7977  return Action::state_ptr(new WorldSetDefaultNameState(newName));
  • src/Helpers/Log.cpp

    r95e6b1 r61951b  
    1818void setVerbosity(int verbosityLevel) {
    1919  logger::getInstance().setVerbosity(verbosityLevel);
    20 }
    21 
    22 /**
    23  * Gets verbosity for the error logger and the standard logger.
    24  *
    25  * \param int verbosity level
    26  */
    27 int getVerbosity() {
    28   return logger::getInstance().getVerbosity();
    2920}
    3021
  • src/Helpers/Log.hpp

    r95e6b1 r61951b  
    1515class errorLogger & eLog();
    1616void setVerbosity(int verbosityLevel);
    17 int getVerbosity();
    1817bool DoLog(int verbose);
    1918bool DoeLog(int verbose);
  • src/Helpers/errorlogger.cpp

    r95e6b1 r61951b  
    4141void errorLogger::setVerbosity(int verbosityLevel) {
    4242  verbosity = verbosityLevel;
    43 }
    44 
    45 /**
    46  * Gets the verbosity.
    47  *
    48  * \return verbosity level
    49  */
    50 int errorLogger::getVerbosity()
    51 {
    52   return verbosity;
    5343}
    5444
  • src/Helpers/errorlogger.hpp

    r95e6b1 r61951b  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
    27   static int getVerbosity();
    2827
    2928protected:
  • src/Helpers/logger.cpp

    r95e6b1 r61951b  
    4444
    4545/**
    46  * Gets the verbosity.
    47  *
    48  * \return verbosity level
    49  */
    50 int logger::getVerbosity()
    51 {
    52   return verbosity;
    53 }
    54 
    55 /**
    5646 * Operator for the Binary(arg) call.
    5747 * Constructs temporary a Verbose class object, wherein the Binary is stored.
  • src/Helpers/logger.hpp

    r95e6b1 r61951b  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
    27   static int getVerbosity();
    2827
    2928protected:
  • src/Makefile.am

    r95e6b1 r61951b  
    66ATOMSOURCE = \
    77  atom.cpp \
    8   AtomicInfo.cpp \
    98  atom_atominfo.cpp \
    109  atom_bondedparticle.cpp \
     
    1716ATOMHEADER = \
    1817  atom.hpp \
    19   AtomicInfo.hpp \
    2018  atom_atominfo.hpp \
    2119  atom_bondedparticle.hpp \
  • src/atom.cpp

    r95e6b1 r61951b  
    353353}
    354354
    355 molecule* atom::getMolecule() const {
     355molecule* atom::getMolecule(){
    356356  return mol;
    357357}
  • src/atom.hpp

    r95e6b1 r61951b  
    9292
    9393   void setMolecule(molecule*);
    94    molecule* getMolecule() const;
     94   molecule* getMolecule();
    9595   void removeFromMolecule();
    9696
  • tests/regression/Simple_configuration/5/pre/test.conf

    r95e6b1 r61951b  
    2828OutSrcStep      5       # Output "restart" data every ..th step
    2929TargetTemp      0.000950045     # Target temperature
    30 MaxPsiStep      3       # number of Minimisation steps per state (0 - default)
     30MaxPsiStep      0       # number of Minimisation steps per state (0 - default)
    3131EpsWannier      1e-07   # tolerance value for spread minimisation of orbitals
    3232
     
    3535RelEpsTotalE    1e-07   # relative change in total energy
    3636RelEpsKineticE  1e-05   # relative change in kinetic energy
    37 MaxMinStopStep  1       # check every ..th steps
    38 MaxMinGapStopStep       1       # check every ..th steps
     37MaxMinStopStep  0       # check every ..th steps
     38MaxMinGapStopStep       0       # check every ..th steps
    3939
    4040# Values specifying when to stop for INIT, otherwise same as above
     
    4242InitRelEpsTotalE        1e-05   # relative change in total energy
    4343InitRelEpsKineticE      0.0001  # relative change in kinetic energy
    44 InitMaxMinStopStep      1       # check every ..th steps
    45 InitMaxMinGapStopStep   1       # check every ..th steps
     44InitMaxMinStopStep      0       # check every ..th steps
     45InitMaxMinGapStopStep   0       # check every ..th steps
    4646
    4747BoxLength                       # (Length of a unit cell)
     
    5454Level0Factor    2       # factor by which node number increases from S to 0 level
    5555RiemannTensor   0       # (Use metric)
    56 PsiType         1       # 0 - doubly occupied, 1 - SpinUp,SpinDown
     56PsiType         0       # 0 - doubly occupied, 1 - SpinUp,SpinDown
    5757MaxPsiDouble    0       # here: specifying both maximum number of SpinUp- and -Down-states
    5858PsiMaxNoUp      0       # here: specifying maximum number of SpinUp-states
    59 PsiMaxNoDown    1       # here: specifying maximum number of SpinDown-states
     59PsiMaxNoDown    0       # here: specifying maximum number of SpinDown-states
    6060AddPsis         0       # Additional unoccupied Psis for bandgap determination
    6161
  • tests/regression/testsuite-simple_configuration.at

    r95e6b1 r61951b  
    3131AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp xyz -a 1 --position "0., 0., -1."], 134, [ignore], [ignore])
    3232AT_CLEANUP
    33 AT_SETUP([Simple configuration - adding atom with Undo/Redo])
    34 AT_KEYWORDS([configuration])
    35 AT_CHECK([../../molecuilder -i empty.conf -o pcp -a 1 --position "10., 10., 10." --undo], 0, [ignore], [ignore])
    36 AT_CHECK([file=empty.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    37 AT_CHECK([../../molecuilder -i test.conf -o mpqc pcp xyz -a 1 --position "10., 10., 10." --undo --redo], 0, [ignore], [ignore])
    38 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    39 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    40 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    41 AT_CLEANUP
    4233
    4334# 4. change the element
     
    4637AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    4738AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 ], 0, [ignore], [ignore])
    48 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
    49 AT_CLEANUP
    50 AT_SETUP([Simple configuration - Changing element with Undo/Redo])
    51 AT_KEYWORDS([configuration])
    52 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    53 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo], 0, [ignore], [ignore])
    54 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore])
    55 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    56 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo --redo], 0, [ignore], [ignore])
    5739AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
    5840AT_CLEANUP
     
    6648AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    6749AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    68 AT_CLEANUP
    69 AT_SETUP([Simple configuration - Atom removal with Undo/Redo])
    70 AT_KEYWORDS([configuration])
    71 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
    72 AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo], 0, [ignore], [ignore])
    73 AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/$file], 0, [ignore], [ignore])
    74 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
    75 AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo --redo], 0, [ignore], [ignore])
    76 AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    7750AT_CLEANUP
    7851
     
    11386AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    11487AT_CLEANUP
    115 AT_SETUP([Simple configuration - Removing sphere of atoms with Undo/Redo])
    116 AT_KEYWORDS([configuration])
    117 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    118 AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
    119 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    120 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutsphere.xyz], 0)
    121 AT_CHECK([../../molecuilder -i test-withoutsphere.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
    122 AT_CHECK([sort -n test-withoutsphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
    123 AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    124 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    125 AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
    126 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    127 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-sphere.xyz], 0)
    128 AT_CHECK([../../molecuilder -i test-sphere.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
    129 AT_CHECK([sort -n test-sphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore])
    130 AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    131 AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
    132 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    133 AT_CLEANUP
    13488
    13589AT_SETUP([Simple configuration - Removing cuboid of atoms])
     
    14195AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
    14296AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r], 0, [stdout], [stderr])
    143 AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
    144 AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    145 AT_CHECK([cat test-cuboid.xyz-sorted test-withoutcuboid.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
    146 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    147 AT_CLEANUP
    148 AT_SETUP([Simple configuration - Removing cuboid of atoms with Undo/Redo])
    149 AT_KEYWORDS([configuration])
    150 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    151 AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
    152 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    153 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutcuboid.xyz], 0)
    154 AT_CHECK([../../molecuilder -i test-withoutcuboid.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
    155 AT_CHECK([sort -n test-withoutcuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutcuboid.xyz-sorted], 0, [ignore], [ignore])
    156 AT_CHECK([file=test-withoutcuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    157 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    158 AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
    159 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    160 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
    161 AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
    16297AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
    16398AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
  • tests/regression/testsuite-standard_options.at

    r95e6b1 r61951b  
    55AT_CHECK([pwd],[ignore],[ignore])
    66AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore])
    7 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
    8 AT_CLEANUP
    9 AT_SETUP([Standard Options - verbosity with Undo/Redo])
    10 AT_KEYWORDS([options])
    11 AT_CHECK([../../molecuilder -v 1 --undo], 0, [stdout], [ignore])
    12 AT_CHECK([grep "Setting verbosity from 1 to .*" stdout], 0, [ignore], [ignore])
    13 AT_CHECK([../../molecuilder -v 1 --undo --redo], 0, [stdout], [ignore])
    14 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
     7AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
    158AT_CLEANUP
    169
     
    6053AT_CHECK([fgrep "I won't parse trajectories" stdout], 0, [ignore], [ignore])
    6154AT_CLEANUP
    62 AT_SETUP([Standard Options - fast trajectories with Undo/Redo])
    63 AT_KEYWORDS([options])
    64 AT_CHECK([../../molecuilder -i test.conf -n 1 --undo], 0, [stdout], [stderr])
    65 AT_CHECK([fgrep "I will parse trajectories." stdout], 0, [ignore], [ignore])
    66 AT_CHECK([../../molecuilder -i test.conf -n 1 --undo --redo], 0, [stdout], [stderr])
    67 AT_CHECK([grep -c "I won't parse trajectories" stdout], 0, 2
    68 , [ignore])
    69 AT_CLEANUP
    7055
    7156# 7. molecule default name
     
    7560AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
    7661AT_CLEANUP
    77 AT_SETUP([Standard Options - molecule default name with Undo/Redo])
    78 AT_KEYWORDS([options])
    79 AT_CHECK([../../molecuilder -i test.conf -X test --undo], 0, [stdout], [stderr])
    80 AT_CHECK([fgrep "Default name of new molecules set to none." stdout], 0, [ignore], [ignore])
    81 AT_CHECK([../../molecuilder -i test.conf -X test --undo --redo], 0, [stdout], [stderr])
    82 AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
    83 AT_CLEANUP
Note: See TracChangeset for help on using the changeset viewer.