aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-13 22:25:48 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-13 22:25:48 +0100
commit460d00b0caf65a4483d3e029495cc9340bb3e785 (patch)
tree5d168baf2602bc1e303eae741a5daf3fcce4d556
parent3442b5fdeb4f8dfef38977078c5c6e801dcc2b51 (diff)
downloadqtmips-460d00b0caf65a4483d3e029495cc9340bb3e785.tar.gz
qtmips-460d00b0caf65a4483d3e029495cc9340bb3e785.tar.bz2
qtmips-460d00b0caf65a4483d3e029495cc9340bb3e785.zip
Use trick to force knobs to resend signals when machine is newly connected.
The value is forced to change one step down and then up. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
-rw-r--r--qtmips_gui/peripheralsview.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/qtmips_gui/peripheralsview.cpp b/qtmips_gui/peripheralsview.cpp
index 5a8ec70..231de90 100644
--- a/qtmips_gui/peripheralsview.cpp
+++ b/qtmips_gui/peripheralsview.cpp
@@ -21,7 +21,21 @@ PeripheralsView::~PeripheralsView()
}
void PeripheralsView::setup(const machine::PeripSpiLed *perip_spi_led) {
+ int val;
+
connect(ui->spinRed, SIGNAL(valueChanged(int)), perip_spi_led, SLOT(red_knob_update(int)));
connect(ui->spinGreen, SIGNAL(valueChanged(int)), perip_spi_led, SLOT(green_knob_update(int)));
connect(ui->spinBlue, SIGNAL(valueChanged(int)), perip_spi_led, SLOT(blue_knob_update(int)));
+
+ val = ui->spinRed->value();
+ ui->spinRed->setValue(val - 1);
+ ui->spinRed->setValue(val);
+
+ val = ui->spinGreen->value();
+ ui->spinGreen->setValue(val - 1);
+ ui->spinGreen->setValue(val);
+
+ val = ui->spinBlue->value();
+ ui->spinBlue->setValue(val - 1);
+ ui->spinBlue->setValue(val);
}