- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/VerletIntegrationAction.cpp
r112b09 r047878 9 9 10 10 #include "Actions/MoleculeAction/VerletIntegrationAction.hpp" 11 #include "Actions/ActionRegistry.hpp" 12 #include "log.hpp" 13 #include "molecule.hpp" 14 #include "verbose.hpp" 15 #include "World.hpp" 11 16 12 17 #include <iostream> … … 18 23 #include "UIElements/UIFactory.hpp" 19 24 #include "UIElements/Dialog.hpp" 20 #include "Actions/MapOfActions.hpp" 21 22 #include "atom.hpp" 23 #include "log.hpp" 24 #include "molecule.hpp" 25 #include "verbose.hpp" 26 #include "World.hpp" 25 #include "UIElements/ValueStorage.hpp" 27 26 28 27 /****** MoleculeVerletIntegrationAction *****/ … … 49 48 {} 50 49 50 void MoleculeVerletIntegration(std::string &forcesfile) { 51 ValueStorage::getInstance().setCurrentValue(MoleculeVerletIntegrationAction::NAME, forcesfile); 52 ActionRegistry::getInstance().getActionByName(MoleculeVerletIntegrationAction::NAME)->call(Action::NonInteractive); 53 }; 54 55 Dialog* MoleculeVerletIntegrationAction::fillDialog(Dialog *dialog) { 56 ASSERT(dialog,"No Dialog given when filling action dialog"); 57 58 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); 59 60 return dialog; 61 } 62 51 63 Action::state_ptr MoleculeVerletIntegrationAction::performCall() { 52 64 string filename; 53 Dialog *dialog = UIFactory::getInstance().makeDialog();54 65 molecule *mol = NULL; 55 66 56 dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME)); 57 dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id")); 67 ValueStorage::getInstance().queryCurrentValue(NAME, filename); 58 68 59 if(dialog->display()) { 69 for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) { 70 mol = iter->second; 60 71 DoLog(1) && (Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl); 61 72 // TODO: sollte besser stream nutzen, nicht filename direkt (es sei denn, ist prefix), besser fuer unit test 62 73 char outputname[MAXSTRINGSIZE]; 63 74 strcpy(outputname, filename.c_str()); 64 if (!mol->VerletForceIntegration(outputname, *(World::getInstance().getConfig()) ))75 if (!mol->VerletForceIntegration(outputname, *(World::getInstance().getConfig()), 0)) 65 76 DoLog(2) && (Log() << Verbose(2) << "File not found." << endl); 66 77 else 67 78 DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl); 68 69 delete dialog;70 return Action::success;71 79 } 72 delete dialog; 73 return Action::failure; 80 return Action::success; 74 81 } 75 82
Note:
See TracChangeset
for help on using the changeset viewer.