This commit is contained in:
zhangsheng 2025-04-27 10:05:00 +08:00
parent ac2f1ee8ec
commit e71d0abfe8
16 changed files with 1259 additions and 0 deletions

49
ethconfig.cpp Normal file
View File

@ -0,0 +1,49 @@
#include "ethconfig.h"
#include "ui_ethconfig.h"
#include <QRegularExpression>
#include <QRegularExpressionValidator>
EthConfig::EthConfig(QWidget *parent) :
QWidget(parent),
ui(new Ui::EthConfig)
{
ui->setupUi(this);
QRegularExpression ipRegex(R"(^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$)");
QRegularExpressionValidator *ipValidator = new QRegularExpressionValidator(ipRegex, this);
ui->lineEdit_IP->setValidator(ipValidator);
ui->lineEdit_netmask->setValidator(ipValidator);
ui->lineEdit_gw->setValidator(ipValidator);
}
EthConfig::~EthConfig()
{
delete ui;
}
void EthConfig::on_pushButton_confirm_clicked()
{
PackageHead header = { {0xAA, 0x55, 0xAA}, kRebootCard, sizeof(ConfigIPv4Req),0,{} };
ConfigIPv4Req config_ip;
config_ip.ethn = ui->comboBox_eth->currentIndex();
memcpy(config_ip.ip,ui->lineEdit_IP->text().toStdString().c_str(),sizeof(config_ip.ip));
memcpy(config_ip.netmask,ui->lineEdit_netmask->text().toStdString().c_str(),sizeof(config_ip.netmask));
memcpy(config_ip.gw,ui->lineEdit_gw->text().toStdString().c_str(),sizeof(config_ip.gw));
char send_buf[100] ={0};
memcpy(send_buf, (char*)&header, sizeof(PackageHead));
memcpy(send_buf + sizeof(PackageHead), (char*)&config_ip, sizeof(ConfigIPv4Req));
int length = sizeof(PackageHead) + sizeof(ConfigIPv4Req);
qint64 bytesWritten = m_tcpClient->sendData(send_buf, length);
m_tcpClient->waitForRead();
qDebug() << "bytesWritten: " << bytesWritten;
this->close();
}
void EthConfig::on_pushButton_cancel_clicked()
{
this->close();
}

30
ethconfig.h Normal file
View File

@ -0,0 +1,30 @@
#ifndef ETHCONFIG_H
#define ETHCONFIG_H
#include <QWidget>
#include "MyTcpClient.h"
namespace Ui {
class EthConfig;
}
class EthConfig : public QWidget
{
Q_OBJECT
public:
explicit EthConfig(QWidget *parent = nullptr);
~EthConfig();
private slots:
void on_pushButton_confirm_clicked();
void on_pushButton_cancel_clicked();
private:
Ui::EthConfig *ui;
MyTcpClient* m_tcpClient;
};
#endif // ETHCONFIG_H

165
ethconfig.ui Normal file
View File

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EthConfig</class>
<widget class="QWidget" name="EthConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>361</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>以太网配置</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>60</x>
<y>40</y>
<width>54</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>以太网:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QComboBox" name="comboBox_eth">
<property name="geometry">
<rect>
<x>130</x>
<y>40</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<item>
<property name="text">
<string>eth1</string>
</property>
</item>
<item>
<property name="text">
<string>eth2</string>
</property>
</item>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>60</x>
<y>90</y>
<width>54</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>IP</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>33</x>
<y>120</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>子网掩码:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>60</x>
<y>150</y>
<width>54</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>网关:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_IP">
<property name="geometry">
<rect>
<x>130</x>
<y>90</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_netmask">
<property name="geometry">
<rect>
<x>130</x>
<y>120</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_gw">
<property name="geometry">
<rect>
<x>130</x>
<y>150</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_confirm">
<property name="geometry">
<rect>
<x>60</x>
<y>222</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_cancel">
<property name="geometry">
<rect>
<x>170</x>
<y>222</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

42
macconfig.cpp Normal file
View File

