From a9a951326eb271d4d1f1622f70cefaeca2b39f35 Mon Sep 17 00:00:00 2001 From: "DESKTOP-7I8SUIC\\zhang" Date: Fri, 15 Aug 2025 14:40:25 +0800 Subject: [PATCH] add point name --- config_mgr.cpp | 4 + data_config.h | 1 + pointname.cpp | 7 ++ seismic_monitor.ui | 236 ++++++++++++++++++++++----------------------- 4 files changed, 130 insertions(+), 118 deletions(-) diff --git a/config_mgr.cpp b/config_mgr.cpp index 27a309d..744e0ab 100644 --- a/config_mgr.cpp +++ b/config_mgr.cpp @@ -458,6 +458,8 @@ void ConfigMgr::Save(QString & file_path) { channel_item.insert("hysteresis", ptr->variables_[cid].hysteresis); channel_item.insert("events_per_revolution", ptr->variables_[cid].events_per_revolution); channel_item.insert("automatic_threshold",ptr->variables_[cid].automatic_threshold); + channel_item.insert("point_name",ptr->variables_[cid].point_name); + } slot_item[QString::number(cid + 1)] = channel_item; slot_item["dc_output"] = dc_output; @@ -919,6 +921,8 @@ void ConfigMgr::Load(QString filename) { keyphase_data->variables_[j].hysteresis = channel["hysteresis"].toDouble(); keyphase_data->variables_[j].events_per_revolution = channel["events_per_revolution"].toInt(); keyphase_data->variables_[j].automatic_threshold = channel["automatic_threshold"].toBool(); + keyphase_data->variables_[j].point_name = channel["point_name"].toString(); + } cards_.push_back(keyphase_data); }else if (card_type_[i] == kCardRelaySingle ){ diff --git a/data_config.h b/data_config.h index 2aa5d38..35aa465 100644 --- a/data_config.h +++ b/data_config.h @@ -412,6 +412,7 @@ typedef struct { } TachometerVariables; typedef struct { + QString point_name; bool active; float normal_voltage_low; float normal_voltage_high; diff --git a/pointname.cpp b/pointname.cpp index 48db0e6..685d410 100644 --- a/pointname.cpp +++ b/pointname.cpp @@ -3,6 +3,7 @@ #include "config_mgr.h" #include "vibrationdata.h" #include "tachometer_data.h" +#include "keyphase_data.h" PointName::PointName(int slot_no_,int cardtype,QWidget *parent) : QWidget(parent), @@ -66,6 +67,12 @@ void PointName::on_pushButton_confirm_clicked() tac_data->variables_[1].point_name = ui->lineEdit_pointname_2->text(); tac_data->variables_[2].point_name = ui->lineEdit_pointname_3->text(); tac_data->variables_[3].point_name = ui->lineEdit_pointname_4->text(); + }else if(base_ptr->card_type_ == kCardKeyphaseSingle){ + std::shared_ptr keyphase_data = std::dynamic_pointer_cast(base_ptr); + keyphase_data->variables_[0].point_name = ui->lineEdit_pointname_1->text(); + keyphase_data->variables_[1].point_name = ui->lineEdit_pointname_2->text(); + keyphase_data->variables_[2].point_name = ui->lineEdit_pointname_3->text(); + keyphase_data->variables_[3].point_name = ui->lineEdit_pointname_4->text(); } this->close(); } diff --git a/seismic_monitor.ui b/seismic_monitor.ui index da11401..24b4011 100644 --- a/seismic_monitor.ui +++ b/seismic_monitor.ui @@ -111,7 +111,7 @@ - 0 + 2 @@ -993,70 +993,70 @@ 通道1-通道2 - + 20 50 - 180 - 22 + 218 + 23 - - - 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 - - - - 函数 - + + + + + + 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 + + + + + + + + 函数 + + + + @@ -1292,7 +1292,7 @@ - 0 + 2 @@ -2174,70 +2174,70 @@ 通道3-通道4 - + 20 50 - 180 - 22 + 218 + 23 - - - 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 - - - - 函数 - + + + + + + 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 + + + + + + + + 函数 + + + +