12 #include <argos3/core/config.h>
13 #include <argos3/core/utility/plugins/dynamic_loading.h>
14 #include <argos3/core/utility/logging/argos_log.h>
15 #include <argos3/core/simulator/simulator.h>
16 #include <argos3/core/simulator/loop_functions.h>
18 #include <QtCore/QVariant>
19 #include <QtWidgets/QAction>
20 #include <QtWidgets/QApplication>
21 #include <QtWidgets/QDockWidget>
22 #include <QtWidgets/QHeaderView>
23 #include <QtWidgets/QLCDNumber>
24 #include <QtWidgets/QPushButton>
25 #include <QtWidgets/QSpinBox>
26 #include <QtWidgets/QDoubleSpinBox>
27 #include <QtWidgets/QStatusBar>
28 #include <QtWidgets/QWidget>
30 #include <QCloseEvent>
31 #include <QMessageBox>
34 #include <QTextStream>
50 m_pcQTOpenGLItem(NULL) {
51 setContentsMargins(0, 0, 0, 0);
55 if(m_pcQTOpenGLItem != NULL) {
56 delete m_pcQTOpenGLItem;
61 if(m_pcQTOpenGLItem != NULL) {
62 delete m_pcQTOpenGLItem;
64 m_pcQTOpenGLItem = item;
67 return (m_pcQTOpenGLItem != NULL) ? 1 : 0;
70 virtual QLayoutItem*
itemAt(
int index)
const {
71 return (index == 0) ? m_pcQTOpenGLItem : NULL;
74 virtual QLayoutItem*
takeAt(
int index) {
76 QLayoutItem* pcRetVal = m_pcQTOpenGLItem;
77 m_pcQTOpenGLItem = NULL;
86 return QSize(320,240);
90 return QSize(640,480);
95 QLayout::setGeometry(r);
96 if(m_pcQTOpenGLItem != NULL) {
99 QRect cCandidate1(r.x(), r.y(), (r.height() * 4) / 3, r.height());
101 QRect cCandidate2(r.x(), r.y(), r.width(), (r.width() * 3) / 4);
103 if(r.contains(cCandidate1)) {
105 int nPadding = (r.width() - cCandidate1.width()) / 2;
106 cCandidate1.translate(nPadding, 0);
107 m_pcQTOpenGLItem->setGeometry(cCandidate1);
111 int nPadding = (r.height() - cCandidate2.height()) / 2;
112 cCandidate2.translate(0, nPadding);
113 m_pcQTOpenGLItem->setGeometry(cCandidate2);
120 QLayoutItem* m_pcQTOpenGLItem;
128 m_pcUserFunctions(NULL) {
130 std::string strTitle;
131 GetNodeAttributeOrDefault<std::string>(t_tree,
"title", strTitle,
"ARGoS v" ARGOS_VERSION
"-" ARGOS_RELEASE);
132 setWindowTitle(tr(strTitle.c_str()));
134 ReadSettingsPreCreation();
136 m_pcStatusbar =
new QStatusBar(
this);
137 setStatusBar(m_pcStatusbar);
139 CreateExperimentActions();
140 CreateCameraActions();
144 CreateUserFunctions(t_tree);
146 CreateOpenGLWidget(t_tree);
148 CreateExperimentMenu();
153 CreateExperimentToolBar();
154 CreateCameraToolBar();
156 CreateLogMessageDock();
158 ReadSettingsPostCreation();
162 m_eExperimentState = EXPERIMENT_INITIALIZED;
164 bool bAutoPlay =
false;
175 delete m_pcUserFunctions;
176 delete m_pcLogStream;
177 delete m_pcLogErrStream;
178 if(m_bWasLogColored) {
187 void CQTOpenGLMainWindow::ReadSettingsPreCreation() {
189 cSettings.beginGroup(
"MainWindow");
190 resize(cSettings.value(
"size", QSize(640,480)).toSize());
191 move(cSettings.value(
"position", QPoint(0,0)).toPoint());
192 if(cSettings.contains(
"icon_dir")) {
193 m_strIconDir = cSettings.value(
"icon_dir").toString();
194 if(m_strIconDir.at(m_strIconDir.length()-1) !=
'/') {
195 m_strIconDir.append(
"/");
200 m_strIconDir +=
"/include/argos3/plugins/simulator/visualizations/qt-opengl/icons/";
202 if(cSettings.contains(
"texture_dir")) {
203 m_strTextureDir = cSettings.value(
"texture_dir").toString();
204 if(m_strTextureDir.at(m_strTextureDir.length()-1) !=
'/') {
205 m_strTextureDir.append(
"/");
210 m_strTextureDir +=
"/include/argos3/plugins/simulator/visualizations/qt-opengl/textures/";
212 cSettings.endGroup();
218 void CQTOpenGLMainWindow::ReadSettingsPostCreation() {
220 cSettings.beginGroup(
"MainWindow");
221 restoreState(cSettings.value(
"docks").toByteArray());
222 cSettings.endGroup();
228 void CQTOpenGLMainWindow::WriteSettings() {
230 cSettings.beginGroup(
"MainWindow");
231 cSettings.setValue(
"docks", saveState());
232 cSettings.setValue(
"size", size());
233 cSettings.setValue(
"position", pos());
234 cSettings.setValue(
"icon_dir", m_strIconDir);
235 cSettings.setValue(
"texture_dir", m_strTextureDir);
236 cSettings.endGroup();
242 void CQTOpenGLMainWindow::CreateExperimentActions() {
245 cPlayIcon. addPixmap(QPixmap(m_strIconDir +
"/play.png"));
246 m_pcPlayAction =
new QAction(cPlayIcon, tr(
"&Play"),
this);
247 m_pcPlayAction->setShortcut(Qt::Key_P);
248 m_pcPlayAction->setToolTip(tr(
"Play experiment"));
249 m_pcPlayAction->setStatusTip(tr(
"Play experiment"));
253 cStepIcon.addPixmap(QPixmap(m_strIconDir +
"/step.png"));
254 m_pcStepAction =
new QAction(cStepIcon, tr(
"&Step"),
this);
255 m_pcStepAction->setToolTip(tr(
"Step experiment"));
256 m_pcStepAction->setStatusTip(tr(
"Step experiment"));
257 m_pcStepAction->setShortcut(Qt::Key_X);
259 QIcon cFastForwardIcon;
260 cFastForwardIcon.addPixmap(QPixmap(m_strIconDir +
"/fast_forward.png"));
261 m_pcFastForwardAction =
new QAction(cFastForwardIcon, tr(
"&Fast Forward"),
this);
262 m_pcFastForwardAction->setToolTip(tr(
"Fast forward experiment"));
263 m_pcFastForwardAction->setStatusTip(tr(
"Fast forward experiment"));
264 m_pcFastForwardAction->setShortcut(Qt::Key_F);
267 cPauseIcon. addPixmap(QPixmap(m_strIconDir +
"/pause.png"));
268 m_pcPauseAction =
new QAction(cPauseIcon, tr(
"&Pause"),
this);
269 m_pcPauseAction->setShortcut(Qt::Key_O);
270 m_pcPauseAction->setToolTip(tr(
"Pause experiment"));
271 m_pcPauseAction->setStatusTip(tr(
"Pause experiment"));
272 m_pcPauseAction->setEnabled(
false);
275 QIcon cTerminateIcon;
276 cTerminateIcon.addPixmap(QPixmap(m_strIconDir +
"/stop.png"));
277 m_pcTerminateAction =
new QAction(cTerminateIcon, tr(
"&Terminate"),
this);
278 m_pcTerminateAction->setShortcut(Qt::Key_T);
279 m_pcTerminateAction->setToolTip(tr(
"Terminate experiment"));
280 m_pcTerminateAction->setStatusTip(tr(
"Terminate experiment"));
281 m_pcTerminateAction->setEnabled(
false);
284 cResetIcon.addPixmap(QPixmap(m_strIconDir +
"/reset.png"));
285 m_pcResetAction =
new QAction(cResetIcon, tr(
"&Reset"),
this);
286 m_pcResetAction->setToolTip(tr(
"Reset experiment"));
287 m_pcResetAction->setStatusTip(tr(
"Reset experiment"));
288 m_pcResetAction->setShortcut(Qt::Key_R);
289 m_pcResetAction->setEnabled(
false);
292 cCaptureIcon.addPixmap(QPixmap(m_strIconDir +
"/record.png"));
293 m_pcCaptureAction =
new QAction(cCaptureIcon, tr(
"&Capture"),
this);
294 m_pcCaptureAction->setToolTip(tr(
"Capture frames"));
295 m_pcCaptureAction->setStatusTip(tr(
"Capture frames"));
296 m_pcCaptureAction->setCheckable(
true);
297 m_pcCaptureAction->setShortcut(Qt::Key_C);
299 m_pcQuitAction =
new QAction(tr(
"&Quit"),
this);
300 m_pcQuitAction->setStatusTip(tr(
"Quit the simulator"));
306 void CQTOpenGLMainWindow::CreateCameraActions() {
308 m_pcSwitchCameraActionGroup =
new QActionGroup(
this);
310 cCameraIcon.addPixmap(QPixmap(m_strIconDir +
"/camera.png"));
311 for(
UInt32 i = 0; i < 12; ++i) {
312 QAction* pcAction =
new QAction(cCameraIcon, tr(QString(
"Camera %1").arg(i+1).toLatin1().data()), m_pcSwitchCameraActionGroup);
313 pcAction->setToolTip(tr(QString(
"Switch to camera %1").arg(i+1).toLatin1().data()));
314 pcAction->setStatusTip(tr(QString(
"Switch to camera %1").arg(i+1).toLatin1().data()));
315 pcAction->setCheckable(
true);
316 pcAction->setShortcut(Qt::Key_F1 + i);
317 pcAction->setData(i);
318 m_pcSwitchCameraActions.push_back(pcAction);
320 m_pcSwitchCameraActions.first()->setChecked(
true);
322 m_pcShowCameraXMLAction =
new QAction(tr(
"&Show XML..."),
this);
323 m_pcShowCameraXMLAction->setStatusTip(tr(
"Show XML configuration for all cameras"));
345 void CQTOpenGLMainWindow::CreateHelpActions() {
347 m_pcAboutQTAction =
new QAction(tr(
"About &Qt"),
this);
348 m_pcAboutQTAction->setStatusTip(tr(
"Show the Qt library's About box"));
354 void CQTOpenGLMainWindow::CreateExperimentToolBar() {
355 m_pcExperimentToolBar = addToolBar(tr(
"Experiment"));
356 m_pcExperimentToolBar->setObjectName(
"ExperimentToolBar");
357 m_pcExperimentToolBar->setIconSize(QSize(32,32));
358 m_pcCurrentStepLCD =
new QLCDNumber(m_pcExperimentToolBar);
359 m_pcCurrentStepLCD->setToolTip(tr(
"Current step"));
360 m_pcCurrentStepLCD->setDigitCount(6);
361 m_pcCurrentStepLCD->setSegmentStyle(QLCDNumber::Flat);
362 m_pcExperimentToolBar->addWidget(m_pcCurrentStepLCD);
363 m_pcExperimentToolBar->addSeparator();
365 m_pcExperimentToolBar->addAction(m_pcStepAction);
367 m_pcExperimentToolBar->addAction(m_pcPlayAction);
369 m_pcExperimentToolBar->addAction(m_pcPauseAction);
370 m_pcExperimentToolBar->addAction(m_pcFastForwardAction);
371 m_pcDrawFrameEvery =
new QSpinBox(m_pcExperimentToolBar);
372 m_pcDrawFrameEvery->setToolTip(tr(
"Draw frame every X steps when in fast-forward"));
373 m_pcDrawFrameEvery->setMinimum(1);
374 m_pcDrawFrameEvery->setMaximum(999);
375 m_pcDrawFrameEvery->setValue(1);
376 m_pcExperimentToolBar->addWidget(m_pcDrawFrameEvery);
378 m_pcExperimentToolBar->addSeparator();
379 m_pcExperimentToolBar->addAction(m_pcTerminateAction);
380 m_pcExperimentToolBar->addAction(m_pcResetAction);
381 m_pcExperimentToolBar->addSeparator();
382 m_pcExperimentToolBar->addAction(m_pcCaptureAction);
388 void CQTOpenGLMainWindow::CreateExperimentMenu() {
389 m_pcExperimentMenu = menuBar()->addMenu(tr(
"&Experiment"));
390 m_pcExperimentMenu->addAction(m_pcPlayAction);
392 m_pcExperimentMenu->addAction(m_pcPauseAction);
393 m_pcExperimentMenu->addAction(m_pcFastForwardAction);
394 m_pcExperimentMenu->addAction(m_pcStepAction);
396 m_pcExperimentMenu->addSeparator();
397 m_pcExperimentMenu->addAction(m_pcTerminateAction);
398 m_pcExperimentMenu->addAction(m_pcResetAction);
399 m_pcExperimentMenu->addSeparator();
400 m_pcExperimentMenu->addAction(m_pcCaptureAction);
401 m_pcExperimentMenu->addSeparator();
402 m_pcExperimentMenu->addAction(m_pcQuitAction);
408 void CQTOpenGLMainWindow::CreateCameraToolBar() {
409 m_pcCameraToolBar =
new QToolBar(tr(
"Camera"));
410 m_pcCameraToolBar->setAllowedAreas(Qt::LeftToolBarArea |
411 Qt::RightToolBarArea |
412 Qt::BottomToolBarArea);
413 m_pcCameraToolBar->setObjectName(
"CameraToolBar");
414 m_pcCameraToolBar->setIconSize(QSize(32,32));
415 m_pcCameraToolBar->addActions(m_pcSwitchCameraActions);
416 m_pcCameraToolBar->addSeparator();
417 m_pcFocalLength =
new QDoubleSpinBox(m_pcCameraToolBar);
418 m_pcFocalLength->setToolTip(tr(
"Set the focal length of the current camera"));
419 m_pcFocalLength->setSuffix(
"mm");
420 m_pcFocalLength->setDecimals(1);
421 m_pcFocalLength->setSingleStep(1.0f);
422 m_pcFocalLength->setRange(1.0f, 999.0f);
424 m_pcCameraToolBar->addWidget(m_pcFocalLength);
425 addToolBar(Qt::LeftToolBarArea, m_pcCameraToolBar);
431 void CQTOpenGLMainWindow::CreateCameraMenu() {
432 m_pcCameraMenu = menuBar()->addMenu(tr(
"&Camera"));
433 m_pcCameraMenu->addActions(m_pcSwitchCameraActions);
434 m_pcCameraMenu->addAction(m_pcShowCameraXMLAction);
449 void CQTOpenGLMainWindow::CreateHelpMenu() {
450 m_pcHelpMenu = menuBar()->addMenu(tr(
"&?"));
451 m_pcHelpMenu->addAction(m_pcAboutQTAction);
459 QSurfaceFormat cFormat = QSurfaceFormat::defaultFormat();
460 cFormat.setSamples(4);
461 cFormat.setDepthBufferSize(24);
463 QWidget* pcPlaceHolder =
new QWidget(
this);
464 m_pcOpenGLWidget =
new CQTOpenGLWidget(pcPlaceHolder, *
this, *m_pcUserFunctions);
465 m_pcOpenGLWidget->setFormat(cFormat);
466 m_pcOpenGLWidget->setCursor(QCursor(Qt::OpenHandCursor));
474 CQTOpenGLLayout* pcQTOpenGLLayout =
new CQTOpenGLLayout();
475 pcQTOpenGLLayout->addWidget(m_pcOpenGLWidget);
476 pcPlaceHolder->setLayout(pcQTOpenGLLayout);
477 setCentralWidget(pcPlaceHolder);
483 m_pcUserFunctions->
Init(tNode);
490 void CQTOpenGLMainWindow::CreateLogMessageDock() {
494 m_pcLogDock =
new QDockWidget(tr(
"Log"),
this);
495 m_pcLogDock->setObjectName(
"LogDockWindow");
496 m_pcLogDock->setFeatures(QDockWidget::DockWidgetMovable |
497 QDockWidget::DockWidgetFloatable);
498 m_pcLogDock->setAllowedAreas(Qt::LeftDockWidgetArea |
499 Qt::RightDockWidgetArea |
500 Qt::BottomDockWidgetArea);
502 m_pcDockLogBuffer =
new QTextEdit();
503 m_pcDockLogBuffer->setReadOnly(
true);
506 m_pcDockLogBuffer->append(
"<b>[t=0]</b> Log started.");
508 m_pcLogStream =
new CQTOpenGLLogStream(
LOG.
GetStream(), m_pcDockLogBuffer);
510 m_pcLogDock->setWidget(m_pcDockLogBuffer);
511 addDockWidget(Qt::RightDockWidgetArea, m_pcLogDock);
513 m_pcLogErrDock =
new QDockWidget(tr(
"LogErr"),
this);
514 m_pcLogErrDock->setObjectName(
"LogErrDockWindow");
515 m_pcLogErrDock->setFeatures(QDockWidget::DockWidgetMovable |
516 QDockWidget::DockWidgetFloatable);
517 m_pcLogErrDock->setAllowedAreas(Qt::LeftDockWidgetArea |
518 Qt::RightDockWidgetArea |
519 Qt::BottomDockWidgetArea);
521 m_pcDockLogErrBuffer =
new QTextEdit();
522 m_pcDockLogErrBuffer->setReadOnly(
true);
525 m_pcDockLogErrBuffer->append(
"<b>[t=0]</b> LogErr started.");
527 m_pcLogErrStream =
new CQTOpenGLLogStream(
LOGERR.
GetStream(), m_pcDockLogErrBuffer);
528 m_pcLogErrDock->setWidget(m_pcDockLogErrBuffer);
530 addDockWidget(Qt::RightDockWidgetArea, m_pcLogErrDock);
537 void CQTOpenGLMainWindow::CreateConnections() {
539 connect(m_pcPlayAction, SIGNAL(triggered()),
542 connect(m_pcResetAction, SIGNAL(triggered()),
545 connect(m_pcOpenGLWidget, SIGNAL(StepDone(
int)),
546 m_pcCurrentStepLCD, SLOT(display(
int)));
551 connect(m_pcTerminateAction, SIGNAL(triggered()),
555 connect(m_pcPauseAction, SIGNAL(triggered()),
558 connect(m_pcStepAction, SIGNAL(triggered()),
561 connect(m_pcFastForwardAction, SIGNAL(triggered()),
564 connect(m_pcDrawFrameEvery, SIGNAL(valueChanged(
int)),
565 m_pcOpenGLWidget, SLOT(SetDrawFrameEvery(
int)));
574 connect(m_pcCaptureAction, SIGNAL(triggered(
bool)),
575 m_pcOpenGLWidget, SLOT(SetGrabFrame(
bool)));
577 connect(m_pcQuitAction, SIGNAL(triggered()),
580 connect(m_pcAboutQTAction, SIGNAL(triggered()),
581 qApp, SLOT(aboutQt()));
583 connect(m_pcSwitchCameraActionGroup, SIGNAL(triggered(QAction*)),
586 m_pcOpenGLWidget, SLOT(SetCamera(
int)));
588 connect(m_pcFocalLength, SIGNAL(valueChanged(
double)),
589 m_pcOpenGLWidget, SLOT(SetCameraFocalLength(
double)));
591 connect(m_pcShowCameraXMLAction, SIGNAL(triggered()),
604 std::string strLabel, strLibrary;
609 if(strLibrary !=
"") {
616 catch(CARGoSException& ex) {
622 m_pcUserFunctions =
new CQTOpenGLUserFunctions;
630 void CQTOpenGLMainWindow::closeEvent(QCloseEvent* pc_event) {
641 if(m_eExperimentState != EXPERIMENT_INITIALIZED &&
642 m_eExperimentState != EXPERIMENT_PAUSED) {
643 LOGERR <<
"[BUG] CQTOpenGLMainWindow::PlayExperiment() called in wrong state: "
644 << m_eExperimentState
650 m_pcPlayAction->setEnabled(
false);
651 m_pcResetAction->setEnabled(
false);
652 m_pcTerminateAction->setEnabled(
true);
654 m_pcPauseAction->setEnabled(
true);
655 m_pcFastForwardAction->setEnabled(
false);
656 m_pcStepAction->setEnabled(
false);
661 m_eExperimentState = EXPERIMENT_PLAYING;
662 if(m_eExperimentState == EXPERIMENT_INITIALIZED) {
674 if(m_eExperimentState != EXPERIMENT_INITIALIZED &&
675 m_eExperimentState != EXPERIMENT_PAUSED) {
676 LOGERR <<
"[BUG] CQTOpenGLMainWindow::FastForwardExperiment() called in wrong state: "
677 << m_eExperimentState
683 m_pcPlayAction->setEnabled(
false);
684 m_pcPauseAction->setEnabled(
true);
685 m_pcResetAction->setEnabled(
false);
686 m_pcTerminateAction->setEnabled(
true);
687 m_pcFastForwardAction->setEnabled(
false);
688 m_pcStepAction->setEnabled(
false);
692 m_eExperimentState = EXPERIMENT_FAST_FORWARDING;
693 if(m_eExperimentState == EXPERIMENT_INITIALIZED) {
705 if(m_eExperimentState != EXPERIMENT_INITIALIZED &&
706 m_eExperimentState != EXPERIMENT_PAUSED) {
707 LOGERR <<
"[BUG] CQTOpenGLMainWindow::StepExperiment() called in wrong state: "
708 << m_eExperimentState
714 m_pcPlayAction->setEnabled(
true);
715 m_pcResetAction->setEnabled(
false);
716 m_pcTerminateAction->setEnabled(
true);
717 m_pcFastForwardAction->setEnabled(
true);
718 m_pcStepAction->setEnabled(
true);
722 m_eExperimentState = EXPERIMENT_PAUSED;
731 if(m_eExperimentState != EXPERIMENT_PLAYING &&
732 m_eExperimentState != EXPERIMENT_FAST_FORWARDING) {
733 LOGERR <<
"[BUG] CQTOpenGLMainWindow::PauseExperiment() called in wrong state: "
734 << m_eExperimentState
740 m_pcPlayAction->setEnabled(
true);
741 m_pcResetAction->setEnabled(
false);
742 m_pcTerminateAction->setEnabled(
true);
744 m_pcPauseAction->setEnabled(
false);
745 m_pcFastForwardAction->setEnabled(
true);
746 m_pcStepAction->setEnabled(
true);
751 m_eExperimentState = EXPERIMENT_PAUSED;
760 if(m_eExperimentState != EXPERIMENT_PLAYING &&
761 m_eExperimentState != EXPERIMENT_PAUSED &&
762 m_eExperimentState != EXPERIMENT_FAST_FORWARDING &&
763 m_eExperimentState != EXPERIMENT_SUSPENDED) {
764 LOGERR <<
"[BUG] CQTOpenGLMainWindow::TerminateExperiment() called in wrong state: "
765 << m_eExperimentState
773 m_pcPlayAction->setEnabled(
false);
774 m_pcResetAction->setEnabled(
true);
775 m_pcTerminateAction->setEnabled(
false);
776 m_pcCaptureAction->setEnabled(
false);
777 m_pcCaptureAction->setChecked(
false);
779 m_pcPauseAction->setEnabled(
false);
780 m_pcStepAction->setEnabled(
false);
781 m_pcFastForwardAction->setEnabled(
false);
789 m_eExperimentState = EXPERIMENT_DONE;
798 if(m_eExperimentState != EXPERIMENT_SUSPENDED &&
799 m_eExperimentState != EXPERIMENT_DONE) {
800 LOGERR <<
"[BUG] CQTOpenGLMainWindow::ResetExperiment() called in wrong state: "
801 << m_eExperimentState
807 m_pcPlayAction->setEnabled(
true);
808 m_pcResetAction->setEnabled(
false);
809 m_pcTerminateAction->setEnabled(
false);
810 m_pcCaptureAction->setEnabled(
true);
811 m_pcCaptureAction->setChecked(
false);
813 m_pcPauseAction->setEnabled(
false);
814 m_pcStepAction->setEnabled(
true);
815 m_pcFastForwardAction->setEnabled(
true);
818 m_pcCurrentStepLCD->display(0);
819 m_pcDockLogBuffer->setHtml(
"<b>[t=0]</b> Log restarted.");
820 m_pcDockLogErrBuffer->setHtml(
"<b>[t=0]</b> LogErr restarted.");
823 m_pcUserFunctions->
Reset();
825 m_eExperimentState = EXPERIMENT_INITIALIZED;
834 m_pcPlayAction->setEnabled(
false);
835 m_pcResetAction->setEnabled(
true);
836 m_pcTerminateAction->setEnabled(
true);
837 m_pcCaptureAction->setEnabled(
false);
838 m_pcCaptureAction->setChecked(
false);
840 m_pcPauseAction->setEnabled(
false);
841 m_pcStepAction->setEnabled(
false);
842 m_pcFastForwardAction->setEnabled(
false);
847 m_eExperimentState = EXPERIMENT_SUSPENDED;
856 if(m_eExperimentState != EXPERIMENT_SUSPENDED) {
857 LOGERR <<
"[BUG] CQTOpenGLMainWindow::ResumeExperiment() called in wrong state: "
858 << m_eExperimentState
864 m_pcPlayAction->setEnabled(
true);
865 m_pcResetAction->setEnabled(
false);
866 m_pcTerminateAction->setEnabled(
false);
867 m_pcCaptureAction->setEnabled(
true);
869 m_pcStepAction->setEnabled(
true);
870 m_pcFastForwardAction->setEnabled(
true);
873 m_eExperimentState = EXPERIMENT_PAUSED;
882 QTextEdit* pcXMLOutput =
new QTextEdit();
885 QRect cGeom = geometry();
886 cGeom.setBottomRight(geometry().center());
887 cGeom.moveCenter(geometry().center());
888 pcXMLOutput->setGeometry(cGeom);
890 pcXMLOutput->setWindowModality(Qt::ApplicationModal);
892 pcXMLOutput->setReadOnly(
true);
894 pcXMLOutput->setDocumentTitle(
"ARGoS XML camera config");
895 pcXMLOutput->setWindowTitle(
"ARGoS XML camera config");
931 QString strResult(
"<camera>\n");
934 for(
UInt32 i = 0; i < 12; ++i) {
941 QString(
" <placement idx=\"%1\" position=\"%2,%3,%4\" look_at=\"%5,%6,%7\" up=\"%8,%9,%10\" lens_focal_length=\"%11\" />\n")
954 strResult.append(
"</camera>\n");