@ -0,0 +1,42 @@
#include "macconfig.h"
#include "ui_macconfig.h"
#include <QRegularExpression>
#include <QRegularExpressionValidator>
MacConfig::MacConfig(QWidget *parent) :
QWidget(parent),
ui(new Ui::MacConfig)
{
ui->setupUi(this);
QRegularExpression macRegex("^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$");
QRegularExpressionValidator *macValidator = new QRegularExpressionValidator(macRegex, this);
ui->lineEdit_mac->setValidator(macValidator);
}
MacConfig::~MacConfig()
{
delete ui;
}
void MacConfig::on_pushButton_confirm_clicked()
{
PackageHead header = { {0xAA, 0x55, 0xAA}, kConfigMac, sizeof(ConfigMacReq),0,{} };
ConfigMacReq config_mac;
memcpy(config_mac.mac,ui->lineEdit_mac->text().toStdString().c_str(),sizeof(config_mac.mac));
char send_buf[20] ={0};
memcpy(send_buf, (char*)&header, sizeof(PackageHead));
memcpy(send_buf + sizeof(PackageHead), (char*)&config_mac, sizeof(ConfigMacReq));
int length = sizeof(PackageHead) + sizeof(ConfigMacReq);
qint64 bytesWritten = m_tcpClient->sendData(send_buf, length);
m_tcpClient->waitForRead();
qDebug() << "bytesWritten: " << bytesWritten;
this->close();
}
void MacConfig::on_pushButton_cancel_clicked()
{
this->close();
}

29
macconfig.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef MACCONFIG_H
#define MACCONFIG_H
#include <QWidget>
#include "MyTcpClient.h"
namespace Ui {
class MacConfig;
}
class MacConfig : public QWidget
{
Q_OBJECT
public:
explicit MacConfig(QWidget *parent = nullptr);
~MacConfig();
private slots:
void on_pushButton_confirm_clicked();
void on_pushButton_cancel_clicked();
private:
Ui::MacConfig *ui;
MyTcpClient* m_tcpClient;
};
#endif // MACCONFIG_H

74
macconfig.ui Normal file
View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MacConfig</class>
<widget class="QWidget" name="MacConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>mac配置</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>50</x>
<y>80</y>
<width>54</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>MAC:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_mac">
<property name="geometry">
<rect>
<x>120</x>
<y>80</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_confirm">
<property name="geometry">
<rect>
<x>50</x>
<y>212</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_cancel">
<property name="geometry">
<rect>
<x>160</x>
<y>212</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

56
pointname.cpp Normal file
View File

@ -0,0 +1,56 @@
#include "pointname.h"
#include "ui_pointname.h"
#include "config_mgr.h"
#include "vibrationdata.h"
PointName::PointName(int slot_no_,int cardtype,QWidget *parent) :
QWidget(parent),
ui(new Ui::PointName)
{
ui->setupUi(this);
slot_no = slot_no_;
car_type = static_cast<CardType>(cardtype);
ui->label_slot->setText(QString::number(slot_no));
Init();
}
PointName::~PointName()
{
delete ui;
}
void PointName::Init()
{
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
if (base_ptr == nullptr) {
return;
}
std::shared_ptr<VibrationData> vib_data = std::dynamic_pointer_cast<VibrationData>(base_ptr);
ui->lineEdit_pointname_1->setText(vib_data->base_config_[0].point_name);
ui->lineEdit_pointname_2->setText(vib_data->base_config_[1].point_name);
ui->lineEdit_pointname_3->setText(vib_data->base_config_[2].point_name);
ui->lineEdit_pointname_4->setText(vib_data->base_config_[3].point_name);
}
void PointName::on_pushButton_cancel_clicked()
{
this->close();
}
void PointName::on_pushButton_confirm_clicked()
{
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
if (base_ptr == nullptr) {
return;
}
std::shared_ptr<VibrationData> vib_data = std::dynamic_pointer_cast<VibrationData>(base_ptr);
vib_data->base_config_[0].point_name = ui->lineEdit_pointname_1->text();
vib_data->base_config_[1].point_name = ui->lineEdit_pointname_2->text();
vib_data->base_config_[2].point_name = ui->lineEdit_pointname_3->text();
vib_data->base_config_[3].point_name = ui->lineEdit_pointname_4->text();
this->close();
}

31
pointname.h Normal file
View File

