添加键相测点名称

This commit is contained in:
DESKTOP-7I8SUIC\zhang 2025-12-08 17:14:23 +08:00
parent ce6c066532
commit 88c2a30e95
11 changed files with 39 additions and 26 deletions

View File

@ -28,6 +28,7 @@ SOURCES += \
mainwindow.cpp \
mqtt_config.cpp \
pointname.cpp \
pointname_relay.cpp \
pressure_pulsation.cpp \
radial_vibration.cpp \
rangeslider.cpp \
@ -67,6 +68,7 @@ HEADERS += \
mainwindow.h \
mqtt_config.h \
pointname.h \
pointname_relay.h \
pressure_pulsation.h \
radial_vibration.h \
rangeslider.h \
@ -100,6 +102,7 @@ FORMS += \
mainwindow.ui \
mqtt_config.ui \
pointname.ui \
pointname_relay.ui \
pressure_pulsation.ui \
radial_vibration.ui \
relaysetting.ui \

View File

@ -107,7 +107,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -127,7 +127,7 @@
<item>
<widget class="QCheckBox" name="checkBox_high_pass">
<property name="text">
<string>高通</string>
<string>带通1</string>
</property>
</widget>
</item>
@ -218,7 +218,7 @@
<item>
<widget class="QCheckBox" name="checkBox_low_pass">
<property name="text">
<string>低通</string>
<string>带通2</string>
</property>
</widget>
</item>
@ -288,7 +288,7 @@
<item>
<widget class="QCheckBox" name="checkBox_band_pass">
<property name="text">
<string>带通:</string>
<string>带通3</string>
</property>
</widget>
</item>

View File

