添加主界面逻辑

This commit is contained in:
zhangsheng 2025-02-11 19:54:22 +08:00
parent 923b95bca6
commit cf3b2c94d0
7 changed files with 2539 additions and 2865 deletions

View File

@ -16,16 +16,19 @@ SOURCES += \
radial_vibration.cpp \
seismic_monitor.cpp \
setpoint.cpp \
singlerelay.cpp \
tachometer.cpp \
velocity.cpp
HEADERS += \
acceleration.h \
data_config.h \
keyphase.h \
mainwindow.h \
radial_vibration.h \
seismic_monitor.h \
setpoint.h \
singlerelay.h \
tachometer.h \
velocity.h

View File

@ -13,96 +13,225 @@
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>40</x>
<y>100</y>
<width>621</width>
<height>391</height>
</rect>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QWidget" name="widget_3" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>通道:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>(启用)</string>
</property>
</widget>
</item>
</layout>
</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>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string> 槽位号:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_2">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>400</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>滤波配置</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>591</width>
<height>141</height>
</rect>
</property>
<property name="title">
<string>滤波</string>
</property>
<widget class="QLabel" name="label_29">
<property name="geometry">
<rect>
<x>310</x>
<y>70</y>
<width>72</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>30 - 30000Hz</string>
</property>
</widget>
<widget class="QComboBox" name="comboBox_7">
<property name="geometry">
<rect>
<x>225</x>
<y>70</y>
<width>69</width>
<height>20</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="checkBox_10">
<property name="text">
<string>30000</string>
<string/>
</property>
</item>
</widget>
<widget class="QLabel" name="label_30">
<property name="geometry">
<rect>
<x>195</x>
<y>70</y>
<width>21</width>
<height>16</height>
</rect>
</item>
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>高通:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_2">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>3</number>
</property>
<property name="maximum">
<number>3000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_33">
<property name="text">
<string>-</string>
</property>
</widget>
<widget class="QLabel" name="label_11">
<property name="geometry">
<rect>
<x>56</x>
<y>71</y>
<width>36</width>
<height>16</height>
</rect>
</item>
<item>
<widget class="QSpinBox" name="spinBox_3">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>3</number>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="value">
<number>3000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_32">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>3 - 3000Hz</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>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="checkBox_11">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>低通:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_2">
<property name="geometry">
<rect>
<x>105</x>
<y>71</y>
<width>61</width>
<height>20</height>
</rect>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
@ -110,101 +239,74 @@
</property>
</item>
</widget>
<widget class="QLabel" name="label_12">
<property name="geometry">
<rect>
<x>56</x>
<y>31</y>
<width>36</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>高通:</string>
</property>
</widget>
<widget class="QLabel" name="label_32">
<property name="geometry">
<rect>
<x>310</x>
<y>30</y>
<width>60</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>3 - 3000Hz</string>
</property>
</widget>
<widget class="QLabel" name="label_33">
<property name="geometry">
<rect>
<x>195</x>
<y>30</y>
<width>21</width>
<height>16</height>
</rect>
</property>
</item>
<item>
<widget class="QLabel" name="label_30">
<property name="text">
<string>-</string>
</property>
</widget>
<widget class="QSpinBox" name="spinBox_2">
<property name="geometry">
<rect>
<x>105</x>
<y>30</y>
<width>61</width>
<height>22</height>
</rect>
</item>
<item>
<widget class="QComboBox" name="comboBox_7">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<number>3</number>
<item>
<property name="text">
<string>30000</string>
</property>
<property name="maximum">
<number>3000</number>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_29">
<property name="text">
<string>30 - 30000Hz</string>
</property>
</widget>
<widget class="QSpinBox" name="spinBox_3">
<property name="geometry">
<rect>
<x>225</x>
<y>30</y>
<width>61</width>
<height>22</height>
</rect>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="minimum">
<number>3</number>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="value">
<number>3000</number>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QCheckBox" name="checkBox_12">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="geometry">
<rect>
<x>56</x>
<y>101</y>
<width>36</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>带通:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_5">
<property name="geometry">
<rect>
<x>105</x>
<y>100</y>
<width>61</width>
<height>22</height>
</rect>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<number>3</number>
@ -213,27 +315,21 @@
<number>3000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_34">
<property name="geometry">
<rect>
<x>195</x>
<y>100</y>
<width>21</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_6">
<property name="geometry">
<rect>
<x>225</x>
<y>100</y>
<width>61</width>
<height>22</height>
</rect>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<number>3</number>
@ -245,59 +341,46 @@
<number>3000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_35">
<property name="geometry">
<rect>
<x>310</x>
<y>100</y>
<width>60</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>3 - 3000Hz</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_10">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>21</width>
<height>16</height>
</rect>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="text">
<string/>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>248</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QCheckBox" name="checkBox_11">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>21</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_12">
<property name="geometry">
<rect>
<x>20</x>
<y>100</y>
<width>21</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
@ -900,120 +983,106 @@
</widget>
</widget>
</widget>
<widget class="QWidget" name="layoutWidget_3">
<property name="geometry">
<rect>
<x>20</x>
<y>510</y>
<width>651</width>
<height>29</height>
</rect>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QToolButton" name="toolButton_9">
<widget class="QPushButton" name="pushButton_9">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_10">
<widget class="QPushButton" name="pushButton_10">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>设置为默认值</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_11">
<widget class="QPushButton" name="pushButton_11">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>测点名称</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_12">
<widget class="QPushButton" name="pushButton_12">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_13">
<widget class="QPushButton" name="pushButton_13">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>打印</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_14">
<widget class="QPushButton" name="pushButton_14">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>帮助</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_4">
<property name="geometry">
<rect>
<x>30</x>
<y>10</y>
<width>231</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>通道:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>(启用)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_5">
<property name="geometry">
<rect>
<x>350</x>
<y>10</y>
<width>189</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string> 槽位号:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_2">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,14 @@
#include "ui_mainwindow.h"
#include <QDebug>
#include <QList>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include "keyphase.h"
#include "singlerelay.h"
#include "tachometer.h"
#include "seismic_monitor.h"
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
@ -26,24 +34,64 @@ MainWindow::MainWindow(QWidget *parent)
btnGroup_slot->addButton(ui->pushButton_slot16);
btnGroup_slot->addButton(ui->pushButton_slot17);
ui->pushButton_slot->setChecked(true);
readJsonFile(QCoreApplication::applicationDirPath() + "\\config\\main.json");
createMenu();
connect(btnGroup_slot, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(OnButtonGroup(QAbstractButton *)));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::readJsonFile(const QString &filePath)
{
// 创建文件对象
QFile file(filePath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "Cannot open file for reading:" << filePath;
return;
}
QString content = file.readAll();
file.close();
QByteArray jsonData = content.toUtf8();
QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData);
if (jsonDoc.isNull()) {
qDebug() << "Cannot parse JSON document";
return;
}
if (!jsonDoc.isObject() && !jsonDoc.isArray()) {
qDebug() << "JSON document is not an object or an array";
return;
}
int slot_id = 3;
QJsonArray jsonArray = jsonDoc.array();
for (const QJsonValue &value : jsonArray) {
SlotConfig slot_config;
if (value.isObject()) { // 处理数组中的对象,例如每个对象代表一个记录或用户等。
QJsonObject obj = value.toObject();
slot_config.slot = obj["slot"].toInt();
slot_config.slot_type = obj["slot_type"].toInt();
slot_config.chan_type = obj["chan_type"].toString();
slot_config.rack_type = obj["rack_type"].toString();
map_slot_config.insert(slot_id,slot_config);
slot_id ++;
}
}
}
void MainWindow::createMenu()
{
QList<QAbstractButton*> buttonList = btnGroup_slot->buttons();
for (int i = 0; i < buttonList.count(); i++){
slot_type.insert(buttonList[i]->objectName(),"");
}
for (int i = 0; i < buttonList.count(); i++){
if(slot_type[buttonList[i]->objectName()] == "")
//buttonList[i]->setText(map_slot_config[i + 3].chan_type);
createMenu(QString("%1").arg(i + 1), (QPushButton*)buttonList[i]);
else
createMenuSet(QString("%1").arg(i + 1), (QPushButton*)buttonList[i]);
// else
// createMenuSet(QString("%1").arg(i + 1), (QPushButton*)buttonList[i]);
}
}
void MainWindow::createMenu(const QString& rootTitle, QPushButton* parent )
@ -99,7 +147,9 @@ void MainWindow::createMenu(const QString& rootTitle, QPushButton* parent )
QObject::connect(keyphasor_1, &QAction::triggered,this, &MainWindow::onMenuActionTriggered);
QObject::connect(keyphasor_2, &QAction::triggered,this, &MainWindow::onMenuActionTriggered);
QObject::connect(reset, &QAction::triggered,this, &MainWindow::onMenuActionTriggered);
}
void MainWindow::createMenuSet(const QString& rootTitle, QPushButton* parent )
{
// 创建主菜单
@ -146,9 +196,30 @@ void MainWindow::onMenuActionTriggered()
while (menu) {
QPushButton *button = qobject_cast<QPushButton*>(menu->parent());
if (button) {
qDebug() << "子菜单项被点击,所属按钮:" << button->objectName();
qDebug() << "子菜单项被点击,所属按钮:" << button->objectName() << action->text();
int slot_type = action->text().mid(1,2).toInt();
QString rack_type = action->text().right(action->text().length()-4);
int button_id = button->objectName().right(button->objectName().length()-15).toInt();
qDebug() << slot_type << rack_type << button_id << map_slot_config[button_id + 1].slot_type << map_slot_config[button_id + 2].slot_type << endl;
if(rack_type == "三冗余板卡" && (map_slot_config[button_id + 1].slot_type != 0 \
|| map_slot_config[button_id + 2].slot_type != 0)){
QMessageBox::information(this, QStringLiteral("提示"), "不要重叠三冗余板卡配置,请在创建新配置之前移除现有的配置!");
return;
}else if(rack_type == "三冗余板卡" && map_slot_config[button_id + 1].slot_type == 0 \
&& map_slot_config[button_id + 2].slot_type == 0){
map_slot_config[button_id].slot_type = slot_type;
map_slot_config[button_id].rack_type = "TMR";
}
if(rack_type == "两板卡" && map_slot_config[button_id + 1].slot_type != 0 ){
QMessageBox::information(this, QStringLiteral("提示"), "不要重叠两板卡配置,请在创建新配置之前移除现有的配置!");
return;
}else if(rack_type == "两板卡" && map_slot_config[button_id + 1].slot_type == 0){
map_slot_config[button_id].slot_type = slot_type;
map_slot_config[button_id].rack_type = "Double";
}
map_slot_config[button_id].slot_type = slot_type;
map_slot_config[button_id].rack_type = "Single";
button->setText(action->text());
slot_type[button->objectName()] = action->text();
QMenu* menu = button->menu();
if (!menu) {
qWarning() << "菜单为空,无法清除属性!";
@ -164,40 +235,94 @@ void MainWindow::onMenuActionTriggered()
}
}
void MainWindow::OnButtonGroup(QAbstractButton * slot_btn, bool checked)
void MainWindow::OnButtonGroup(QAbstractButton * slot_btn)
{
if(slot_btn != NULL)
if(slot_btn != NULL && ui->pushButton_chan->isChecked())
{
qDebug() << slot_btn->objectName();
qDebug() << checked;
QString str;
QList<QAbstractButton*> buttonList = btnGroup_slot->buttons();
for (int i = 0; i < buttonList.count(); i++){
QString object_name = slot_btn->objectName();
qDebug() << object_name << endl;
int button_id = object_name.right(object_name.length()-15).toInt();
SlotConfig slot_config = map_slot_config[button_id];
if (slot_config.slot_type == KEYPHASOR){
KeyPhase *key_phase = new KeyPhase();
key_phase->setWindowModality(Qt::ApplicationModal);
key_phase->show();
}else if (slot_config.slot_type == RELAY){
SingleRelay *single_relay = new SingleRelay();
single_relay->setWindowModality(Qt::ApplicationModal);
single_relay->show();
}else if (slot_config.slot_type == VIBRATE){
Seismic_monitor *seismic_monitor = new Seismic_monitor();
seismic_monitor->setWindowModality(Qt::ApplicationModal);
seismic_monitor->show();
}else if (slot_config.slot_type == RPM){
Tachometer *tachometer = new Tachometer();
tachometer->setWindowModality(Qt::ApplicationModal);
tachometer->show();
}
}
}
void MainWindow::on_pushButton_slot_clicked()
{
if(ui->pushButton_chan->isChecked())
ui->pushButton_chan->setChecked(false);
if(ui->pushButton_alarm->isChecked())
ui->pushButton_alarm->setChecked(false);
if(ui->pushButton_point_name->isChecked())
ui->pushButton_point_name->setChecked(false);
}
void MainWindow::on_pushButton_chan_clicked()
{
if(ui->pushButton_slot->isChecked())
ui->pushButton_slot->setChecked(false);
if(ui->pushButton_alarm->isChecked())
ui->pushButton_alarm->setChecked(false);
if(ui->pushButton_point_name->isChecked())
ui->pushButton_point_name->setChecked(false);
}
void MainWindow::on_pushButton_alarm_clicked()
{
if(ui->pushButton_slot->isChecked())
ui->pushButton_slot->setChecked(false);
if(ui->pushButton_chan->isChecked())
ui->pushButton_chan->setChecked(false);
if(ui->pushButton_point_name->isChecked())
ui->pushButton_point_name->setChecked(false);
}
void MainWindow::on_pushButton_point_name_clicked()
{
if(ui->pushButton_slot->isChecked())
ui->pushButton_slot->setChecked(false);
if(ui->pushButton_chan->isChecked())
ui->pushButton_chan->setChecked(false);
if(ui->pushButton_alarm->isChecked())
ui->pushButton_alarm->setChecked(false);
}
void MainWindow::on_pushButton_save_clicked()
{
QJsonObject itemObj;
QJsonArray slotArray;
for(int i = 0; i < map_slot_config.size();i++){
itemObj["slot"] = map_slot_config[i+3].slot;
itemObj["slot_type"] = map_slot_config[i+3].slot_type;
itemObj["chan_type"] = map_slot_config[i+3].chan_type;
itemObj["rack_type"] = map_slot_config[i+3].rack_type;
slotArray.append(itemObj);
}
QJsonDocument jsonDoc;
jsonDoc.setArray(slotArray);
QFile file(QCoreApplication::applicationDirPath() + "\\config\\main.json");
file.open(QIODevice::WriteOnly);
file.write(jsonDoc.toJson());
file.close();
}

View File

@ -5,6 +5,7 @@
#include <QMap>
#include <QButtonGroup>
#include <QPushButton>
#include "data_config.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
@ -29,7 +30,7 @@ private:
//声明菜单
QMenu * button_menu;
QMap<QString,QString> slot_type;
QMap<int,SlotConfig> map_slot_config;
QButtonGroup * btnGroup_slot = nullptr;
@ -38,14 +39,17 @@ private:
void createMenuSet(const QString& rootTitle, QPushButton* button = nullptr);
void clearMenuProperties(QMenu* menu);
void readJsonFile(const QString &filePath);
private slots:
void OnButtonGroup(QAbstractButton *, bool);
void OnButtonGroup(QAbstractButton *);
void onMenuActionTriggered();
void on_pushButton_slot_clicked();
void on_pushButton_chan_clicked();
void on_pushButton_alarm_clicked();
void on_pushButton_point_name_clicked();
void on_pushButton_save_clicked();
};
#endif // MAINWINDOW_H

View File

@ -32,7 +32,7 @@
<height>100</height>
</size>
</property>
<widget class="QPushButton" name="pushButton_20">
<widget class="QPushButton" name="pushButton_save">
<property name="geometry">
<rect>
<x>20</x>
@ -54,7 +54,7 @@
</size>
</property>
<property name="text">
<string/>
<string>保存</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_21">
@ -269,6 +269,9 @@
<property name="text">
<string>板卡配置</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -282,6 +285,9 @@
<property name="text">
<string>通道配置</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -295,6 +301,9 @@
<property name="text">
<string>触发配置</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -308,6 +317,9 @@
<property name="text">
<string>测点名称</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>

File diff suppressed because it is too large Load Diff