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

Strip down GUI controls

parent 2d0de39a
......@@ -73,33 +73,15 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
m_hiddenShortcut = new QShortcut(QKeySequence(Qt::SHIFT + Qt::ALT + Qt::Key_D), this);
// establish object communications
connect(ui.pushRun, SIGNAL(clicked()),
ui.pulsarGlWidget, SLOT(runAnimation()));
connect(ui.actionRun, SIGNAL(triggered()),
ui.pulsarGlWidget, SLOT(runAnimation()));
connect(ui.actionRun, SIGNAL(triggered()),
this, SLOT(on_pushRun_clicked()));
connect(ui.pushPause, SIGNAL(clicked()),
ui.pulsarGlWidget, SLOT(pauseAnimation()));
connect(ui.actionPause, SIGNAL(triggered()),
ui.pulsarGlWidget, SLOT(pauseAnimation()));
connect(ui.actionPause, SIGNAL(triggered()),
this, SLOT(on_pushPause_clicked()));
connect(ui.pushStop, SIGNAL(clicked()),
ui.pulsarGlWidget, SLOT(stopAnimation()));
connect(ui.actionStop, SIGNAL(triggered()),
ui.pulsarGlWidget, SLOT(stopAnimation()));
connect(ui.actionStop, SIGNAL(triggered()),
this, SLOT(on_pushStop_clicked()));
connect(ui.actionPermanent_orbits, SIGNAL(toggled(bool)),
ui.pulsarGlWidget, SLOT(showOrbits(bool)));
......@@ -220,51 +202,6 @@ void PulsatingScience::closeEvent(QCloseEvent *event)
}
}
void PulsatingScience::on_pushRun_clicked()
{
ui.pushRun->setEnabled(false);
ui.pushPause->setEnabled(true);
ui.pushStop->setEnabled(true);
}
void PulsatingScience::on_pushPause_clicked()
{
ui.pushRun->setEnabled(true);
ui.pushPause->setEnabled(false);
ui.pushStop->setEnabled(true);
}
void PulsatingScience::on_pushStop_clicked()
{
ui.pushRun->setEnabled(true);
ui.pushPause->setEnabled(false);
ui.pushStop->setEnabled(false);
}
void PulsatingScience::on_radioCompanionWD_toggled(bool checked)
{
if(checked) {
ui.pulsarGlWidget->setCompanionMass(0.6);
ui.lcdCompanionMass->display(QString::number(0.6, 'f', 1));
}
}
void PulsatingScience::on_radioCompanionSun_toggled(bool checked)
{
if(checked) {
ui.pulsarGlWidget->setCompanionMass(1.0);
ui.lcdCompanionMass->display(QString::number(1.0, 'f', 1));
}
}
void PulsatingScience::on_radioCompanionNS_toggled(bool checked)
{
if(checked) {
ui.pulsarGlWidget->setCompanionMass(1.4);
ui.lcdCompanionMass->display(QString::number(1.4, 'f', 1));
}
}
void PulsatingScience::on_sliderPulsarMass_valueChanged(int value)
{
ui.pulsarGlWidget->setPulsarMass(value * 0.1);
......@@ -588,9 +525,6 @@ void PulsatingScience::saveOrRestoreInitialAnimationSettings()
{
static bool initialized = false;
static bool radioCompanionWD;
static bool radioCompanionSun;
static bool radioCompanionNS;
static int sliderPulsarMass;
static int sliderPulsarSpinFrequency;
static int sliderPulsarSpinAxisInclination;
......@@ -603,9 +537,6 @@ void PulsatingScience::saveOrRestoreInitialAnimationSettings()
if(initialized) {
// restore intial settings
ui.radioCompanionWD->setChecked(radioCompanionWD);
ui.radioCompanionSun->setChecked(radioCompanionSun);
ui.radioCompanionNS->setChecked(radioCompanionNS);
ui.sliderPulsarMass->setValue(sliderPulsarMass);
ui.sliderPulsarSpinFrequency->setValue(sliderPulsarSpinFrequency);
ui.sliderPulsarSpinAxisInclination->setValue(sliderPulsarSpinAxisInclination);
......@@ -615,9 +546,6 @@ void PulsatingScience::saveOrRestoreInitialAnimationSettings()
}
else {
// save initial settings
radioCompanionWD = ui.radioCompanionWD->isChecked();
radioCompanionSun = ui.radioCompanionSun->isChecked();
radioCompanionNS = ui.radioCompanionNS->isChecked();
sliderPulsarMass = ui.sliderPulsarMass->value();
sliderPulsarSpinFrequency = ui.sliderPulsarSpinFrequency->value();
sliderPulsarSpinAxisInclination = ui.sliderPulsarSpinAxisInclination->value();
......
......@@ -43,13 +43,6 @@ public:
void closeEvent(QCloseEvent *event);
public slots:
void on_pushRun_clicked();
void on_pushPause_clicked();
void on_pushStop_clicked();
void on_radioCompanionWD_toggled(bool checked);
void on_radioCompanionSun_toggled(bool checked);
void on_radioCompanionNS_toggled(bool checked);
void on_sliderPulsarMass_valueChanged(int value);
void on_sliderPulsarSpinFrequency_valueChanged(int value);
void on_sliderPulsarSpinAxisInclination_valueChanged(int value);
......
......@@ -64,23 +64,98 @@
<set>QDockWidget::AllDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string>Animation Control</string>
<string>Parameters</string>
</property>
<attribute name="dockWidgetArea">
<number>8</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="2">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<item row="3" column="1">
<widget class="QSlider" name="sliderPulsarMagneticAxisInclination">
<property name="statusTip">
<string>Use this slider to adjust the inclination of the magnetic pole axis with respect to the spin axis</string>
</property>
<property name="maximum">
<number>180</number>
</property>
<property name="value">
<number>60</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_13">
<property name="text">
<string>deg</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>LHO</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSlider" name="sliderPulsarMass">
<property name="statusTip">
<string>Use this slider to adjust the pulsar mass</string>
</property>
<property name="minimum">
<number>14</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="pageStep">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLCDNumber" name="lcdPulsarMass">
<property name="numDigits">
<number>6</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
<property name="value" stdset="0">
<double>1.400000000000000</double>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_9">
<property name="text">
<string>deg</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Pulsar Spin Frequency:</string>
<string>LLO</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QSlider" name="sliderPulsarSpinFrequency">
<property name="statusTip">
<string>Use this slider to adjust the spin frequency</string>
......@@ -114,7 +189,7 @@
</property>
</widget>
</item>
<item row="2" column="2">
<item row="1" column="2">
<widget class="QLCDNumber" name="lcdPulsarSpinFrequency">
<property name="numDigits">
<number>6</number>
......@@ -130,7 +205,7 @@
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Pulsar Orbit Semi Major Axis:</string>
<string>Source: inclination</string>
</property>
</widget>
</item>
......@@ -173,163 +248,28 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Pulsar Spin Axis Inclination:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Pulsar Magn. Axis Inclination:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSlider" name="sliderPulsarSpinAxisInclination">
<property name="statusTip">
<string>Use this slider to adjust the inclination of the spin axis with respect to the orbit axis</string>
</property>
<property name="maximum">
<number>180</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLCDNumber" name="lcdPulsarSpinAxisInclination">
<property name="numDigits">
<number>6</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
<property name="intValue" stdset="0">
<number>0</number>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSlider" name="sliderPulsarMagneticAxisInclination">
<property name="statusTip">
<string>Use this slider to adjust the inclination of the magnetic pole axis with respect to the spin axis</string>
</property>
<property name="maximum">
<number>180</number>
</property>
<property name="value">
<number>60</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLCDNumber" name="lcdPulsarMagneticAxisInclination">
<property name="numDigits">
<number>6</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
<property name="value" stdset="0">
<double>60.000000000000000</double>
</property>
<property name="intValue" stdset="0">
<number>60</number>
<string>Virgo</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_6">
<property name="text">
<string>deg</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_7">
<property name="text">
<string>deg</string>
</property>
</widget>
</item>
<item row="2" column="3">
<item row="1" column="3">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Hz</string>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_9">
<property name="text">
<string>AU</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Companion Class:</string>
<string>deg</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="radioCompanionWD">
<property name="statusTip">
<string>Set companion class to &quot;White Dwarf&quot; (0.6 solar masses)</string>
</property>
<property name="text">
<string>White Dwarf</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioCompanionSun">
<property name="statusTip">
<string>Set companion class to &quot;Sun&quot; (1.0 solar masses)</string>
</property>
<property name="text">
<string>Sun</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioCompanionNS">
<property name="statusTip">
<string>Set companion class to &quot;Neutron Star&quot; (1.4 solar masses)</string>
</property>
<property name="text">
<string>Neutron Star</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<widget class="QLCDNumber" name="lcdCompanionMass">
<item row="3" column="2">
<widget class="QLCDNumber" name="lcdPulsarMagneticAxisInclination">
<property name="numDigits">
<number>6</number>
</property>
......@@ -337,37 +277,30 @@
<enum>QLCDNumber::Flat</enum>
</property>
<property name="value" stdset="0">
<double>1.400000000000000</double>
<double>60.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_11">
<property name="text">
<string>M&lt;sub&gt;0&lt;/sub&gt;</string>
<property name="intValue" stdset="0">
<number>60</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Pulsar Mass:</string>
<string>Source: iota</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="sliderPulsarMass">
<item row="4" column="1">
<widget class="QSlider" name="sliderPulsarSpinAxisInclination">
<property name="statusTip">
<string>Use this slider to adjust the pulsar mass</string>
</property>
<property name="minimum">
<number>14</number>
<string>Use this slider to adjust the inclination of the spin axis with respect to the orbit axis</string>
</property>
<property name="maximum">
<number>30</number>
<number>180</number>
</property>
<property name="pageStep">
<number>2</number>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -377,128 +310,28 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLCDNumber" name="lcdPulsarMass">
<item row="4" column="2">
<widget class="QLCDNumber" name="lcdPulsarSpinAxisInclination">
<property name="numDigits">
<number>6</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
<property name="value" stdset="0">
<double>1.400000000000000</double>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_13">
<property name="text">
<string>M&lt;sub&gt;0&lt;/sub&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="pushRun">
<property name="statusTip">
<string>Start the animation</string>
</property>
<property name="text">
<string>Start</string>
</property>
<property name="icon">
<iconset resource="pulsatingscience.qrc">
<normaloff>:/icons/resources/control-run.png</normaloff>:/icons/resources/control-run.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushPause">
<property name="enabled">
<bool>false</bool>
</property>
<property name="statusTip">
<string>Pause the animation</string>
</property>
<property name="text">
<string>Pause</string>
</property>
<property name="icon">
<iconset resource="pulsatingscience.qrc">
<normaloff>:/icons/resources/control-pause.png</normaloff>:/icons/resources/control-pause.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushStop">
<property name="enabled">
<bool>false</bool>
</property>
<property name="statusTip">
<string>Stop and reset the animation</string>
</property>
<property name="text">
<string>Stop</string>
</property>
<property name="icon">
<iconset resource="pulsatingscience.qrc">
<normaloff>:/icons/resources/control-stop.png</normaloff>:/icons/resources/control-stop.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushHelp">
<property name="statusTip">
<string>Display online help</string>
</property>
<property name="text">
<string>Help</string>
</property>
<property name="icon">
<iconset resource="pulsatingscience.qrc">
<normaloff>:/icons/resources/help-help.png</normaloff>:/icons/resources/help-help.png</iconset>
<property name="intValue" stdset="0">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushAbout">
<property name="statusTip">
<string>About &quot;Pulsating Science&quot;</string>
</property>
<item row="4" column="3">
<widget class="QLabel" name="label_6">
<property name="text">
<string>About</string>
</property>
<property name="icon">
<iconset resource="pulsatingscience.qrc">
<normaloff>:/icons/resources/help-about.png</normaloff>:/icons/resources/help-about.png</iconset>
<string>deg</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
......@@ -785,37 +618,5 @@
</hint>
</hints>
</connection>
<connection>
<sender>pushAbout</sender>
<signal>clicked()</signal>
<receiver>actionAbout</receiver>
<slot>trigger()</slot>
<hints>
<hint type="sourcelabel">
<x>47</x>
<y>551</y>
</hint>
<hint type="destinationlabel">
<x>-1</x>
<y>-1</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushHelp</sender>
<signal>clicked()</signal>