VPGlobal.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #pragma once
  2. #include <QHash>
  3. #include <QMetaEnum>
  4. class GvlManager;
  5. class POU;
  6. class PouManager;
  7. class UiManager;
  8. class Document;
  9. class WindowAppResourceManagerTree;
  10. class WindowAppGvlView;
  11. class WindowHdw;
  12. class TaskManager;
  13. class WindowAppMdiFrame;
  14. class WindowAppTaskMonitorView;
  15. class DialogUserMsg;
  16. class WindowRuntime;
  17. class WindowMain;
  18. class LoadingManager;
  19. // class FrameManager;
  20. #define g_pMainWindow VPGlobal::m_pMainWindow
  21. #define g_pTaskManager VPGlobal::m_pTaskManager
  22. #define g_pGvlManager VPGlobal::m_pGvlManager
  23. #define g_pResourceManager VPGlobal::m_pResourceManager
  24. #define g_pDialogUserMsg VPGlobal::m_pDialogUserMsg
  25. #define g_pPouManager VPGlobal::m_pPouManager
  26. #define g_pUiManager VPGlobal::m_pUiManager
  27. #define g_pRuntime VPGlobal::m_pWindowRuntime
  28. // #define g_pFrameManager VPGlobal::m_pFrameManager
  29. #define g_pLoadingManager VPGlobal::m_pLoadingManager
  30. // #define emTaskMode VPGlobal::enumTaskMode
  31. #define emExecStatus VPGlobal::enumExecStatus
  32. #define emRetValue VPGlobal::enumRetValue
  33. #define emPriority VPGlobal::enumPriority
  34. #define emGvlAccess VPGlobal::enumGvlAccess
  35. /// <summary>
  36. /// 全局访问的变量公共存储区
  37. /// </summary>
  38. class VPGlobal
  39. {
  40. public:
  41. VPGlobal();
  42. // 初始化
  43. static void init();
  44. //// 注册Pou
  45. //static void Register(POU* pPou);
  46. //// 注册硬件Pou
  47. //static void RegisterHdwPou(POU* pPou);
  48. // 注册主框架
  49. static void Register(WindowMain* pMainWindow);
  50. // 注册AppTree
  51. static void Register(WindowAppResourceManagerTree* pAppTree);
  52. // 注册GvlView
  53. static void Register(WindowAppGvlView* pGvlView);
  54. //// 注册HardwareView
  55. //static void Register(WindowHdw* pHdwWnd);
  56. // 注册MdiFrame
  57. static void Register(WindowAppMdiFrame* pMdiFrame);
  58. // 注册默认的Task Monitor View
  59. static void Register(WindowAppTaskMonitorView* pTaskMonitorView);
  60. // 注册Runtime窗体
  61. static void Register(WindowRuntime* pRuntime);
  62. // 获取MdiFrame的指针
  63. static WindowAppMdiFrame* getMdiFrame();
  64. // 获取 TaskMonitor 的指针
  65. static WindowAppTaskMonitorView* getTaskMonitorView();
  66. friend Document;
  67. static WindowMain* m_pMainWindow;
  68. static PouManager* m_pPouManager;
  69. static UiManager* m_pUiManager;
  70. static TaskManager* m_pTaskManager;
  71. static GvlManager* m_pGvlManager;
  72. static WindowAppResourceManagerTree* m_pResourceManager;
  73. static WindowRuntime* m_pWindowRuntime;
  74. static Document* m_pDoc;
  75. static DialogUserMsg* m_pDialogUserMsg;
  76. // static FrameManager* m_pFrameManager;
  77. static LoadingManager* m_pLoadingManager;
  78. // Q_ENUM使用的枚举类型
  79. // static QMetaEnum emTaskMode;
  80. static QMetaEnum enumExecStatus;
  81. static QMetaEnum enumRetValue;
  82. static QMetaEnum enumPriority;
  83. static QMetaEnum enumGvlAccess;
  84. private:
  85. // For Debug
  86. void debugAllPous();
  87. private:
  88. static WindowAppGvlView* m_pGvlView;
  89. static WindowAppMdiFrame* m_pMdiFrame;
  90. static WindowAppTaskMonitorView* m_pTaskMonitorView;
  91. // static POU* m_pHardwarePou;
  92. // static LinkManager* m_pLinkManager;
  93. };