| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 | 
							- #pragma once
 
- #include <string>
 
- #include <map>
 
- #include <list>
 
- #include <vector>
 
- class CMonitorObject
 
- {
 
- public:
 
- 	CMonitorObject();
 
- 	virtual ~CMonitorObject();
 
- public:
 
- 	std::string id;
 
- 	std::string name;
 
- 	std::string type;
 
- 	std::string up;
 
- 	std::list<CMonitorObject*> m_lstMo;
 
- 	//如果type为mo.mp的, 可能存在报警参数
 
- 	//报警参数
 
- };
 
- class CMonitorObjectMng
 
- {
 
- 	CMonitorObjectMng();
 
- 	virtual ~CMonitorObjectMng();
 
- public:
 
- 	static CMonitorObjectMng* Instance()	{ return &obj; };
 
- 	BOOL	LoadMonitorTree();
 
- 	BOOL	LoadHistoryData();
 
- 	//获取战场站点名
 
- 	bool	GetStationNameByMomP(const std::string& momp, std::string& station, std::string& momp_name);
 
- 	bool	GetStationNameByMomP(const std::string& mo, const std::string& mp, std::string& station, std::string& momp_name);
 
- 	//获取测力曲线名称
 
- 	bool	GetNameByMoMp(const std::string& momp, std::string& name1, std::string& name2, std::string& name3);
 
- 	bool	GetNameByMoMp(const std::string& momp, std::string& name1, std::string& name2, std::string& name3, std::string& out_name, std::string& in_name);
 
- 	//设置测力曲线名称
 
- 	void	SetNameByMoMp(const std::string& momp, std::string& name1, std::string& name2, std::string& name3);
 
- 	//获取转换阻力方向名称
 
- 	bool	GetDirectByMoMp(const std::string& momp, std::string& direct1, std::string& direct2);
 
- 	//设置转换阻力方向名称
 
- 	void	SetDirectByMoMp(const std::string& momp, std::string& direct1, std::string& direct2);
 
- 	static bool	spiltByPoint(std::string&src, std::string& dst1, std::string& dst2);
 
- 	std::string concatStringByPoint(const std::string& src1, const std::string& src2);
 
- 	//通过ID来获取树节点
 
- 	CMonitorObject* GetTreeByID(string& id);
 
- 	
 
- 	static bool    ReNameMO(string id, string name);
 
- 	static bool    AddMO(string id, string name, string type, string up);
 
- 	static bool    AddMO2(string id, string name, string type, string up);
 
- private:
 
- 	static CMonitorObject* GetTreeByID(CMonitorObject* p, string& id);
 
- 	void	GetChild(std::list<CMonitorObject*>& lst, std::list<CMonitorObject*>& child, const std::string& id);
 
- 	bool	GetStationNameByMomP(CMonitorObject* pInfo, const std::string& momp, std::string& station, std::string& momp_name);
 
- 	void	Clear();
 
- 	CMonitorObject*	m_treeroot = nullptr;//整棵树
 
- 	std::map<std::string, std::string> m_mapImeiIdxMoMp;//设备号对应momp
 
- 	std::map<std::string, std::string> m_mapMoMpImeiIdx;
 
- 	std::map<std::string, std::vector<string>> m_mapMoMpName;  //mo, mp 对应三个测力曲线的名称
 
- 	std::map<std::string, std::vector<string>> m_mapMoMpDirect;	//mo, mp 对应的两个阻力转换方向名称
 
- private:
 
- 	static CMonitorObjectMng obj;
 
- };
 
 
  |