add point name

This commit is contained in:
DESKTOP-7I8SUIC\zhang 2025-08-15 14:40:25 +08:00
parent 88cb93b261
commit a9a951326e
4 changed files with 130 additions and 118 deletions

View File

@ -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 ){

View File

@ -412,6 +412,7 @@ typedef struct {
} TachometerVariables;
typedef struct {
QString point_name;
bool active;
float normal_voltage_low;
float normal_voltage_high;

View File

@ -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<KeyphaseData> keyphase_data = std::dynamic_pointer_cast<KeyphaseData>(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();
}

View File

@ -111,7 +111,7 @@
</size>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -993,15 +993,18 @@
<attribute name="title">
<string>通道1-通道2</string>
</attribute>
<widget class="QComboBox" name="comboBox">
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<width>180</width>
<height>22</height>
<width>218</width>
<height>23</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QComboBox" name="comboBox">
<property name="minimumSize">
<size>
<width>180</width>
@ -1045,19 +1048,16 @@
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>220</x>
<y>60</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>函数</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
@ -1292,7 +1292,7 @@
</size>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
@ -2174,15 +2174,18 @@
<attribute name="title">
<string>通道3-通道4</string>
</attribute>
<widget class="QComboBox" name="comboBox_2">
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<width>180</width>
<height>22</height>
<width>218</width>
<height>23</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_22">
<item>
<widget class="QComboBox" name="comboBox_2">
<property name="minimumSize">
<size>
<width>180</width>
@ -2226,19 +2229,16 @@
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>220</x>
<y>60</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>函数</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>