diff --git a/TSI_Config.pro b/TSI_Config.pro index bb7c02a..49a74a5 100644 --- a/TSI_Config.pro +++ b/TSI_Config.pro @@ -15,6 +15,7 @@ SOURCES += \ common.cpp \ config_mgr.cpp \ connect.cpp \ + dc_outputs.cpp \ ethconfig.cpp \ keyphase.cpp \ keyphase_data.cpp \ @@ -48,6 +49,7 @@ HEADERS += \ config_mgr.h \ connect.h \ data_config.h \ + dc_outputs.h \ displacement_ds.h \ ethconfig.h \ keyphase.h \ @@ -77,6 +79,7 @@ HEADERS += \ FORMS += \ acceleration.ui \ connect.ui \ + dc_outputs.ui \ ethconfig.ui \ keyphase.ui \ macconfig.ui \ diff --git a/acceleration.cpp b/acceleration.cpp index db4d62b..cc1c94d 100644 --- a/acceleration.cpp +++ b/acceleration.cpp @@ -32,136 +32,6 @@ Acceleration::~Acceleration() { delete ui; } -void Acceleration::on_checkBox_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_checkBox_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_checkBox_1x_ampl_toggled(bool checked) { - if (checked) { - ui->comboBox_1x_value_range->setEnabled(true); - ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true); - ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(true); - return; - } - ui->comboBox_1x_value_range->setEnabled(false); - ui->doubleSpinBox_1x_ampl_clamp->setEnabled(false); - ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false); -} - -void Acceleration::on_checkBox_2x_ampl_toggled(bool checked) { - if (checked) { - ui->comboBox_2x_value_range->setEnabled(true); - ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true); - ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(true); - return; - } - ui->comboBox_2x_value_range->setEnabled(false); - ui->doubleSpinBox_2x_ampl_clamp->setEnabled(false); - ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false); -} - void Acceleration::Init() { std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); if (base_ptr == nullptr) { @@ -188,32 +58,70 @@ void Acceleration::Init() { ui->checkBox_band_pass->setChecked(variable_ptr->filter_[2].checked); ui->spinBox_band_pass_low->setValue(variable_ptr->filter_[2].low); ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); - ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range); - ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value); -// ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage)); -// ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value); -// ui->comboBox_bias_volt_range->setCurrentIndex(); - ui->checkBox_1x_ampl->setChecked(variable_ptr->x1_.checked); - ui->comboBox_1x_value_range->setCurrentIndex(variable_ptr->x1_.full_scale_range); - ui->doubleSpinBox_1x_ampl_clamp->setValue(variable_ptr->x1_.clamp_value); - ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variable_ptr->x1_.phase_lag); - ui->checkBox_2x_ampl->setChecked(variable_ptr->x2_.checked); - ui->comboBox_2x_value_range->setCurrentIndex(variable_ptr->x2_.full_scale_range); - ui->doubleSpinBox_2x_ampl_clamp->setValue(variable_ptr->x2_.clamp_value); - ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variable_ptr->x2_.phase_lag); - ui->spinBox_alert->setValue(variable_ptr->delay_.alert); - ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger); - ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms); - ui->checkBox_rms->setChecked(variable_ptr->rms_active_); - ui->checkBox_integrate->setChecked(variable_ptr->integrate_active_); - ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_); - ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_); - ui->checkBox_timed_ok->setChecked(variable_ptr->timed_ok_); - ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output); - ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp); - ui->doubleSpinBox_trip_multiply->setValue(variable_ptr->recorder_out_.trip_multiply); - ui->comboBox_comparision->setCurrentIndex(variable_ptr->recorder_out_.comparision); - ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage); + + // processed output + // -general + if(variable_ptr->general.output_used) + ui->comboBox_output_used->setCurrentIndex(0); + else + ui->comboBox_output_used->setCurrentIndex(1); + // -alarm + ui->lineEdit_danger_high_level->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_hysteresis->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_delay->setText(QString::number(variable_ptr->danger_high.level)); + ui->checkBox_danger_high_enable->setChecked(variable_ptr->danger_high.enable); + ui->checkBox_danger_high_latch->setChecked(variable_ptr->danger_high.latch); + + ui->lineEdit_alert_high_level->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_hysteresis->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_delay->setText(QString::number(variable_ptr->alert_high.level)); + ui->checkBox_alert_high_enable->setChecked(variable_ptr->alert_high.enable); + ui->checkBox_alert_high_latch->setChecked(variable_ptr->alert_high.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); + // + ui->checkBox_enable->setChecked(variable_ptr->freband_output[0].enable); + ui->lineEdit_start->setText(QString::number(variable_ptr->freband_output[0].start)); + ui->lineEdit_end->setText(QString::number(variable_ptr->freband_output[0].end)); + ui->checkBox_enable_2->setChecked(variable_ptr->freband_output[1].enable); + ui->lineEdit_start_2->setText(QString::number(variable_ptr->freband_output[1].start)); + ui->lineEdit_end_2->setText(QString::number(variable_ptr->freband_output[1].end)); + ui->checkBox_enable_3->setChecked(variable_ptr->freband_output[2].enable); + ui->lineEdit_start_3->setText(QString::number(variable_ptr->freband_output[2].start)); + ui->lineEdit_end_3->setText(QString::number(variable_ptr->freband_output[2].end)); + ui->checkBox_enable_4->setChecked(variable_ptr->freband_output[3].enable); + ui->lineEdit_start_4->setText(QString::number(variable_ptr->freband_output[3].start)); + ui->lineEdit_end_4->setText(QString::number(variable_ptr->freband_output[3].end)); + ui->checkBox_enable_5->setChecked(variable_ptr->freband_output[4].enable); + ui->lineEdit_start_5->setText(QString::number(variable_ptr->freband_output[4].start)); + ui->lineEdit_end_5->setText(QString::number(variable_ptr->freband_output[4].end)); + ui->checkBox_enable_6->setChecked(variable_ptr->freband_output[5].enable); + ui->lineEdit_start_6->setText(QString::number(variable_ptr->freband_output[5].start)); + ui->lineEdit_end_6->setText(QString::number(variable_ptr->freband_output[5].end)); + ui->checkBox_enable_7->setChecked(variable_ptr->freband_output[6].enable); + ui->lineEdit_start_7->setText(QString::number(variable_ptr->freband_output[6].start)); + ui->lineEdit_end_7->setText(QString::number(variable_ptr->freband_output[6].end)); + ui->checkBox_enable_8->setChecked(variable_ptr->freband_output[7].enable); + ui->lineEdit_start_8->setText(QString::number(variable_ptr->freband_output[7].start)); + ui->lineEdit_end_8->setText(QString::number(variable_ptr->freband_output[7].end)); + ui->checkBox_enable_9->setChecked(variable_ptr->freband_output[8].enable); + ui->lineEdit_start_9->setText(QString::number(variable_ptr->freband_output[8].start)); + ui->lineEdit_end_9->setText(QString::number(variable_ptr->freband_output[8].end)); + ui->checkBox_enable_10->setChecked(variable_ptr->freband_output[9].enable); + ui->lineEdit_start_10->setText(QString::number(variable_ptr->freband_output[9].start)); + ui->lineEdit_end_10->setText(QString::number(variable_ptr->freband_output[9].end)); + + } void Acceleration::on_pushButton_confirm_clicked() { @@ -243,32 +151,8 @@ void Acceleration::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->x1_.checked = ui->checkBox_1x_ampl->isChecked(); - variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex(); - variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value(); - variable->x1_.custom = 0; // TODO: - variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value(); - variable->x2_.checked = ui->checkBox_2x_ampl->isChecked(); - variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex(); - variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value(); - variable->x2_.custom = 0; // TODO: - variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value(); - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value(); - variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex(); - variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->rms_active_ = ui->checkBox_rms->isChecked(); - variable->integrate_active_ = ui->checkBox_integrate->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); - variable->timed_ok_ = ui->checkBox_timed_ok->isChecked(); + + ptr->variables_.push_back(variable); this->close(); return; @@ -283,32 +167,7 @@ void Acceleration::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->x1_.checked = ui->checkBox_1x_ampl->isChecked(); - variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex(); - variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value(); - variable->x1_.custom = 0; // TODO: - variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value(); - variable->x2_.checked = ui->checkBox_2x_ampl->isChecked(); - variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex(); - variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value(); - variable->x2_.custom = 0; // TODO: - variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value(); - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value(); - variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex(); - variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->rms_active_ = ui->checkBox_rms->isChecked(); - variable->integrate_active_ = ui->checkBox_integrate->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); - variable->timed_ok_ = ui->checkBox_timed_ok->isChecked(); + this->close(); } diff --git a/acceleration.h b/acceleration.h index 21ce04c..b28459e 100644 --- a/acceleration.h +++ b/acceleration.h @@ -23,10 +23,6 @@ class Acceleration : public QWidget { void on_pushButton_set_default_clicked(); void on_pushButton_cancel_clicked(); - void on_checkBox_1x_ampl_toggled(bool checked); - void on_checkBox_2x_ampl_toggled(bool checked); - void on_checkBox_rms_toggled(bool checked); - void on_checkBox_integrate_toggled(bool checked); private: Ui::Acceleration *ui; diff --git a/acceleration.ui b/acceleration.ui index e0dbe0e..3397641 100644 --- a/acceleration.ui +++ b/acceleration.ui @@ -11,7 +11,7 @@ - 加速度配置 + 处理后输出 @@ -107,11 +107,11 @@ - 1 + 2 - 滤波配置 + 滤波 @@ -378,714 +378,8 @@ - 特征值和警报配置 + 处理后输出 - - - - 20 - 10 - 431 - 351 - - - - 特征值 - - - - - 20 - 50 - 54 - 12 - - - - 直接值 - - - - - - 10 - 80 - 81 - 16 - - - - 偏置电压 - - - - - - 20 - 110 - 81 - 16 - - - - 1倍频幅值 - - - - - - 20 - 180 - 81 - 16 - - - - 2倍频幅值 - - - - - - 141 - 31 - 48 - 16 - - - - 取值范围 - - - - - - 269 - 31 - 48 - 16 - - - - 默认值 - - - - - - 130 - 50 - 111 - 22 - - - - - 16777215 - 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 - - - - - 自定义 - - - - - - - 260 - 50 - 62 - 22 - - - - - 80 - 16777215 - - - - - - - 130 - 80 - 54 - 12 - - - - -24 - - - - - - 260 - 80 - 62 - 22 - - - - 1 - - - - - false - - - - 130 - 110 - 111 - 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 - - - - - 自定义 - - - - - - false - - - - 260 - 110 - 62 - 22 - - - - - - - 20 - 150 - 91 - 16 - - - - 1倍频相位 - - - - - - 20 - 210 - 91 - 16 - - - - 2倍频相位 - - - - - false - - - - 260 - 150 - 62 - 22 - - - - 0 - - - 100.000000000000000 - - - - - false - - - - 260 - 180 - 62 - 22 - - - - - - false - - - - 260 - 210 - 62 - 22 - - - - 0 - - - - - false - - - - 130 - 180 - 111 - 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 - - - - - 自定义 - - - - - - - 20 - 250 - 71 - 16 - - - - 有效值 - - - - - - 130 - 250 - 61 - 16 - - - - 积分 - - - - - - 200 - 240 - 221 - 101 - - - - 延时 - - - - - 20 - 20 - 54 - 12 - - - - 告警 - - - - - - 20 - 50 - 54 - 12 - - - - 危险 - - - - - - 60 - 50 - 61 - 21 - - - - 1 - - - 1.000000000000000 - - - - - - 60 - 80 - 71 - 16 - - - - 100 ms - - - - - - 130 - 20 - 54 - 12 - - - - 1 - 60s - - - - - - 130 - 50 - 71 - 16 - - - - 1.0 - 60.0s - - - - - - 60 - 20 - 61 - 21 - - - - 1 - - - - - - - 190 - 80 - 53 - 15 - - - - Vdc - - - - - - - 460 - 20 - 131 - 16 - - - - 告警锁定 - - - - - - 460 - 40 - 131 - 16 - - - - 危险锁定 - - - - - - 460 - 170 - 121 - 16 - - - - 倍增 - - - - - - 460 - 190 - 62 - 16 - - - - 1.000000000000000 - - - - - - 460 - 210 - 141 - 16 - - - - 1.00 - 3.00 (步进0.25) - - - - - - 460 - 90 - 54 - 12 - - - - 记录输出 - - - - - - 460 - 110 - 141 - 22 - - - - - - - - - - 直接幅值 - - - - - 1倍频幅值 - - - - - 2倍频幅值 - - - - - - - 460 - 140 - 91 - 16 - - - - 2 mA 默认值 - - - - - - 460 - 60 - 181 - 16 - - - - Timed OK channel Defeat - - - - - - 460 - 250 - 121 - 16 - - - - 比较 - - - - - false - - - - 460 - 310 - 61 - 22 - - - - - - false - - - - 460 - 270 - 141 - 22 - - - - - - - - - - 直接幅值 - - - - - 1倍频幅值 - - - - - 2倍频幅值 - - - @@ -1099,6 +393,859 @@ % + + + + 10 + 40 + 621 + 321 + + + + 1 + + + + 常规 + + + + + 170 + 150 + 54 + 12 + + + + 整流器 + + + + + + 10 + 140 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + RMS + + + + + + + 170 + 50 + 54 + 12 + + + + 输出使用 + + + + + + 10 + 90 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + um + + + + + + + 170 + 100 + 54 + 12 + + + + 工程单位 + + + + + + 10 + 40 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + + + + + + + + + + + + + 警报 + + + + + 10 + 60 + 71 + 16 + + + + 危险 + 高 + + + + + + 10 + 100 + 71 + 16 + + + + 警报 + 高 + + + + + + 10 + 140 + 71 + 16 + + + + 警报 + 低 + + + + + + 10 + 180 + 71 + 16 + + + + 危险 + 低 + + + + + + 90 + 30 + 31 + 31 + + + + 等级 + (um) + + + + + + 170 + 30 + 31 + 31 + + + + 回差 +(um) + + + + + + 230 + 30 + 31 + 31 + + + + 延时 +(um) + + + + + + 280 + 40 + 31 + 16 + + + + 使能 + + + + + + 340 + 40 + 31 + 16 + + + + 锁存 + + + + + + 80 + 60 + 51 + 20 + + + + + + + 150 + 60 + 51 + 20 + + + + + + + 220 + 60 + 51 + 20 + + + + + + + 220 + 100 + 51 + 20 + + + + + + + 80 + 100 + 51 + 20 + + + + + + + 150 + 100 + 51 + 20 + + + + + + + 220 + 140 + 51 + 20 + + + + + + + 150 + 180 + 51 + 20 + + + + + + + 80 + 140 + 51 + 20 + + + + + + + 220 + 180 + 51 + 20 + + + + + + + 80 + 180 + 51 + 20 + + + + + + + 150 + 140 + 51 + 20 + + + + + + + 290 + 60 + 16 + 16 + + + + + + + + + + 290 + 100 + 16 + 16 + + + + + + + + + + 290 + 140 + 16 + 16 + + + + + + + + + + 290 + 180 + 16 + 16 + + + + + + + + + + 350 + 100 + 16 + 16 + + + + + + + + + + 350 + 180 + 16 + 16 + + + + + + + + + + 350 + 60 + 16 + 16 + + + + + + + + + + 350 + 140 + 16 + 16 + + + + + + + + + + + + 分频段选择 + + + + + 50 + 90 + 71 + 16 + + + + 使能 + + + + + + 170 + 50 + 91 + 16 + + + + 频率开始(Hz) + + + + + + 320 + 50 + 91 + 16 + + + + 频率结束(Hz) + + + + + + 150 + 90 + 113 + 20 + + + + + + + 300 + 90 + 113 + 20 + + + + + + + 150 + 120 + 113 + 20 + + + + + + + 50 + 120 + 71 + 16 + + + + 使能 + + + + + + 300 + 120 + 113 + 20 + + + + + + + 50 + 150 + 71 + 16 + + + + 使能 + + + + + + 300 + 150 + 113 + 20 + + + + + + + 150 + 150 + 113 + 20 + + + + + + + 50 + 180 + 71 + 16 + + + + 使能 + + + + + + 300 + 180 + 113 + 20 + + + + + + + 150 + 180 + 113 + 20 + + + + + + + 50 + 210 + 71 + 16 + + + + 使能 + + + + + + 300 + 210 + 113 + 20 + + + + + + + 150 + 210 + 113 + 20 + + + + + + + 50 + 240 + 71 + 16 + + + + 使能 + + + + + + 300 + 240 + 113 + 20 + + + + + + + 150 + 240 + 113 + 20 + + + + + + + 50 + 270 + 71 + 16 + + + + 使能 + + + + + + 300 + 270 + 113 + 20 + + + + + + + 150 + 270 + 113 + 20 + + + + + + + 50 + 300 + 71 + 16 + + + + 使能 + + + + + + 300 + 300 + 113 + 20 + + + + + + + 150 + 300 + 113 + 20 + + + + + + + 50 + 330 + 71 + 16 + + + + 使能 + + + + + + 300 + 330 + 113 + 20 + + + + + + + 150 + 330 + 113 + 20 + + + + + + + 50 + 360 + 71 + 16 + + + + 使能 + + + + + + 300 + 360 + 113 + 20 + + + + + + + 150 + 360 + 113 + 20 + + + diff --git a/cardbase.h b/cardbase.h index 8523d52..9dee64d 100644 --- a/cardbase.h +++ b/cardbase.h @@ -24,12 +24,12 @@ class VariableBase { int id_; VibChannelType type_; Filter filter_[3]; - DirectImpl direct_; - GapRange gap_range; - XImpl x1_; - XImpl x2_; - RecorderOut recorder_out_; - Delay delay_; + General general; + AlarmDangerHigh danger_high; + AlarmAlertHigh alert_high; + AlarmDangerLow danger_low; + AlarmAlertLow alert_low; + FrequencybandOutput freband_output[10]; }; // 位移 diff --git a/data_config.h b/data_config.h index d8ecaef..09a54dc 100644 --- a/data_config.h +++ b/data_config.h @@ -149,6 +149,25 @@ typedef struct { bool checked; } Filter; +typedef struct{ + bool output_used; + QString engineering_unit; + QString rectifier_function; +}General; + +typedef struct{ + float level; + float hysteresis; + float delay; + bool enable; + bool latch; +}AlarmDangerHigh,AlarmAlertHigh,AlarmDangerLow,AlarmAlertLow ; + +typedef struct{ + bool enable; + int start; + int end; +}FrequencybandOutput ; //typedef struct { // Filter filter[3]; // 0: kFilterTypeLowPass, 1: kFilterTypeHighPass, 2: kFilterTypeBandPass //} AllFilter; diff --git a/dc_outputs.cpp b/dc_outputs.cpp new file mode 100644 index 0000000..e292240 --- /dev/null +++ b/dc_outputs.cpp @@ -0,0 +1,14 @@ +#include "dc_outputs.h" +#include "ui_dc_outputs.h" + +DC_Outputs::DC_Outputs(QWidget *parent) : + QWidget(parent), + ui(new Ui::DC_Outputs) +{ + ui->setupUi(this); +} + +DC_Outputs::~DC_Outputs() +{ + delete ui; +} diff --git a/dc_outputs.h b/dc_outputs.h new file mode 100644 index 0000000..6f155f8 --- /dev/null +++ b/dc_outputs.h @@ -0,0 +1,22 @@ +#ifndef DC_OUTPUTS_H +#define DC_OUTPUTS_H + +#include + +namespace Ui { +class DC_Outputs; +} + +class DC_Outputs : public QWidget +{ + Q_OBJECT + +public: + explicit DC_Outputs(QWidget *parent = nullptr); + ~DC_Outputs(); + +private: + Ui::DC_Outputs *ui; +}; + +#endif // DC_OUTPUTS_H diff --git a/dc_outputs.ui b/dc_outputs.ui new file mode 100644 index 0000000..98711df --- /dev/null +++ b/dc_outputs.ui @@ -0,0 +1,293 @@ + + + DC_Outputs + + + + 0 + 0 + 727 + 450 + + + + Form + + + + + 60 + 40 + 150 + 25 + + + + + 150 + 25 + + + + + 150 + 25 + + + + + 通道1 输出1 + + + + + + + 50 + 150 + 54 + 12 + + + + 1 + + + + + + 50 + 200 + 54 + 12 + + + + 2 + + + + + + 50 + 240 + 54 + 12 + + + + 3 + + + + + + 50 + 280 + 54 + 12 + + + + 4 + + + + + + 160 + 100 + 101 + 16 + + + + IOC 直流 输出 + + + + + + 310 + 100 + 101 + 16 + + + + 最小值 + + + + + + 440 + 100 + 101 + 16 + + + + 最大值 + + + + + + 160 + 150 + 81 + 16 + + + + 通道1 输出1 + + + + + + 160 + 200 + 81 + 16 + + + + 通道1 输出2 + + + + + + 160 + 240 + 81 + 16 + + + + 未使用 + + + + + + 160 + 280 + 81 + 16 + + + + 未使用 + + + + + + 300 + 140 + 101 + 16 + + + + 0.0 m/s**2_RMSpk + + + + + + 300 + 200 + 101 + 16 + + + + 0.000 g_RMS + + + + + + 420 + 140 + 121 + 16 + + + + 200.0 m/s**2_RMSpk + + + + + + 420 + 200 + 101 + 16 + + + + 666.667 g_RMS + + + + + + 300 + 240 + 71 + 16 + + + + ----- ----- + + + + + + 300 + 280 + 71 + 16 + + + + ----- ----- + + + + + + 430 + 240 + 71 + 16 + + + + ----- ----- + + + + + + 430 + 280 + 71 + 16 + + + + ----- ----- + + + + + + diff --git a/mainwindow.ui b/mainwindow.ui index c2fe78a..843a923 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -254,7 +254,7 @@ - 触发配置 + 直流输出 true diff --git a/pressure_pulsation.ui b/pressure_pulsation.ui index c196bd0..5b943e5 100644 --- a/pressure_pulsation.ui +++ b/pressure_pulsation.ui @@ -168,7 +168,7 @@ - 1 + 0 diff --git a/radial_vibration.cpp b/radial_vibration.cpp index e82e43d..dd48fcd 100644 --- a/radial_vibration.cpp +++ b/radial_vibration.cpp @@ -37,27 +37,11 @@ void Radial::on_pushButton_cancel_clicked() { } void Radial::on_checkBox_1x_ampl_toggled(bool checked) { - if (checked) { - ui->comboBox_1x_value_range->setEnabled(true); - ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true); - ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(true); - return; - } - ui->comboBox_1x_value_range->setEnabled(false); - ui->doubleSpinBox_1x_ampl_clamp->setEnabled(false); - ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false); + } void Radial::on_checkBox_2x_ampl_toggled(bool checked) { - if (checked) { - ui->comboBox_2x_value_range->setEnabled(true); - ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true); - ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(true); - return; - } - ui->comboBox_2x_value_range->setEnabled(false); - ui->doubleSpinBox_2x_ampl_clamp->setEnabled(false); - ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false); + } void Radial::Init() { @@ -86,29 +70,7 @@ void Radial::Init() { ui->checkBox_band_pass->setChecked(variable_ptr->filter_[2].checked); ui->spinBox_band_pass_low->setValue(variable_ptr->filter_[2].low); ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); - ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range); - ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value); -// ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage)); -// ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value); -// ui->comboBox_bias_volt_range->setCurrentIndex(); - ui->checkBox_1x_ampl->setChecked(variable_ptr->x1_.checked); - ui->comboBox_1x_value_range->setCurrentIndex(variable_ptr->x1_.full_scale_range); - ui->doubleSpinBox_1x_ampl_clamp->setValue(variable_ptr->x1_.clamp_value); - ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variable_ptr->x1_.phase_lag); - ui->checkBox_2x_ampl->setChecked(variable_ptr->x2_.checked); - ui->comboBox_2x_value_range->setCurrentIndex(variable_ptr->x2_.full_scale_range); - ui->doubleSpinBox_2x_ampl_clamp->setValue(variable_ptr->x2_.clamp_value); - ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variable_ptr->x2_.phase_lag); - ui->spinBox_alert->setValue(variable_ptr->delay_.alert); - ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger); - ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms); - ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_); - ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_); - ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output); - ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp); - ui->doubleSpinBox_trip_multiply->setValue(variable_ptr->recorder_out_.trip_multiply); - ui->comboBox_comparision->setCurrentIndex(variable_ptr->recorder_out_.comparision); - ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage); + } void Radial::on_pushButton_confirm_clicked() { @@ -138,29 +100,7 @@ void Radial::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->x1_.checked = ui->checkBox_1x_ampl->isChecked(); - variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex(); - variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value(); - variable->x1_.custom = 0; // TODO: - variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value(); - variable->x2_.checked = ui->checkBox_2x_ampl->isChecked(); - variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex(); - variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value(); - variable->x2_.custom = 0; // TODO: - variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value(); - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value(); - variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex(); - variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); + ptr->variables_.push_back(variable); this->close(); return; @@ -175,29 +115,7 @@ void Radial::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->x1_.checked = ui->checkBox_1x_ampl->isChecked(); - variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex(); - variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value(); - variable->x1_.custom = 0; // TODO: - variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value(); - variable->x2_.checked = ui->checkBox_2x_ampl->isChecked(); - variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex(); - variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value(); - variable->x2_.custom = 0; // TODO: - variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value(); - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value(); - variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex(); - variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); + this->close(); } diff --git a/radial_vibration.ui b/radial_vibration.ui index ce15039..51513c9 100644 --- a/radial_vibration.ui +++ b/radial_vibration.ui @@ -27,7 +27,7 @@ - 传感器和滤波配置 + 滤波 @@ -275,657 +275,8 @@ - 特征值和警报配置 + 测量 - - - - 20 - 10 - 411 - 411 - - - - 特征值 - - - - - 20 - 50 - 54 - 12 - - - - 直接值 - - - - - - 20 - 80 - 81 - 16 - - - - 间隙 - - - - - - 20 - 110 - 81 - 16 - - - - 1倍频幅值 - - - - - - 20 - 180 - 81 - 16 - - - - 2倍频幅值 - - - - - - 141 - 31 - 48 - 16 - - - - 取值范围 - - - - - - 260 - 31 - 61 - 16 - - - - 默认值 - - - - - - 130 - 50 - 111 - 22 - - - - 4 - - - - 0-100 um - - - - - 0-150 um - - - - - 0-200 um - - - - - 0-400 um - - - - - 0-500 um - - - - - 自定义 - - - - - - - 260 - 50 - 62 - 22 - - - - 0 - - - 1000.000000000000000 - - - - - - 260 - 80 - 62 - 22 - - - - 1 - - - - - false - - - - 130 - 110 - 111 - 22 - - - - 4 - - - - 0-100 um - - - - - 0-150 um - - - - - 0-200 um - - - - - 0-400 um - - - - - 0-500 um - - - - - 自定义 - - - - - - false - - - - 260 - 110 - 62 - 22 - - - - 0 - - - 1000.000000000000000 - - - - - - 20 - 150 - 91 - 16 - - - - 1倍频相位 - - - - - - 20 - 210 - 91 - 16 - - - - 2倍频相位 - - - - - false - - - - 260 - 150 - 62 - 22 - - - - 0 - - - 360.000000000000000 - - - - - false - - - - 260 - 180 - 62 - 22 - - - - 0 - - - - - false - - - - 260 - 210 - 62 - 22 - - - - 0 - - - 360.000000000000000 - - - - - false - - - - 130 - 180 - 111 - 22 - - - - 4 - - - - 0-100 um - - - - - 0-150 um - - - - - 0-200 um - - - - - 0-400 um - - - - - 0-500 um - - - - - 自定义 - - - - - - - 130 - 80 - 111 - 22 - - - - 0 - - - - -24 Vdc - - - - - 0-100 um - - - - - 0-150 um - - - - - 0-200 um - - - - - 0-400 um - - - - - 0-500 um - - - - - 自定义 - - - - - - - 10 - 300 - 221 - 101 - - - - 延时 - - - - - 20 - 20 - 54 - 12 - - - - 告警 - - - - - - 20 - 50 - 54 - 12 - - - - 危险 - - - - - - 60 - 50 - 61 - 21 - - - - 1 - - - 1.000000000000000 - - - 99.900000000000006 - - - - - - 60 - 80 - 71 - 16 - - - - 100 ms - - - - - - 130 - 20 - 54 - 12 - - - - 1 - 60s - - - - - - 130 - 50 - 71 - 16 - - - - 1.0 - 60.0s - - - - - - 60 - 20 - 61 - 21 - - - - 1 - - - - - - - - 470 - 20 - 131 - 16 - - - - 告警锁定 - - - - - - 470 - 40 - 131 - 16 - - - - 危险锁定 - - - - - - 460 - 220 - 121 - 16 - - - - 倍增 - - - - - - 460 - 240 - 62 - 16 - - - - 1.000000000000000 - - - - - - 460 - 260 - 141 - 16 - - - - 1.00 - 3.00 (步进0.25) - - - - - - 460 - 130 - 54 - 12 - - - - 记录输出 - - - - - - 460 - 150 - 141 - 22 - - - - - - - - - - 直接幅值 - - - - - 1倍频幅值 - - - - - 2倍频幅值 - - - - - - - 460 - 180 - 91 - 16 - - - - 2 mA 默认值 - - - true - - - - - - 460 - 290 - 121 - 16 - - - - 比较 - - @@ -939,51 +290,994 @@ % - - - false - + - 460 - 310 - 141 - 22 + 10 + 40 + 621 + 321 - - - - - - - - 直接幅值 - - - - - 1倍频幅值 - - - - - 2倍频幅值 - - + + 0 + + + + 常规 + + + + + 170 + 150 + 54 + 12 + + + + 整流器 + + + + + + 10 + 140 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + RMS + + + + + + + 170 + 50 + 54 + 12 + + + + 输出使用 + + + + + + 10 + 90 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + um + + + + + + + 170 + 100 + 54 + 12 + + + + 工程单位 + + + + + + 10 + 40 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + + + + + + + + + + + + + 警报 + + + + + 10 + 60 + 71 + 16 + + + + 危险 + 高 + + + + + + 10 + 100 + 71 + 16 + + + + 警报 + 高 + + + + + + 10 + 140 + 71 + 16 + + + + 警报 + 低 + + + + + + 10 + 180 + 71 + 16 + + + + 危险 + 低 + + + + + + 90 + 30 + 31 + 31 + + + + 等级 + (um) + + + + + + 170 + 30 + 31 + 31 + + + + 回差 +(um) + + + + + + 230 + 30 + 31 + 31 + + + + 延时 +(um) + + + + + + 280 + 40 + 31 + 16 + + + + 使能 + + + + + + 340 + 40 + 31 + 16 + + + + 锁存 + + + + + + 80 + 60 + 51 + 20 + + + + + + + 150 + 60 + 51 + 20 + + + + + + + 220 + 60 + 51 + 20 + + + + + + + 220 + 100 + 51 + 20 + + + + + + + 80 + 100 + 51 + 20 + + + + + + + 150 + 100 + 51 + 20 + + + + + + + 220 + 140 + 51 + 20 + + + + + + + 150 + 180 + 51 + 20 + + + + + + + 80 + 140 + 51 + 20 + + + + + + + 220 + 180 + 51 + 20 + + + + + + + 80 + 180 + 51 + 20 + + + + + + + 150 + 140 + 51 + 20 + + + + + + + 290 + 60 + 16 + 16 + + + + + + + + + + 290 + 100 + 16 + 16 + + + + + + + + + + 290 + 140 + 16 + 16 + + + + + + + + + + 290 + 180 + 16 + 16 + + + + + + + + + + 350 + 100 + 16 + 16 + + + + + + + + + + 350 + 180 + 16 + 16 + + + + + + + + + + 350 + 60 + 16 + 16 + + + + + + + + + + 350 + 140 + 16 + 16 + + + + + + + - - - false - + + + + 间隙 + + - 460 - 350 - 61 - 22 + 20 + 40 + 621 + 321 + + 0 + + + + 常规 + + + + + 170 + 150 + 54 + 12 + + + + 整流器 + + + + + + 10 + 140 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + RMS + + + + + + + 170 + 50 + 54 + 12 + + + + 输出使用 + + + + + + 10 + 90 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + um + + + + + + + 170 + 100 + 54 + 12 + + + + 工程单位 + + + + + + 10 + 40 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + + + + + + + + + + + + + 警报 + + + + + 10 + 60 + 71 + 16 + + + + 危险 + 高 + + + + + + 10 + 100 + 71 + 16 + + + + 警报 + 高 + + + + + + 10 + 140 + 71 + 16 + + + + 警报 + 低 + + + + + + 10 + 180 + 71 + 16 + + + + 危险 + 低 + + + + + + 90 + 30 + 31 + 31 + + + + 等级 + (um) + + + + + + 170 + 30 + 31 + 31 + + + + 回差 +(um) + + + + + + 230 + 30 + 31 + 31 + + + + 延时 +(um) + + + + + + 280 + 40 + 31 + 16 + + + + 使能 + + + + + + 340 + 40 + 31 + 16 + + + + 锁存 + + + + + + 80 + 60 + 51 + 20 + + + + + + + 150 + 60 + 51 + 20 + + + + + + + 220 + 60 + 51 + 20 + + + + + + + 220 + 100 + 51 + 20 + + + + + + + 80 + 100 + 51 + 20 + + + + + + + 150 + 100 + 51 + 20 + + + + + + + 220 + 140 + 51 + 20 + + + + + + + 150 + 180 + 51 + 20 + + + + + + + 80 + 140 + 51 + 20 + + + + + + + 220 + 180 + 51 + 20 + + + + + + + 80 + 180 + 51 + 20 + + + + + + + 150 + 140 + 51 + 20 + + + + + + + 290 + 60 + 16 + 16 + + + + + + + + + + 290 + 100 + 16 + 16 + + + + + + + + + + 290 + 140 + 16 + 16 + + + + + + + + + + 290 + 180 + 16 + 16 + + + + + + + + + + 350 + 100 + 16 + 16 + + + + + + + + + + 350 + 180 + 16 + 16 + + + + + + + + + + 350 + 60 + 16 + 16 + + + + + + + + + + 350 + 140 + 16 + 16 + + + + + + + diff --git a/seismic_monitor.cpp b/seismic_monitor.cpp index 68302e8..48f81aa 100644 --- a/seismic_monitor.cpp +++ b/seismic_monitor.cpp @@ -25,14 +25,7 @@ Seismic_monitor::Seismic_monitor(int slot,int cardtype, QWidget *parent) : ui->comboBox_chan_type_2->setView(new QListView()); ui->comboBox_chan_type_3->setView(new QListView()); ui->comboBox_chan_type_4->setView(new QListView()); - ui->comboBox_transducer_name_1->setView(new QListView()); - ui->comboBox_transducer_name_2->setView(new QListView()); - ui->comboBox_transducer_name_3->setView(new QListView()); - ui->comboBox_transducer_name_4->setView(new QListView()); - ui->comboBox_sample_rate_1->setView(new QListView()); - ui->comboBox_sample_rate_2->setView(new QListView()); - ui->comboBox_sample_rate_3->setView(new QListView()); - ui->comboBox_sample_rate_4->setView(new QListView()); + slot_no = slot; car_type = static_cast(cardtype); QString slot_no_ = QString("%1").arg(slot_no); @@ -69,41 +62,33 @@ void Seismic_monitor::Init() { qDebug() << vib_data->base_config_[i].channel_type ; ui->comboBox_chan_type_1->setCurrentIndex(vib_data->base_config_[i].channel_type); ui->checkBox_standby_1->setChecked(vib_data->base_config_[i].standby); - ui->comboBox_transducer_name_1->setCurrentIndex(vib_data->base_config_[i].transducer_id); - ui->doubleSpinBox_scale_factor_1->setValue(vib_data->base_config_[i].scale_factor); + ui->checkBox_enable_1->setChecked(vib_data->base_config_[i].active); ui->doubleSpinBox_low_1->setValue(vib_data->base_config_[i].normal_voltage_low); ui->doubleSpinBox_high_1->setValue(vib_data->base_config_[i].normal_voltage_high); - ui->comboBox_sample_rate_1->setCurrentIndex(vib_data->base_config_[i].sampling_rate); - ui->checkBox_power_1->setChecked(vib_data->base_config_[i].power); + } else if (i + 1 == 2) { ui->comboBox_chan_type_2->setCurrentIndex(vib_data->base_config_[i].channel_type); - ui->comboBox_transducer_name_2->setCurrentIndex(vib_data->base_config_[i].transducer_id); - ui->doubleSpinBox_scale_factor_2->setValue(vib_data->base_config_[i].scale_factor); + ui->checkBox_enable_2->setChecked(vib_data->base_config_[i].active); ui->doubleSpinBox_low_2->setValue(vib_data->base_config_[i].normal_voltage_low); ui->doubleSpinBox_high_2->setValue(vib_data->base_config_[i].normal_voltage_high); - ui->comboBox_sample_rate_2->setCurrentIndex(vib_data->base_config_[i].sampling_rate); - ui->checkBox_power_2->setChecked(vib_data->base_config_[i].power); + } else if (i + 1 == 3) { ui->checkBox_standby_2->setChecked(vib_data->base_config_[i].standby); ui->comboBox_chan_type_3->setCurrentIndex(vib_data->base_config_[i].channel_type); - ui->comboBox_transducer_name_3->setCurrentIndex(vib_data->base_config_[i].transducer_id); - ui->doubleSpinBox_scale_factor_3->setValue(vib_data->base_config_[i].scale_factor); + ui->checkBox_enable_3->setChecked(vib_data->base_config_[i].active); ui->doubleSpinBox_low_3->setValue(vib_data->base_config_[i].normal_voltage_low); ui->doubleSpinBox_high_3->setValue(vib_data->base_config_[i].normal_voltage_high); - ui->comboBox_sample_rate_3->setCurrentIndex(vib_data->base_config_[i].sampling_rate); - ui->checkBox_power_3->setChecked(vib_data->base_config_[i].power); + } else if (i + 1 == 4) { ui->comboBox_chan_type_4->setCurrentIndex(vib_data->base_config_[i].channel_type); - ui->comboBox_transducer_name_4->setCurrentIndex(vib_data->base_config_[i].transducer_id); - ui->doubleSpinBox_scale_factor_4->setValue(vib_data->base_config_[i].scale_factor); + ui->checkBox_enable_4->setChecked(vib_data->base_config_[i].active); ui->doubleSpinBox_low_4->setValue(vib_data->base_config_[i].normal_voltage_low); ui->doubleSpinBox_high_4->setValue(vib_data->base_config_[i].normal_voltage_high); - ui->comboBox_sample_rate_4->setCurrentIndex(vib_data->base_config_[i].sampling_rate); - ui->checkBox_power_4->setChecked(vib_data->base_config_[i].power); + } } } @@ -115,12 +100,9 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { vib_data->base_config_[var].active = ui->checkBox_enable_1->isChecked(); vib_data->base_config_[var].rack_type = 0; vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_1->currentIndex(); - vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_1->currentIndex(); - vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_1->value(); - vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_1->currentIndex(); + vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_1->value(); vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_1->value(); - vib_data->base_config_[var].power = ui->checkBox_power_1->isChecked(); vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0')); vib_data->base_config_[var].keyphase = ui->checkBox_keyphase->isChecked(); vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot->currentText().toInt(); @@ -130,12 +112,10 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { vib_data->base_config_[var].active = ui->checkBox_enable_2->isChecked(); vib_data->base_config_[var].rack_type = 0; vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_2->currentIndex(); - vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_2->currentIndex(); - vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_2->value(); - vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_2->currentIndex(); + vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_2->value(); vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_2->value(); - vib_data->base_config_[var].power = ui->checkBox_power_2->isChecked(); + vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0')); vib_data->base_config_[var].keyphase = ui->checkBox_keyphase_2->isChecked(); vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot_2->currentText().toInt(); @@ -145,12 +125,10 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { vib_data->base_config_[var].active = ui->checkBox_enable_3->isChecked(); vib_data->base_config_[var].rack_type = 0; vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_3->currentIndex(); - vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_3->currentIndex(); - vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_3->value(); - vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_3->currentIndex(); + vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_3->value(); vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_3->value(); - vib_data->base_config_[var].power = ui->checkBox_power_3->isChecked(); + vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0')); vib_data->base_config_[var].keyphase = ui->checkBox_keyphase_3->isChecked(); vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot_3->currentText().toInt(); @@ -160,12 +138,8 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { vib_data->base_config_[var].active = ui->checkBox_enable_4->isChecked(); vib_data->base_config_[var].rack_type = 0; vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_4->currentIndex(); - vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_4->currentIndex(); - vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_4->value(); - vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_4->currentIndex(); vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_4->value(); vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_4->value(); - vib_data->base_config_[var].power = ui->checkBox_power_4->isChecked(); vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0')); vib_data->base_config_[var].keyphase = ui->checkBox_keyphase_4->isChecked(); vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot_4->currentText().toInt(); @@ -313,19 +287,19 @@ void Seismic_monitor::on_pushButton_config_4_clicked() { void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString &arg1) { switch (ui->comboBox_chan_type_1->currentIndex()) { case kVibRadial: - ui->label_unit_1->setText("mV / mm"); + EnableKeyphase(); break; case kVibAcc: - ui->label_unit_1->setText("mV / m/s^2"); + EnableKeyphase(); break; case kVibVelocity: - ui->label_unit_1->setText("mV / mm/s"); + EnableKeyphase(); break; case kVibThrust: - ui->label_unit_1->setText("mV / mil"); + DisableKeyphase(); break; case kVibPressurePulsation: @@ -337,19 +311,15 @@ void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString & void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString &arg1) { switch (ui->comboBox_chan_type_2->currentIndex()) { case kVibRadial: - ui->label_unit_2->setText("mV / mm"); EnableKeyphase(); break; case kVibAcc: - ui->label_unit_2->setText("mV / m/s^2"); EnableKeyphase2(); break; case kVibVelocity: - ui->label_unit_2->setText("mV / mm/s"); EnableKeyphase2(); break; case kVibThrust: - ui->label_unit_2->setText("mV / mil"); DisableKeyphase2(); break; case kVibPressurePulsation: @@ -361,19 +331,15 @@ void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString & void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString &arg1) { switch (ui->comboBox_chan_type_3->currentIndex()) { case kVibRadial: - ui->label_unit_3->setText("mV / mm"); EnableKeyphase(); break; case kVibAcc: - ui->label_unit_3->setText("mV / m/s^2"); EnableKeyphase3(); break; case kVibVelocity: - ui->label_unit_3->setText("mV / mm/s"); EnableKeyphase3(); break; case kVibThrust: - ui->label_unit_3->setText("mV / mil"); DisableKeyphase3(); break; case kVibPressurePulsation: @@ -385,19 +351,15 @@ void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString & void Seismic_monitor::on_comboBox_chan_type_4_currentTextChanged(const QString &arg1) { switch (ui->comboBox_chan_type_4->currentIndex()) { case kVibRadial: - ui->label_unit_4->setText("mV / mm"); EnableKeyphase4(); break; case kVibAcc: - ui->label_unit_4->setText("mV / m/s^2"); EnableKeyphase4(); break; case kVibVelocity: - ui->label_unit_4->setText("mV / mm/s"); EnableKeyphase4(); break; case kVibThrust: - ui->label_unit_4->setText("mV / mil"); DisableKeyphase4(); break; case kVibPressurePulsation: @@ -411,35 +373,19 @@ void Seismic_monitor::on_pushButton_cancel_clicked() { } void Seismic_monitor::on_comboBox_transducer_name_1_currentTextChanged(const QString &arg1) { - for (int var = 0; var < vec_transducer.size(); ++var) { - if (ui->comboBox_transducer_name_1->currentText() == vec_transducer[var].transducer_name) { - ui->doubleSpinBox_scale_factor_1->setValue(vec_transducer[var].scale_factor); - } - } + } void Seismic_monitor::on_comboBox_transducer_name_2_currentTextChanged(const QString &arg1) { - for (int var = 0; var < vec_transducer.size(); ++var) { - if (ui->comboBox_transducer_name_2->currentText() == vec_transducer[var].transducer_name) { - ui->doubleSpinBox_scale_factor_2->setValue(vec_transducer[var].scale_factor); - } - } + } void Seismic_monitor::on_comboBox_transducer_name_3_currentTextChanged(const QString &arg1) { - for (int var = 0; var < vec_transducer.size(); ++var) { - if (ui->comboBox_transducer_name_3->currentText() == vec_transducer[var].transducer_name) { - ui->doubleSpinBox_scale_factor_3->setValue(vec_transducer[var].scale_factor); - } - } + } void Seismic_monitor::on_comboBox_transducer_name_4_currentTextChanged(const QString &arg1) { - for (int var = 0; var < vec_transducer.size(); ++var) { - if (ui->comboBox_transducer_name_4->currentText() == vec_transducer[var].transducer_name) { - ui->doubleSpinBox_scale_factor_4->setValue(vec_transducer[var].scale_factor); - } - } + } void Seismic_monitor::EnableKeyphase(){ ui->checkBox_keyphase->setCheckable(true); diff --git a/seismic_monitor.ui b/seismic_monitor.ui index c67cddc..e299192 100644 --- a/seismic_monitor.ui +++ b/seismic_monitor.ui @@ -7,7 +7,7 @@ 0 0 862 - 580 + 632 @@ -324,8 +324,8 @@ 10 50 - 333 - 328 + 311 + 321 @@ -347,296 +347,295 @@ 通道1 - + - + - + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + 加速度 + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 径向位移 - - - - - 加速度 - - - - - 速度 - - - - - 轴向位移 - - - - - 动态压力脉动 - - - + + 速度 + - - - Qt::Horizontal - - - - 40 - 20 - - - + + 压力脉动 + - + + + 轴振 + + + + + 轴位移 + + + + + DC + + + - + + + + 90 + 0 + + + + 传感器类型 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + g + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - xxx - - - - xxx - - - - - yyy - - - + + m/s^2 + - - - Qt::Horizontal - - - - 20 - 20 - - - + + mm/s + - + + + um + + + + + mm + + + + + mbar + + + + + bar + + + - - - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - - - + + + + 90 + 0 + + + + 传感器灵敏度单位 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + - + + + + 90 + 0 + + + + 信号灵敏度(mV/um) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 采样率: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - - 16 k - - - - - 32 k - - - - - 64 k - - - - - 128 k - - - + + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + - - - - - Qt::Horizontal - - - - 90 - 20 - - - - - - - - Qt::LeftToRight - - - 是否供电 - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + 90 + 0 + + + + 传感器IEPE供电 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + 电压上限(V) + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + -25.000000000000000 + + + + + + + 电压下限(V) + + @@ -777,418 +776,301 @@ - - - - - 220 - 80 - - - - 电压范围 - - - - - - - - - 80 - 0 - - - - 上限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - 25.000000000000000 - - - - - - - V - - - - - - - - - - - - 80 - 0 - - - - 下限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - -25.000000000000000 - - - - - - - V - - - - - - - - 通道2 - + - + - + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + 加速度 + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 径向位移 - - - - - 加速度 - - - - - 速度 - - - - - 轴向位移 - - - - - 动态压力脉动 - - - + + 速度 + - - - Qt::Horizontal - - - - 40 - 20 - - - + + 压力脉动 + - + + + 轴振 + + + + + 轴位移 + + + + + DC + + + - + + + + 90 + 0 + + + + 传感器类型 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + g + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - xxx - - - - - yyy - - - + + m/s^2 + - - - Qt::Horizontal - - - - 20 - 20 - - - + + mm/s + - + + + um + + + + + mm + + + + + mbar + + + + + bar + + + - - - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - - - + + + + 90 + 0 + + + + 传感器灵敏度单位 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + - + + + + 90 + 0 + + + + 信号灵敏度(mV/um) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 采样率: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - - 16 k - - - - - 32 k - - - - - 64 k - - - - - 128 k - - - + + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + - - - - - Qt::Horizontal - - - - 90 - 20 - - - - - - - - Qt::LeftToRight - - - 是否供电 - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + 90 + 0 + + + + 传感器IEPE供电 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + 电压上限(V) + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + -25.000000000000000 + + + + + + + 电压下限(V) + + @@ -1329,139 +1211,78 @@ - - - - - 220 - 80 - - - - 电压范围 - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 上限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - 25.000000000000000 - - - - - - - V - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 下限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - -25.000000000000000 - - - - - - - V - - - - - - - - + + + 通道1-通道2 + + + + + 20 + 50 + 180 + 22 + + + + + 180 + 0 + + + + + 120 + 16777215 + + + + + No Processing + + + + + (SMAX) Smax + + + + + (DHE) Differential Housing Expansion + + + + + (RST) Relative Shaft Expansion (Shaft taper) + + + + + (RSC) Relative Shaft Expansion (Shaft collar) + + + + + (DMF) Dual Mathematical Function + + + + + + + 220 + 60 + 54 + 12 + + + + 函数 + + + @@ -1631,8 +1452,8 @@ 10 50 - 333 - 328 + 321 + 321 @@ -1648,296 +1469,301 @@ - 0 + 1 通道3 - + - + - + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + 加速度 + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 径向位移 - - - - - 加速度 - - - - - 速度 - - - - - 轴向位移 - - - - - 动态压力脉动 - - - + + 速度 + - - - Qt::Horizontal - - - - 40 - 20 - - - + + 压力脉动 + - + + + 轴振 + + + + + 轴位移 + + + + + DC + + + - + + + + 90 + 0 + + + + 传感器类型 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + g + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - xxx - - - - - yyy - - - + + m/s^2 + - - - Qt::Horizontal - - - - 20 - 20 - - - + + mm/s + - + + + um + + + + + mm + + + + + mbar + + + + + bar + + + - - - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - - - + + + + 90 + 0 + + + + 传感器灵敏度单位 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + - + + + + 90 + 0 + + + + 信号灵敏度(mV/um) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 采样率: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - - 16 k - - - - - 32 k - - - - - 64 k - - - - - 128 k - - - + + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + - - - - - Qt::Horizontal - - - - 90 - 20 - - - - - - - - Qt::LeftToRight - - - 是否供电 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + 90 + 0 + + + + 传感器IEPE供电 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + 电压上限(V) + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + -25.000000000000000 + + + + + + + 电压下限(V) + + @@ -2078,415 +1904,301 @@ - - - - - 220 - 80 - - - - 电压范围 - - - - - - - - - 80 - 0 - - - - 上限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - 25.000000000000000 - - - - - - - V - - - - - - - - - - - - 80 - 0 - - - - 下限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - -25.000000000000000 - - - - - - - V - - - - - - - - 通道4 - + - + - + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + 加速度 + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 径向位移 - - - - - 加速度 - - - - - 速度 - - - - - 轴向位移 - - - - - 动态压力脉动 - - - + + 速度 + - - - Qt::Horizontal - - - - 40 - 20 - - - + + 压力脉动 + - + + + 轴振 + + + + + 轴位移 + + + + + DC + + + - + + + + 90 + 0 + + + + 传感器类型 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + g + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - xxx - - - - - yyy - - - + + m/s^2 + - - - Qt::Horizontal - - - - 20 - 20 - - - + + mm/s + - + + + um + + + + + mm + + + + + mbar + + + + + bar + + + - - - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - - - + + + + 90 + 0 + + + + 传感器灵敏度单位 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + - + + + + 90 + 0 + + + + 信号灵敏度(mV/um) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + - - - - 90 - 0 - - - - 采样率: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - - 16 k - - - - - 32 k - - - - - 64 k - - - - - 128 k - - - + + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + - - - - - Qt::Horizontal - - - - 90 - 20 - - - - - - - - Qt::LeftToRight - - - 是否供电 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + 90 + 0 + + + + 传感器IEPE供电 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + 电压上限(V) + + + + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + -25.000000000000000 + + + + + + + 电压下限(V) + + @@ -2627,127 +2339,78 @@ - - - - - 220 - 80 - - - - 电压范围 - - - - - - - - - 80 - 0 - - - - 上限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - 25.000000000000000 - - - - - - - V - - - - - - - - - - - - 80 - 0 - - - - 下限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - -25.000000000000000 - - - - - - - V - - - - - - - - + + + 通道3-通道4 + + + + + 20 + 50 + 180 + 22 + + + + + 180 + 0 + + + + + 120 + 16777215 + + + + + No Processing + + + + + (SMAX) Smax + + + + + (DHE) Differential Housing Expansion + + + + + (RST) Relative Shaft Expansion (Shaft taper) + + + + + (RSC) Relative Shaft Expansion (Shaft collar) + + + + + (DMF) Dual Mathematical Function + + + + + + + 220 + 60 + 54 + 12 + + + + 函数 + + + diff --git a/trust.cpp b/trust.cpp index 8d7faed..f4c192e 100644 --- a/trust.cpp +++ b/trust.cpp @@ -59,19 +59,7 @@ void Trust::Init() { ui->checkBox_band_pass->setChecked(variable_ptr->filter_[2].checked); ui->spinBox_band_pass_low->setValue(variable_ptr->filter_[2].low); ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); - ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range); - ui->comboBox_gap_range->setCurrentIndex(variable_ptr->gap_range.full_scale_range); - ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value); - // ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage)); - // ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value); - // ui->comboBox_bias_volt_range->setCurrentIndex(); - ui->spinBox_alert->setValue(variable_ptr->delay_.alert); - ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger); - ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms); - ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_); - ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_); - ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output); - ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp); + ui->doubleSpinBox_zero_position->setValue(variable_ptr->zero_position.value); ui->checkBox_negation->setChecked(variable_ptr->zero_position.negation); } @@ -103,17 +91,7 @@ void Trust::on_pushButton_confirm_clicked() variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->gap_range.full_scale_range = ui->comboBox_gap_range->currentIndex(); - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); + variable->zero_position.value = ui->doubleSpinBox_zero_position->value(); variable->zero_position.negation = ui->checkBox_negation->isChecked(); ptr->variables_.push_back(variable); @@ -130,18 +108,7 @@ void Trust::on_pushButton_confirm_clicked() variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->gap_range.full_scale_range = ui->comboBox_gap_range->currentIndex(); - variable->gap_range.custom = 0; - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); + variable->zero_position.value = ui->doubleSpinBox_zero_position->value(); variable->zero_position.negation = ui->checkBox_negation->isChecked(); this->close(); diff --git a/trust.ui b/trust.ui index a087018..5734bec 100644 --- a/trust.ui +++ b/trust.ui @@ -7,7 +7,7 @@ 0 0 691 - 505 + 525 @@ -19,7 +19,7 @@ 10 60 651 - 381 + 391 @@ -27,7 +27,7 @@ - 传感器和滤波配置 + 滤波 @@ -273,429 +273,919 @@ - + - 特征值和警报配置 + 间隙 - + - 20 - 10 - 411 + 10 + 20 + 621 321 - - 特征值 + + 1 - - - - 20 - 50 - 54 - 12 - - - - 直接值 - - - - - - 20 - 80 - 81 - 16 - - - - 间隙 - - - - - - 141 - 31 - 48 - 16 - - - - 取值范围 - - - - - - 260 - 31 - 61 - 16 - - - - 默认值 - - - - - - 130 - 50 - 111 - 22 - - - - 0 - - - - 25-0-25 mil - - - - - 30-0-30 mil - - - - - 40-0-40 mil - - - - - 0.5-0-0.5 mm - - - - - 1.0-0-1.0 mm - - - - - 自定义 - - - - - - - 260 - 50 - 62 - 22 - - - - 0 - - - 1000.000000000000000 - - - - - - 260 - 80 - 62 - 22 - - - - 1 - - - - - - 130 - 80 - 111 - 22 - - - - 0 - - - - -24 Vdc - - - - - 自定义 - - - - - - - 10 - 190 - 201 - 101 - - - - 延时 - - + + + 常规 + + - 20 - 20 + 170 + 150 54 12 - 告警 + 整流器 - - - - 20 - 50 - 54 - 12 - - - - 危险 - - - - - - 60 - 50 - 61 - 21 - - - - 1 - - - 1.000000000000000 - - - 99.900000000000006 - - - - - - 60 - 80 - 71 - 16 - - - - 100 ms - - - - - - 130 - 20 - 54 - 12 - - - - 1 - 60s - - - - - - 130 - 50 - 71 - 16 - - - - 1.0 - 60.0s - - - - - - 60 - 20 - 61 - 21 - - - - 1 - - - - - - - 220 - 190 - 171 - 101 - - - - 初始位置 - - + 10 - 30 - 61 - 21 + 140 + 125 + 25 - - 2 + + + 125 + 25 + - - -50.000000000000000 + + + 125 + 25 + - - 50.000000000000000 + + + RMS + + + + + + + 170 + 50 + 54 + 12 + + + + 输出使用 - + + + + 10 + 90 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + um + + + + + + + 170 + 100 + 54 + 12 + + + + 工程单位 + + + + + + 10 + 40 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + + + + + + + + + + + + + 10 + 180 + 171 + 101 + + + + 初始位置 + + + + + 10 + 30 + 61 + 21 + + + + 2 + + + -50.000000000000000 + + + 50.000000000000000 + + + + + + 80 + 30 + 91 + 16 + + + + -50 - 50 V + + + + + + 10 + 70 + 71 + 16 + + + + 取反 + + + + + + + 警报 + + + + + 10 + 60 + 71 + 16 + + + + 危险 + 高 + + + + + + 10 + 100 + 71 + 16 + + + + 警报 + 高 + + + + + + 10 + 140 + 71 + 16 + + + + 警报 + 低 + + + + + + 10 + 180 + 71 + 16 + + + + 危险 + 低 + + + + + + 90 + 30 + 31 + 31 + + + + 等级 + (um) + + + + + + 170 + 30 + 31 + 31 + + + + 回差 +(um) + + + + + + 230 + 30 + 31 + 31 + + + + 延时 +(um) + + + + + + 280 + 40 + 31 + 16 + + + + 使能 + + + + + + 340 + 40 + 31 + 16 + + + + 锁存 + + + 80 - 30 - 91 - 16 + 60 + 51 + 20 - - -50 - 50 V - - + - 10 - 70 - 71 + 150 + 60 + 51 + 20 + + + + + + + 220 + 60 + 51 + 20 + + + + + + + 220 + 100 + 51 + 20 + + + + + + + 80 + 100 + 51 + 20 + + + + + + + 150 + 100 + 51 + 20 + + + + + + + 220 + 140 + 51 + 20 + + + + + + + 150 + 180 + 51 + 20 + + + + + + + 80 + 140 + 51 + 20 + + + + + + + 220 + 180 + 51 + 20 + + + + + + + 80 + 180 + 51 + 20 + + + + + + + 150 + 140 + 51 + 20 + + + + + + + 290 + 60 + 16 16 - 取反 + + + + + + + 290 + 100 + 16 + 16 + + + + + + + + + + 290 + 140 + 16 + 16 + + + + + + + + + + 290 + 180 + 16 + 16 + + + + + + + + + + 350 + 100 + 16 + 16 + + + + + + + + + + 350 + 180 + 16 + 16 + + + + + + + + + + 350 + 60 + 16 + 16 + + + + + + + + + + 350 + 140 + 16 + 16 + + + + - + + + + 分频段选择 + + - 470 + 120 + 210 + 113 + 20 + + + + + + + 20 + 90 + 71 + 16 + + + + 使能 + + + + + + 270 + 270 + 113 + 20 + + + + + + + 20 + 300 + 71 + 16 + + + + 使能 + + + + + + 20 + 60 + 71 + 16 + + + + 使能 + + + + + + 140 20 - 131 - 16 - - - - 告警锁定 - - - - - - 470 - 40 - 131 - 16 - - - - 危险锁定 - - - - - - 460 - 130 - 54 - 12 - - - - 记录输出 - - - - - - 460 - 150 - 141 - 22 - - - - - - - - - - 直接幅值 - - - - - 间隙 - - - - - - - 460 - 180 91 16 - 2 mA 默认值 - - - true + 频率开始(Hz) - + - 470 - 60 - 181 + 270 + 300 + 113 + 20 + + + + + + + 270 + 240 + 113 + 20 + + + + + + + 20 + 330 + 71 16 - Timed OK channel Defeat + 使能 + + + + + + 120 + 60 + 113 + 20 + + + + + + + 20 + 270 + 71 + 16 + + + + 使能 + + + + + + 120 + 270 + 113 + 20 + + + + + + + 270 + 60 + 113 + 20 + + + + + + + 120 + 150 + 113 + 20 + + + + + + + 120 + 120 + 113 + 20 + + + + + + + 20 + 150 + 71 + 16 + + + + 使能 + + + + + + 290 + 20 + 91 + 16 + + + + 频率结束(Hz) + + + + + + 270 + 180 + 113 + 20 + + + + + + + 120 + 330 + 113 + 20 + + + + + + + 270 + 120 + 113 + 20 + + + + + + + 270 + 210 + 113 + 20 + + + + + + + 20 + 120 + 71 + 16 + + + + 使能 + + + + + + 120 + 180 + 113 + 20 + + + + + + + 270 + 150 + 113 + 20 + + + + + + + 120 + 240 + 113 + 20 + + + + + + + 120 + 300 + 113 + 20 + + + + + + + 270 + 90 + 113 + 20 + + + + + + + 20 + 240 + 71 + 16 + + + + 使能 + + + + + + 120 + 90 + 113 + 20 + + + + + + + 20 + 180 + 71 + 16 + + + + 使能 + + + + + + 20 + 210 + 71 + 16 + + + + 使能 + + + + + + 270 + 330 + 113 + 20 + @@ -737,7 +1227,7 @@ 20 - 450 + 470 632 37 diff --git a/velocity.cpp b/velocity.cpp index 45ea98b..aa54834 100644 --- a/velocity.cpp +++ b/velocity.cpp @@ -34,60 +34,12 @@ Velocity::~Velocity() { void Velocity::on_checkBox_rms_toggled(bool checked) { // TODO: 自定义的回调 - if (checked) { - ui->checkBox_integrate->setEnabled(false); - QStringList items = {"0-10 mm/s rms", "0-20 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(1); - ui->comboBox_1x_value_range->clear(); - ui->comboBox_1x_value_range->addItems(items); - ui->comboBox_1x_value_range->setCurrentIndex(1); - ui->comboBox_2x_value_range->clear(); - ui->comboBox_2x_value_range->addItems(items); - ui->comboBox_2x_value_range->setCurrentIndex(1); - return; - } - ui->checkBox_integrate->setEnabled(true); - ui->comboBox_direct_value_range->clear(); - QStringList items = {"0-10 mm/s pk", "0-20 mm/s pk", "0-50 mm/s pk", "自定义"}; - ui->comboBox_direct_value_range->addItems(items); - ui->comboBox_direct_value_range->setCurrentIndex(1); - ui->comboBox_1x_value_range->clear(); - ui->comboBox_1x_value_range->addItems(items); - ui->comboBox_1x_value_range->setCurrentIndex(1); - ui->comboBox_2x_value_range->clear(); - ui->comboBox_2x_value_range->addItems(items); - ui->comboBox_2x_value_range->setCurrentIndex(1); + } void Velocity::on_checkBox_integrate_toggled(bool checked) { // TODO: 自定义的回调 - if (checked) { - ui->checkBox_rms->setEnabled(false); - ui->comboBox_direct_value_range->clear(); - QStringList items = {"0-100 um pp", "0-200 um pp", "0-500 um pp", "自定义"}; - ui->comboBox_direct_value_range->addItems(items); - ui->comboBox_direct_value_range->setCurrentIndex(1); - ui->comboBox_1x_value_range->clear(); - ui->comboBox_1x_value_range->addItems(items); - ui->comboBox_1x_value_range->setCurrentIndex(1); - ui->comboBox_2x_value_range->clear(); - ui->comboBox_2x_value_range->addItems(items); - ui->comboBox_2x_value_range->setCurrentIndex(1); - return; - } - ui->checkBox_rms->setEnabled(true); - ui->comboBox_direct_value_range->clear(); - QStringList items = {"0-10 mm/s pk", "0-20 mm/s pk", "0-50 mm/s pk", "自定义"}; - ui->comboBox_direct_value_range->addItems(items); - ui->comboBox_direct_value_range->setCurrentIndex(1); - ui->comboBox_1x_value_range->clear(); - ui->comboBox_1x_value_range->addItems(items); - ui->comboBox_1x_value_range->setCurrentIndex(1); - ui->comboBox_2x_value_range->clear(); - ui->comboBox_2x_value_range->addItems(items); - ui->comboBox_2x_value_range->setCurrentIndex(1); + } void Velocity::on_pushButton_cancel_clicked() { @@ -95,27 +47,11 @@ void Velocity::on_pushButton_cancel_clicked() { } void Velocity::on_checkBox_1x_ampl_toggled(bool checked) { - if (checked) { - ui->comboBox_1x_value_range->setEnabled(true); - ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true); - ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(true); - return; - } - ui->comboBox_1x_value_range->setEnabled(false); - ui->doubleSpinBox_1x_ampl_clamp->setEnabled(false); - ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false); + } void Velocity::on_checkBox_2x_ampl_toggled(bool checked) { - if (checked) { - ui->comboBox_2x_value_range->setEnabled(true); - ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true); - ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(true); - return; - } - ui->comboBox_2x_value_range->setEnabled(false); - ui->doubleSpinBox_2x_ampl_clamp->setEnabled(false); - ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false); + } void Velocity::Init() { @@ -144,32 +80,7 @@ void Velocity::Init() { ui->checkBox_band_pass->setChecked(variable_ptr->filter_[2].checked); ui->spinBox_band_pass_low->setValue(variable_ptr->filter_[2].low); ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); - ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range); - ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value); -// ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage)); -// ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value); -// ui->comboBox_bias_volt_range->setCurrentIndex(); - ui->checkBox_1x_ampl->setChecked(variable_ptr->x1_.checked); - ui->comboBox_1x_value_range->setCurrentIndex(variable_ptr->x1_.full_scale_range); - ui->doubleSpinBox_1x_ampl_clamp->setValue(variable_ptr->x1_.clamp_value); - ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variable_ptr->x1_.phase_lag); - ui->checkBox_2x_ampl->setChecked(variable_ptr->x2_.checked); - ui->comboBox_2x_value_range->setCurrentIndex(variable_ptr->x2_.full_scale_range); - ui->doubleSpinBox_2x_ampl_clamp->setValue(variable_ptr->x2_.clamp_value); - ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variable_ptr->x2_.phase_lag); - ui->spinBox_alert->setValue(variable_ptr->delay_.alert); - ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger); - ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms); - ui->checkBox_rms->setChecked(variable_ptr->rms_active_); - ui->checkBox_integrate->setChecked(variable_ptr->integrate_active_); - ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_); - ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_); - ui->checkBox_timed_ok->setChecked(variable_ptr->timed_ok_); - ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output); - ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp); - ui->doubleSpinBox_trip_multiply->setValue(variable_ptr->recorder_out_.trip_multiply); - ui->comboBox_comparision->setCurrentIndex(variable_ptr->recorder_out_.comparision); - ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage); + } void Velocity::on_pushButton_confirm_clicked() { @@ -199,32 +110,7 @@ void Velocity::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->x1_.checked = ui->checkBox_1x_ampl->isChecked(); - variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex(); - variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value(); - variable->x1_.custom = 0; // TODO: - variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value(); - variable->x2_.checked = ui->checkBox_2x_ampl->isChecked(); - variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex(); - variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value(); - variable->x2_.custom = 0; // TODO: - variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value(); - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value(); - variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex(); - variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->rms_active_ = ui->checkBox_rms->isChecked(); - variable->integrate_active_ = ui->checkBox_integrate->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); - variable->timed_ok_ = ui->checkBox_timed_ok->isChecked(); + ptr->variables_.push_back(variable); this->close(); return; @@ -239,31 +125,6 @@ void Velocity::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex(); - variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value(); - variable->direct_.custom = 0; // TODO: - variable->x1_.checked = ui->checkBox_1x_ampl->isChecked(); - variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex(); - variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value(); - variable->x1_.custom = 0; // TODO: - variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value(); - variable->x2_.checked = ui->checkBox_2x_ampl->isChecked(); - variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex(); - variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value(); - variable->x2_.custom = 0; // TODO: - variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value(); - variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex(); - variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value(); - variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex(); - variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value(); - variable->delay_.alert = ui->spinBox_alert->value(); - variable->delay_.danger = ui->doubleSpinBox_danger->value(); - variable->delay_.active_100ms = ui->checkBox_100ms->isChecked(); - variable->rms_active_ = ui->checkBox_rms->isChecked(); - variable->integrate_active_ = ui->checkBox_integrate->isChecked(); - variable->alert_latching_ = ui->checkBox_alert_latching->isChecked(); - variable->danger_latching_ = ui->checkBox_danger_latching->isChecked(); - variable->timed_ok_ = ui->checkBox_timed_ok->isChecked(); + this->close(); } diff --git a/velocity.ui b/velocity.ui index 4783dd6..ba9bd1f 100644 --- a/velocity.ui +++ b/velocity.ui @@ -27,7 +27,7 @@ - 滤波配置 + 滤波 @@ -275,684 +275,8 @@ - 特征值和警报配置 + 处理后输出 - - - - 10 - 10 - 431 - 351 - - - - 特征值 - - - - - 20 - 50 - 54 - 12 - - - - 直接值 - - - - - - 10 - 80 - 81 - 16 - - - - 偏置电压 - - - - - - 20 - 110 - 81 - 16 - - - - 1倍频幅值 - - - - - - 20 - 180 - 81 - 16 - - - - 2倍频幅值 - - - - - - 141 - 31 - 48 - 16 - - - - 取值范围 - - - - - - 269 - 31 - 48 - 16 - - - - 默认值 - - - - - - 130 - 50 - 111 - 22 - - - - 0-20 mm/s pk - - - 1 - - - - 0-10 mm/s pk - - - - - 0-20 mm/s pk - - - - - 0-50 mm/s pk - - - - - 自定义 - - - - - - - 260 - 50 - 62 - 22 - - - - 1 - - - - - - 130 - 80 - 54 - 12 - - - - -24 - - - - - - 260 - 80 - 62 - 22 - - - - 1 - - - - - false - - - - 130 - 110 - 111 - 22 - - - - 1 - - - - 0-10 mm/s pk - - - - - 0-20 mm/s pk - - - - - 0-50 mm/s pk - - - - - 自定义 - - - - - - false - - - - 260 - 110 - 62 - 22 - - - - 1 - - - - - - 20 - 150 - 91 - 16 - - - - 1倍频相位 - - - - - - 20 - 210 - 91 - 16 - - - - 2倍频相位 - - - - - false - - - - 260 - 150 - 62 - 22 - - - - 0 - - - - - false - - - - 260 - 180 - 62 - 22 - - - - 1 - - - - - false - - - - 260 - 210 - 62 - 22 - - - - 0 - - - - - false - - - - 130 - 180 - 111 - 22 - - - - 1 - - - - 0-10 mm/s pk - - - - - 0-20 mm/s pk - - - - - 0-50 mm/s pk - - - - - 自定义 - - - - - - - 20 - 250 - 71 - 16 - - - - 有效值 - - - - - - 130 - 250 - 71 - 16 - - - - 积分 - - - - - - 200 - 240 - 221 - 101 - - - - 延时 - - - - - 20 - 20 - 54 - 12 - - - - 告警 - - - - - - 20 - 50 - 54 - 12 - - - - 危险 - - - - - - 60 - 50 - 61 - 21 - - - - 1 - - - 1.000000000000000 - - - - - - 60 - 80 - 71 - 16 - - - - 100 ms - - - - - - 130 - 20 - 54 - 12 - - - - 1 - 60s - - - - - - 130 - 50 - 71 - 16 - - - - 1.0 - 60.0s - - - - - - 60 - 20 - 61 - 21 - - - - 1 - - - - - - - 170 - 80 - 53 - 15 - - - - Vdc - - - - - - - 460 - 20 - 131 - 16 - - - - 告警锁定 - - - true - - - - - - 460 - 40 - 131 - 16 - - - - 危险锁定 - - - true - - - - - - 460 - 190 - 121 - 16 - - - - 倍增 - - - - - - 460 - 210 - 62 - 16 - - - - 1.000000000000000 - - - - - - 460 - 230 - 141 - 16 - - - - 1.00 - 3.00 (步进0.25) - - - - - - 460 - 110 - 54 - 12 - - - - 记录输出 - - - - - - 460 - 130 - 141 - 22 - - - - - - - - - - 直接幅值 - - - - - 1倍频幅值 - - - - - 2倍频幅值 - - - - - - - 460 - 160 - 101 - 16 - - - - 2 mA 默认值 - - - true - - - - - - 460 - 60 - 181 - 16 - - - - Timed OK channel Defeat - - - - - - 460 - 260 - 121 - 16 - - - - 比较 - - - - - false - - - - 460 - 280 - 141 - 22 - - - - - - - - - - 直接幅值 - - - - - 1倍频幅值 - - - - - 2倍频幅值 - - - - - - false - - - - 460 - 320 - 61 - 22 - - - @@ -966,6 +290,498 @@ % + + + + 10 + 20 + 621 + 321 + + + + 0 + + + + 常规 + + + + + 170 + 150 + 54 + 12 + + + + 整流器 + + + + + + 10 + 140 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + RMS + + + + + + + 170 + 50 + 54 + 12 + + + + 输出使用 + + + + + + 10 + 90 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + um + + + + + + + 170 + 100 + 54 + 12 + + + + 工程单位 + + + + + + 10 + 40 + 125 + 25 + + + + + 125 + 25 + + + + + 125 + 25 + + + + + + + + + + + + + + + + + 警报 + + + + + 10 + 60 + 71 + 16 + + + + 危险 + 高 + + + + + + 10 + 100 + 71 + 16 + + + + 警报 + 高 + + + + + + 10 + 140 + 71 + 16 + + + + 警报 + 低 + + + + + + 10 + 180 + 71 + 16 + + + + 危险 + 低 + + + + + + 90 + 30 + 31 + 31 + + + + 等级 + (um) + + + + + + 170 + 30 + 31 + 31 + + + + 回差 +(um) + + + + + + 230 + 30 + 31 + 31 + + + + 延时 +(um) + + + + + + 280 + 40 + 31 + 16 + + + + 使能 + + + + + + 340 + 40 + 31 + 16 + + + + 锁存 + + + + + + 80 + 60 + 51 + 20 + + + + + + + 150 + 60 + 51 + 20 + + + + + + + 220 + 60 + 51 + 20 + + + + + + + 220 + 100 + 51 + 20 + + + + + + + 80 + 100 + 51 + 20 + + + + + + + 150 + 100 + 51 + 20 + + + + + + + 220 + 140 + 51 + 20 + + + + + + + 150 + 180 + 51 + 20 + + + + + + + 80 + 140 + 51 + 20 + + + + + + + 220 + 180 + 51 + 20 + + + + + + + 80 + 180 + 51 + 20 + + + + + + + 150 + 140 + 51 + 20 + + + + + + + 290 + 60 + 16 + 16 + + + + + + + + + + 290 + 100 + 16 + 16 + + + + + + + + + + 290 + 140 + 16 + 16 + + + + + + + + + + 290 + 180 + 16 + 16 + + + + + + + + + + 350 + 100 + 16 + 16 + + + + + + + + + + 350 + 180 + 16 + 16 + + + + + + + + + + 350 + 60 + 16 + 16 + + + + + + + + + + 350 + 140 + 16 + 16 + + + + + + + +