From 027ac632cf6c91b06fffa3c8b8404f89d363d93c Mon Sep 17 00:00:00 2001 From: Georgi Tushev Date: Mon, 31 Dec 2018 15:45:21 +0100 Subject: [PATCH] value changed added --- BrainATUMtome/mainwindow.cpp | 30 ++++++++++++++++-------------- BrainATUMtome/mainwindow.h | 11 +++++------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/BrainATUMtome/mainwindow.cpp b/BrainATUMtome/mainwindow.cpp index fcc7007..33ac565 100644 --- a/BrainATUMtome/mainwindow.cpp +++ b/BrainATUMtome/mainwindow.cpp @@ -47,7 +47,9 @@ void MainWindow::configure_epos() connect(ui->radioButton_epos_tension_off, &QRadioButton::toggled, this, &MainWindow::on_radioButtonsEposTensionToggled); connect(ui->radioButton_epos_tension_on, &QRadioButton::toggled, this, &MainWindow::on_radioButtonsEposTensionToggled); - + ui->spinBox_epos_sync_velocity->setKeyboardTracking(false); + ui->spinBox_epos_lower_velocity->setKeyboardTracking(false); + ui->spinBox_epos_upper_velocity->setKeyboardTracking(false); } @@ -59,6 +61,8 @@ void MainWindow::configure_microtome() connect(this, &MainWindow::uirequest_microtome_cuttingSpeed, m_driverMicrotome, &Microtome::on_uirequest_cuttingSpeed); connect(this, &MainWindow::uirequest_microtome_returnSpeed, m_driverMicrotome, &Microtome::on_uirequest_returnSpeed); connect(this, &MainWindow::uirequest_microtome_feedStep, m_driverMicrotome, &Microtome::on_uirequest_feedStep); + ui->spinBox_microtome_cuttingSpeed->setKeyboardTracking(false); + ui->spinBox_microtome_feedStep->setKeyboardTracking(false); } @@ -159,29 +163,28 @@ void MainWindow::on_radioButtonsEposTensionToggled(bool checked) } -void MainWindow::on_spinBox_epos_sync_velocity_editingFinished() +void MainWindow::on_spinBox_epos_sync_velocity_valueChanged(int value) { - int velocity_value = ui->spinBox_epos_sync_velocity->value(); - ui->spinBox_epos_lower_velocity->setValue(velocity_value); - ui->spinBox_epos_upper_velocity->setValue(velocity_value); + ui->spinBox_epos_lower_velocity->setValue(value); + ui->spinBox_epos_upper_velocity->setValue(value); } -void MainWindow::on_spinBox_epos_lower_velocity_editingFinished() +void MainWindow::on_spinBox_epos_lower_velocity_valueChanged(int value) { if (ui->radioButton_epos_lower_off->isChecked()) return; - drive_epos_motor(EPOS_LOWER_MOTTOR, ui->spinBox_epos_lower_velocity->value()); + drive_epos_motor(EPOS_LOWER_MOTTOR, value); } -void MainWindow::on_spinBox_epos_upper_velocity_editingFinished() +void MainWindow::on_spinBox_epos_upper_velocity_valueChanged(int value) { if (ui->radioButton_epos_upper_off->isChecked()) return; - drive_epos_motor(EPOS_UPPER_MOTTOR, ui->spinBox_epos_upper_velocity->value()); + drive_epos_motor(EPOS_UPPER_MOTTOR, value); } @@ -192,9 +195,9 @@ void MainWindow::drive_epos_motor(int motorid, int velocity) } -void MainWindow::on_spinBox_microtome_cuttingSpeed_editingFinished() +void MainWindow::on_spinBox_microtome_cuttingSpeed_valueChanged(int value) { - emit uirequest_microtome_cuttingSpeed(ui->spinBox_microtome_cuttingSpeed->value()); + emit uirequest_microtome_cuttingSpeed(value); } @@ -205,9 +208,9 @@ void MainWindow::on_comboBox_microtome_returnSpeed_activated(int index) } -void MainWindow::on_spinBox_microtome_feedStep_editingFinished() +void MainWindow::on_spinBox_microtome_feedStep_valueChanged(int value) { - emit uirequest_microtome_feedStep(ui->spinBox_microtome_feedStep->value()); + emit uirequest_microtome_feedStep(value); } @@ -244,4 +247,3 @@ void MainWindow::on_checkBox_syringe_auto_toggled(bool checked) { emit uirequest_syringe_auto(checked); } - diff --git a/BrainATUMtome/mainwindow.h b/BrainATUMtome/mainwindow.h index 60a6506..da8f846 100644 --- a/BrainATUMtome/mainwindow.h +++ b/BrainATUMtome/mainwindow.h @@ -46,20 +46,19 @@ private slots: void on_radioButtonsEposLowerToggled(bool checked); void on_radioButtonsEposUpperToggled(bool checked); void on_radioButtonsEposTensionToggled(bool checked); - void on_spinBox_epos_sync_velocity_editingFinished(); - void on_spinBox_epos_lower_velocity_editingFinished(); - void on_spinBox_epos_upper_velocity_editingFinished(); + void on_spinBox_epos_sync_velocity_valueChanged(int value); + void on_spinBox_epos_lower_velocity_valueChanged(int value); + void on_spinBox_epos_upper_velocity_valueChanged(int value); - void on_spinBox_microtome_cuttingSpeed_editingFinished(); + void on_spinBox_microtome_cuttingSpeed_valueChanged(int value); void on_comboBox_microtome_returnSpeed_activated(int index); - void on_spinBox_microtome_feedStep_editingFinished(); + void on_spinBox_microtome_feedStep_valueChanged(int value); void on_pushButton_microtome_cut_clicked(); void on_pushButton_microtome_stop_clicked(); void on_pushButton_syringe_pump_clicked(); void on_checkBox_syringe_auto_toggled(bool checked); - signals: void uirequest_epos_velocity(int motorid, int velocity); void uirequest_epos_tension(bool state);