From 9ea836be8c1dafa4298e9cff48e6c8b4a6e465e6 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Sun, 6 Jul 2025 16:31:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8C=AF=E5=8A=A8=E9=80=9A?= =?UTF-8?q?=E9=81=93=E7=BB=91=E5=AE=9A=E9=94=AE=E7=9B=B8=E9=80=9A=E9=81=93?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=BD=B4=E5=90=91=E4=BD=8D=E7=A7=BB?= =?UTF-8?q?=E9=80=9A=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TSI_Config.pro | 4 + cardbase.h | 8 +- config_mgr.cpp | 95 +- data_config.h | 7 +- mainwindow.cpp | 22 +- rangeslider.cpp | 2 +- rangeslider.h | 2 +- seismic_monitor.cpp | 96 ++ seismic_monitor.h | 2 + seismic_monitor.ui | 3482 +++++++++++++++++++++++-------------------- setpoint.cpp | 39 + 11 files changed, 2105 insertions(+), 1654 deletions(-) diff --git a/TSI_Config.pro b/TSI_Config.pro index 2e6363f..1fe84ad 100644 --- a/TSI_Config.pro +++ b/TSI_Config.pro @@ -34,6 +34,7 @@ SOURCES += \ tachometer_data.cpp \ tmrrelayassociation.cpp \ tmrrelayassociation_data.cpp \ + trust.cpp \ velocity.cpp \ vibrationdata.cpp @@ -65,6 +66,8 @@ HEADERS += \ tachometer_data.h \ tmrrelayassociation.h \ tmrrelayassociation_data.h \ + trust.h \ + trust_ds.h \ velocity.h \ velocity_ds.h \ vibrationdata.h @@ -85,6 +88,7 @@ FORMS += \ singlerelay.ui \ tachometer.ui \ tmrrelayassociation.ui \ + trust.ui \ velocity.ui # Default rules for deployment. diff --git a/cardbase.h b/cardbase.h index 55f298f..0b02ae9 100644 --- a/cardbase.h +++ b/cardbase.h @@ -49,5 +49,11 @@ class AccVelVariable : public VariableBase { bool rms_active_; bool integrate_active_; }; - +// 加速度与速度 +class ThrustVariable : public VariableBase { + public: + bool alert_latching_; + bool danger_latching_; + bool timed_ok_; +}; #endif // CARDBASE_H diff --git a/config_mgr.cpp b/config_mgr.cpp index 8d6e670..a436d2b 100644 --- a/config_mgr.cpp +++ b/config_mgr.cpp @@ -66,19 +66,24 @@ void ConfigMgr::Save(QString & file_path) { channel_item["power"] = ptr->base_config_[cid].power; channel_item["point_name"] = ptr->base_config_[cid].point_name; channel_item["chan_id"] = ptr->base_config_[cid].chan_id; + channel_item["keyphase"] = ptr->base_config_[cid].keyphase; + channel_item["keyphase_slot"] = ptr->base_config_[cid].keyphase_slot; + channel_item["keyphase_ch"] = ptr->base_config_[cid].keyphase_ch; QJsonArray voltage_range; voltage_range.append(ptr->base_config_[cid].normal_voltage_low); voltage_range.append(ptr->base_config_[cid].normal_voltage_high); channel_item["normal_voltage_range"] = voltage_range; QJsonObject setpoint_data; + if(ptr->base_config_[cid].channel_type != kVibThrust){ + setpoint_data["1x_ampl_upper"] = qRound(ptr->alert_danger[cid].x1_ampl_upper * 10)/10.0; + setpoint_data["1x_ampl_lower"] = qRound(ptr->alert_danger[cid].x1_ampl_lower * 10)/10.0; + setpoint_data["1x_ampl_enable"] = ptr->alert_danger[cid].x1_ampl_enable; + setpoint_data["2x_ampl_upper"] = qRound(ptr->alert_danger[cid].x2_ampl_upper * 10)/10.0; + setpoint_data["2x_ampl_lower"] = qRound(ptr->alert_danger[cid].x2_ampl_lower * 10)/10.0; + setpoint_data["2x_ampl_enable"] = ptr->alert_danger[cid].x2_ampl_enable; + } setpoint_data["direct_upper"] = qRound(ptr->alert_danger[cid].direct_upper * 10)/10.0; setpoint_data["direct_enable"] = ptr->alert_danger[cid].direct_enable; - setpoint_data["1x_ampl_upper"] = qRound(ptr->alert_danger[cid].x1_ampl_upper * 10)/10.0; - setpoint_data["1x_ampl_lower"] = qRound(ptr->alert_danger[cid].x1_ampl_lower * 10)/10.0; - setpoint_data["1x_ampl_enable"] = ptr->alert_danger[cid].x1_ampl_enable; - setpoint_data["2x_ampl_upper"] = qRound(ptr->alert_danger[cid].x2_ampl_upper * 10)/10.0; - setpoint_data["2x_ampl_lower"] = qRound(ptr->alert_danger[cid].x2_ampl_lower * 10)/10.0; - setpoint_data["2x_ampl_enable"] = ptr->alert_danger[cid].x2_ampl_enable; setpoint_data["danger_param"] = ptr->alert_danger[cid].danger_param; setpoint_data["danger_upper"] = qRound(ptr->alert_danger[cid].danger_upper * 10)/10.0; setpoint_data["danger_enable"] = ptr->alert_danger[cid].danger_enable; @@ -147,6 +152,51 @@ void ConfigMgr::Save(QString & file_path) { latching.append(radial_ptr->alert_latching_); latching.append(radial_ptr->danger_latching_); variables["latching"] = latching; + }else if(ptr->base_config_[cid].channel_type == kVibThrust){ + std::shared_ptr thrust_ptr = std::dynamic_pointer_cast(base_channel_ptr); + if(thrust_ptr == nullptr){ + continue; + } + // filter + QJsonArray filter; + QJsonObject low_pass; + low_pass["low"] = thrust_ptr->filter_[0].low; + low_pass["high"] = thrust_ptr->filter_[0].high; + low_pass["checked"] = thrust_ptr->filter_[0].checked; + filter.append(low_pass); + QJsonObject high_pass; + high_pass["low"] = thrust_ptr->filter_[1].low; + high_pass["high"] = thrust_ptr->filter_[1].high; + high_pass["checked"] = thrust_ptr->filter_[1].checked; + filter.append(high_pass); + QJsonObject band_pass; + band_pass["low"] = thrust_ptr->filter_[2].low; + band_pass["high"] = thrust_ptr->filter_[2].high; + band_pass["checked"] = thrust_ptr->filter_[2].checked; + filter.append(band_pass); + variables["filter"] = filter; + QJsonObject direct; + QJsonObject recorder_out; + QJsonObject delay; + QJsonArray latching; + direct["full_scale_range"] = thrust_ptr->direct_.full_scale_range; + direct["clamp_value"] = thrust_ptr->direct_.clamp_value; + direct["custom"] = thrust_ptr->direct_.custom; + variables["direct"] = direct; + recorder_out["recorder_output"] = thrust_ptr->recorder_out_.recorder_output; + recorder_out["two_ma_clamp"] = thrust_ptr->recorder_out_.two_ma_clamp; + recorder_out["trip_multiply"] = thrust_ptr->recorder_out_.trip_multiply; + recorder_out["comparision"] = thrust_ptr->recorder_out_.comparision; + recorder_out["percentage"] = thrust_ptr->recorder_out_.percentage; + variables["recorder_out"] = recorder_out; + delay["alert"] = thrust_ptr->delay_.alert; + delay["danger"] = thrust_ptr->delay_.danger; + delay["active_100ms"] = thrust_ptr->delay_.active_100ms; + variables["delay"] = delay; + latching.append(thrust_ptr->alert_latching_); + latching.append(thrust_ptr->danger_latching_); + latching.append(thrust_ptr->timed_ok_); + variables["latching"] = latching; } else { std::shared_ptr av_ptr = std::dynamic_pointer_cast(base_channel_ptr); if(av_ptr == nullptr){ @@ -380,6 +430,9 @@ void ConfigMgr::Load(QString filename) { vib_data->base_config_[j].power = channel["power"].toBool(); vib_data->base_config_[j].point_name = channel["point_name"].toString(); vib_data->base_config_[j].chan_id = channel["chan_id"].toString(); + vib_data->base_config_[j].keyphase = channel["keyphase"].toBool(); + vib_data->base_config_[j].keyphase_slot = channel["keyphase_slot"].toInt(); + vib_data->base_config_[j].keyphase_ch = channel["keyphase_ch"].toInt(); //setpoint QJsonObject setpoint_data = channel["setpoint"].toObject(); vib_data->alert_danger[j].direct_upper = setpoint_data["direct_upper"].toDouble(); @@ -439,6 +492,36 @@ void ConfigMgr::Load(QString filename) { vib_data->variables_.push_back(variable); break; } + case kVibThrust: { + std::shared_ptr variable = std::make_shared(); + // filter + QJsonArray filter_array = tmp_variable["filter"].toArray(); + for (int k = 0; k < filter_array.size(); k++) { + QJsonObject filter_ele = filter_array[k].toObject(); + variable->filter_[k].low = filter_ele["low"].toInt(); + variable->filter_[k].high = filter_ele["high"].toInt(); + variable->filter_[k].checked = filter_ele["checked"].toBool(); + } + variable->id_ = j + 1; + QJsonObject direct = tmp_variable["direct"].toObject(); + variable->direct_.full_scale_range = direct["full_scale_range"].toInt(); + variable->direct_.clamp_value = direct["clamp_value"].toDouble(); + variable->direct_.custom = direct["custom"].toDouble(); + + QJsonObject recorder_out = tmp_variable["recorder_out"].toObject(); + variable->recorder_out_.recorder_output = recorder_out["recorder_output"].toInt(); + variable->recorder_out_.two_ma_clamp = recorder_out["two_ma_clamp"].toBool(); + QJsonObject delay = tmp_variable["delay"].toObject(); + variable->delay_.alert = delay["alert"].toInt(); + variable->delay_.danger = delay["danger"].toDouble(); + variable->delay_.active_100ms = delay["active_100ms"].toBool(); + QJsonObject latching = tmp_variable["latching"].toObject(); + variable->alert_latching_ = latching["alert"].toBool(); + variable->danger_latching_ = latching["danger"].toBool(); + variable->timed_ok_ = latching["timed_ok"].toBool(); + vib_data->variables_.push_back(variable); + break; + } case kVibVelocity: case kVibAcc: { std::shared_ptr variable = std::make_shared(); diff --git a/data_config.h b/data_config.h index b76c542..6f7ef98 100644 --- a/data_config.h +++ b/data_config.h @@ -42,7 +42,9 @@ typedef enum { typedef enum { kVibRadial = 0, // 径向位移 kVibAcc = 1, // 加速度 - kVibVelocity = 2 // 速度 + kVibVelocity = 2, // 速度 + kVibThrust = 3, //轴向位移 + kVibPressurePulsation = 4 //动态压力脉动 } VibChannelType; typedef struct SlotConfig_{ @@ -122,6 +124,9 @@ typedef struct { float normal_voltage_low; float normal_voltage_high; bool power; + bool keyphase; + int keyphase_slot; + int keyphase_ch; } SeismicMonitor; typedef enum { diff --git a/mainwindow.cpp b/mainwindow.cpp index af8eb06..e48be63 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -591,17 +591,7 @@ void MainWindow::on_pushButton_save_clicked() { void MainWindow::on_pushButton_open_clicked() { - map_slot_config.clear(); - QList buttonList = btnGroup_slot->buttons(); - for (int i = 0; i < buttonList.count(); i++) { - buttonList[i]->setText(""); - } - for (int i = 0; i < SLOT_NUM; i++) { - std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(i + 1); - if(base_ptr != nullptr){ - ConfigMgr::Instance()->RemoveCard(base_ptr); - } - } + tsi_config_file = QFileDialog::getOpenFileName(this, tr("选择文件"), tr(""), tr("*.json")); QFileInfo fileinfo; fileinfo = QFileInfo(tsi_config_file); @@ -615,6 +605,16 @@ void MainWindow::on_pushButton_open_clicked() { qWarning() << "Failed to open update file."; return; } + QList buttonList = btnGroup_slot->buttons(); + for (int i = 0; i < buttonList.count(); i++) { + buttonList[i]->setText(""); + } + for (int i = 0; i < SLOT_NUM; i++) { + std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(i + 1); + if(base_ptr != nullptr){ + ConfigMgr::Instance()->RemoveCard(base_ptr); + } + } ConfigMgr::Instance()->Load(tsi_config_file); for (int i = 0; i < buttonList.count(); i++) { std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(i + 1); diff --git a/rangeslider.cpp b/rangeslider.cpp index 768004e..69e2f1b 100644 --- a/rangeslider.cpp +++ b/rangeslider.cpp @@ -10,7 +10,7 @@ RangeSlider::RangeSlider(int style_,QWidget *parent) style = style_; } -void RangeSlider::setRange(int min, int max) { +void RangeSlider::setRange(float min, float max) { m_min = min; m_max = max; m_lower = qBound(m_min, m_lower, m_max); diff --git a/rangeslider.h b/rangeslider.h index fc78427..9019fbe 100644 --- a/rangeslider.h +++ b/rangeslider.h @@ -9,7 +9,7 @@ class RangeSlider : public QWidget { public: explicit RangeSlider(int style_ = 0,QWidget *parent = nullptr); - void setRange(int min, int max); + void setRange(float min, float max); void setSliderWidth(int width); // 新增方法:设置宽度 float lowerValue() const; float upperValue() const; diff --git a/seismic_monitor.cpp b/seismic_monitor.cpp index 21dfc6a..dfc62ce 100644 --- a/seismic_monitor.cpp +++ b/seismic_monitor.cpp @@ -12,6 +12,7 @@ #include "data_config.h" #include "config_mgr.h" #include "vibrationdata.h" +#include "trust.h" Seismic_monitor::Seismic_monitor(int slot,int cardtype, QWidget *parent) : QWidget(parent), @@ -48,6 +49,7 @@ void Seismic_monitor::Init() { // ui->comboBox_transducer_name_3->addItem(vec_transducer[var].transducer_name); // ui->comboBox_transducer_name_4->addItem(vec_transducer[var].transducer_name); // } + int slot = 0; std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); if (base_ptr == nullptr) { qDebug() << "base_ptr"; @@ -59,6 +61,18 @@ void Seismic_monitor::Init() { UpdateData(vib_data); return; } + for (int i = 0; i < SLOT_NUM; ++i) { + if (ConfigMgr::Instance()->card_type_[i] == kCardNone) { + continue; + } + QJsonObject card_item; + slot = i + 1; + card_item["type"] = ConfigMgr::Instance()->card_type_[i]; + card_item["slot"] = slot; + if (ConfigMgr::Instance()->card_type_[i] == kCardKeyphaseSingle ) { + ui->comboBox_keyphase_slot->addItem(QString::number(slot)); + } + } std::shared_ptr vib_data = std::dynamic_pointer_cast(base_ptr); for (int i = 0; i < CHANNEL_COUNT; i++) { if (i + 1 == 1) { @@ -118,6 +132,9 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { 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(); + vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch->currentText().toInt(); } else if (var + 1 == 2) { vib_data->base_config_[var].standby = ui->checkBox_standby_1->isChecked(); vib_data->base_config_[var].active = ui->checkBox_enable_2->isChecked(); @@ -130,6 +147,9 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { 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(); + vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch_2->currentText().toInt(); } else if (var + 1 == 3) { vib_data->base_config_[var].standby = ui->checkBox_standby_2->isChecked(); vib_data->base_config_[var].active = ui->checkBox_enable_3->isChecked(); @@ -142,6 +162,9 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { 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(); + vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch_3->currentText().toInt(); } else if (var + 1 == 4) { vib_data->base_config_[var].standby = ui->checkBox_standby_2->isChecked(); vib_data->base_config_[var].active = ui->checkBox_enable_4->isChecked(); @@ -154,6 +177,9 @@ void Seismic_monitor::UpdateData(std::shared_ptr vib_data) { 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(); + vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch_4->currentText().toInt(); } } } @@ -189,6 +215,10 @@ void Seismic_monitor::on_pushButton_config_1_clicked() { Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_1->isChecked()); velocity->setWindowModality(Qt::ApplicationModal); velocity->show(); + }else if (ui->comboBox_chan_type_1->currentIndex() == kVibThrust) { + Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_1->isChecked()); + trust->setWindowModality(Qt::ApplicationModal); + trust->show(); } } @@ -206,6 +236,10 @@ void Seismic_monitor::on_pushButton_config_2_clicked() { Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_2->isChecked()); velocity->setWindowModality(Qt::ApplicationModal); velocity->show(); + }else if (ui->comboBox_chan_type_2->currentIndex() == kVibThrust) { + Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_1->isChecked()); + trust->setWindowModality(Qt::ApplicationModal); + trust->show(); } } @@ -223,6 +257,10 @@ void Seismic_monitor::on_pushButton_config_3_clicked() { Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_3->isChecked()); velocity->setWindowModality(Qt::ApplicationModal); velocity->show(); + }else if (ui->comboBox_chan_type_3->currentIndex() == kVibThrust) { + Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_1->isChecked()); + trust->setWindowModality(Qt::ApplicationModal); + trust->show(); } } @@ -240,6 +278,10 @@ void Seismic_monitor::on_pushButton_config_4_clicked() { Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_4->isChecked()); velocity->setWindowModality(Qt::ApplicationModal); velocity->show(); + }else if (ui->comboBox_chan_type_4->currentIndex() == kVibThrust) { + Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_1->isChecked()); + trust->setWindowModality(Qt::ApplicationModal); + trust->show(); } } @@ -254,6 +296,9 @@ void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString & case kVibVelocity: ui->label_unit_1->setText("mV / mm/s"); break; + case kVibThrust: + ui->label_unit_1->setText("mV / mil"); + break; } } @@ -268,6 +313,9 @@ void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString & case kVibVelocity: ui->label_unit_2->setText("mV / mm/s"); break; + case kVibThrust: + ui->label_unit_2->setText("mV / mil"); + break; } } @@ -282,6 +330,9 @@ void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString & case kVibVelocity: ui->label_unit_3->setText("mV / mm/s"); break; + case kVibThrust: + ui->label_unit_3->setText("mV / mil"); + break; } } @@ -296,6 +347,9 @@ void Seismic_monitor::on_comboBox_chan_type_4_currentTextChanged(const QString & case kVibVelocity: ui->label_unit_4->setText("mV / mm/s"); break; + case kVibThrust: + ui->label_unit_4->setText("mV / mil"); + break; } } @@ -334,3 +388,45 @@ void Seismic_monitor::on_comboBox_transducer_name_4_currentTextChanged(const QSt } } } +void Seismic_monitor::EnableKeyphase(){ + ui->checkBox_keyphase->setCheckable(true); + ui->checkBox_keyphase->setEnabled(true); + ui->comboBox_keyphase_ch->setEnabled(true); + ui->comboBox_keyphase_slot->setEnabled(true); + + ui->checkBox_keyphase_2->setCheckable(true); + ui->checkBox_keyphase_2->setEnabled(true); + ui->comboBox_keyphase_ch_2->setEnabled(true); + ui->comboBox_keyphase_slot_2->setEnabled(true); + + ui->checkBox_keyphase_3->setCheckable(true); + ui->checkBox_keyphase_3->setEnabled(true); + ui->comboBox_keyphase_ch_3->setEnabled(true); + ui->comboBox_keyphase_slot_3->setEnabled(true); + + ui->checkBox_keyphase_4->setCheckable(true); + ui->checkBox_keyphase_4->setEnabled(true); + ui->comboBox_keyphase_ch_4->setEnabled(true); + ui->comboBox_keyphase_slot_4->setEnabled(true); +} +void Seismic_monitor::DisableKeyphase(){ + ui->checkBox_keyphase->setCheckable(false); + ui->checkBox_keyphase->setEnabled(false); + ui->comboBox_keyphase_ch->setEnabled(false); + ui->comboBox_keyphase_slot->setEnabled(false); + + ui->checkBox_keyphase_2->setCheckable(false); + ui->checkBox_keyphase_2->setEnabled(false); + ui->comboBox_keyphase_ch_2->setEnabled(false); + ui->comboBox_keyphase_slot_2->setEnabled(false); + + ui->checkBox_keyphase_3->setCheckable(false); + ui->checkBox_keyphase_3->setEnabled(false); + ui->comboBox_keyphase_ch_3->setEnabled(false); + ui->comboBox_keyphase_slot_3->setEnabled(false); + + ui->checkBox_keyphase_4->setCheckable(false); + ui->checkBox_keyphase_4->setEnabled(false); + ui->comboBox_keyphase_ch_4->setEnabled(false); + ui->comboBox_keyphase_slot_4->setEnabled(false); +} diff --git a/seismic_monitor.h b/seismic_monitor.h index 12638b7..c97ae69 100644 --- a/seismic_monitor.h +++ b/seismic_monitor.h @@ -57,6 +57,8 @@ class Seismic_monitor : public QWidget { // SeismicMonitor seismic_monitor[CHANNLE_COUNT]; QVector vec_transducer; void Init(); + void EnableKeyphase(); + void DisableKeyphase(); }; #endif // SEISMIC_MONITOR_H diff --git a/seismic_monitor.ui b/seismic_monitor.ui index e6ee6af..7989d29 100644 --- a/seismic_monitor.ui +++ b/seismic_monitor.ui @@ -7,7 +7,7 @@ 0 0 862 - 544 + 580 @@ -61,7 +61,7 @@ 10 - 500 + 530 844 37 @@ -178,7 +178,7 @@ - 390 + 420 203 52 75 @@ -228,8 +228,8 @@ 40 40 - 331 - 441 + 361 + 471 @@ -239,7 +239,7 @@ 10 - 340 + 380 120 80 @@ -281,7 +281,7 @@ 200 - 340 + 380 120 81 @@ -324,8 +324,8 @@ 10 50 - 311 - 268 + 333 + 328 @@ -347,850 +347,958 @@ 通道1 - - - - 9 - 150 - 288 - 80 - - - - - 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 - - - - - - - - - - - 1 - 0 - 266 - 136 - - - - - - - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 位移 + + + + + + + + + + 90 + 0 + - - - 加速度 + 类 型: - - - - 速度 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + 径向位移 + + + + + 加速度 + + + + + 速度 + + + + + 轴向位移 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 90 + 0 + - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - xxx - - + 传感器名称: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + xxx + + + xxx + + + + + yyy + + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + + + + + + 90 + 0 + + + + 灵敏度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 10000.000000000000000 + + + 8.000000000000000 + + + + + + + v/mm + + + + + + + + + + + + 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 + + + + + + + + + + + + 键相 + + + + + + + + 键相 + + - - yyy - + + + 槽位: + + - - - - - - Qt::Horizontal - - - - 20 - 20 - - - + + + + + + + 通道: + + + + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + - - - + + + + + + + 220 + 80 + + + + 电压范围 + + - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + 上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + V + + + + - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - + + + + + + 80 + 0 + + + + 下限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + -25.000000000000000 + + + + + + + V + + + + - - - - - - - - 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 - - - - - - - - + + + 通道2 - - - - 9 - 150 - 288 - 80 - - - - - 220 - 80 - - - - 电压范围 - - - - + + + + + + + + + + 90 + 0 + + + + 类 型: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + 径向位移 + + + + + 加速度 + + + + + 速度 + + + + + 轴向位移 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 90 + 0 + + + + 传感器名称: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + xxx + + + + + yyy + + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + + + + + + 90 + 0 + + + + 灵敏度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 10000.000000000000000 + + + 8.000000000000000 + + + + + + + v/mm + + + + + + + + + + + + 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 + + + + + + + + + + + + 键相 + + - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 上限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - 25.000000000000000 - - - - - - - V - - + + + + + 键相 + + + + + + + 槽位: + + + + + + + + + + 通道: + + + + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + - - - + + + + + + + 220 + 80 + + + + 电压范围 + + - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 下限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + V + + + + - - - - 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 - 0 - 266 - 136 - - - - - - - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 位移 - - - - - 加速度 - - - - - 速度 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - xxx - - - - - yyy - - - - - - - - Qt::Horizontal - - - - 20 - 20 - - - - - - - - - - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - - - - - - - - - - - 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 - - - - - - - - + + + @@ -1210,7 +1318,7 @@ 140 - 350 + 390 52 75 @@ -1263,10 +1371,10 @@ - 460 + 500 40 331 - 441 + 471 @@ -1276,7 +1384,7 @@ 10 - 340 + 380 120 80 @@ -1318,7 +1426,7 @@ 200 - 340 + 380 120 80 @@ -1361,8 +1469,8 @@ 10 50 - 312 - 271 + 333 + 328 @@ -1384,829 +1492,937 @@ 通道3 - - - - 9 - 150 - 288 - 80 - - - - - 220 - 80 - - - - 电压范围 - - - - + + + + + + + + + + 90 + 0 + + + + 类 型: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + 径向位移 + + + + + 加速度 + + + + + 速度 + + + + + 轴向位移 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 90 + 0 + + + + 传感器名称: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + xxx + + + + + yyy + + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + + + + + + 90 + 0 + + + + 灵敏度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 10000.000000000000000 + + + 8.000000000000000 + + + + + + + v/mm + + + + + + + + + + + + 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 + + + + + + + + + + + + 键相 + + - - - - 80 - 0 - - - - 上限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - 25.000000000000000 - - - - - - - V - - + + + + + 键相 + + + + + + + 槽位: + + + + + + + + + + 通道: + + + + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + - - - + + + + + + + 220 + 80 + + + + 电压范围 + + - - - - 80 - 0 - - - - 下限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + 上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + V + + + + - - - - 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 + + + + - - - - - - - 1 - 1 - 266 - 136 - - - - - - - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 位移 - - - - - 加速度 - - - - - 速度 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - xxx - - - - - yyy - - - - - - - - Qt::Horizontal - - - - 20 - 20 - - - - - - - - - - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - - - - - - - - - - - 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 - - - - - - - - + + + 通道4 - - - - 9 - 150 - 288 - 80 - - - - - 220 - 80 - - - - 电压范围 - - - - + + + + + + + + + + 90 + 0 + + + + 类 型: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + 径向位移 + + + + + 加速度 + + + + + 速度 + + + + + 轴向位移 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 90 + 0 + + + + 传感器名称: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + xxx + + + + + yyy + + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + + + + + + 90 + 0 + + + + 灵敏度: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 10000.000000000000000 + + + 8.000000000000000 + + + + + + + v/mm + + + + + + + + + + + + 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 + + + + + + + + + + + + 键相 + + - - - - 80 - 0 - - - - 上限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 1 - - - -100.000000000000000 - - - 25.000000000000000 - - - - - - - V - - + + + + + 键相 + + + + + + + 槽位: + + + + + + + + + + 通道: + + + + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + - - - + + + + + + + 220 + 80 + + + + 电压范围 + + - - - - 80 - 0 - - - - 下限: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + 上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 1 + + + -100.000000000000000 + + + 25.000000000000000 + + + + + + + V + + + + - - - - 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 + + + + - - - - - - - 1 - 1 - 266 - 136 - - - - - - - - - - 90 - 0 - - - - 类 型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - 位移 - - - - - 加速度 - - - - - 速度 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 90 - 0 - - - - 传感器名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - xxx - - - - - yyy - - - - - - - - Qt::Horizontal - - - - 20 - 20 - - - - - - - - - - - - - 90 - 0 - - - - 灵敏度: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10000.000000000000000 - - - 8.000000000000000 - - - - - - - v/mm - - - - - - - - - - - - 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 - - - - - - - - + + + @@ -2226,7 +2442,7 @@ 140 - 352 + 392 52 75 diff --git a/setpoint.cpp b/setpoint.cpp index b5d6822..591a014 100644 --- a/setpoint.cpp +++ b/setpoint.cpp @@ -191,6 +191,45 @@ void Setpoint::update() ui->label_direct->setText("um"); ui->label_danger->setText("um"); + } + if(setpoint_data->base_config_[chan].channel_type == kVibThrust){ + ui->label_27->hide(); + ui->label_1x->hide(); + ui->lineEdit_1x_ampl_upper->hide(); + ui->widget_1x_ampl->hide(); + ui->lineEdit_1x_ampl_lower->hide(); + ui->checkBox_1x_ampl->hide(); + + ui->label_32->hide(); + ui->label_2x->hide(); + ui->lineEdit_2x_ampl_upper->hide(); + ui->widget_2x_ampl->hide(); + ui->lineEdit_2x_ampl_lower->hide(); + ui->checkBox_2x_ampl->hide(); + ui->label_direct->setText("mil"); + ui->label_danger->setText("mil"); + if(variable_[chan]->direct_.full_scale_range == 0){ + slider_direct->setRange(-25,25); + slider_danger->setRange(-25,25); + }else if(variable_[chan]->direct_.full_scale_range == 1){ + slider_direct->setRange(-30,30); + slider_danger->setRange(-30,30); + }else if(variable_[chan]->direct_.full_scale_range == 2){ + slider_direct->setRange(-40,40); + slider_danger->setRange(-40,40); + }else if(variable_[chan]->direct_.full_scale_range == 3){ + ui->label_direct->setText("mm"); + ui->label_danger->setText("mm"); + slider_direct->setRange(-0.5,0.5); + slider_danger->setRange(-0.5,0.5); + }else if(variable_[chan]->direct_.full_scale_range == 4){ + ui->label_direct->setText("mm"); + ui->label_danger->setText("mm"); + slider_direct->setRange(-1,1); + slider_danger->setRange(-1,1); + } + + } if(setpoint_data->base_config_[chan].channel_type == kVibAcc){ std::shared_ptr base_channel_ptr = setpoint_data->GetChannelPtr(chan + 1);