- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/SaveTemperatureAction.cpp
r112b09 r047878 9 9 10 10 #include "Actions/MoleculeAction/SaveTemperatureAction.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 /****** MoleculeSaveTemperatureAction *****/ … … 49 48 {} 50 49 50 void MoleculeSaveTemperature(std::string &temperaturefile) { 51 ValueStorage::getInstance().setCurrentValue(MoleculeSaveTemperatureAction::NAME, temperaturefile); 52 ActionRegistry::getInstance().getActionByName(MoleculeSaveTemperatureAction::NAME)->call(Action::NonInteractive); 53 }; 54 55 Dialog* MoleculeSaveTemperatureAction::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 MoleculeSaveTemperatureAction::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) << "Storing temperatures in " << filename << "." << endl); 61 72 ofstream output; … … 66 77 DoLog(2) && (Log() << Verbose(2) << "File stored." << endl); 67 78 output.close(); 68 delete dialog;69 return Action::success;70 79 } 71 delete dialog; 72 return Action::failure; 80 return Action::success; 73 81 } 74 82
Note:
See TracChangeset
for help on using the changeset viewer.