完成了网页控制断路器
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <atomic>
|
||||
#include <vector>
|
||||
#include "udpComm.h"
|
||||
#include <functional>
|
||||
|
||||
class PowerManger; // 前向声明
|
||||
|
||||
@@ -30,19 +31,60 @@ public:
|
||||
// 初始化UDP通信
|
||||
bool initUdpComm();
|
||||
|
||||
// TODO:实现连接检查功能
|
||||
bool checkConnection();
|
||||
|
||||
// 更新设备状态
|
||||
bool updatePoweSystemStates();
|
||||
|
||||
//================================断路器操作函数=======================================
|
||||
template<typename CmdT, typename StateT>
|
||||
bool operateBreakerGeneric(
|
||||
char const* name,
|
||||
char opt,
|
||||
std::function<void(CmdT&)> fillCmd, // 填 cmd 对应字段
|
||||
std::function<StateT()> readState // 读 pmCurrentState 对应字段
|
||||
);
|
||||
// 高电压母线
|
||||
bool operate_HV_fuelCellCircuit_Breaker(char opt);
|
||||
bool operate_HV_powerLithiumBattery_Breaker(char opt);
|
||||
bool operate_HV_propulsionMotor_Breaker(char opt);
|
||||
bool operate_HV_lithiumBatteryMeter_Breaker(char opt);
|
||||
bool operate_HV_dcDc5Module_Breaker(char opt);
|
||||
bool operate_HV_bowHighVoltageBox_Breaker(char opt);
|
||||
bool operate_HV_sternFt45_Breaker(char opt);
|
||||
bool operate_HV_sternRudder1_Breaker(char opt);
|
||||
bool operate_HV_sternRudder2_Breaker(char opt);
|
||||
bool operate_HV_fbReserved_Breaker(char opt);
|
||||
bool operate_HV_tyzReserved_Breaker(char opt);
|
||||
bool operate_HV_reserved_Breaker(char opt);
|
||||
bool operate_HV_dcDc5_Breaker(char opt);
|
||||
bool operate_HV_coolingSystem_Breaker(char opt);
|
||||
// 高压汇流排
|
||||
bool operate_HVA_bowFTDevice123Circuit_Breaker(char opt);
|
||||
bool operate_HVA_actuatorCircuit_Breaker(char opt);
|
||||
bool operate_HVA_mastSteeringGearControlBoxCircuit_Breaker(char opt);
|
||||
bool operate_HVA_xczCircuit_Breaker(char opt);
|
||||
bool operate_HVA_bowRudderControlBoxCircuit_Breaker(char opt);
|
||||
bool operate_HVA_openWaterCoverStartCylinderCircuit_Breaker(char opt);
|
||||
// 仪表母线
|
||||
bool operate_LV_lithiumBatteryGroupInstrumentCircuit_Breaker(char opt);
|
||||
bool operate_LV_bowLowVoltageDistributionBoxCircuit_Breaker(char opt);
|
||||
bool operate_LV_unit4Dc48V_Breaker(char opt);
|
||||
bool operate_LV_dcC1Panel_Breaker(char opt);
|
||||
bool operate_LV_reservedCircuit1_Breaker(char opt);
|
||||
bool operate_LV_reservedCircuit2_Breaker(char opt);
|
||||
bool operate_LV_mergencyLithiumBatteryGroup2Circuit_Breaker(char opt);
|
||||
// 仪表汇流排
|
||||
bool operate_LVA_unit1Circuit_Breaker(char opt);
|
||||
bool operate_LVA_unit2Circuit_Breaker(char opt);
|
||||
bool operate_LVA_unit3Circuit_Breaker(char opt);
|
||||
bool operate_LVA_unit5Circuit_Breaker(char opt);
|
||||
bool operate_LVA_bowPZDeviceCircuit_Breaker(char opt);
|
||||
bool operate_LVA_reservedCircuit1_Breaker(char opt);
|
||||
bool operate_LVA_reservedCircuit2_Breaker(char opt);
|
||||
bool operate_LVA_mergencyLithiumBatteryGroup1Circuit_Breaker(char opt);
|
||||
//========================================================================================
|
||||
// 发送CCU控制命令
|
||||
bool sendCcuCommand(const ccuColCmd cmd);
|
||||
bool sendDisSysCommand(const disSysBreakerList& cmd);
|
||||
|
||||
// 获取通信状态
|
||||
int getConnectionState() const { return m_connectState; }
|
||||
|
||||
bool sendDisSysCommand(const disSysBreakerList& cmd); //已废弃,不同时操作多个继电器设备
|
||||
|
||||
// 启动/停止监听线程
|
||||
void startListenThread();
|
||||
void stopListenThread();
|
||||
|
||||
Reference in New Issue
Block a user