DCSysMG.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #ifndef OCC_PUBLIC_DEFINE_DCHEADER_FILE
  2. #define OCC_PUBLIC_DEFINE_DCHEADER_FILE
  3. #pragma once
  4. #include "ElecBaseDefine.h"
  5. #include "CalculEquation.h"
  6. #include "YN_NodeDef.h"
  7. #include <vector>
  8. #include <map>
  9. #include "BaseElectricEqpmt.h"
  10. #include "ElectricEqpmt_Line_TouchNet.h"
  11. using namespace std;
  12. class DCSysMG // 直流计算类
  13. {
  14. public:
  15. DCSysMG(void);
  16. bool UpdataTrainData(DCSysTrain& pTrain); //更新列车数据
  17. bool IsTrainInPowerStation(DCSysTrain& pTrain); //判断车是否在站内
  18. void CalculValue(); //计算值
  19. bool CalculRectArray(); //计算矩阵数组
  20. bool CreateRectArray(); //创建矩阵数组
  21. bool CreateFixYNodes();
  22. bool CreateHeadNodes();
  23. bool CreateTailNodes();
  24. int CreateNodeID();
  25. bool CreateRectierToTouchNetNode(Dc_PowerStation& Station);
  26. bool CreateRectierToRailWayNode(Dc_PowerStation& Station);
  27. bool CreateRailWayNode(Dc_PowerStation& Station);
  28. bool CreateTrainNode();
  29. size_t FindNodeListIndex(string touchnetid,double ex,int arrow,vector<LineNodeData>& m_UpRunDataList,vector<LineNodeData>& m_DownRunDataList);
  30. void FindCalScope(Dc_PowerStation& node, bool& stop,double i);
  31. bool HaveRightResult();
  32. bool OutPutRectValueToFile();
  33. void OutPutTrainSMap();
  34. bool RemoveSpanNetInfo(int station,int errorid,int arrow);
  35. void AdjustI(double& i); //调整电流值
  36. bool AddSpanNetInfo(int station,int errorid,int arrow);
  37. bool AddTrainToNodes(DCSysTrain& train,vector<LineNodeData>& m_UpRunDataList,vector<LineNodeData>& m_DownRunDataList);
  38. void AddStationData(TrainRuningData &station);
  39. void AddStationInfo(Dc_PowerStation& station);
  40. void AddStationTo(int index,TrainRuningData &station);
  41. bool AdjustFixNodeRect(map<int,POWERNODE>& NodeMap);
  42. bool AdjustSpanNetNode(TouchNet_SpanNetApplyPower_Info& AdjustNode);
  43. bool AdjustShortCutNode(); //调整短路节点
  44. void AdjustTouchNetRelation(string touchnetid,Track_Section& tracksec); //调整接触网关系
  45. bool JudgeShortCutAreaTrian(DCSysTrain& train); //判断短路区域车辆
  46. size_t GetStationSize();
  47. bool GetStationByindex(int index,TrainRuningData &station); //通过索引来查找车站
  48. int GetRelaNodeRectIndex(int RelationNodeID); //获取关系节点矩阵索引
  49. void GetTrianVPublish(std::vector<POWERVALUE>& PQIList); //获取列车电压数据发布
  50. void GetRectiterVPublish(std::vector<POWERVALUE>& PQIList); //获取整流器电压发布
  51. void GetBackVIPublish(std::vector<POWERVALUE>& PQIList); //获取回流线电压发布
  52. double GetTouchNetDurDistance(string startline,double exs,string endline,double exe,int arrow); //获取两段接触网之间的距离
  53. string GetTouchNetByPosition(int trackid,double ex); //通过轨道区段号获取接触网位置
  54. double GetTouchLenght(string id);
  55. bool GetTouchNetPosByRailPosition(int trackid,double railex,string& touchnetid,double&touchnetex);
  56. void SetPQValueArr(DCNodePQValue PQValueArr[]); //设置PQ节点参数数组
  57. void SetHeadTailTouchNet(int arrow,int headtail,string id); //设置头尾接触网
  58. void PushTailNodes(); //把尾节点压到车站
  59. void SetRunStatus(int status); //设置运行状态
  60. void ExitInstance();
  61. //added by zhangjiahua
  62. void CheckSpanNetInfo(); //检测存在通过越区隔离开关进行越区供电情形,并进行相关节点关系调整 xyx注释
  63. void DeleteSpanNetInfo(); //在下一次直流计算前,将节点关系恢复至初始状态 xyx注释
  64. TOUCHNETMAP * GetTouchNetMap()
  65. {
  66. return &TouchNetMap;
  67. }
  68. map<int,DCSysTrain>* GetTrainSInStationMap()
  69. {
  70. return &TrainSInStationMap;
  71. }
  72. public:
  73. int m_RunStatus; //运行状态
  74. int m_trainID; //列车ID
  75. double PowerSourceV; //电源电压
  76. double PowerSourceR; //电源电阻
  77. bool HaveResult; //有无值
  78. vector<TrainRuningData> m_StationDataList; //,车站数据表 未用
  79. vector<TrainRuningData> m_RunDataList; //列车运行数据 未用
  80. vector<StationInfo> m_StationInfoVector; //车站信息,定义了列车运行的相关参数 未用
  81. vector<TouchNet_SpanNetApplyPower_Info> m_TouchNetSpanNetInfo; //接触网_跨网供电类向量的定义, 未用
  82. TOUCHNETRELAMAP m_NetTracksRelationMap; //接触网与轨道的关系
  83. typedef map<int,Dc_PowerStation> DCSTATIONMAP; //直流电站表,Dc_PowerStation直流电站类
  84. typedef map<int,DcYNodeBase*> DCYNODEMAP; //直流节点
  85. DCSTATIONMAP m_PowerStationNodeMap; //直流电站
  86. DCNodePQValue* p_PQValueArr; //直流PQ节点数组
  87. typedef map<int,POWERNODE> DCYSNODEMAP; //电力节点
  88. DCYSNODEMAP m_DCFixNodesMap; //直流固定节点
  89. DCYSNODEMAP m_DCNodesMap; //直流节点 //直流列车节点 xyx注释
  90. map<int,DCSysTrain> TrainSInStationMap; //直流列车系统相关定义,列车表的定义,DCSysTrain列车类
  91. CalculEquation m_EquationCalcul; //方程计算
  92. vector<LineNodeData> m_UpRunFixDataList; //上行固定节点列表 //上行接触网上的节点列表(含线上的直流直流母线节点及列车受电弓节点) xyx注释
  93. vector<LineNodeData> m_DownFixRunDataList; //下行接触网上的节点列表(含线上的直流直流母线节点及列车受电弓节点) xyx注释
  94. map<int,DCSysTrain> m_ShortCutAreaTrians; //短路区域车的数量
  95. int UpHeadNodeID; //接触网上行头节点ID
  96. int DownHeadNodeID; //接触网下行头节点ID
  97. int UpTailNodeID; //接触网上行尾节点ID
  98. int DownTailNodeID; //接触网下行尾节点ID
  99. string UpStartTouchNetID; //上行接触网起始ID
  100. string UpEndTouchNetID; //
  101. string DownStartTouchNetID;
  102. string DownEndtouchNetID; //下行接触网终点ID
  103. int NodeIDsCount; //节点的个数、(站)
  104. int NodeIndex; //节点索引
  105. TOUCHNETMAP TouchNetMap; //接触网相关信息
  106. ELEEQPMTMAP ElectricEqpmtMap;
  107. void SetElcEqpmtMap(ELEEQPMTMAP elceqpmtmap)
  108. {
  109. ElectricEqpmtMap = elceqpmtmap;
  110. }
  111. std::mutex m_CritilSec;
  112. std::mutex m_CritilSecYNodesMap;
  113. std::mutex m_CritilSecSpanNet;
  114. //bool m_bInit;
  115. protected:
  116. //保存当前计算数值,防止析构时数值变化导致数组越界
  117. int m_nMaxSigleArrowTrainNums; //单方向最大列车数量
  118. int m_nAllPowerStationNums; //全线所有车站数量
  119. public:
  120. ~DCSysMG(void);
  121. };
  122. #endif