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

Display semi major axis value in red if out of slider range (capped)

parent d14613a8
...@@ -52,7 +52,6 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) ...@@ -52,7 +52,6 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
on_sliderPulsarSpinFrequency_valueChanged(ui.sliderPulsarSpinFrequency->value()); on_sliderPulsarSpinFrequency_valueChanged(ui.sliderPulsarSpinFrequency->value());
on_sliderPulsarSpinAxisInclination_valueChanged(ui.sliderPulsarSpinAxisInclination->value()); on_sliderPulsarSpinAxisInclination_valueChanged(ui.sliderPulsarSpinAxisInclination->value());
on_sliderPulsarMagneticAxisInclination_valueChanged(ui.sliderPulsarMagneticAxisInclination->value()); on_sliderPulsarMagneticAxisInclination_valueChanged(ui.sliderPulsarMagneticAxisInclination->value());
} }
PulsatingScience::~PulsatingScience() PulsatingScience::~PulsatingScience()
...@@ -140,6 +139,7 @@ void PulsatingScience::on_sliderPulsarSemiMajorAxis_valueChanged(int value) ...@@ -140,6 +139,7 @@ void PulsatingScience::on_sliderPulsarSemiMajorAxis_valueChanged(int value)
{ {
ui.pulsarGlWidget->setPulsarSemiMajorAxis(value * 0.001f); ui.pulsarGlWidget->setPulsarSemiMajorAxis(value * 0.001f);
ui.lcdPulsarSemiMajorAxis->display(QString::number(value * 0.001f, 'f', 1)); ui.lcdPulsarSemiMajorAxis->display(QString::number(value * 0.001f, 'f', 1));
ui.lcdPulsarSemiMajorAxis->setStyleSheet("color: black");
} }
void PulsatingScience::on_actionMenu_bar_toggled(bool checked) void PulsatingScience::on_actionMenu_bar_toggled(bool checked)
...@@ -165,4 +165,9 @@ void PulsatingScience::on_actionAbout_activated() ...@@ -165,4 +165,9 @@ void PulsatingScience::on_actionAbout_activated()
void PulsatingScience::updatePulsarSemiMajorAxisValue(double value) void PulsatingScience::updatePulsarSemiMajorAxisValue(double value)
{ {
ui.sliderPulsarSemiMajorAxis->setValue(value * 1000.0); ui.sliderPulsarSemiMajorAxis->setValue(value * 1000.0);
if(value < 1.0 || value > 20.0) {
ui.lcdPulsarSemiMajorAxis->setStyleSheet("color: red");
ui.lcdPulsarSemiMajorAxis->display(QString::number(value, 'f', 1));
}
} }
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