|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
26 #ifndef MANAGER_MONITORINGMANAGER_H
27 #define MANAGER_MONITORINGMANAGER_H
35 #include <MonitorIn.hxx>
36 #include <MonitorOut.hxx>
66 virtual bool init() = 0;
68 virtual void end() = 0;
73 virtual void doMove() = 0;
75 virtual bool checkStop() = 0;
81 void reload(
bool delPml =
true);
86 void writeOutput(
const char* fileName);
88 void writeCsv(
const char* fileName);
90 void saveMmlIn(
const char* fileName);
96 double getCurrentTime();
97 double getCurrentStep();
98 double getStepComputingTime();
99 double getComputingTime();
115 std::string getPmlFileName();
116 std::string getLmlFileName();
117 std::string getMmlFileName();
118 std::string getmmlFileFolder();
121 void getOldPosition(
double pos[3],
unsigned int index);
125 void setCurrentTime(
double time);
128 void storeOldPositions();
130 void updateCurrentTime();
132 void updateComputingTime();
137 void setDt(
double dt);
139 void setRefresh(
double refresh);
141 void setPmlFileName(
const char* file);
143 void setLmlFileName(
const char* file);
147 void addMonitor(
Monitor* monitor);
149 Monitor* getMonitor(
const unsigned int i)
const;
151 void deleteMonitor(
const unsigned int i);
153 unsigned int numberOfMonitor()
const;
163 std::unique_ptr<mml::MonitoringIn>
mmlIn;
190 void buildMonitors();
196 void buildPmlAndSimulator(
bool delPml =
true);
198 void buildPmlAndSimulatorfromPml();
200 void buildPmlAndSimulatorfromSimulator();
225 #endif // MANAGER_MONITORINGMANAGERF_H
std::string getMmlFileName()
Definition: MonitoringManager.cpp:295
void buildPmlAndSimulator(bool delPml=true)
build physical model and simulator
Definition: MonitoringManager.cpp:522
int step
current step
Definition: MonitoringManager.h:177
void setRefresh(double refresh)
change refresh and save modification into mmlIn
Definition: MonitoringManager.cpp:399
double * oldPositionPointer
old position pointer
Definition: MonitoringManager.h:207
std::string pmlFileName
name of the pml file (complete path from working directory)
Definition: MonitoringManager.h:215
PhysicalModel * takePml()
This is nearly the same as getPml(), but it also transfers ownership of the pointer.
Definition: MonitoringManager.cpp:268
void getOldPosition(double pos[3], unsigned int index)
get atom position for precedent step
Definition: MonitoringManager.cpp:335
void simulate()
perform simulation loop, make tests and save monitors' data into output file
Definition: MonitoringManager.cpp:428
std::vector< mml::TimeStep * > times
Vector that contains information saved by saveMonitors method.
Definition: MonitoringManager.h:167
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
void addMonitor(Monitor *monitor)
add a monitor to the list
Definition: MonitoringManager.cpp:366
MonitoringManager(const char *mml)
constructor
Definition: MonitoringManager.cpp:44
PhysicalModel * initPml
initial pml
Definition: MonitoringManager.h:209
bool ownLml
is the lml "own" by this is instance, which is the normal case when there are not visual representati...
Definition: MonitoringManager.h:213
PhysicalModel * getPml()
Definition: MonitoringManager.cpp:263
void setDt(double dt)
change dt and save modification into mmlIn
Definition: MonitoringManager.cpp:393
void setLmlFileName(const char *file)
change lml file name and save modification into mmlIn
Definition: MonitoringManager.cpp:405
virtual ~MonitoringManager()
destructor
Definition: MonitoringManager.cpp:111
double dt
integration step
Definition: MonitoringManager.h:170
double getDt()
Definition: MonitoringManager.cpp:227
double getCurrentStep()
Definition: MonitoringManager.cpp:242
Loads * lml
Loads applied to pml.
Definition: MonitoringManager.h:211
#define MML_API
Definition: MMLAPI.h:43
static SimulatorFactory * getInstance()
return the unique instance of the factory
Definition: SimulatorFactory.cpp:56
void saveMonitors()
Save save monitors' state for the current time.
Definition: MonitoringManager.cpp:200
void updateComputingTime()
add step computing time to total computing time
Definition: MonitoringManager.cpp:325
double getComputingTime()
Definition: MonitoringManager.cpp:253
std::string getLmlFileName()
Definition: MonitoringManager.cpp:290
Monitor * getMonitor(const unsigned int i) const
get a monitor by its index in the list
Definition: MonitoringManager.cpp:378
A simulator engine is used to compute the displacements of all atoms of the model.
Definition: Simulator.h:46
void setCurrentTime(double time)
mutators for simulation parameters
Definition: MonitoringManager.cpp:313
std::string mmlFileName
name of the mml in file (complete path from working directory)
Definition: MonitoringManager.h:219
void buildMonitors()
build monitors
Definition: MonitoringManager.cpp:510
void buildPmlAndSimulatorfromPml()
build physical model and simulator from a pml file
Definition: MonitoringManager.cpp:552
double currentTime
time at current moment
Definition: MonitoringManager.h:179
void writeOutput(const char *fileName)
Write all saved monitors' states into mmlOut file.
Definition: MonitoringManager.cpp:137
std::string getPmlFileName()
Definition: MonitoringManager.cpp:285
bool isLmlPresent()
check if a lml is present
Definition: MonitoringManager.cpp:486
std::string getmmlFileFolder()
Definition: MonitoringManager.cpp:300
virtual void createPml(const char *inputFile, const char *pmlFile)=0
Create a pml file from a simulator specific imput file.
bool ownPml
is the pml "own" by this instance, which is the normal case when there are no visual representation....
Definition: MonitoringManager.h:205
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
std::string lmlFileName
name of the lml file (complete path from working directory)
Definition: MonitoringManager.h:217
void buildLoads()
build the loads if lml file was given
Definition: MonitoringManager.cpp:491
void saveMmlIn(const char *fileName)
save current version of mml in
Definition: MonitoringManager.cpp:417
void storeOldPositions()
store old positions before next step
Definition: MonitoringManager.cpp:361
std::string mmlFileFolder
folder of mml file (complete path from working directory)
Definition: MonitoringManager.h:221
Loads * getLml()
Definition: MonitoringManager.cpp:274
unsigned int numberOfMonitor() const
get the number of monitors stored in the list
Definition: MonitoringManager.cpp:388
std::vector< Monitor * > monitors
Vector that contains all monitors.
Definition: MonitoringManager.h:165
Simulator * getSimulator()
Definition: MonitoringManager.cpp:306
void rewind()
Rewind simulation.
Definition: MonitoringManager.cpp:445
static Monitor * createMonitor(mml::Monitor *m, MonitoringManager *monitoringManager)
create a monitor according to the xsdcxx object monitor
Definition: MonitorFactory.cpp:37
void setPmlFileName(const char *file)
change pml file name and save modification into mmlIn
Definition: MonitoringManager.cpp:411
double getRefresh()
Definition: MonitoringManager.cpp:232
PhysicalModel * pml
pml at current moment
Definition: MonitoringManager.h:203
void deleteMonitor(const unsigned int i)
delete a monitor and remove it from the list using its index
Definition: MonitoringManager.cpp:371
std::unique_ptr< mml::MonitoringIn > mmlIn
Object representing manager in the file generated by xsdcxx, can be used for serialization.
Definition: MonitoringManager.h:163
Manager of the benchmark tests. Do simulation loop and tests.
Definition: MonitoringManager.h:50
Simulator * simul
the simulator used for simualtion
Definition: MonitoringManager.h:185
This class makes it possible to manage a list of "Load". Remember that Load is an abstract class (con...
Definition: Loads.h:71
std::string simulatorName
name of the simulator
Definition: MonitoringManager.h:174
Simulator * createSimulator(std::string id, MonitoringManager *monitoringManager)
Creates a Simulator based on its string id or return nullptr if there is no id in the map.
Definition: SimulatorFactory.cpp:37
void writeCsv(const char *fileName)
Write all saved monitors'state into csv file.
Definition: MonitoringManager.cpp:168
void updateCurrentTime()
add dt to current time
Definition: MonitoringManager.cpp:319
void buildPmlAndSimulatorfromSimulator()
build physical model and simulator from a specific simulator file
Definition: MonitoringManager.cpp:561
Loads * takeLml()
This is nearly the same as getLml(), but it also transfers ownership of the pointer.
Definition: MonitoringManager.cpp:279
double getCurrentTime()
Definition: MonitoringManager.cpp:237
PhysicalModel * getInitPml()
Definition: MonitoringManager.cpp:258
void refresh()
refresh the display
void reload(bool delPml=true)
reload simulation with current parameters
Definition: MonitoringManager.cpp:462
A monitor calculate and store followed data (ex:calculation between current position and references) ...
Definition: Monitor.h:49
double refresh
refreshing step
Definition: MonitoringManager.h:172
void incStep()
increment step by one
Definition: MonitoringManager.cpp:330
double computingTime
total computing time at current moment
Definition: MonitoringManager.h:183
double stepComputingTime
computing time of last step
Definition: MonitoringManager.h:181
double getStepComputingTime()
Definition: MonitoringManager.cpp:247
bool isPmlPresent()
check if a scn is present instead of pmlFileName
Definition: MonitoringManager.cpp:481