Commit c0e08c4f authored by Oliver Bock's avatar Oliver Bock
Browse files

Added IYA2009 demo mode

parent 9736c7b4
...@@ -36,6 +36,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) ...@@ -36,6 +36,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
m_statusBarVisible = ui.actionStatus_bar->isChecked(); m_statusBarVisible = ui.actionStatus_bar->isChecked();
m_animControlVisible = true; m_animControlVisible = true;
m_animControlFloating = ui.dockAnimControl->isFloating(); m_animControlFloating = ui.dockAnimControl->isFloating();
m_hiddenDemoModeActivated = false;
// register alternate shortcuts (will be enabled when menu is hidden) // register alternate shortcuts (will be enabled when menu is hidden)
m_runShortcut = new QShortcut(ui.actionRun->shortcut(), this); m_runShortcut = new QShortcut(ui.actionRun->shortcut(), this);
...@@ -53,6 +54,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) ...@@ -53,6 +54,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
m_fullscreenShortcut = new QShortcut(ui.actionFullscreen->shortcut(), this); m_fullscreenShortcut = new QShortcut(ui.actionFullscreen->shortcut(), this);
m_fullscreenShortcut->setEnabled(false); m_fullscreenShortcut->setEnabled(false);
// register "hidden" demo mode shortcut for IYA2009 exhibition
m_hiddenShortcut = new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::ALT + Qt::Key_D, this);
// establish object communications // establish object communications
connect(ui.pushRun, SIGNAL(clicked()), connect(ui.pushRun, SIGNAL(clicked()),
ui.pulsarGlWidget, SLOT(runAnimation())); ui.pulsarGlWidget, SLOT(runAnimation()));
...@@ -95,6 +99,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) ...@@ -95,6 +99,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
connect(ui.pulsarGlWidget, SIGNAL(pulseProfileUpdated(const QVector<double>&)), connect(ui.pulsarGlWidget, SIGNAL(pulseProfileUpdated(const QVector<double>&)),
ui.pulseScopeWidget, SLOT(drawCurve(const QVector<double>&)), Qt::DirectConnection); ui.pulseScopeWidget, SLOT(drawCurve(const QVector<double>&)), Qt::DirectConnection);
connect(m_hiddenShortcut, SIGNAL(activated()),
this, SLOT(toggleHiddenDemoMode()));
} }
PulsatingScience::~PulsatingScience() PulsatingScience::~PulsatingScience()
...@@ -133,6 +140,21 @@ PulsatingScience::~PulsatingScience() ...@@ -133,6 +140,21 @@ PulsatingScience::~PulsatingScience()
m_fullscreenShortcut->disconnect(); m_fullscreenShortcut->disconnect();
delete m_fullscreenShortcut; delete m_fullscreenShortcut;
} }
if(m_hiddenShortcut) {
m_hiddenShortcut->disconnect();
delete m_hiddenShortcut;
}
}
void PulsatingScience::closeEvent(QCloseEvent *event)
{
if(m_hiddenDemoModeActivated) {
event->ignore();
}
else {
event->accept();
}
} }
void PulsatingScience::on_pushRun_clicked() void PulsatingScience::on_pushRun_clicked()
...@@ -402,3 +424,19 @@ void PulsatingScience::updatePulsarSemiMajorAxisValue(double value) ...@@ -402,3 +424,19 @@ void PulsatingScience::updatePulsarSemiMajorAxisValue(double value)
ui.lcdPulsarSemiMajorAxis->display(QString::number(value, 'f', 1)); ui.lcdPulsarSemiMajorAxis->display(QString::number(value, 'f', 1));
} }
} }
void PulsatingScience::toggleHiddenDemoMode()
{
if(m_hiddenDemoModeActivated) {
menuBarToggled();
window()->setWindowState(windowState() & ~Qt::WindowFullScreen);
ui.dockAnimControl->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
m_hiddenDemoModeActivated = false;
}
else {
menuBarToggled();
window()->setWindowState(windowState() | Qt::WindowFullScreen);
ui.dockAnimControl->setFeatures(QDockWidget::NoDockWidgetFeatures);
m_hiddenDemoModeActivated = true;
}
}
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "ui_pulsatingscience.h" #include "ui_pulsatingscience.h"
class PulsatingScience : public QMainWindow class PulsatingScience : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
...@@ -35,6 +36,8 @@ public: ...@@ -35,6 +36,8 @@ public:
PulsatingScience(QWidget *parent = 0); PulsatingScience(QWidget *parent = 0);
~PulsatingScience(); ~PulsatingScience();
void closeEvent(QCloseEvent *event);
public slots: public slots:
void on_pushRun_clicked(); void on_pushRun_clicked();
void on_pushPause_clicked(); void on_pushPause_clicked();
...@@ -64,6 +67,7 @@ public slots: ...@@ -64,6 +67,7 @@ public slots:
void on_actionAbout_activated(); void on_actionAbout_activated();
void updatePulsarSemiMajorAxisValue(double value); void updatePulsarSemiMajorAxisValue(double value);
void toggleHiddenDemoMode();
private: private:
Ui::PulsatingScienceClass ui; Ui::PulsatingScienceClass ui;
...@@ -75,6 +79,7 @@ private: ...@@ -75,6 +79,7 @@ private:
QShortcut *m_rotationAxesShortcut; QShortcut *m_rotationAxesShortcut;
QShortcut *m_menuBarShortcut; QShortcut *m_menuBarShortcut;
QShortcut *m_fullscreenShortcut; QShortcut *m_fullscreenShortcut;
QShortcut *m_hiddenShortcut;
bool m_permanentOrbits; bool m_permanentOrbits;
bool m_rotationAxesVisible; bool m_rotationAxesVisible;
...@@ -82,6 +87,7 @@ private: ...@@ -82,6 +87,7 @@ private:
bool m_statusBarVisible; bool m_statusBarVisible;
bool m_animControlVisible; bool m_animControlVisible;
bool m_animControlFloating; bool m_animControlFloating;
bool m_hiddenDemoModeActivated;
}; };
#endif // PULSATINGSCIENCE_H #endif // PULSATINGSCIENCE_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment