ElectricEqpmt_ElcTurnOffAreaMng.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #pragma once
  2. #include <cstring>
  3. typedef bool (*CALLBACKFUNC_EqpmtElcStatus)(void* pOwner, const std::string& strEqpmtStrID );
  4. typedef void (*CALLBACKFUNC_TurnOffArea)(void* pOwner, int nAreaID, int nStationID, int nMark );
  5. #include "ElectricEqpmt_ElcTurnOffArea.h"
  6. #include <map>
  7. class ElectricEqpmt_ElcTurnOffAreaMng
  8. {
  9. public:
  10. ElectricEqpmt_ElcTurnOffAreaMng();
  11. ~ElectricEqpmt_ElcTurnOffAreaMng();
  12. void AddElcTurnOffArea( int nOffArea, int nStationID, const std::string& strEqpmtStrID );
  13. /*
  14. 设备区域电力设备失电发生
  15. */
  16. void EqpmtOffOccur( const std::string& strEqpmtID );
  17. /*
  18. 设备区是否断电
  19. */
  20. void TurnOffArea( int nArea );
  21. /*
  22. 根据设备ID获取设备关联400V设备区域ID
  23. */
  24. int GetAreaID( const string& strEqpmtID );
  25. public:
  26. /*
  27. 总处理模块句柄
  28. */
  29. static void* m_pOwner;
  30. /*
  31. 回调函数:设备是否带电状态获取
  32. */
  33. static CALLBACKFUNC_EqpmtElcStatus m_hCallBackEqpmtElcStatus;
  34. /*
  35. 回调函数:设备区断电处理
  36. */
  37. static CALLBACKFUNC_TurnOffArea m_hCallBackTurnOffArea;
  38. static void SetOwner(void* pOwner )
  39. {
  40. m_pOwner = pOwner;
  41. }
  42. static void SetCallBackEqpmtElcStatus( CALLBACKFUNC_EqpmtElcStatus hCallBackEqpmtElcStatus )
  43. {
  44. m_hCallBackEqpmtElcStatus = hCallBackEqpmtElcStatus;
  45. }
  46. static void SetCallBackTurnOffArea( CALLBACKFUNC_TurnOffArea hCallBackTurnOffArea )
  47. {
  48. m_hCallBackTurnOffArea = hCallBackTurnOffArea;
  49. }
  50. public:
  51. /*
  52. 停电区域数据
  53. */
  54. /*
  55. 停电区设备编号和区域ID映射关系
  56. */
  57. map<string, int > m_mapEqpmtStrIDAndAreaID;
  58. /*
  59. 设备停电区数据集合
  60. */
  61. map<int, ElectricEqpmt_ElcTurnOffArea > m_mapElcTurnOffArea;
  62. public:
  63. //添加电环联合数据信息 xyx新增
  64. //************************************
  65. // 函数名称: AddElcToRelaData
  66. // 函数功能: 添加电环联合数据信息
  67. // 函数类型: public
  68. // 返 回 值: void
  69. // 参数1说明: int StationID 车站ID
  70. // 参数2说明: int CtrlAreaID 控制区域ID
  71. // 参数3说明: string ElcEqpmtStrID 设备图元ID
  72. // 作 者: xyx新增
  73. // 日 期: 2019/8/29
  74. // 修改记录:
  75. //************************************
  76. void AddElcToRelaData(int StationID,int CtrlAreaID, string ElcEqpmtStrID);
  77. private:
  78. int m_nStationID;
  79. int m_nCtrlAreaID;
  80. string m_strEqpmtStrID;
  81. public:
  82. void SetStationID(int StationID)
  83. {
  84. m_nStationID = StationID;
  85. }
  86. int GetStationID()
  87. {
  88. return m_nStationID;
  89. }
  90. void SetCtrlAreaID(int CtrlAreaID)
  91. {
  92. m_nCtrlAreaID = CtrlAreaID;
  93. }
  94. int GetCtrlAreaID()
  95. {
  96. return m_nCtrlAreaID;
  97. }
  98. void SetEqpmtStrID(string EqpmtStrID)
  99. {
  100. m_strEqpmtStrID = EqpmtStrID;
  101. }
  102. string GetEqpmtStrID()
  103. {
  104. return m_strEqpmtStrID;
  105. }
  106. };