diff --git a/acceleration.cpp b/acceleration.cpp index 48e653f..0e59b8f 100644 --- a/acceleration.cpp +++ b/acceleration.cpp @@ -28,12 +28,120 @@ Acceleration::Acceleration(int slot_no_, int channel_, bool active, QWidget *par Init(); connect(ui->checkBox_1x_ampl, &QCheckBox::toggled, this, &Acceleration::on_1x_ampl_toggled); connect(ui->checkBox_2x_ampl, &QCheckBox::toggled, this, &Acceleration::on_2x_ampl_toggled); + connect(ui->checkBox_rms, &QCheckBox::toggled, this, &Acceleration::on_rms_toggled); + connect(ui->checkBox_integrate, &QCheckBox::toggled, this, &Acceleration::on_integrate_toggled); } Acceleration::~Acceleration() { delete ui; } +void Acceleration::on_rms_toggled(bool checked) { + // TODO: 自定义的回调 + if (checked) { + if (ui->checkBox_integrate->isChecked()) { + QStringList items = {"0-25 mm/s rms", "0-50 mm/s rms", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } else { + QStringList items = {"0-20 m/s^2 rms", "0-50 m/s^2 rms", "0-100 m/s^2 rms", "0-200 m/s^2 rms", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } + return; + } + if (ui->checkBox_integrate->isChecked()) { + QStringList items = {"0-25 mm/s pk", "0-50 mm/s pk", "0-100 mm/s pk", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } else { + QStringList items = {"0-20 m/s^2 pk", "0-50 m/s^2 pk", "0-100 m/s^2 pk", "0-200 m/s^2 pk", "0-250 m/s^2 pk", "0-400 m/s^2 pk", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } +} + +void Acceleration::on_integrate_toggled(bool checked) { + // TODO: 自定义的回调 + if (checked) { + if (ui->checkBox_rms->isChecked()) { + QStringList items = {"0-25 mm/s rms", "0-50 mm/s rms", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } else { + QStringList items = {"0-25 mm/s pk", "0-50 mm/s pk", "0-100 mm/s pk", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } + return; + } + if (ui->checkBox_rms->isChecked()) { + QStringList items = {"0-20 m/s^2 rms", "0-50 m/s^2 rms", "0-100 m/s^2 rms", "0-200 m/s^2 rms", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } else { + QStringList items = {"0-20 m/s^2 pk", "0-50 m/s^2 pk", "0-100 m/s^2 pk", "0-200 m/s^2 pk", "0-250 m/s^2 pk", "0-400 m/s^2 pk", "自定义"}; + ui->comboBox_direct_value_range->clear(); + ui->comboBox_direct_value_range->addItems(items); + ui->comboBox_direct_value_range->setCurrentIndex(0); + ui->comboBox_1x_value_range->clear(); + ui->comboBox_1x_value_range->addItems(items); + ui->comboBox_1x_value_range->setCurrentIndex(0); + ui->comboBox_2x_value_range->clear(); + ui->comboBox_2x_value_range->addItems(items); + ui->comboBox_2x_value_range->setCurrentIndex(0); + } +} + void Acceleration::on_1x_ampl_toggled(bool checked) { if (checked) { ui->comboBox_1x_value_range->setEnabled(true); diff --git a/acceleration.h b/acceleration.h index 18259a1..3b0feea 100644 --- a/acceleration.h +++ b/acceleration.h @@ -25,6 +25,8 @@ class Acceleration : public QWidget { void on_pushButton_cancel_clicked(); void on_1x_ampl_toggled(bool checked); void on_2x_ampl_toggled(bool checked); + void on_rms_toggled(bool checked); + void on_integrate_toggled(bool checked); private: Ui::Acceleration *ui; diff --git a/acceleration.ui b/acceleration.ui index 2012855..8d1afc4 100644 --- a/acceleration.ui +++ b/acceleration.ui @@ -107,7 +107,7 @@ - 1 + 0 @@ -485,6 +485,41 @@ 16777215 + + + 0-20 m/s^2 pk + + + + + 0-50 m/s^2 pk + + + + + 0-100 m/s^2 pk + + + + + 0-200 m/s^2 pk + + + + + 0-250 m/s^2 pk + + + + + 0-400 m/s^2 pk + + + + + 自定义 + + @@ -540,6 +575,41 @@ 22 + + + 0-20 m/s^2 pk + + + + + 0-50 m/s^2 pk + + + + + 0-100 m/s^2 pk + + + + + 0-200 m/s^2 pk + + + + + 0-250 m/s^2 pk + + + + + 0-400 m/s^2 pk + + + + + 自定义 + + @@ -640,6 +710,41 @@ 22 + + + 0-20 m/s^2 pk + + + + + 0-50 m/s^2 pk + + + + + 0-100 m/s^2 pk + + + + + 0-200 m/s^2 pk + + + + + 0-250 m/s^2 pk + + + + + 0-400 m/s^2 pk + + + + + 自定义 + + diff --git a/radial_vibration.ui b/radial_vibration.ui index 032c8cf..20c0ff8 100644 --- a/radial_vibration.ui +++ b/radial_vibration.ui @@ -376,9 +376,37 @@ 22 + + 4 + - 0 - 500 um + 0-100 um + + + + + 0-150 um + + + + + 0-200 um + + + + + 0-400 um + + + + + 0-500 um + + + + + 自定义 @@ -391,6 +419,12 @@ 22 + + 0 + + + 1000.000000000000000 + @@ -401,6 +435,9 @@ 22 + + 1 + @@ -414,9 +451,37 @@ 22 + + 4 + - 0 - 500 um + 0-100 um + + + + + 0-150 um + + + + + 0-200 um + + + + + 0-400 um + + + + + 0-500 um + + + + + 自定义 @@ -432,6 +497,12 @@ 22 + + 0 + + + 1000.000000000000000 + @@ -475,7 +546,7 @@ 0 - 100.000000000000000 + 360.000000000000000 @@ -490,6 +561,9 @@ 22 + + 0 + @@ -507,7 +581,7 @@ 0 - 100.000000000000000 + 360.000000000000000 @@ -522,9 +596,37 @@ 22 + + 4 + - 0 - 500 um + 0-100 um + + + + + 0-150 um + + + + + 0-200 um + + + + + 0-400 um + + + + + 0-500 um + + + + + 自定义 @@ -537,9 +639,42 @@ 22 + + 0 + - 0 - 500 um + -24 Vdc + + + + + 0-100 um + + + + + 0-150 um + + + + + 0-200 um + + + + + 0-400 um + + + + + 0-500 um + + + + + 自定义 @@ -568,9 +703,37 @@ 22 + + 4 + - 0 - 500 um + 0-100 um + + + + + 0-150 um + + + + + 0-200 um + + + + + 0-400 um + + + + + 0-500 um + + + + + 自定义 @@ -586,6 +749,12 @@ 22 + + 0 + + + 1000.000000000000000 + @@ -599,9 +768,37 @@ 22 + + 4 + - 0 - 500 um + 0-100 um + + + + + 0-150 um + + + + + 0-200 um + + + + + 0-400 um + + + + + 0-500 um + + + + + 自定义 @@ -630,6 +827,12 @@ 22 + + 0 + + + 1000.000000000000000 +