@ -0,0 +1,31 @@
#ifndef POINTNAME_H
#define POINTNAME_H
#include <QWidget>
#include "data_config.h"
namespace Ui {
class PointName;
}
class PointName : public QWidget
{
Q_OBJECT
public:
explicit PointName(int slot_no_,int cardtype,QWidget *parent = nullptr);
~PointName();
int slot_no;
CardType car_type;
private slots:
void on_pushButton_cancel_clicked();
void on_pushButton_confirm_clicked();
private:
Ui::PointName *ui;
void Init();
};
#endif // POINTNAME_H

211
pointname.ui Normal file
View File

@ -0,0 +1,211 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PointName</class>
<widget class="QWidget" name="PointName">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>416</width>
<height>291</height>
</rect>
</property>
<property name="windowTitle">
<string>测点名称</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>30</x>
<y>30</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>100</x>
<y>30</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>80</x>
<y>232</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_cancel">
<property name="geometry">
<rect>
<x>220</x>
<y>232</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>40</x>
<y>70</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="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>40</x>
<y>110</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">
<property name="geometry">
<rect>
<x>40</x>
<y>150</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="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>40</x>
<y>190</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>
<resources/>
<connections/>
</ui>

125
setpoint_tachometer.cpp Normal file
View File

@ -0,0 +1,125 @@
#include "setpoint_tachometer.h"
#include "ui_setpoint_tachometer.h"
#include "config_mgr.h"
Setpoint_Tachometer::Setpoint_Tachometer(int slot_no_,int cardtype,QWidget *parent) :
QWidget(parent),
ui(new Ui::Setpoint_Tachometer)
{
ui->setupUi(this);
slot_no = slot_no_;
car_type = static_cast<CardType>(cardtype);
ui->label_slot->setText(QString::number(slot_no));
Init();
connect(ui->comboBox_chan, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &Setpoint_Tachometer::onComboBoxIndexChanged);
current_index = ui->comboBox_chan->currentIndex();
}
Setpoint_Tachometer::~Setpoint_Tachometer()
{
if(slider_alert != nullptr)
delete slider_alert;
if(slider_danger != nullptr)
delete slider_danger;
delete ui;
}
void Setpoint_Tachometer::Init(){
QVBoxLayout *layout_alert = new QVBoxLayout(ui->widget_alert);
slider_alert = new RangeSlider;
layout_alert->addWidget(slider_alert);
QVBoxLayout *layout_danger = new QVBoxLayout(ui->widget_danger);
slider_danger = new RangeSlider(1);
layout_danger->addWidget(slider_danger);
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
speed_alert_ptr = std::dynamic_pointer_cast<TachometerData>(base_ptr);
switch (car_type) {
case kCardSpeedSingle:{
slider_alert->m_upper = 3500;
slider_alert->m_lower = 1500;
slider_alert->setRange(0,5000);
slider_danger->m_upper = 4250;
slider_danger->m_lower = 750;
slider_danger->setRange(0,5000);
int chan = ui->comboBox_chan->currentIndex();
std::shared_ptr<TachometerData> setpoint_data = std::dynamic_pointer_cast<TachometerData>(base_ptr);
ui->lineEdit_alert_upper->setText(QString::number(setpoint_data->alert_danger[chan].speed_upper));
ui->lineEdit_alert_lower->setText(QString::number(setpoint_data->alert_danger[chan].speed_lower));
ui->checkBox_alert_upper->setChecked(setpoint_data->alert_danger[chan].speed_upper_enable);
ui->checkBox_alert_lower->setChecked(setpoint_data->alert_danger[chan].speed_lower_enable);
if(setpoint_data->alert_danger[chan].speed_upper > 0 && setpoint_data->alert_danger[chan].speed_lower){
slider_alert->m_upper = setpoint_data->alert_danger[chan].speed_upper;
slider_alert->m_lower = setpoint_data->alert_danger[chan].speed_lower;
}
ui->lineEdit_danger_upper->setText(QString::number(setpoint_data->alert_danger[chan].danger_speed_upper));
if(setpoint_data->alert_danger[chan].danger_speed_upper > 0 ){
slider_danger->m_upper = setpoint_data->alert_danger[chan].danger_speed_upper;
}
}break;
}
QObject::connect(ui->lineEdit_alert_upper, &QLineEdit::editingFinished, [&]() {
slider_alert->setUpperValue(ui->lineEdit_alert_upper->text().toFloat());
});
QObject::connect(ui->lineEdit_alert_lower, &QLineEdit::editingFinished, [&]() {
slider_alert->setLowerValue(ui->lineEdit_alert_lower->text().toFloat());
});
QObject::connect(slider_alert, &RangeSlider::rangeChanged, [&](float low,float high) {
ui->lineEdit_alert_upper->setText(QString::number((int)high));
ui->lineEdit_alert_lower->setText(QString::number((int)low));
});
QObject::connect(ui->lineEdit_danger_upper, &QLineEdit::editingFinished, [&]() {
slider_danger->setUpperValue(ui->lineEdit_danger_upper->text().toFloat());
});
QObject::connect(slider_danger, &RangeSlider::rangeChanged, [&](float low,float high) {
ui->lineEdit_danger_upper->setText(QString::number((int)high));
});
}
void Setpoint_Tachometer::onComboBoxIndexChanged(int index){
speed_alert_ptr->alert_danger[current_index].speed_upper = ui->lineEdit_alert_upper->text().toFloat();
speed_alert_ptr->alert_danger[current_index].speed_lower = ui->lineEdit_alert_lower->text().toFloat();
speed_alert_ptr->alert_danger[current_index].speed_upper_enable = ui->checkBox_alert_upper->checkState();
speed_alert_ptr->alert_danger[current_index].speed_lower_enable = ui->checkBox_alert_lower->checkState();
speed_alert_ptr->alert_danger[current_index].danger_speed_upper = ui->lineEdit_danger_upper->text().toFloat();
current_index = index;
ui->lineEdit_alert_upper->setText(QString::number(speed_alert_ptr->alert_danger[index].speed_upper));
ui->lineEdit_alert_lower->setText(QString::number(speed_alert_ptr->alert_danger[index].speed_lower));
ui->checkBox_alert_upper->setChecked(speed_alert_ptr->alert_danger[index].speed_upper_enable);
ui->checkBox_alert_lower->setChecked(speed_alert_ptr->alert_danger[index].speed_lower_enable);
if(speed_alert_ptr->alert_danger[index].speed_upper > 0 && speed_alert_ptr->alert_danger[index].speed_lower){
slider_alert->m_upper = speed_alert_ptr->alert_danger[index].speed_upper;
slider_alert->m_lower = speed_alert_ptr->alert_danger[index].speed_lower;
}
ui->lineEdit_danger_upper->setText(QString::number(speed_alert_ptr->alert_danger[index].danger_speed_upper));
if(speed_alert_ptr->alert_danger[index].danger_speed_upper > 0){
slider_danger->m_upper = speed_alert_ptr->alert_danger[index].danger_speed_upper;
}
}
void Setpoint_Tachometer::on_pushButton_confirm_clicked()
{
if (speed_alert_ptr == nullptr) {
qCritical() << "[Setpoint_Tachometer::confirm] should not be here";
return;
}
speed_alert_ptr->alert_danger[current_index].speed_upper = ui->lineEdit_alert_upper->text().toFloat();
speed_alert_ptr->alert_danger[current_index].speed_lower = ui->lineEdit_alert_lower->text().toFloat();
speed_alert_ptr->alert_danger[current_index].speed_upper_enable = ui->checkBox_alert_upper->checkState();
speed_alert_ptr->alert_danger[current_index].speed_lower_enable = ui->checkBox_alert_lower->checkState();
speed_alert_ptr->alert_danger[current_index].danger_speed_upper = ui->lineEdit_danger_upper->text().toFloat();
this->close();
}
void Setpoint_Tachometer::on_pushButton_cancel_clicked()
{
this->close();
}

