Computer Assited Medical Intervention Tool Kit  version 5.0
MonitoringDialog.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef MONITORINGDIALOG_H
27 #define MONITORINGDIALOG_H
28 
29 #include "MMLMonitoringGUIAPI.h"
30 
31 #include <QDialog>
32 class QTableWidget;
33 class QTreeWidgetItem;
34 
35 namespace Ui {
36 class MonitoringDialog;
37 }
38 
40 
41 class StoppingCriterion;
42 
50 class /* needed if you monitoringgui is compiled as shared: MML_MONITORING_GUI_API*/ MonitoringDialog : public QDialog {
51  Q_OBJECT
52 
53 public:
55  MonitoringDialog(MonitoringGuiManager* guiManager, QWidget* parent = nullptr);
57  ~MonitoringDialog() override;
58 
60  void init();
61 
63  void updateAll();
65  void updateMonitors();
69  void updateSimulation();
71  void updateSimulatorWidget();
73  QString getMmlInFileName();
75  QTableWidget* getMonitorsTableWidget();
76 
77 public slots:
79  void browseMmlIn();
81  void saveMmlOut();
83  void saveCsv();
85  void saveMmlIn();
87  void browsePml();
89  void browseLml();
91  void dtModified();
93  void refreshModified();
94 
98  void pause();
101  void simulate();
103  void simulateOneStep();
105  void rewind();
106 
107 signals:
109  void monitorsChanged();
110 
111 
112 private:
114  Ui::MonitoringDialog* ui;
115 
118 
120  QColor bgColor;
121 
123  void enableButtons(bool enable);
124 
126  QTreeWidgetItem* createItem(StoppingCriterion* sc, QTreeWidgetItem* parent);
127 };
128 
129 #endif // MONITORINGDIALOG_H
MonitoringManager::getMmlFileName
std::string getMmlFileName()
Definition: MonitoringManager.cpp:295
Criterion
Class which represents a simple criterion A criterion can be checked using checkCriterion method to k...
Definition: Criterion.h:47
MonitoringDriver.h
MonitoringDialog::ui
Ui::MonitoringDialog * ui
the ui dialog designed in qtdesigner
Definition: MonitoringDialog.h:114
MonitoringDialog::dtModified
void dtModified()
Slot called after dt editing.
Definition: MonitoringDialog.cpp:356
MonitoringDialog::saveMmlOut
void saveMmlOut()
Slot called when save MmlOut file is clicked.
Definition: MonitoringDialog.cpp:146
InteractiveMonitoringManager::getStoppingCriterion
StoppingCriterion * getStoppingCriterion()
get Stopping Criterion
Definition: InteractiveMonitoringManager.cpp:100
Monitor::getStopAt
double getStopAt()
Definition: Monitor.cpp:212
MonitoringDialog::simulateOneStep
void simulateOneStep()
Slot called when the next step is clicked.
Definition: MonitoringDialog.cpp:199
MonitoringGuiManager::updatePml
void updatePml(QString fileName)
update pml
Definition: MonitoringGuiManager.cpp:228
InteractiveMonitoringManager.h
MonitoringManager::getDt
double getDt()
Definition: MonitoringManager.cpp:227
MonitoringManager::getCurrentStep
double getCurrentStep()
Definition: MonitoringManager.cpp:242
MonitoringDialog::updateSimulation
void updateSimulation()
update simulation tab
Definition: MonitoringDialog.cpp:288
MonitoringDialog::rewind
void rewind()
Slot called when the button Rewind is clicked.
Definition: MonitoringDialog.cpp:209
MonitoringDialog::browseMmlIn
void browseMmlIn()
Slot called when Browse MmlIn file is clicked.
Definition: MonitoringDialog.cpp:137
MonitoringDialog::updateMonitors
void updateMonitors()
update monitors tab
Definition: MonitoringDialog.cpp:257
MonitoringDialog
TODO Comment class here.
Definition: MonitoringDialog.h:50
MonitoringDialog.h
MonitoringGuiManager::saveMmlInFile
bool saveMmlInFile(QString fileName)
Save MMLIn file.
Definition: MonitoringGuiManager.cpp:211
MonitoringGuiManager::reload
void reload()
reload simulation with current parameters
Definition: MonitoringGuiManager.cpp:170
MonitoringManager::getComputingTime
double getComputingTime()
Definition: MonitoringManager.cpp:253
MonitoringManager::getLmlFileName
std::string getLmlFileName()
Definition: MonitoringManager.cpp:290
MonitoringManager::getMonitor
Monitor * getMonitor(const unsigned int i) const
get a monitor by its index in the list
Definition: MonitoringManager.cpp:378
MonitoringDialog::enableButtons
void enableButtons(bool enable)
set the rew,play,pause,step buttons enable or not
Definition: MonitoringDialog.cpp:104
MonitoringDialog::init
void init()
initialize dialog
Definition: MonitoringDialog.cpp:99
MonitoringDialog::monitorsChanged
void monitorsChanged()
emitted
Monitor::getReferenceName
std::string getReferenceName()
Definition: Monitor.cpp:192
MonitoringManager::getPmlFileName
std::string getPmlFileName()
Definition: MonitoringManager.cpp:285
MonitoringDialog::updateAll
void updateAll()
update all tabs
Definition: MonitoringDialog.cpp:225
MonitoringDialog::bgColor
QColor bgColor
the initial bg color
Definition: MonitoringDialog.h:120
StoppingCriterion::getName
virtual std::string getName()=0
get stopping criterion name
MonitoringManager::isLmlPresent
bool isLmlPresent()
check if a lml is present
Definition: MonitoringManager.cpp:486
MMLMonitoringGUIAPI.h
MonitoringDialog::refreshModified
void refreshModified()
Slot called after refresh editing.
Definition: MonitoringDialog.cpp:361
Monitor::getTargetName
std::string getTargetName()
Definition: Monitor.cpp:217
Ui
Definition: SettingsDialog.h:31
MonitoringDialog::saveMmlIn
void saveMmlIn()
Slot called when save MmlIn file is clicked.
Definition: MonitoringDialog.cpp:162
MonitoringGuiManager
A GUI to manipulate mml documents.
Definition: MonitoringGuiManager.h:45
StoppingCriterion::getChild
virtual StoppingCriterion * getChild(const unsigned int i)=0
get the child repered by index, return nullptr if no child
MonitoringManager::numberOfMonitor
unsigned int numberOfMonitor() const
get the number of monitors stored in the list
Definition: MonitoringManager.cpp:388
MonitoringGuiManager::loadMmlInFile
bool loadMmlInFile(QString fileName)
Load a MMLIn file.
Definition: MonitoringGuiManager.cpp:181
MonitoringDialog::saveCsv
void saveCsv()
Slot called when save as csv file is clicked.
Definition: MonitoringDialog.cpp:154
MonitoringGuiManager::pause
void pause()
pause simulation
Definition: MonitoringGuiManager.cpp:156
MonitoringDialog::updateSimulatorWidget
void updateSimulatorWidget()
update simulator specific widget
Definition: MonitoringDialog.cpp:314
MonitoringManager::getSimulator
Simulator * getSimulator()
Definition: MonitoringManager.cpp:306
MonitoringGuiManager::simulateOneStep
void simulateOneStep()
do one step of simulation
Definition: MonitoringGuiManager.cpp:144
MonitoringGuiManager::saveMmlOutFile
bool saveMmlOutFile(QString fileName)
Save MMLout file.
Definition: MonitoringGuiManager.cpp:198
MonitoringGuiManager.h
MonitoringManager::getRefresh
double getRefresh()
Definition: MonitoringManager.cpp:232
MonitoringDialog::guiManager
MonitoringGuiManager * guiManager
the monitoring manager
Definition: MonitoringDialog.h:117
StoppingCriterion.h
MonitoringDialog::pause
void pause()
do one step of simulation
Definition: MonitoringDialog.cpp:204
StoppingCriterion::getNumberOfChildren
virtual int getNumberOfChildren()=0
get number of childre; return -1 for non multiple criteria
MonitoringDialog::getMonitorsTableWidget
QTableWidget * getMonitorsTableWidget()
get the monitors table
Definition: MonitoringDialog.cpp:365
StoppingCriterion
class which represent the stopping criterion to check to stop simulation a StoppingCriterion is eithe...
Definition: StoppingCriterion.h:48
MonitoringGuiManager::simulate
void simulate()
do simulation lopp
Definition: MonitoringGuiManager.cpp:132
MonitoringDialog::simulate
void simulate()
Slot called when the button Play is clicked.
Definition: MonitoringDialog.cpp:218
MonitoringGuiManager::updateDt
void updateDt(double dt)
update dt
Definition: MonitoringGuiManager.cpp:218
MonitoringGuiManager::updateLml
void updateLml(QString fileName)
update lml
Definition: MonitoringGuiManager.cpp:233
Monitor::getTypeName
virtual std::string getTypeName()=0
MonitoringDialog::updateStoppingCriteria
void updateStoppingCriteria()
update stopping criteria tab
Definition: MonitoringDialog.cpp:301
MonitoringDialog::getMmlInFileName
QString getMmlInFileName()
get MmlIn file name
Definition: MonitoringDialog.cpp:351
MonitoringGuiManager::updateRefresh
void updateRefresh(double refresh)
update refresh
Definition: MonitoringGuiManager.cpp:223
MonitoringGuiManager::getMonitoringManager
MonitoringManager * getMonitoringManager()
get Monitoring Manager
Definition: MonitoringGuiManager.cpp:74
MonitoringManager::getCurrentTime
double getCurrentTime()
Definition: MonitoringManager.cpp:237
Criterion.h
MonitoringDialog::createItem
QTreeWidgetItem * createItem(StoppingCriterion *sc, QTreeWidgetItem *parent)
Definition: MonitoringDialog.cpp:333
Monitor
A monitor calculate and store followed data (ex:calculation between current position and references) ...
Definition: Monitor.h:49
MonitoringDialog::~MonitoringDialog
~MonitoringDialog() override
Destructor.
Definition: MonitoringDialog.cpp:85
InteractiveMonitoringManager
Interactice managers are managers linked with an interactive simulator.
Definition: InteractiveMonitoringManager.h:51
MonitoringDialog::MonitoringDialog
MonitoringDialog(MonitoringGuiManager *guiManager, QWidget *parent=nullptr)
Default Constructor.
Definition: MonitoringDialog.cpp:44
Monitor.h
Monitor::getStartAt
double getStartAt()
Definition: Monitor.cpp:207
MonitoringGuiManager::saveCsvFile
bool saveCsvFile(QString fileName)
Save csv file.
Definition: MonitoringGuiManager.cpp:204
MonitoringGuiManager::getDriver
MonitoringDriver * getDriver()
get driver
Definition: MonitoringGuiManager.cpp:69
MonitoringManager::getStepComputingTime
double getStepComputingTime()
Definition: MonitoringManager.cpp:247
MonitoringDialog::browsePml
void browsePml()
Slot called when Browse Pml file is clicked.
Definition: MonitoringDialog.cpp:185
MonitoringGuiManager::rewind
void rewind()
rewind simulation
Definition: MonitoringGuiManager.cpp:161
MonitoringDialog::browseLml
void browseLml()
Slot called when Browse Lml file is clicked.
Definition: MonitoringDialog.cpp:171
MonitoringManager::isPmlPresent
bool isPmlPresent()
check if a scn is present instead of pmlFileName
Definition: MonitoringManager.cpp:481