2017-10-21 06:11:49 +01:00
|
|
|
#include "scoperangeenterdialog.h"
|
|
|
|
#include "ui_scoperangeenterdialog.h"
|
|
|
|
|
2018-09-04 11:24:08 +01:00
|
|
|
scopeRangeEnterDialog::scopeRangeEnterDialog(QWidget *parent, bool buttonVisible, double yTop, double yBot, double window, double delay) :
|
2017-10-21 06:11:49 +01:00
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::scopeRangeEnterDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
ui->vMaxBox->setMinimum(yBot);
|
|
|
|
ui->vMinBox->setMaximum(yTop);
|
|
|
|
|
|
|
|
ui->vMaxBox->setValue(yTop);
|
|
|
|
ui->vMinBox->setValue(yBot);
|
|
|
|
ui->timeWindowBox->setValue(window);
|
2018-09-04 11:24:08 +01:00
|
|
|
ui->buttonBox->setVisible(buttonVisible);
|
2018-09-17 10:12:07 +01:00
|
|
|
|
|
|
|
for (espoSpinBox* spinBox : {ui->vMaxBox, ui->vMinBox, ui->timeWindowBox, ui->delayBox})
|
|
|
|
{
|
|
|
|
spinBox->changeStepping(spinBox->value());
|
|
|
|
connect(spinBox, SIGNAL(valueChanged(double)), spinBox, SLOT(changeStepping(double)));
|
|
|
|
}
|
2017-10-21 06:11:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
scopeRangeEnterDialog::~scopeRangeEnterDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void scopeRangeEnterDialog::toUpdateYTop(double val){
|
|
|
|
qDebug() << val;
|
2018-09-04 11:24:08 +01:00
|
|
|
|
|
|
|
if (yTop != val)
|
|
|
|
{
|
|
|
|
yTop = val;
|
|
|
|
yTopUpdated(val);
|
|
|
|
}
|
2017-10-21 06:11:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void scopeRangeEnterDialog::toUpdateYBot(double val){
|
|
|
|
qDebug() << val;
|
2018-09-04 11:24:08 +01:00
|
|
|
|
|
|
|
if (yBot != val)
|
|
|
|
{
|
|
|
|
yBot = val;
|
|
|
|
yBotUpdated(val);
|
|
|
|
}
|
2017-10-21 06:11:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void scopeRangeEnterDialog::toUpdateWindow(double val){
|
|
|
|
qDebug() << val;
|
2018-09-04 11:24:08 +01:00
|
|
|
|
|
|
|
if (timeWindow != val)
|
|
|
|
{
|
|
|
|
ui->delayBox->setMax(((double)MAX_WINDOW_SIZE) - ui->timeWindowBox->value());
|
|
|
|
qDebug() << "delayBox updating to" << ui->delayBox->maximum();
|
|
|
|
timeWindow = val;
|
|
|
|
windowUpdated(val);
|
|
|
|
}
|
2017-10-21 06:11:49 +01:00
|
|
|
}
|
|
|
|
|
2017-11-07 02:54:38 +00:00
|
|
|
void scopeRangeEnterDialog::toUpdateDelay(double val){
|
|
|
|
qDebug() << val;
|
2018-09-04 11:24:08 +01:00
|
|
|
|
|
|
|
if (delay != val)
|
|
|
|
{
|
|
|
|
ui->timeWindowBox->setMax(((double)MAX_WINDOW_SIZE) - ui->delayBox->value());
|
|
|
|
qDebug() << "timeWindowBox updating max to" << ui->timeWindowBox->maximum();
|
|
|
|
delay = val;
|
|
|
|
delayUpdated(val);
|
|
|
|
}
|
2017-11-07 02:54:38 +00:00
|
|
|
}
|
2018-09-04 11:24:08 +01:00
|
|
|
|
|
|
|
void scopeRangeEnterDialog::yTopChanged(double val)
|
|
|
|
{
|
|
|
|
ui->vMaxBox->setValue(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void scopeRangeEnterDialog::yBotChanged(double val)
|
|
|
|
{
|
|
|
|
ui->vMinBox->setValue(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void scopeRangeEnterDialog::windowChanged(double val)
|
|
|
|
{
|
|
|
|
ui->timeWindowBox->setValue(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void scopeRangeEnterDialog::delayChanged(double val)
|
|
|
|
{
|
|
|
|
ui->delayBox->setValue(val);
|
|
|
|
}
|
|
|
|
|