DialogGotoSelection.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include "Common.h"
  3. #include "ui_DialogGotoSelection.h"
  4. /// <summary>
  5. /// Goto工具用来进行下行工具选择的界面(2022-4-18,Goto的工具绑定选择对话框废弃,统一通过连线来绑定Tool)
  6. /// </summary>
  7. class POU;
  8. class DialogGotoSelection : public QDialog
  9. {
  10. Q_OBJECT
  11. public:
  12. DialogGotoSelection(const POU* pou, QWidget *parent = Q_NULLPTR);
  13. ~DialogGotoSelection();
  14. // 用户选择的Goto绑定工具
  15. QString m_selToolInstName;
  16. private:
  17. Ui::DialogGotoSelection ui;
  18. private:
  19. // 对话框初始化
  20. void initUI();
  21. // 添加兼容的Pou工具到树形结构中
  22. void AddPouToolsToTree(const POU* pPou);
  23. // 添加根节点
  24. QTreeWidgetItem* AddRootTreeItem(const QString& toolName);
  25. // 添加Tool子节点
  26. void AddToolTreeItem(QTreeWidgetItem* pToolItem, const TOOL* pTool);
  27. private slots:
  28. // select按钮
  29. void onButtonSelectClicked();
  30. // Combo框选择变更时,需要切换对应的工具列表(当前仅一个分组)
  31. void onComboGroupChanged(int nIndex);
  32. private:
  33. // 本对话框管理数据所在的Pou分组
  34. const POU* m_pou;
  35. };