增加了配电app
This commit is contained in:
@@ -54,7 +54,7 @@ public:
|
||||
msg_CcuStateFbMsg m_CcuCurrentState;
|
||||
msg_disHighVolBusFbMsg m_disHighVolBusCurrentState;
|
||||
msg_disHighAVolBusFbMsg m_disHighAVolBusCurrentState;
|
||||
msg_disHighBVolBusFbMsg m_disHighBVolBusCurrentState;
|
||||
msg_disLowMainBusFbMsg m_disHighBVolBusCurrentState;
|
||||
msg_disLowBusFbMsg m_disLowBusState;
|
||||
// 配电和CCU的反馈状态时间戳
|
||||
double msg_CcuStateFbMsg_Update_time;
|
||||
|
||||
@@ -11,6 +11,37 @@ void PowerManagerFsm::react(TaskStopEvent const &e) {
|
||||
transit<RemoteControl>();
|
||||
LOG_F(INFO, "使命结束");
|
||||
};
|
||||
|
||||
void PowerManagerFsm::react(CycleTriggeredEvent const &){
|
||||
if(pm->currentMod != RunMode::Debug)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
bool PowerManagerFsm::handPowerProtection(DevCmdExt const &e){
|
||||
if(pm->workCondition > WorkCondition::REMOTE_CONTROL){
|
||||
LOG_F(INFO, "上电保护,执行任务时候禁止操作设备");
|
||||
return false;
|
||||
}
|
||||
if(e.id == DeviceId::singleBeamSonar1 ||
|
||||
e.id == DeviceId::singleBeamSonar2 ||
|
||||
e.id == DeviceId::singleBeamSonar3 ||
|
||||
e.id == DeviceId::singleBeamSonar4 ||
|
||||
e.id == DeviceId::singleBeamSonar5 ||
|
||||
e.id == DeviceId::singleBeamSonar6 ||
|
||||
e.id == DeviceId::singleBeamSonar7 ||
|
||||
e.id == DeviceId::singleBeamSonar8 ||
|
||||
e.id == DeviceId::sideSonar ||
|
||||
e.id == DeviceId::forwardSonar ||
|
||||
e.id == DeviceId::lowFreqSonar ||
|
||||
e.id == DeviceId::DVL ||
|
||||
e.id == DeviceId::USBL){
|
||||
if(e.cmd == 1){
|
||||
LOG_F(INFO, "水声设备操作上电保护 %d 已关闭", e.id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
void PowerManagerFsm::react(TaskStartEvent const &e){
|
||||
LOG_F(INFO, "TaskStartEvent received - type: %d, enableBowRudder: %d, enableBuoyancyAdjustment: %d", e.type, e.enableBowRudder, e.enableBuoyancyAdjustment);
|
||||
switch (e.type)
|
||||
@@ -44,7 +75,7 @@ void PowerManagerFsm::react(TaskStartEvent const &e){
|
||||
}
|
||||
}
|
||||
|
||||
void PowerManagerFsm::react(DevCmdExt const &e) {
|
||||
void PowerManagerFsm::react(DevCmdExt const &e) {
|
||||
LOG_F(INFO, "DevCmdExt received - id: %d, cmd: %d", e.id, e.cmd);
|
||||
switch (e.id)
|
||||
{
|
||||
@@ -1704,6 +1735,33 @@ void PowerManagerFsm::react(DevCmdExt const &e) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void StandbyState::react(DevCmdExt const &e)
|
||||
{
|
||||
LOG_F(INFO, "StandbyState::react(DevCmdExt const &e)");
|
||||
//正常模式下,不允许执行DevCmdExt
|
||||
if (pm->currentMod == RunMode::Normal )
|
||||
{
|
||||
LOG_F(INFO, "正常模式下,不允许执行DevCmdExt");
|
||||
}
|
||||
else if (pm->currentMod == RunMode::Test)
|
||||
{
|
||||
if(handPowerProtection(e))
|
||||
PowerManagerFsm::react(e);
|
||||
else
|
||||
LOG_F(INFO, "DevCmdExt 执行失败");
|
||||
}
|
||||
else if (pm->currentMod == RunMode::Debug)
|
||||
{
|
||||
LOG_F(INFO, "调试模式下,直接执行DevCmdExt");
|
||||
PowerManagerFsm::react(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_F(INFO, "当前模式未知");
|
||||
}
|
||||
}
|
||||
|
||||
void PowerManagerFsm::basicNavigationFault(FaultEvent const &e)
|
||||
{
|
||||
LOG_F(INFO, "basicNavigationFault");
|
||||
@@ -1712,6 +1770,7 @@ void PowerManagerFsm::basicNavigationFault(FaultEvent const &e)
|
||||
LOG_F(INFO, "部分深度计失效");
|
||||
pm->faultCode.push_back(0x1102);
|
||||
pm->faultCode.push_back(0x1103);
|
||||
pm->faultCode.push_back(0x1104);
|
||||
}
|
||||
if(FaultEnable::BasicNavigationFault_2)
|
||||
{
|
||||
@@ -2003,7 +2062,7 @@ void StandbyState::react(MasterCommandEvent const &) {
|
||||
}
|
||||
|
||||
void StandbyState::handlePowerOn() {
|
||||
PowerManagerFsm::pm->m_pmEvent = "动力电上电";
|
||||
LOG_F(INFO,"动力电上电");
|
||||
PowerManagerFsm::pm->m_CcuColCmd.powerBatCmd = 0x10;
|
||||
if(PowerManagerFsm::pm->m_pmCurrentState.ccustate.fcuState == 0x04)
|
||||
PowerManagerFsm::pm->m_CcuColCmd.fcuCmd = 0x02;
|
||||
@@ -2326,6 +2385,8 @@ void RemoteControl::entry() {
|
||||
LOG_F(INFO, "进入遥控工况");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// void StandbyState::react(TaskStart const &)
|
||||
// {
|
||||
// LOG_F(INFO, "接收到任务启动信息");
|
||||
|
||||
@@ -23,9 +23,6 @@ enum class PowerSystemState {
|
||||
struct InitEvent : tinyfsm::Event { };
|
||||
struct StandbyEvent : tinyfsm::Event { };
|
||||
struct TaskStopEvent : tinyfsm::Event { };
|
||||
|
||||
//==================状态流程事件============================
|
||||
struct MasterCommandEvent : tinyfsm::Event {};
|
||||
struct TaskStartEvent : tinyfsm::Event {
|
||||
int type;
|
||||
bool enableBowRudder;
|
||||
@@ -33,14 +30,17 @@ struct TaskStartEvent : tinyfsm::Event {
|
||||
TaskStartEvent() : type(0), enableBowRudder(false), enableBuoyancyAdjustment(false) {};
|
||||
TaskStartEvent(int type, bool bowRudder, bool buoyancyAdjustment) : type(type), enableBowRudder(bowRudder), enableBuoyancyAdjustment(buoyancyAdjustment) {};
|
||||
};
|
||||
struct DeviceCmd : tinyfsm::Event { };
|
||||
//==================状态流程事件============================
|
||||
struct CycleTriggeredEvent : tinyfsm::Event {};
|
||||
struct MasterCommandEvent : tinyfsm::Event {};
|
||||
struct DeviceCmd : tinyfsm::Event {};
|
||||
struct DevCmdExt : tinyfsm::Event {
|
||||
int id;
|
||||
int cmd;
|
||||
DevCmdExt() : id(0), cmd(0) {};
|
||||
DevCmdExt(int id, int cmd) : id(id), cmd(cmd) {};
|
||||
};
|
||||
struct FaultEvent : tinyfsm::Event {
|
||||
struct FaultEvent : tinyfsm::Event {
|
||||
unsigned int subDisSysFaultCode;
|
||||
unsigned int disSysFaultCode;
|
||||
unsigned int powerFaultCode;
|
||||
@@ -78,12 +78,15 @@ public:
|
||||
virtual void react(TaskStartEvent const &e);
|
||||
virtual void react(FaultEvent const &e);
|
||||
virtual void react(TaskStopEvent const &e);
|
||||
virtual void react(CycleTriggeredEvent const &);
|
||||
|
||||
//操作函数
|
||||
void handelPowerCmd();
|
||||
void handleModCmd();
|
||||
void handleWorkCmd();
|
||||
void handleDeviceCmd();
|
||||
|
||||
bool handPowerProtection(DevCmdExt const &e);
|
||||
//故障处理
|
||||
void basicNavigationFault(FaultEvent const &e);
|
||||
void extendedNavigationFault(FaultEvent const &e);
|
||||
@@ -141,6 +144,7 @@ class StandbyState : public PowerManagerFsm {
|
||||
public:
|
||||
void entry() override;
|
||||
void react(StandbyEvent const &) override;
|
||||
void react(DevCmdExt const &e) override;
|
||||
void react(MasterCommandEvent const &) override;
|
||||
private:
|
||||
void handlePowerOn();
|
||||
|
||||
@@ -34,6 +34,7 @@ PowerManger::PowerManger()
|
||||
sustainableTime = 0;
|
||||
m_faultNum = 0;
|
||||
m_ticker = 0;
|
||||
m_leakage = 0;
|
||||
faultCode.push_back(0);
|
||||
|
||||
m_pmCurrentState = {};
|
||||
|
||||
@@ -98,7 +98,8 @@ class PowerManger : public AppCastingMOOSApp
|
||||
unsigned int sustainableTime;
|
||||
unsigned int m_faultNum;
|
||||
Driver m_driver; //设备表处理
|
||||
std::string m_pmEvent; // 状态机事件描述
|
||||
unsigned char m_leakage;
|
||||
// std::string m_pmEvent; // 状态机事件描述
|
||||
//===========================CONFIG========================================
|
||||
long m_lPort;
|
||||
unsigned int m_nReceiveBufferSizeKB;
|
||||
@@ -106,7 +107,6 @@ class PowerManger : public AppCastingMOOSApp
|
||||
double m_current_time;
|
||||
unsigned int m_ticker;
|
||||
int connectState;
|
||||
|
||||
//=============================过程函数======================================
|
||||
void initControlCmd();
|
||||
|
||||
|
||||
@@ -385,6 +385,8 @@ void UpperCommManager::buildSystemReport() {
|
||||
|
||||
suffix = getTypeName(typeid(m_pm->sustainableTime).name());
|
||||
pms["sustainableTime_int64"] = m_pm->sustainableTime;
|
||||
|
||||
pms["leakage_uint8"] = m_pm->m_leakage;
|
||||
|
||||
//2.构建燃料电池状态报告
|
||||
suffix = getTypeName(typeid(m_pm->m_pmCurrentState.ccustate.fcuState).name());
|
||||
|
||||
@@ -27,7 +27,7 @@ using namespace std;
|
||||
|
||||
//决策消息
|
||||
#define DB_TO_PM_DEEPTH "uDevice_depth_st"
|
||||
#define DB_TO_PM_MISSION "uPlan_taskReport_st"
|
||||
#define DB_TO_PM_MISSION "uPlan_taskStart_cmd"
|
||||
#define DB_TO_PM_TASKSTOP "uPlan_planStop_cmd"
|
||||
|
||||
//外部通信消息
|
||||
|
||||
@@ -77,12 +77,12 @@ typedef struct
|
||||
cChecksum checkCode;
|
||||
}msg_disHVBACmd;
|
||||
|
||||
typedef struct
|
||||
typedef struct msg_disHVBBCmd
|
||||
{
|
||||
m_header header;
|
||||
disHighBVolBusCmd data;
|
||||
cChecksum checkCode;
|
||||
}msg_disHVBBCmd;
|
||||
}msg_disLVMBCmd;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -121,12 +121,12 @@ typedef struct {
|
||||
cChecksum checkCode;
|
||||
} msg_disHighAVolBusFbMsg;
|
||||
|
||||
// 高压母线B配电反馈
|
||||
// 仪表母线配电反馈
|
||||
typedef struct {
|
||||
m_header header;
|
||||
disHighBVolBusState data;
|
||||
disLowMainBusState data;
|
||||
cChecksum checkCode;
|
||||
} msg_disHighBVolBusFbMsg;
|
||||
} msg_disLowMainBusFbMsg;
|
||||
|
||||
//仪表汇流排配电反馈
|
||||
typedef struct {
|
||||
|
||||
@@ -120,149 +120,292 @@ typedef struct {
|
||||
|
||||
typedef struct disHighVolBusState
|
||||
{
|
||||
//断路器状态
|
||||
// 5: 燃料电池断路器
|
||||
unsigned char fuelCellCircuitBreaker;
|
||||
// 6: 动力锂电池断路器
|
||||
unsigned char powerLithiumBatteryCircuitBreaker;
|
||||
// 7: 推进电机断路器
|
||||
unsigned char propulsionMotorCircuitBreaker;
|
||||
// 8: 锂电池组仪表断路器
|
||||
unsigned char lithiumBatteryGroupInstrumentCircuitBreaker;
|
||||
// 9: DC/DC5模块断路器
|
||||
unsigned char dcDc5ModuleCircuitBreaker;
|
||||
// 10: 艏部高压配电箱断路器
|
||||
unsigned char bowHighVoltageDistributionBoxCircuitBreaker;
|
||||
// 11: 艉部FT装置4/5断路器
|
||||
unsigned char sternFTDevice45CircuitBreaker;
|
||||
// 12: 艉舵开关1断路器
|
||||
unsigned char sternRudderSwitch1CircuitBreaker;
|
||||
// 13: 艉舵开关2断路器
|
||||
unsigned char sternRudderSwitch2CircuitBreaker;
|
||||
// 14: FB预留断路器
|
||||
unsigned char fbReservedCircuitBreaker;
|
||||
// 15: TYZ预留断路器
|
||||
unsigned char tyzReservedCircuitBreaker;
|
||||
// 16: 预留断路器
|
||||
unsigned char reservedCircuitBreaker;
|
||||
unsigned char busInsulationLow;
|
||||
unsigned char busAInsulationHigh;
|
||||
unsigned char lostPower;
|
||||
unsigned char lostEmerPower;
|
||||
// unsigned char busInsulationLow;
|
||||
// unsigned char busAInsulationHigh;
|
||||
// 17: DC/DC5故障字低
|
||||
// 0x00: 正常状态
|
||||
// Bit0: DC/DC模块过温关机
|
||||
// Bit1: 输出过流
|
||||
// Bit2: 输出过压
|
||||
// Bit3: 输出欠压
|
||||
// Bit4: 输入过压
|
||||
// Bit5: 输入欠压
|
||||
// Bit6: 输出短路保护
|
||||
// Bit7: 内部故障
|
||||
// 18: DC/DC5故障字高
|
||||
unsigned char dcDcFaultWord1;
|
||||
// 0x00: 正常状态
|
||||
// Bit0: 通讯故障报警
|
||||
// Bit1: 工作状态
|
||||
// Bit2: 冷却泵1故障
|
||||
// Bit3: 冷却泵2故障
|
||||
// Bit4: 冷却水泄露
|
||||
unsigned char dcDcFaultWord2;
|
||||
// 19: 动力母排绝缘状态(0x55 正常,0xAA 绝缘低)
|
||||
unsigned char powerBusInsulationStatus;
|
||||
// 20: A汇流排绝缘状态(0x55 正常,0xAA 绝缘低)
|
||||
unsigned char aBusInsulationStatus;
|
||||
// 21: 仪表电源状态 (0x55 正常,0xAA 故障)
|
||||
unsigned char meterPowerLossSignal;
|
||||
// 22: 应急电源状态 (0x55 正常,0xAA 故障)
|
||||
unsigned char emergencyPowerLossSignal;
|
||||
// 23: 动力汇流排电压
|
||||
unsigned short powerBusVoltage;
|
||||
// 24: DC/DC5模块电流
|
||||
unsigned short dcDc5ModuleCurrent;
|
||||
// 25: 动力汇流排电流
|
||||
unsigned short powerBusCurrent;
|
||||
// 26: A汇流排电压
|
||||
unsigned short busbarAVoltage;
|
||||
// 27: 推进电机控制箱电流
|
||||
unsigned short propulsionMotorControlBoxCurrent;
|
||||
// 28: A汇流排电流
|
||||
unsigned short busbarACurrent;
|
||||
// 29: 锂电池组(仪表)电流
|
||||
unsigned short lithiumBatteryGroupMeterCurrent;
|
||||
// 30: 艏部高压配电箱电流
|
||||
unsigned short bowHighVoltageDistributionBoxCurrent;
|
||||
// 31: 艉部FT装置4/5电流
|
||||
unsigned short sternFTDevice45Current;
|
||||
// 32: TYZ预留开关电流
|
||||
unsigned short tyzReservedSwitchCurrent;
|
||||
// 33: 艉舵开关1电流
|
||||
unsigned short sternRudderSwitch1Current;
|
||||
// 34: 预留电流
|
||||
unsigned short reservedCurrent1; // 改为 reservedCurrent1 以避免重名
|
||||
// 35: 艉舵开关2电流
|
||||
unsigned short sternRudderSwitch2Current;
|
||||
// 36: 预留电流2
|
||||
unsigned short reservedCurrent2; // 改为 reservedCurrent2 以避免重名
|
||||
// 37: FB预留电流
|
||||
unsigned short fbReservedSwitchCurrent;
|
||||
// 38: 预留电流3
|
||||
unsigned short reservedCurrent3; // 改为 reservedCurrent3 以避免重名
|
||||
// 39: 冷却水压力
|
||||
unsigned short coolWaterPressure;
|
||||
}disHighVolBusState;
|
||||
|
||||
typedef struct disHighAVolBusState
|
||||
{
|
||||
//5. 艏部FT装置1/2/3断路器
|
||||
unsigned char bowFTDevice123CircuitBreaker;
|
||||
//6. 启闭机构断路器
|
||||
unsigned char actuatorCircuitBreaker;
|
||||
//7. 桅杆舵机控制箱断路器
|
||||
unsigned char mastSteeringGearControlBoxCircuitBreaker;
|
||||
//8. XCZ断路器
|
||||
unsigned char xczCircuitBreaker;
|
||||
//9. 艏舵控制箱断路器
|
||||
unsigned char bowRudderControlBoxCircuitBreaker;
|
||||
//10. 敞水盖启动电缸断路器
|
||||
unsigned char openWaterCoverStartCylinderCircuitBreaker;
|
||||
//11. 仪表电源失电信号 (0x55 正常,0xAA 故障)
|
||||
unsigned char instrumentPowerFailureSignal;
|
||||
//12. 应急电源失电信号 (0x55 正常,0xAA 故障)
|
||||
unsigned char emergencyPowerFailureSignal;
|
||||
//13. 浸水报警
|
||||
// unsigned char busbarBInsulationStatus;
|
||||
unsigned char waterIngressionAlarm;
|
||||
//14. 汇流排B电压
|
||||
unsigned short busbarBVoltage;
|
||||
//15. 汇流排B电流
|
||||
unsigned short busbarBCurrent;
|
||||
//16. 艏部FT装置1/2/3电流
|
||||
unsigned short bowFTDevice123Current;
|
||||
//17. 启闭机构电流
|
||||
unsigned short actuatorCurrent;
|
||||
//18. 桅杆舵机控制箱电流
|
||||
unsigned short mastSteeringGearControlBoxCurrent;
|
||||
//19. XCZ电流
|
||||
unsigned short xczCurrent;
|
||||
//20. 艏舵控制箱电流
|
||||
unsigned short bowRudderControlBoxCurrent;
|
||||
//21. 敞水盖启动电缸电流
|
||||
unsigned short openWaterCoverStartCylinderCurrent;
|
||||
}disHighAVolBusState;
|
||||
|
||||
typedef struct disHighBVolBusState
|
||||
{
|
||||
//5. 锂电池组(仪表)断路器
|
||||
unsigned char lithiumBatteryGroupInstrumentCircuitBreaker;
|
||||
//6. 艏部低压配电箱断路器
|
||||
unsigned char bowLowVoltageDistributionBoxCircuitBreaker;
|
||||
//7. UNIT4仪表DC48V断路器
|
||||
unsigned char unit4InstrumentDC48VCircuitBreaker;
|
||||
//8. DC-C1直流配电板断路器
|
||||
unsigned char dcC1DCDistributionPanelCircuitBreaker;
|
||||
//9. 预留断路器1
|
||||
unsigned char reservedCircuitBreaker1; // 为了区分,添加了数字后缀
|
||||
//10. 预留断路器2
|
||||
unsigned char reservedCircuitBreaker2; // 为了区分,添加了数字后缀
|
||||
//11. 应急锂电池组2断路器
|
||||
unsigned char emergencyLithiumBatteryGroup2CircuitBreaker;
|
||||
//12. 仪表电源失电信号 (0x55 正常,0xAA 故障)
|
||||
unsigned char instrumentPowerFailureSignal;
|
||||
//13. 应急电源失电信号 (0x55 正常,0xAA 故障)
|
||||
unsigned char emergencyPowerFailureSignal;
|
||||
//14. 仪表汇流排绝缘低 (0x55 正常,0xAA 绝缘低)
|
||||
unsigned char instrumentBusbarInsulationLow;
|
||||
//15. 仪表母排电压
|
||||
unsigned short instrumentBusbarVoltage;
|
||||
//16. 艏部低压配电箱电流
|
||||
unsigned short bowLowVoltageDistributionBoxCurrent;
|
||||
//17. DC-C1(直流配电板1)仪表DC48V电流
|
||||
unsigned short dcC1InstrumentDC48VCurrent;
|
||||
//18. 预留电流
|
||||
unsigned short reservedCurrent1; // 为了区分,添加了数字后缀
|
||||
//19. 应急锂电池组2电流
|
||||
unsigned short emergencyLithiumBatteryGroup2Current;
|
||||
//20. 锂电池组(仪表)电流
|
||||
unsigned short lithiumBatteryGroupInstrumentCurrent;
|
||||
//21. UNIT4仪表DC48V电流
|
||||
unsigned short unit4InstrumentDC48VCurrent;
|
||||
//22. Ushort 预留电流
|
||||
unsigned short reservedCurrent2; // 为了区分,添加了数字后缀
|
||||
//23. 应急2汇流排电压
|
||||
unsigned short emergency2BusbarVoltage;
|
||||
//24. 复合能源管控系统应急DC48V电流
|
||||
unsigned short compositeEnergyManagementSystemEmergencyDC48VCurrent;
|
||||
//25. 燃料电池安全系统应急DC48V电流
|
||||
unsigned short fuelCellSecuritySystemEmergencyDC48VCurrent;
|
||||
//26. PLC控制电源电流
|
||||
unsigned short plcControlPowerCurrent;
|
||||
}disHighBVolBusState;
|
||||
}disLowMainBusState;
|
||||
|
||||
typedef struct disLowBusState
|
||||
{
|
||||
//5. UNIT1断路器
|
||||
unsigned char unit1CircuitBreaker;
|
||||
//6. UNIT2断路器
|
||||
unsigned char unit2CircuitBreaker;
|
||||
//7. UNIT3断路器
|
||||
unsigned char unit3CircuitBreaker;
|
||||
//8. UNIT5断路器
|
||||
unsigned char unit5CircuitBreaker;
|
||||
//9. 艏部PZ装置断路器
|
||||
unsigned char bowPZDeviceCircuitBreaker;
|
||||
//10. 预留断路器1
|
||||
unsigned char reservedCircuitBreaker1; // 为了区分,添加了数字后缀
|
||||
//11. 预留断路器2
|
||||
unsigned char reservedCircuitBreaker2; // 为了区分,添加了数字后缀
|
||||
//12. 应急锂电池组1断路器
|
||||
unsigned char emergencyLithiumBatteryGroup1CircuitBreaker;
|
||||
//13. 仪表电源失电信号 (0x55 正常,0xAA 故障)
|
||||
unsigned char powerFailureSignal;
|
||||
//14. 浸水报警 (0x55 正常,0xAA 故障)
|
||||
unsigned char waterIngressionAlarm;
|
||||
//15. 仪表母排电压
|
||||
unsigned short instrumentBusbarVoltage;
|
||||
//16. 仪表母排电流
|
||||
unsigned short instrumentBusbarCurrent;
|
||||
//17. UNIT1电流
|
||||
unsigned short unit1Current;
|
||||
//18. UNIT2电流
|
||||
unsigned short unit2Current;
|
||||
//19. UNIT3电流
|
||||
unsigned short unit3Current;
|
||||
//20. UNIT5电流
|
||||
unsigned short unit5Current;
|
||||
//21. 艏部PZ装置电流
|
||||
unsigned short bowPZDeviceCurrent;
|
||||
//22. 应急锂电池组1电流
|
||||
unsigned short emergencyLithiumBatteryGroup1Current;
|
||||
//23. 应急1汇流排电压
|
||||
unsigned short emergency1BusbarVoltage;
|
||||
}disLowBusState;
|
||||
|
||||
typedef struct disHighVolBusCmd
|
||||
{
|
||||
// 5: 燃料电池断路器
|
||||
unsigned char fuelCellCircuitBreaker;
|
||||
// 6: 动力锂电池断路器
|
||||
unsigned char powerLithiumBatteryCircuitBreaker;
|
||||
// 7: 推进电机断路器
|
||||
unsigned char propulsionMotorCircuitBreaker;
|
||||
// 8: 锂电池组仪表断路器
|
||||
unsigned char lithiumBatteryGroupInstrumentCircuitBreaker;
|
||||
// 9: DC/DC5模块断路器
|
||||
unsigned char dcDc5ModuleCircuitBreaker;
|
||||
// 10: 艏部高压配电箱断路器
|
||||
unsigned char bowHighVoltageDistributionBoxCircuitBreaker;
|
||||
// 11: 艉部FT装置4/5断路器
|
||||
unsigned char sternFTDevice45CircuitBreaker;
|
||||
// 12: 艉舵开关1断路器
|
||||
unsigned char sternRudderSwitch1CircuitBreaker;
|
||||
// 13: 艉舵开关2断路器
|
||||
unsigned char sternRudderSwitch2CircuitBreaker;
|
||||
// 14: FB预留断路器
|
||||
unsigned char fbReservedCircuitBreaker;
|
||||
// 15: TYZ预留断路器
|
||||
unsigned char tyzReservedCircuitBreaker;
|
||||
// 16: 预留断路器
|
||||
unsigned char reservedCircuitBreaker;
|
||||
// 17: DC/DC5模块启动
|
||||
unsigned char dcdc5Module;
|
||||
unsigned char inputWater;
|
||||
unsigned char outputWater;
|
||||
// 18: 冷却系统启动
|
||||
unsigned char coolingSystem;
|
||||
// unsigned char inputWater;
|
||||
// unsigned char outputWater;
|
||||
}disHighVolBusCmd;
|
||||
|
||||
typedef struct disHighAVolBusCmd
|
||||
{
|
||||
//5. 艏部FT装置1/2/3断路器
|
||||
unsigned char bowFTDevice123CircuitBreaker;
|
||||
//6. 启闭机构断路器
|
||||
unsigned char actuatorCircuitBreaker;
|
||||
//7. 桅杆舵机控制箱断路器
|
||||
unsigned char mastSteeringGearControlBoxCircuitBreaker;
|
||||
//8. XCZ断路器
|
||||
unsigned char xczCircuitBreaker;
|
||||
//9. 艏舵控制箱断路器
|
||||
unsigned char bowRudderControlBoxCircuitBreaker;
|
||||
//10. 敞水盖启动电缸断路器
|
||||
unsigned char openWaterCoverStartCylinderCircuitBreaker;
|
||||
}disHighAVolBusCmd;
|
||||
|
||||
typedef struct disHighBVolBusCmd
|
||||
{
|
||||
//5. 锂电池组(仪表)断路器
|
||||
unsigned char lithiumBatteryGroupInstrumentCircuitBreaker;
|
||||
//6. 艏部低压配电箱断路器
|
||||
unsigned char bowLowVoltageDistributionBoxCircuitBreaker;
|
||||
//7. UNIT4仪表DC48V断路器
|
||||
unsigned char unit4InstrumentDC48VCircuitBreaker;
|
||||
//8. DC-C1直流配电板断路器
|
||||
unsigned char dcC1DCDistributionPanelCircuitBreaker;
|
||||
//9. 预留断路器1
|
||||
unsigned char reservedCircuitBreaker1; // 为了区分,添加了数字后缀
|
||||
//10. 预留断路器2
|
||||
unsigned char reservedCircuitBreaker2; // 为了区分,添加了数字后缀
|
||||
//11. 应急锂电池组2断路器
|
||||
unsigned char emergencyLithiumBatteryGroup2CircuitBreaker;
|
||||
}disHighBVolBusCmd;
|
||||
}disLowMainBusCmd;
|
||||
|
||||
typedef struct disLowBusCmd
|
||||
{
|
||||
@@ -284,7 +427,7 @@ typedef struct pmState
|
||||
ccuState ccustate;
|
||||
disHighVolBusState bus1State;
|
||||
disHighAVolBusState bus2State;
|
||||
disHighBVolBusState bus3State;
|
||||
disLowMainBusState bus3State;
|
||||
disLowBusState bus4State;
|
||||
} PmState;
|
||||
|
||||
@@ -439,6 +582,17 @@ namespace WorkCondition {
|
||||
};
|
||||
};
|
||||
|
||||
namespace RunMode {
|
||||
enum Type : unsigned char {
|
||||
//正常模式
|
||||
Normal = 0,
|
||||
//测试模式
|
||||
Test = 1,
|
||||
//调试模式
|
||||
Debug = 2
|
||||
};
|
||||
};
|
||||
|
||||
namespace TaskType {
|
||||
enum Type : unsigned char {
|
||||
THROW_LOAD = 1, // 抛载
|
||||
@@ -510,55 +664,122 @@ struct DeviceSwitchCmd
|
||||
int cmd;
|
||||
};
|
||||
|
||||
namespace DeviceId {
|
||||
enum Type : unsigned char {
|
||||
singleBeamSonar1 = 0,
|
||||
singleBeamSonar2 = 1,
|
||||
singleBeamSonar3 = 2,
|
||||
singleBeamSonar4 = 3,
|
||||
singleBeamSonar5 = 4,
|
||||
singleBeamSonar6 = 5,
|
||||
singleBeamSonar7 = 6,
|
||||
singleBeamSonar8 = 7,
|
||||
forwardSonar = 8,
|
||||
bowCover1 = 9,
|
||||
bowCover2 = 10,
|
||||
bowCover3 = 11,
|
||||
bowCover4 = 12,
|
||||
bowCover5 = 13,
|
||||
bowCover6 = 14,
|
||||
bowRudderDeploy = 15,
|
||||
bowRudderServo1 = 16,
|
||||
bowRudderServo2 = 17,
|
||||
depth1 = 18,
|
||||
depth2 = 19,
|
||||
depth3 = 20,
|
||||
overDeep1 = 21,
|
||||
overDeep2 = 22,
|
||||
ctd1 = 23,
|
||||
ctd2 = 24,
|
||||
soundVeloc = 25,
|
||||
waterInject = 26,
|
||||
bowWaterlnet1 = 27,
|
||||
bowWaterlnet2 = 28,
|
||||
bowWaterlnet3 = 29,
|
||||
bowWaterlnet4 = 30,
|
||||
bowWaterlnet5 = 31,
|
||||
bowWaterlnet6 = 32,
|
||||
bowWaterlnet7 = 33,
|
||||
bowWaterlnet8 = 34,
|
||||
sideSonar = 35,
|
||||
lowFreqSonar = 36,
|
||||
launchControler = 37,
|
||||
photoSensor = 38,
|
||||
electSensor = 39,
|
||||
commMast = 40,
|
||||
mastLiftingServo = 41,
|
||||
USBL = 42,
|
||||
DVL = 43,
|
||||
buoyancyAdjust1 = 44,
|
||||
buoyancyAdjust2 = 45,
|
||||
buoyancyAdjust3 = 46,
|
||||
buoyancyAdjust4 = 47,
|
||||
buoyancyAdjust5 = 48,
|
||||
sternRudderServo1 = 49,
|
||||
sternRudderServo2 = 50,
|
||||
sternRudderServo3 = 51,
|
||||
sternRudderServo4 = 52,
|
||||
thruster = 53,
|
||||
bowThrow = 54,
|
||||
sternThrow = 55,
|
||||
buoyage = 56,
|
||||
ins = 57,
|
||||
ntp = 58,
|
||||
inputWaterSensor1 = 59,
|
||||
inputWaterSensor2 = 60,
|
||||
inputWaterSensor3 = 61,
|
||||
};
|
||||
}
|
||||
|
||||
namespace FaultEnable {
|
||||
enum Type : bool {
|
||||
BasicNavigationFault_1 = true, // 使能故障
|
||||
BasicNavigationFault_2 = false,
|
||||
BasicNavigationFault_3 = false,
|
||||
BasicNavigationFault_4 = false,
|
||||
BasicNavigationFault_5 = false,
|
||||
BasicNavigationFault_6 = false,
|
||||
BasicNavigationFault_7 = false,
|
||||
BasicNavigationFault_8 = false,
|
||||
BasicNavigationFault_9 = false,
|
||||
BasicNavigationFault_10 = false,
|
||||
BasicNavigationFault_2 = true,
|
||||
BasicNavigationFault_3 = true,
|
||||
BasicNavigationFault_4 = true,
|
||||
BasicNavigationFault_5 = true,
|
||||
BasicNavigationFault_6 = true,
|
||||
BasicNavigationFault_7 = true,
|
||||
BasicNavigationFault_8 = true,
|
||||
BasicNavigationFault_9 = true,
|
||||
BasicNavigationFault_10 = true,
|
||||
|
||||
ExtendedNavigationFault_1 = false, // 使能故障
|
||||
ExtendedNavigationFault_2 = false,
|
||||
ExtendedNavigationFault_3 = false,
|
||||
ExtendedNavigationFault_4 = false,
|
||||
ExtendedNavigationFault_1 = true, // 使能故障
|
||||
ExtendedNavigationFault_2 = true,
|
||||
ExtendedNavigationFault_3 = true,
|
||||
ExtendedNavigationFault_4 = true,
|
||||
|
||||
ObstacleAvoidanceFault_1 = false, // 使能故障
|
||||
ObstacleAvoidanceFault_2 = false,
|
||||
ObstacleAvoidanceFault_3 = false,
|
||||
ObstacleAvoidanceFault_1 = true, // 使能故障
|
||||
ObstacleAvoidanceFault_2 = true,
|
||||
ObstacleAvoidanceFault_3 = true,
|
||||
|
||||
BuoyancyControlFault_1 = false, // 使能故障
|
||||
BuoyancyControlFault_2 = false,
|
||||
BuoyancyControlFault_3 = false,
|
||||
BuoyancyControlFault_4 = false,
|
||||
BuoyancyControlFault_1 = true, // 使能故障
|
||||
BuoyancyControlFault_2 = true,
|
||||
BuoyancyControlFault_3 = true,
|
||||
BuoyancyControlFault_4 = true,
|
||||
|
||||
CommunicationSystemFault_1 = false, // 使能故障
|
||||
CommunicationSystemFault_2 = false,
|
||||
CommunicationSystemFault_3 = false,
|
||||
CommunicationSystemFault_1 = true, // 使能故障
|
||||
CommunicationSystemFault_2 = true,
|
||||
CommunicationSystemFault_3 = true,
|
||||
|
||||
PayloadSystemFault_1 = false, // 使能故障
|
||||
PayloadSystemFault_2 = false,
|
||||
PayloadSystemFault_3 = false,
|
||||
PayloadSystemFault_4 = false,
|
||||
PayloadSystemFault_5 = false,
|
||||
PayloadSystemFault_6 = false,
|
||||
PayloadSystemFault_7 = false,
|
||||
PayloadSystemFault_1 = true, // 使能故障
|
||||
PayloadSystemFault_2 = true,
|
||||
PayloadSystemFault_3 = true,
|
||||
PayloadSystemFault_4 = true,
|
||||
PayloadSystemFault_5 = true,
|
||||
PayloadSystemFault_6 = true,
|
||||
PayloadSystemFault_7 = true,
|
||||
|
||||
EmergencySystemFault_1 = false, // 使能故障
|
||||
EmergencySystemFault_2 = false,
|
||||
EmergencySystemFault_3 = false,
|
||||
EmergencySystemFault_4 = false,
|
||||
EmergencySystemFault_5 = false,
|
||||
EmergencySystemFault_6 = false,
|
||||
EmergencySystemFault_1 = true, // 使能故障
|
||||
EmergencySystemFault_2 = true,
|
||||
EmergencySystemFault_3 = true,
|
||||
EmergencySystemFault_4 = true,
|
||||
EmergencySystemFault_5 = true,
|
||||
EmergencySystemFault_6 = true,
|
||||
|
||||
SensorSystemFault_1 = false, // 使能故障
|
||||
SensorSystemFault_2 = false,
|
||||
SensorSystemFault_3 = false,
|
||||
SensorSystemFault_1 = true, // 使能故障
|
||||
SensorSystemFault_2 = true,
|
||||
SensorSystemFault_3 = true,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -112,12 +112,12 @@ bool udpComm::getMsgFromBuff(char *m, msg_disHighAVolBusFbMsg &s)
|
||||
s = *p;
|
||||
return true;
|
||||
}
|
||||
bool udpComm::getMsgFromBuff(char *m, msg_disHighBVolBusFbMsg &s)
|
||||
bool udpComm::getMsgFromBuff(char *m, msg_disLowMainBusFbMsg &s)
|
||||
{
|
||||
cChecksum sum;
|
||||
msg_disHighBVolBusFbMsg *p;
|
||||
p = reinterpret_cast<msg_disHighBVolBusFbMsg *>(m);
|
||||
sum = calculateChecksum((unsigned char*)m, sizeof(msg_disHighBVolBusFbMsg), sizeof(cChecksum)) & 0xFF;
|
||||
msg_disLowMainBusFbMsg *p;
|
||||
p = reinterpret_cast<msg_disLowMainBusFbMsg *>(m);
|
||||
sum = calculateChecksum((unsigned char*)m, sizeof(msg_disLowMainBusFbMsg), sizeof(cChecksum)) & 0xFF;
|
||||
if (sum!= p->checkCode) {
|
||||
sError.push_back("DisSys HVBBus Msg Check error");
|
||||
return false;
|
||||
@@ -252,7 +252,7 @@ bool udpComm::pushMsgToQueue(unsigned char *m)
|
||||
}
|
||||
case DIS_HVBUSB_FB_ID: //DIS_HVBUSB_FB 0x0007
|
||||
{
|
||||
msg_disHighBVolBusFbMsg s;
|
||||
msg_disLowMainBusFbMsg s;
|
||||
if(getMsgFromBuff((char *)Buff,s))
|
||||
{
|
||||
if(m_qReceiveDisHighBVolBusBuffer.size()<QUENUE_SIZE)
|
||||
@@ -359,7 +359,7 @@ bool udpComm::popMsgFormQueue(double &time,msg_disHighAVolBusFbMsg &m)
|
||||
m_qReceiveDisHighAVolBusBuffer.pop();
|
||||
return true;
|
||||
}
|
||||
bool udpComm::popMsgFormQueue(double &time,msg_disHighBVolBusFbMsg &m)
|
||||
bool udpComm::popMsgFormQueue(double &time,msg_disLowMainBusFbMsg &m)
|
||||
{
|
||||
if(m_qReceiveDisHighBVolBusBuffer.empty())
|
||||
return false;
|
||||
|
||||
@@ -32,14 +32,14 @@ public:
|
||||
bool getMsgFromBuff(char *m, msg_CcuSetParmFbMsg &s);
|
||||
bool getMsgFromBuff(char *m, msg_disHighVolBusFbMsg &s);
|
||||
bool getMsgFromBuff(char *m, msg_disHighAVolBusFbMsg &s);
|
||||
bool getMsgFromBuff(char *m, msg_disHighBVolBusFbMsg &s);
|
||||
bool getMsgFromBuff(char *m, msg_disLowMainBusFbMsg &s);
|
||||
bool getMsgFromBuff(char *m, msg_disLowBusFbMsg &s);
|
||||
|
||||
bool popMsgFormQueue(double &time,msg_CcuStateFbMsg &m);
|
||||
bool popMsgFormQueue(double &time,msg_CcuSetParmFbMsg &m);
|
||||
bool popMsgFormQueue(double &time,msg_disHighVolBusFbMsg &m);
|
||||
bool popMsgFormQueue(double &time,msg_disHighAVolBusFbMsg &m);
|
||||
bool popMsgFormQueue(double &time,msg_disHighBVolBusFbMsg &m);
|
||||
bool popMsgFormQueue(double &time,msg_disLowMainBusFbMsg &m);
|
||||
bool popMsgFormQueue(double &time,msg_disLowBusFbMsg &m);
|
||||
|
||||
bool sendCcuColCmd(const ccuColCmd cmd);
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
std::queue<std::pair<double,msg_CcuSetParmFbMsg>> m_qReceiveCcuSetParmBuffer;
|
||||
std::queue<std::pair<double,msg_disHighVolBusFbMsg>> m_qReceiveDisHighVolBusBuffer;
|
||||
std::queue<std::pair<double,msg_disHighAVolBusFbMsg>> m_qReceiveDisHighAVolBusBuffer;
|
||||
std::queue<std::pair<double,msg_disHighBVolBusFbMsg>> m_qReceiveDisHighBVolBusBuffer;
|
||||
std::queue<std::pair<double,msg_disLowMainBusFbMsg>> m_qReceiveDisHighBVolBusBuffer;
|
||||
std::queue<std::pair<double,msg_disLowBusFbMsg>> m_qReceiveDisLowBusBuffer;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user