增加了状态显示弹窗
This commit is contained in:
@@ -104,8 +104,7 @@ bool PowerManger::Iterate()
|
||||
updateTime();
|
||||
//2. 运行状态机
|
||||
m_fsm.run(m_pmState,this);
|
||||
cout <<"CURRENT STATE:" << m_pmState.name << " | CURRENT EVENT :" << m_pmEvent << endl;
|
||||
|
||||
// cout <<"CURRENT STATE:" << m_pmState.name << " | CURRENT EVENT :" << m_pmEvent << endl;
|
||||
AppCastingMOOSApp::Iterate();
|
||||
//3. 输出报告
|
||||
buildPowerSysReport();
|
||||
@@ -799,14 +798,20 @@ int PowerManger::handleInite_s1(FSM_State &fsm, void* pData)
|
||||
{
|
||||
cout << fsm.name << endl;
|
||||
PowerManger* pm = (PowerManger*)pData;
|
||||
|
||||
//1. 检查复合管控器连接
|
||||
double StartTime = pm->GetAppStartTime();
|
||||
while (!pm->m_connected)
|
||||
{
|
||||
|
||||
disHighVolBusCmd a;
|
||||
a.fuelCellCircuitBreaker = DIS_BREAKER_OFF;
|
||||
a.propulsionMotorCircuitBreaker = DIS_BREAKER_OFF;
|
||||
pm->m_udpComm.sendDisSysCmd(a);
|
||||
|
||||
MOOSPause(1000);
|
||||
pm->updateTime();
|
||||
double dft = abs(pm->m_current_time - StartTime);
|
||||
if(dft > 1)
|
||||
if(dft > 10)
|
||||
{
|
||||
pm->m_pmState = pm->m_Fault_s99;
|
||||
break;
|
||||
@@ -835,18 +840,19 @@ int PowerManger::handleInite_s1(FSM_State &fsm, void* pData)
|
||||
// 首先闭合应急电源开关
|
||||
//TODO 检查并配置当前配电装置状态
|
||||
disHighVolBusCmd a;
|
||||
a.fuelCellCircuitBreaker = 0xAA;
|
||||
a.propulsionMotorCircuitBreaker = 0xAA;
|
||||
a.fuelCellCircuitBreaker = DIS_BREAKER_OFF;
|
||||
a.propulsionMotorCircuitBreaker = DIS_BREAKER_OFF;
|
||||
pm->m_udpComm.sendDisSysCmd(a);
|
||||
MOOSPause(1000);
|
||||
|
||||
// pm->workCondition = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PowerManger::handleFault_s99(FSM_State &fsm, void* pData)
|
||||
{
|
||||
cout << fsm.name << endl;
|
||||
// cout << fsm.name << endl;
|
||||
PowerManger* pm = (PowerManger*)pData;
|
||||
pm->printState(fsm,"故障");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user