2024-12-18 16:46:39 +08:00
|
|
|
#ifndef TMRRELAYASSOCIATION_H
|
|
|
|
#define TMRRELAYASSOCIATION_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2025-04-19 16:25:33 +08:00
|
|
|
#include <QButtonGroup>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include "data_config.h"
|
|
|
|
#include "config_mgr.h"
|
2025-04-25 14:28:27 +08:00
|
|
|
|
2025-04-19 19:54:56 +08:00
|
|
|
#include "tmrrelayassociation_data.h"
|
2025-04-23 17:13:05 +08:00
|
|
|
#include <QListWidget>
|
2024-12-18 16:46:39 +08:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class TMRRelayAssociation;
|
|
|
|
}
|
2025-07-09 20:24:50 +08:00
|
|
|
|
2025-04-23 14:44:58 +08:00
|
|
|
|
2024-12-18 16:46:39 +08:00
|
|
|
|
|
|
|
class TMRRelayAssociation : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2025-04-19 16:25:33 +08:00
|
|
|
explicit TMRRelayAssociation(int slot,int cardtype,QWidget *parent = nullptr);
|
2024-12-18 16:46:39 +08:00
|
|
|
~TMRRelayAssociation();
|
2025-04-19 16:25:33 +08:00
|
|
|
int slot_no;
|
|
|
|
CardType car_type;
|
|
|
|
private slots:
|
|
|
|
void on_pushButton_cancel_clicked();
|
|
|
|
|
|
|
|
void on_pushButton_confirm_clicked();
|
|
|
|
|
|
|
|
void onComboBoxIndexChanged(int index);
|
|
|
|
|
|
|
|
void OnButtonGroup(QAbstractButton *);
|
2024-12-18 16:46:39 +08:00
|
|
|
|
2025-04-19 16:25:33 +08:00
|
|
|
|
|
|
|
void on_pushButton_and_clicked();
|
|
|
|
|
|
|
|
void on_pushButton_or_clicked();
|
|
|
|
|
|
|
|
void on_treeView_Relay_customContextMenuRequested(const QPoint &pos);
|
|
|
|
void slotDeleteItem();
|
2025-04-21 17:23:38 +08:00
|
|
|
void on_checkBox_sgcc_stateChanged(int arg1);
|
|
|
|
|
|
|
|
void on_pushButton_logic_clicked();
|
|
|
|
|
2024-12-18 16:46:39 +08:00
|
|
|
private:
|
|
|
|
Ui::TMRRelayAssociation *ui;
|
2025-04-19 16:25:33 +08:00
|
|
|
QButtonGroup * btnGroup_slot = nullptr;
|
2025-04-23 14:44:58 +08:00
|
|
|
QListWidget *list_widget_available = nullptr;
|
2025-04-19 16:25:33 +08:00
|
|
|
int current_index;
|
|
|
|
QTreeView *treeView_relay;
|
|
|
|
QStandardItemModel *model_Relay;
|
2025-04-19 19:54:56 +08:00
|
|
|
std::shared_ptr<TmrrelayassociationData> relay_data = nullptr;
|
2025-04-23 14:44:58 +08:00
|
|
|
QMap<QString, QString> channelNameMap;
|
2025-04-19 16:25:33 +08:00
|
|
|
|
|
|
|
void Init();
|
|
|
|
void buildTreeFromExpression(QTreeView *treeView, const QString &expr);
|
|
|
|
ExprNode* parseExpression(const QString& expr, int& pos);
|
|
|
|
QStandardItem* buildItemTree(ExprNode* node);
|
|
|
|
void setExpressionToTreeView(QTreeView* treeView, const QString& expr);
|
|
|
|
QStandardItem* parseExpression(const QString &expr);
|
|
|
|
QString buildLogicExpression(QStandardItem *item);
|
2025-04-21 17:23:38 +08:00
|
|
|
ExprValidationResult validateLogicExpression(const QString& expr);
|
2024-12-18 16:46:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TMRRELAYASSOCIATION_H
|