@ -592,10 +592,11 @@ void ConfigMgr::Save(QString & file_path) {
qDebug() << "ch" << ch << ptr->single_relay[ch].logic_expression;
channel_item.insert("logic_expression", ptr->single_relay[ch].logic_expression);
channel_item.insert("vote",ptr->single_relay[ch].vote);
channel_item.insert("active", ptr->single_relay[ch].active);
channel_item.insert("group",ptr->single_relay[ch].group);
}
}
channel_item.insert("active", ptr->single_relay[ch].active);
channel_item.insert("group",ptr->single_relay[ch].group);
}else if(card_type_[i] == kCardRelaySingleNOK){
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot);
if (base_ptr == nullptr) {

View File

@ -508,6 +508,7 @@ typedef struct SpeedAlert_{
} SpeedAlert;
typedef struct SingleRelayS_{
QString point_name;
QString logic_expression;
bool active;
int group;
@ -522,6 +523,7 @@ typedef struct SingleRelayS_{
} SingleRelayS;
typedef struct SingleRelayNOK_{
QString point_name;
QString logic_expression;
bool active;
int group;
@ -536,6 +538,7 @@ typedef struct SingleRelayNOK_{
} SingleRelayNOK;
typedef struct TMRRelay_{
QString point_name;
QString logic_expression;
TMRRelay_(){
logic_expression = "";

View File

@ -545,7 +545,7 @@ void MainWindow::OnButtonGroup(QAbstractButton *slot_btn) {
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(button_id);
if(base_ptr == nullptr)
return;
PointName *point_name = new PointName(button_id,ConfigMgr::Instance()->card_type_[button_id - 1]);
PointName *point_name = new PointName(button_id,map_slot_config[button_id].card_type);
point_name->setWindowModality(Qt::ApplicationModal);
point_name->show();
}

View File

@ -5,13 +5,13 @@
#include "tachometer_data.h"
#include "keyphase_data.h"
PointName::PointName(int slot_no_,int cardtype,QWidget *parent) :
PointName::PointName(int slot_no_,CardType cardtype,QWidget *parent) :
QWidget(parent),
ui(new Ui::PointName)
{
ui->setupUi(this);
slot_no = slot_no_;
car_type = static_cast<CardType>(cardtype);
car_type = cardtype;
ui->label_slot->setText(QString::number(slot_no));
Init();
}
@ -40,6 +40,12 @@ void PointName::Init()
ui->lineEdit_pointname_2->setText(tac_data->variables_[1].point_name);
ui->lineEdit_pointname_3->setText(tac_data->variables_[2].point_name);
ui->lineEdit_pointname_4->setText(tac_data->variables_[3].point_name);
}else if(base_ptr->card_type_ == kCardKeyphaseSingle){
std::shared_ptr<KeyphaseData> keyphase_data = std::dynamic_pointer_cast<KeyphaseData>(base_ptr);
ui->lineEdit_pointname_1->setText(keyphase_data->variables_[0].point_name);
ui->lineEdit_pointname_2->setText(keyphase_data->variables_[1].point_name);
ui->lineEdit_pointname_3->setText(keyphase_data->variables_[2].point_name);
ui->lineEdit_pointname_4->setText(keyphase_data->variables_[3].point_name);
}
}

View File

@ -13,7 +13,7 @@ class PointName : public QWidget
Q_OBJECT
public:
explicit PointName(int slot_no_,int cardtype,QWidget *parent = nullptr);
explicit PointName(int slot_no_,CardType cardtype,QWidget *parent = nullptr);
~PointName();
int slot_no;
CardType car_type;

View File

@ -98,7 +98,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -118,7 +118,7 @@
<item>
<widget class="QCheckBox" name="checkBox_high_pass">
<property name="text">
<string>高通</string>
<string>带通1</string>
</property>
</widget>
</item>
@ -209,7 +209,7 @@
<item>
<widget class="QCheckBox" name="checkBox_low_pass">
<property name="text">
<string>低通</string>
<string>带通2</string>
</property>
</widget>
</item>
@ -279,7 +279,7 @@
<item>
<widget class="QCheckBox" name="checkBox_band_pass">
<property name="text">
<string>带通:</string>
<string>带通3</string>
</property>
</widget>
</item>

View File

@ -98,7 +98,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_5">
<attribute name="title">
@ -118,7 +118,7 @@
<item>
<widget class="QCheckBox" name="checkBox_high_pass">
<property name="text">
<string>高通</string>
<string>带通1</string>
</property>
</widget>
</item>
@ -203,7 +203,7 @@
<item>
<widget class="QCheckBox" name="checkBox_low_pass">
<property name="text">
<string>低通</string>
<string>带通2</string>
</property>
</widget>
</item>
@ -273,7 +273,7 @@
<item>
<widget class="QCheckBox" name="checkBox_band_pass">
<property name="text">
<string>带通:</string>
<string>带通3</string>
</property>
</widget>
</item>

View File

@ -98,7 +98,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_5">
<attribute name="title">
@ -118,7 +118,7 @@
<item>
<widget class="QCheckBox" name="checkBox_high_pass">
<property name="text">
<string>高通</string>
<string>带通1</string>
</property>
</widget>
</item>
@ -203,7 +203,7 @@
<item>
<widget class="QCheckBox" name="checkBox_low_pass">
<property name="text">
<string>低通</string>
<string>带通2</string>
</property>
</widget>
</item>
@ -273,7 +273,7 @@
<item>
<widget class="QCheckBox" name="checkBox_band_pass">
<property name="text">
<string>带通:</string>
<string>带通3</string>
</property>
</widget>
</item>

View File

@ -98,7 +98,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_5">
<attribute name="title">
@ -118,7 +118,7 @@
<item>
<widget class="QCheckBox" name="checkBox_high_pass">
<property name="text">
<string>高通</string>
<string>带通1</string>
</property>
</widget>
</item>
@ -209,7 +209,7 @@
<item>
<widget class="QCheckBox" name="checkBox_low_pass">
<property name="text">
<string>低通</string>
<string>带通2</string>
</property>
</widget>
</item>
@ -279,7 +279,7 @@
<item>
<widget class="QCheckBox" name="checkBox_band_pass">
<property name="text">
<string>带通:</string>
<string>带通3</string>
</property>
</widget>
</item>