123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #pragma once
- #include <QDialog>
- #include "ui_DialogBlockProperty.h"
- #include "Common.h"
- // 功能块的属性信息(用于更新和显示)
- typedef struct _tagBlockProperty
- {
- // 接口的显示与隐藏配置
- // QHash<const _INTERFACE*, bool> infShowInfo;
- QVector<bool> infEnables;
- // 工具的Info信息
- QString strInfo;
- // 工具的实例名称(需要保存旧名字和新名字以备用)
- QString strOldInstanceName;
- QString strNewInstanceName;
- // 工具的其他相关参数
- bool bToolEnable; // 是否启用本工具
- int nInDelay; // 进入函数时候延时(ms)
- int nOutDelay; // 离开函数时的延时(ms)
- // 2022-9-28,增加工具新的索引号设置
- int nNewIndex;
- _tagBlockProperty()
- {
- bToolEnable = true;
- nInDelay = 0;
- nOutDelay = 0;
- nNewIndex = -1;
- }
- } BLOCK_PROPERTY, *LPBLOCK_PROPERTY;
- /// <summary>
- /// 功能块右键弹出的属性对话框
- /// </summary>
- class POU;
- class DialogBlockProperty : public QDialog
- {
- Q_OBJECT
- public:
- DialogBlockProperty(TOOL* tool, POU* Pou, QWidget *parent = Q_NULLPTR);
- ~DialogBlockProperty();
- private:
- Ui::DialogBlockProperty ui;
- public:
- // 获取用户设置的Block参数
- BLOCK_PROPERTY getBlockSettings()
- {
- return blockSettings;
- }
- private:
- // 对话框初始化
- void initUI();
- // 绘制工具的图像(以及CheckBox)
- void initToolBlock();
- // 2022-9-28 初始化设置工具Index的ComboBox
- void initComboToolIndex();
- // 保存用户的设置项
- void saveBlockSettings();
- private slots:
- // Ok按钮
- void onButtonOkClicked();
- private:
- // 本对话框绑定的工具信息
- TOOL* m_toolInfo;
- // 对话框的配置信息
- BLOCK_PROPERTY blockSettings;
- // 接口的Checkbox
- QVector<QCheckBox*> infCheckBoxs;
- // 本Tool所归属的Pou
- POU* m_pPou;
- };
|