Compare commits

...

3 Commits

14 changed files with 706 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

@ -593,10 +593,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;
@ -523,6 +524,7 @@ typedef struct SingleRelayS_{
} SingleRelayS;
typedef struct SingleRelayNOK_{
QString point_name;
QString logic_expression;
bool active;
int group;
@ -538,6 +540,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;

14
pointname_relay.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "pointname_relay.h"
#include "ui_pointname_relay.h"
PointNameRelay::PointNameRelay(QWidget *parent) :
QWidget(parent),
ui(new Ui::PointNameRelay)
{
ui->setupUi(this);
}
PointNameRelay::~PointNameRelay()
{
delete ui;
}

22
pointname_relay.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef POINTNAME_RELAY_H
#define POINTNAME_RELAY_H
#include <QWidget>
namespace Ui {
class PointNameRelay;
}
class PointNameRelay : public QWidget
{
Q_OBJECT
public:
explicit PointNameRelay(QWidget *parent = nullptr);
~PointNameRelay();
private:
Ui::PointNameRelay *ui;
};
#endif // POINTNAME_RELAY_H

631
pointname_relay.ui Normal file
View File

@ -0,0 +1,631 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PointNameRelay</class>
<widget class="QWidget" name="PointNameRelay">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>742</width>
<height>495</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>30</x>
<y>60</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>通道1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_1"/>
</item>
</layout>
</widget>
<widget class="QPushButton" name="pushButton_cancel">
<property name="geometry">
<rect>
<x>350</x>
<y>430</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget_2">
<property name="geometry">
<rect>
<x>30</x>
<y>140</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>通道3</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_3"/>
</item>
</layout>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>槽位号:</string>
</property>
</widget>
<widget class="QLabel" name="label_slot">
<property name="geometry">
<rect>
<x>90</x>
<y>20</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>slot</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_confirm">
<property name="geometry">
<rect>
<x>210</x>
<y>430</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget_3">
<property name="geometry">
<rect>
<x>30</x>
<y>100</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>通道2</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_2"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_4">
<property name="geometry">
<rect>
<x>30</x>
<y>180</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>通道4</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_4"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_5">
<property name="geometry">
<rect>
<x>30</x>
<y>220</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>通道5</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_5"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_6">
<property name="geometry">
<rect>
<x>30</x>
<y>260</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>通道6</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_6"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_7">
<property name="geometry">
<rect>
<x>30</x>
<y>300</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>通道7</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_7"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_8">
<property name="geometry">
<rect>
<x>30</x>
<y>340</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>通道8</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_8"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_9">
<property name="geometry">
<rect>
<x>380</x>
<y>60</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>通道9</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_9"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_10">
<property name="geometry">
<rect>
<x>380</x>
<y>100</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>通道10</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_10"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_11">
<property name="geometry">
<rect>
<x>380</x>
<y>140</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>通道11</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_11"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_12">
<property name="geometry">
<rect>
<x>380</x>
<y>180</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>通道12</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_12"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_13">
<property name="geometry">
<rect>
<x>380</x>
<y>220</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QLabel" name="label_14">
<property name="text">
<string>通道13</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_13"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_14">
<property name="geometry">
<rect>
<x>380</x>
<y>260</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>通道14</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_14"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_15">
<property name="geometry">
<rect>
<x>380</x>
<y>300</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="label_16">
<property name="text">
<string>通道15</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_15"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_16">
<property name="geometry">
<rect>
<x>380</x>
<y>340</y>
<width>281</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>通道16</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_16">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_pointname_16"/>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

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>