优化结构
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#ifndef UPPER_COMM_MANAGER_H
|
||||
#define UPPER_COMM_MANAGER_H
|
||||
|
||||
#include "MOOS/libMOOS/Thirdparty/AppCasting/AppCastingMOOSApp.h"
|
||||
#include "pmSysvariable.h"
|
||||
#include "driver.h"
|
||||
#include "json/json.h"
|
||||
|
||||
class PowerManger; // 前向声明
|
||||
|
||||
class UpperCommManager {
|
||||
public:
|
||||
UpperCommManager(PowerManger* powerManager);
|
||||
~UpperCommManager();
|
||||
|
||||
// 处理上位机消息
|
||||
bool processUpperMsg(const std::string& key, const std::string& msg);
|
||||
|
||||
// 生成系统报告
|
||||
bool buildSystemReport();
|
||||
|
||||
// 获取控制命令
|
||||
const MSControlCmd& getControlCmd() const { return m_msCmd; }
|
||||
|
||||
// 更新设备命令状态
|
||||
void updateEquipmentCmd(const DriverTable& cmd);
|
||||
|
||||
private:
|
||||
PowerManger* m_powerManager;
|
||||
MSControlCmd m_msCmd;
|
||||
Driver m_driver;
|
||||
|
||||
// 从JSON解析控制命令
|
||||
bool parseControlCmdFromJson(MSControlCmd &cmd, const std::string &strJson);
|
||||
};
|
||||
|
||||
#endif // UPPER_COMM_MANAGER_H
|
||||
Reference in New Issue
Block a user