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);