1 #include "ScatterPlotAlarmConfigDialog.h"
8 #include <QColorDialog>
10 #include <QDoubleSpinBox>
11 #include <QGridLayout>
13 #include <QPushButton>
16 #include "ScatterPlotWindow.h"
32 QGridLayout *mainLayout =
new QGridLayout;
67 QLabel *headerLabel =
new QLabel(
"<h3>Configure Alarming</h3>");
68 mainLayout->addWidget(headerLabel, row, 0, 1, 3);
71 QLabel *descriptionLabel =
new QLabel(
"Alarming is highlighting the "
72 "corresponding pixels between the scatter plot and the source cubes. "
73 "Alarming happens as you move the mouse around on the plot or cube.");
74 descriptionLabel->setWordWrap(
true);
75 mainLayout->addWidget(descriptionLabel, row, 0, 1, 3);
78 QLabel *ontoPlotHeaderLabel =
79 new QLabel(
"<h4>Alarming From Cube to Plot</h4>");
80 mainLayout->addWidget(ontoPlotHeaderLabel, row, 0, 1, 3);
83 QLabel *ontoPlotEnabledLabel =
new QLabel(
"Enabled");
87 mainLayout->addWidget(ontoPlotEnabledLabel, row, 1);
91 QLabel *ontoPlotSamplesLabel =
new QLabel(
"Samples");
97 mainLayout->addWidget(ontoPlotSamplesLabel, row, 1);
101 QLabel *ontoPlotLinesLabel =
new QLabel(
"Lines");
107 mainLayout->addWidget(ontoPlotLinesLabel, row, 1);
113 QLabel *ontoViewportHeaderLabel =
114 new QLabel(
"<h4>Alarming From Plot to Cube</h4>");
115 mainLayout->addWidget(ontoViewportHeaderLabel, row, 0, 1, 3);
118 QLabel *ontoViewportEnabledLabel =
new QLabel(
"Enabled");
122 mainLayout->addWidget(ontoViewportEnabledLabel, row, 1);
126 QLabel *ontoViewportUnitsLabel =
new QLabel(
"Range (units)");
134 mainLayout->addWidget(ontoViewportUnitsLabel, row, 1);
138 QLabel *ontoViewportXDnLabel =
new QLabel(
"X Cube DN Box Size");
141 new QDoubleValidator(0.0, DBL_MAX, DBL_MAX_10_EXP + DBL_DIG,
this));
144 mainLayout->addWidget(ontoViewportXDnLabel, row, 1);
148 QLabel *ontoViewportYDnLabel =
new QLabel(
"Y Cube DN Box Size");
151 new QDoubleValidator(0.0, DBL_MAX, DBL_MAX_10_EXP + DBL_DIG,
this));
154 mainLayout->addWidget(ontoViewportYDnLabel, row, 1);
158 QLabel *ontoViewportWidthLabel =
new QLabel(
"Width");
164 mainLayout->addWidget(ontoViewportWidthLabel, row, 1);
168 QLabel *ontoViewportHeightLabel =
new QLabel(
"Height");
174 mainLayout->addWidget(ontoViewportHeightLabel, row, 1);
178 QHBoxLayout *applyButtonsLayout =
new QHBoxLayout;
179 applyButtonsLayout->addStretch();
186 this, SLOT(accept()));
195 QPushButton *cancelButton =
new QPushButton(
"&Cancel");
196 cancelButton->setIcon(QIcon::fromTheme(
"dialog-cancel"));
197 connect(cancelButton, SIGNAL(clicked()),
198 this, SLOT(reject()));
199 applyButtonsLayout->addWidget(cancelButton);
202 applyButtonsWrapper->setLayout(applyButtonsLayout);
203 mainLayout->addWidget(applyButtonsWrapper, row, 0, 1, 3);
206 setLayout(mainLayout);
212 ScatterPlotAlarmConfigDialog::~ScatterPlotAlarmConfigDialog() {
233 m_window->setAlarmViewportScreenBoxSize(
237 m_window->setAlarmViewportDnBoxSize(
249 m_window->alarmViewportScreenBoxSize();
262 setWindowTitle(
"Configure Alarming - " +
m_window->windowTitle());
283 m_window->alarmViewportScreenBoxSize();
296 bool allValid =
true;
326 allValid = allValid && (xValidator->validate(textToTest, unused) ==
327 QValidator::Acceptable);
331 allValid = allValid && (yValidator->validate(textToTest, unused) ==
332 QValidator::Acceptable);