From 90fd54c7c549ed6b955e0cd6c242df3327af2418 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Tue, 22 Nov 2022 21:54:31 -0600 Subject: Cleaned up UI. --- mainwindow.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'mainwindow.cpp') diff --git a/mainwindow.cpp b/mainwindow.cpp index 8559778..0c845bb 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -61,6 +61,12 @@ MainWindow::MainWindow(QWidget *parent) ui->labelDesiredPreChargeTime->setStyleSheet("color: rgb(0, 0, 0);"); ui->labelSystemCapacitance->setStyleSheet("color: rgb(0, 0, 0);"); + ui->doubleSpinBoxChosenResistance->setEnabled(true); + +// disconnect(ui->doubleSpinBoxPreChargeTime,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxPreChargePercentageDesired,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxChosenResistance,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxSystemCapacitance,static_cast(&QDoubleSpinBox::valueChanged),0,0); }); connect(ui->doubleSpinBoxSystemCapacitance,static_cast(&QDoubleSpinBox::valueChanged), [=]() { @@ -97,6 +103,12 @@ MainWindow::MainWindow(QWidget *parent) ui->labelDesiredPreChargeTime->setStyleSheet("color: rgb(0, 0, 0);"); ui->labelSystemCapacitance->setStyleSheet("color: rgb(0, 0, 0);"); + ui->doubleSpinBoxChosenResistance->setEnabled(true); + +// disconnect(ui->doubleSpinBoxPreChargeTime,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxPreChargePercentageDesired,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxChosenResistance,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxSystemCapacitance,static_cast(&QDoubleSpinBox::valueChanged),0,0); }); connect(ui->doubleSpinBoxPreChargeTime,static_cast(&QDoubleSpinBox::valueChanged), [=]() { @@ -128,6 +140,12 @@ MainWindow::MainWindow(QWidget *parent) ui->labelDesiredPreChargeTime->setStyleSheet("color: rgb(0, 0, 0);"); ui->labelSystemCapacitance->setStyleSheet("color: rgb(0, 0, 0);"); + ui->doubleSpinBoxChosenResistance->setEnabled(true); + +// disconnect(ui->doubleSpinBoxPreChargeTime,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxPreChargePercentageDesired,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxChosenResistance,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxSystemCapacitance,static_cast(&QDoubleSpinBox::valueChanged),0,0); }); connect(ui->doubleSpinBoxChosenResistance,static_cast(&QDoubleSpinBox::valueChanged), [=]() { @@ -159,6 +177,12 @@ MainWindow::MainWindow(QWidget *parent) ui->labelDesiredPreChargeTime->setStyleSheet("color: rgb(0, 0, 0);"); ui->labelSystemCapacitance->setStyleSheet("color: rgb(0, 0, 0);"); + ui->doubleSpinBoxChosenResistance->setEnabled(true); + +// disconnect(ui->doubleSpinBoxPreChargeTime,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxPreChargePercentageDesired,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxChosenResistance,static_cast(&QDoubleSpinBox::valueChanged),0,0); +// disconnect(ui->doubleSpinBoxSystemCapacitance,static_cast(&QDoubleSpinBox::valueChanged),0,0); }); } @@ -227,7 +251,7 @@ void MainWindow::on_lineEditVoltageRange_textChanged(const QString &arg1) m_wire.calculate(); m_precharge.setMaximumVoltage(max); - m_precharge.calculate(); + if(ui->doubleSpinBoxChosenResistance->isEnabled())m_precharge.calculate(); } -- cgit v1.2.3