37
setpoint_tachometer.h Normal file
View File

@ -0,0 +1,37 @@
#ifndef SETPOINT_TACHOMETER_H
#define SETPOINT_TACHOMETER_H
#include <QWidget>
#include "data_config.h"
#include "rangeslider.h"
#include "tachometer_data.h"
namespace Ui {
class Setpoint_Tachometer;
}
class Setpoint_Tachometer : public QWidget
{
Q_OBJECT
public:
explicit Setpoint_Tachometer(int slot_no_,int cardtype,QWidget *parent = nullptr);
~Setpoint_Tachometer();
int slot_no;
CardType car_type;
private slots:
void onComboBoxIndexChanged(int index);
void on_pushButton_confirm_clicked();
void on_pushButton_cancel_clicked();
private:
Ui::Setpoint_Tachometer *ui;
RangeSlider *slider_alert;
RangeSlider *slider_danger;
std::shared_ptr<TachometerData> speed_alert_ptr = nullptr;
int current_index;
void Init();
};
#endif // SETPOINT_TACHOMETER_H

375
setpoint_tachometer.ui Normal file
View File

@ -0,0 +1,375 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Setpoint_Tachometer</class>
<widget class="QWidget" name="Setpoint_Tachometer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>710</width>
<height>522</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>480</y>
<width>666</width>
<height>37</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_20">
<property name="text">
<string>槽位号</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_slot">
<property name="text">
<string>slot</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_chan">
<item>
<property name="text">
<string>通道 1</string>
</property>
</item>
<item>
<property name="text">
<string>通道 2</string>
</property>
</item>
<item>
<property name="text">
<string>通道 3</string>
</property>
</item>
<item>
<property name="text">
<string>通道 4</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_confirm">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_set_default">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>设置为默认值</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_cancel">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_print">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>打印</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_help">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>帮助</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>540</x>
<y>10</y>
<width>161</width>
<height>451</height>
</rect>
</property>
<property name="title">
<string>危险 / 警报 2</string>
</property>
<widget class="QLabel" name="label_23">
<property name="geometry">
<rect>
<x>40</x>
<y>40</y>
<width>36</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>rpm</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_24">
<property name="geometry">
<rect>
<x>40</x>
<y>20</y>
<width>36</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>转速</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_danger_upper">
<property name="geometry">
<rect>
<x>30</x>
<y>80</y>
<width>50</width>
<height>20</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QWidget" name="widget_danger" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>107</y>
<width>120</width>
<height>260</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>260</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>260</height>
</size>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>521</width>
<height>451</height>
</rect>
</property>
<property name="title">
<string>告警 / 警报 1</string>
</property>
<widget class="QLineEdit" name="lineEdit_alert_upper">
<property name="geometry">
<rect>
<x>30</x>
<y>80</y>
<width>50</width>
<height>20</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QWidget" name="widget_alert" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>107</y>
<width>120</width>
<height>260</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>260</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>260</height>
</size>
</property>
</widget>
<widget class="QLabel" name="label_21">
<property name="geometry">
<rect>
<x>40</x>
<y>20</y>
<width>36</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>转速</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_22">
<property name="geometry">
<rect>
<x>40</x>
<y>40</y>
<width>36</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>rpm</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_alert_lower">
<property name="geometry">
<rect>
<x>30</x>
<y>420</y>
<width>65</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>启用</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_alert_upper">
<property name="geometry">
<rect>
<x>30</x>
<y>60</y>
<width>65</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>启用</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_alert_lower">
<property name="geometry">
<rect>
<x>30</x>
<y>380</y>
<width>50</width>
<height>20</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>

4
singlerelay_data.cpp Normal file
View File

@ -0,0 +1,4 @@
#include "singlerelay_data.h"
SingleRelayDataNOK::SingleRelayDataNOK(){
}

11
singlerelay_data.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef SINGLERELAY_DATA_H
#define SINGLERELAY_DATA_H
#include "cardbase.h"
class SingleRelayDataNOK : public CardBase {
public:
SingleRelayDataNOK();
SingleRelayNOK single_relay_nok[RELAY_COUNT];
};
#endif // SINGLERELAY_DATA_H

View File

@ -0,0 +1,6 @@
#include "tmrrelayassociation_data.h"
TmrrelayassociationData::TmrrelayassociationData()
{
}

View File

@ -0,0 +1,14 @@
#ifndef TMRRELAYASSOCIATIONDATA_H
#define TMRRELAYASSOCIATIONDATA_H
#include "cardbase.h"
class TmrrelayassociationData: public CardBase
{
public:
TmrrelayassociationData();
TMRRelay tmr_relay[RELAY_COUNT];
bool sgcc_enable = false;
};
#endif // TMRRELAYASSOCIATIONDATA_H