1 #include "ScatterPlotAlarmConfigDialog.h" 8 #include <QColorDialog> 10 #include <QDoubleSpinBox> 11 #include <QGridLayout> 14 #include <QPushButton> 17 #include "ScatterPlotWindow.h" 33 QGridLayout *mainLayout =
new QGridLayout;
68 QLabel *headerLabel =
new QLabel(
"<h3>Configure Alarming</h3>");
69 mainLayout->addWidget(headerLabel, row, 0, 1, 3);
72 QLabel *descriptionLabel =
new QLabel(
"Alarming is highlighting the " 73 "corresponding pixels between the scatter plot and the source cubes. " 74 "Alarming happens as you move the mouse around on the plot or cube.");
75 descriptionLabel->setWordWrap(
true);
76 mainLayout->addWidget(descriptionLabel, row, 0, 1, 3);
79 QLabel *ontoPlotHeaderLabel =
80 new QLabel(
"<h4>Alarming From Cube to Plot</h4>");
81 mainLayout->addWidget(ontoPlotHeaderLabel, row, 0, 1, 3);
84 QLabel *ontoPlotEnabledLabel =
new QLabel(
"Enabled");
88 mainLayout->addWidget(ontoPlotEnabledLabel, row, 1);
92 QLabel *ontoPlotSamplesLabel =
new QLabel(
"Samples");
98 mainLayout->addWidget(ontoPlotSamplesLabel, row, 1);
102 QLabel *ontoPlotLinesLabel =
new QLabel(
"Lines");
108 mainLayout->addWidget(ontoPlotLinesLabel, row, 1);
114 QLabel *ontoViewportHeaderLabel =
115 new QLabel(
"<h4>Alarming From Plot to Cube</h4>");
116 mainLayout->addWidget(ontoViewportHeaderLabel, row, 0, 1, 3);
119 QLabel *ontoViewportEnabledLabel =
new QLabel(
"Enabled");
123 mainLayout->addWidget(ontoViewportEnabledLabel, row, 1);
127 QLabel *ontoViewportUnitsLabel =
new QLabel(
"Range (units)");
135 mainLayout->addWidget(ontoViewportUnitsLabel, row, 1);
139 QLabel *ontoViewportXDnLabel =
new QLabel(
"X Cube DN Box Size");
142 new QDoubleValidator(0.0, DBL_MAX, DBL_MAX_10_EXP + DBL_DIG,
this));
145 mainLayout->addWidget(ontoViewportXDnLabel, row, 1);
149 QLabel *ontoViewportYDnLabel =
new QLabel(
"Y Cube DN Box Size");
152 new QDoubleValidator(0.0, DBL_MAX, DBL_MAX_10_EXP + DBL_DIG,
this));
155 mainLayout->addWidget(ontoViewportYDnLabel, row, 1);
159 QLabel *ontoViewportWidthLabel =
new QLabel(
"Width");
165 mainLayout->addWidget(ontoViewportWidthLabel, row, 1);
169 QLabel *ontoViewportHeightLabel =
new QLabel(
"Height");
175 mainLayout->addWidget(ontoViewportHeightLabel, row, 1);
179 QHBoxLayout *applyButtonsLayout =
new QHBoxLayout;
180 applyButtonsLayout->addStretch();
187 this, SLOT(accept()));
196 QPushButton *cancelButton =
new QPushButton(
"&Cancel");
197 cancelButton->setIcon(QIcon::fromTheme(
"dialog-cancel"));
198 connect(cancelButton, SIGNAL(clicked()),
199 this, SLOT(reject()));
200 applyButtonsLayout->addWidget(cancelButton);
203 applyButtonsWrapper->setLayout(applyButtonsLayout);
204 mainLayout->addWidget(applyButtonsWrapper, row, 0, 1, 3);
207 setLayout(mainLayout);
213 ScatterPlotAlarmConfigDialog::~ScatterPlotAlarmConfigDialog() {
234 m_window->setAlarmViewportScreenBoxSize(
238 m_window->setAlarmViewportDnBoxSize(
250 m_window->alarmViewportScreenBoxSize();
263 setWindowTitle(
"Configure Alarming - " +
m_window->windowTitle());
284 m_window->alarmViewportScreenBoxSize();
297 bool allValid =
true;
327 allValid = allValid && (xValidator->validate(textToTest, unused) ==
328 QValidator::Acceptable);
332 allValid = allValid && (yValidator->validate(textToTest, unused) ==
333 QValidator::Acceptable);
QPointer< QCheckBox > m_alarmOntoPlot
This is the user option for enabling alarming viewport->plot.
QPointer< QSpinBox > m_alarmOntoViewportHeight
The Y-Pixel Screen Box Size for alarming plot->viewport.
QPointer< QSpinBox > m_alarmOntoPlotSamples
This is the sample box size for alarming viewport->plot.
QPointer< QPushButton > m_applyButton
Button for accepting the current settings.
int toInt(const QString &string)
Global function to convert from a string to an integer.
QPointer< QLineEdit > m_alarmOntoViewportXDnSize
The X-Pixel Cube DN Box Size for alarming plot->viewport.
Alarming is a DN range around the mouse.
void readSettingsFromScatterPlot()
Update the current widgets' states with the current settings in the scatter plot window.
QPointer< QCheckBox > m_alarmOntoViewport
This is the user option for enabling alarming plot->viewport.
QPointer< ScatterPlotWindow > m_window
The scatter plot window that we're configuring alarming on.
Alarming is a visible area around the mouse.
QString ToQt() const
Retuns the object string as a QString.
AlarmRangeUnits
This enumeration differentiates alarming a strict cube DN box size from a screen region.
void refreshWidgetStates()
Update the enabled/disabled states of the various widgets based on the current user inputs' states...
double ToDouble(const T &value)
Helper function to convert values to doubles.
ScatterPlotAlarmConfigDialog(ScatterPlotWindow *window, QWidget *parent=NULL)
Create an alarming configuration dialog.
QPointer< QPushButton > m_okayButton
Button for accepting the current settings and closing the window.
QPointer< QComboBox > m_alarmOntoViewportUnits
This is whether alarming plot->viewport should be screen pixels or a set box size regardless of zoom ...
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
void applySettingsToScatterPlot()
Take the settings that have been configured and apply them to the scatter plot.
QPointer< QLineEdit > m_alarmOntoViewportYDnSize
The Y-Pixel Cube DN Box Size for alarming plot->viewport.
QPointer< QSpinBox > m_alarmOntoViewportWidth
The X-Pixel Screen Box Size for alarming plot->viewport.
QPointer< QSpinBox > m_alarmOntoPlotLines
This is the line box size for alarming viewport->plot.