diff --git a/BrainATUMtome/mainwindow.cpp b/BrainATUMtome/mainwindow.cpp index 7eed3ba..a73d8fd 100644 --- a/BrainATUMtome/mainwindow.cpp +++ b/BrainATUMtome/mainwindow.cpp @@ -45,7 +45,7 @@ void MainWindow::configure_epos() connect(ui->radioButton_epos_tension_on, &QRadioButton::toggled, this, &MainWindow::on_radioButtonsEposTensionToggled); connect(ui->radioButton_epos_sync_off, &QRadioButton::toggled, this, &MainWindow::on_radioButtonsEposSyncToggled); - connect(ui->radioButton_epos_sync_on, &QRadioButton::toggled, this, &MainWindow::on_radioButtonsEposSyncToggled); + //connect(ui->radioButton_epos_sync_on, &QRadioButton::toggled, this, &MainWindow::on_radioButtonsEposSyncToggled); } @@ -90,21 +90,11 @@ void MainWindow::on_radioButtonsEposLowerToggled(bool checked) } - emit ui->spinBox_epos_lower_velocity->editingFinished(); + //emit ui->spinBox_epos_lower_velocity->editingFinished(); + emit ui->spinBox_epos_lower_velocity->valueChanged(ui->spinBox_epos_lower_velocity->value()); } -void MainWindow::on_spinBox_epos_lower_velocity_editingFinished() -{ - int velocity_value = ui->spinBox_epos_lower_velocity->value() * m_epos_direction_lower; - emit uirequest_epos_velocity(0, velocity_value); - - if (ui->radioButton_epos_sync_on->isChecked()) { - ui->spinBox_epos_upper_velocity->setValue(ui->spinBox_epos_lower_velocity->value()); - emit uirequest_epos_velocity(1, velocity_value); - } -} - void MainWindow::on_radioButtonsEposUpperToggled(bool checked) { @@ -137,10 +127,10 @@ void MainWindow::on_spinBox_epos_upper_velocity_editingFinished() int velocity_value = ui->spinBox_epos_upper_velocity->value() * m_epos_direction_upper; emit uirequest_epos_velocity(1, velocity_value); - if (ui->radioButton_epos_sync_on->isChecked()) { - ui->spinBox_epos_lower_velocity->setValue(ui->spinBox_epos_upper_velocity->value()); - emit uirequest_epos_velocity(0, velocity_value); - } + //if (ui->radioButton_epos_sync_on->isChecked()) { + // ui->spinBox_epos_lower_velocity->setValue(ui->spinBox_epos_upper_velocity->value()); + // emit uirequest_epos_velocity(0, velocity_value); + //} } @@ -175,6 +165,7 @@ void MainWindow::on_radioButtonsEposSyncToggled(bool checked) // enable async mode enable_epos_radioButtons(true); } + /* else if (ui->radioButton_epos_sync_on->isChecked()) { ui->widget_board->on_log(EventLogType::Notify, "EPOS :: sync mode is on"); @@ -191,6 +182,7 @@ void MainWindow::on_radioButtonsEposSyncToggled(bool checked) // enable sync mode enable_epos_radioButtons(false); } + */ } @@ -261,3 +253,17 @@ void MainWindow::on_checkBox_syringe_auto_toggled(bool checked) { emit uirequest_syringe_auto(checked); } + +void MainWindow::on_spinBox_epos_lower_velocity_valueChanged(int arg1) +{ + qDebug() << "SPINBOX LOWER " << arg1; + int velocity_value = ui->spinBox_epos_lower_velocity->value() * m_epos_direction_lower; + emit uirequest_epos_velocity(0, velocity_value); + + /* + if (ui->radioButton_epos_sync_on->isChecked()) { + ui->spinBox_epos_upper_velocity->setValue(ui->spinBox_epos_lower_velocity->value()); + emit uirequest_epos_velocity(1, velocity_value); + } + */ +} diff --git a/BrainATUMtome/mainwindow.h b/BrainATUMtome/mainwindow.h index 40866f8..8e8a07c 100644 --- a/BrainATUMtome/mainwindow.h +++ b/BrainATUMtome/mainwindow.h @@ -44,8 +44,8 @@ private slots: void on_radioButtonsEposUpperToggled(bool checked); void on_radioButtonsEposTensionToggled(bool checked); void on_radioButtonsEposSyncToggled(bool checked); - void on_spinBox_epos_lower_velocity_editingFinished(); void on_spinBox_epos_upper_velocity_editingFinished(); + void on_spinBox_epos_lower_velocity_valueChanged(int arg1); void on_spinBox_microtome_cuttingSpeed_editingFinished(); void on_comboBox_microtome_returnSpeed_activated(int index); @@ -54,9 +54,9 @@ private slots: 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); diff --git a/BrainATUMtome/mainwindow.ui b/BrainATUMtome/mainwindow.ui index 73f603f..f900a97 100644 --- a/BrainATUMtome/mainwindow.ui +++ b/BrainATUMtome/mainwindow.ui @@ -7,34 +7,51 @@ 0 0 1000 - 720 + 753 MainWindow - + - + - + EPOS - - + + MotorLower - + - + + + CW + + + + + + + CCW + + + + + - velocity [rpm] + OFF + + + true @@ -55,42 +72,42 @@ - + - OFF - - - true + [rpm] + + + + + + + MotorUpper + + - + - CCW + CW - + - CW + CCW - - - - - - - MotorUpper - - - + - velocity [rpm] + OFF + + + true @@ -111,7 +128,37 @@ - + + + [rpm] + + + + + + + + + + MotorSync + + + + + + CW + + + + + + + CCW + + + + + OFF @@ -121,23 +168,32 @@ - - - CCW + + + 100 + + + 15000 + + + 1 + + + 1000 - + - CW + [rpm] - + Tension @@ -148,50 +204,43 @@ false - + - + - OFF - - - true + ON - + - ON + OFF + + + true - - + + - Sync + Status - + - OFF + 00:00:00 / 0 - + true - - - - ON - - -