2024-12-18 17:14:41 +08:00
|
|
|
#include "Setpoint.h"
|
|
|
|
#include "ui_Setpoint.h"
|
2025-04-14 20:30:41 +08:00
|
|
|
#include "rangeslider.h"
|
2024-12-17 18:53:41 +08:00
|
|
|
|
2024-12-18 17:14:41 +08:00
|
|
|
Setpoint::Setpoint(QWidget *parent) :
|
2024-12-17 18:53:41 +08:00
|
|
|
QWidget(parent),
|
2024-12-18 17:14:41 +08:00
|
|
|
ui(new Ui::Setpoint)
|
2024-12-17 18:53:41 +08:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2025-04-14 20:30:41 +08:00
|
|
|
|
|
|
|
QVBoxLayout *layout_direct = new QVBoxLayout(ui->widget_direct);
|
|
|
|
RangeSlider *slider_direct = new RangeSlider;
|
|
|
|
layout_direct->addWidget(slider_direct);
|
|
|
|
|
|
|
|
QVBoxLayout *layout_1x_ampl = new QVBoxLayout(ui->widget_1x_ampl);
|
|
|
|
RangeSlider *slider_1x_ampl = new RangeSlider;
|
|
|
|
layout_1x_ampl->addWidget(slider_1x_ampl);
|
|
|
|
|
|
|
|
QVBoxLayout *layout_2x_ampl = new QVBoxLayout(ui->widget_2x_ampl);
|
|
|
|
RangeSlider *slider_2x_ampl = new RangeSlider;
|
|
|
|
layout_2x_ampl->addWidget(slider_2x_ampl);
|
|
|
|
|
|
|
|
QVBoxLayout *layout_danger = new QVBoxLayout(ui->widget_danger);
|
|
|
|
RangeSlider *slider_danger = new RangeSlider;
|
|
|
|
layout_danger->addWidget(slider_danger);
|
|
|
|
|
|
|
|
|
|
|
|
QObject::connect(ui->lineEdit_direct_upper, &QLineEdit::editingFinished, [&]() {
|
|
|
|
slider_direct->setUpperValue(ui->lineEdit_direct_upper->text().toInt());
|
|
|
|
});
|
|
|
|
QObject::connect(slider_direct, &RangeSlider::rangeChanged, [&](int low, int high) {
|
|
|
|
ui->lineEdit_direct_upper->setText(QString::number(high));
|
|
|
|
});
|
|
|
|
|
|
|
|
QObject::connect(slider_1x_ampl, &RangeSlider::rangeChanged, [&](int low, int high) {
|
|
|
|
ui->lineEdit_1x_ampl_upper->setText(QString::number(high));
|
|
|
|
ui->lineEdit_1x_ampl_lower->setText(QString::number(low));
|
|
|
|
});
|
|
|
|
QObject::connect(ui->lineEdit_1x_ampl_upper, &QLineEdit::editingFinished, [&]() {
|
|
|
|
slider_1x_ampl->setUpperValue(ui->lineEdit_1x_ampl_upper->text().toInt());
|
|
|
|
});
|
|
|
|
QObject::connect(ui->lineEdit_1x_ampl_lower, &QLineEdit::editingFinished, [&]() {
|
|
|
|
slider_1x_ampl->setLowerValue(ui->lineEdit_1x_ampl_lower->text().toInt());
|
|
|
|
});
|
|
|
|
|
|
|
|
QObject::connect(slider_2x_ampl, &RangeSlider::rangeChanged, [&](int low, int high) {
|
|
|
|
ui->lineEdit_2x_ampl_upper->setText(QString::number(high));
|
|
|
|
ui->lineEdit_2x_ampl_lower->setText(QString::number(low));
|
|
|
|
});
|
|
|
|
QObject::connect(ui->lineEdit_2x_ampl_upper, &QLineEdit::editingFinished, [&]() {
|
|
|
|
slider_1x_ampl->setUpperValue(ui->lineEdit_2x_ampl_upper->text().toInt());
|
|
|
|
});
|
|
|
|
QObject::connect(ui->lineEdit_2x_ampl_lower, &QLineEdit::editingFinished, [&]() {
|
|
|
|
slider_1x_ampl->setLowerValue(ui->lineEdit_2x_ampl_lower->text().toInt());
|
|
|
|
});
|
|
|
|
|
|
|
|
QObject::connect(slider_danger, &RangeSlider::rangeChanged, [&](int low, int high) {
|
|
|
|
ui->lineEdit_danger_upper->setText(QString::number(high));
|
|
|
|
});
|
|
|
|
QObject::connect(ui->lineEdit_danger_upper, &QLineEdit::editingFinished, [&]() {
|
|
|
|
slider_danger->setUpperValue(ui->lineEdit_danger_upper->text().toInt());
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2024-12-17 18:53:41 +08:00
|
|
|
}
|
|
|
|
|
2024-12-18 17:14:41 +08:00
|
|
|
Setpoint::~Setpoint()
|
2024-12-17 18:53:41 +08:00
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|