修改了上电操作
This commit is contained in:
@@ -341,11 +341,11 @@ void PowerManger::initControlCmd()
|
||||
//================初始化复合管控=============================
|
||||
m_CcuColCmd.fcmode = 0x00; //默认无效
|
||||
m_CcuColCmd.fcuCmd = 0x00; //无效指令
|
||||
m_CcuColCmd.fcuPowerEfficiency = 15; //默认为15kw
|
||||
m_CcuColCmd.fcuPowerEfficiency = 8; //默认为8kw
|
||||
m_CcuColCmd.insChargeEnable = 0x30; //不允许充电
|
||||
m_CcuColCmd.insBatCmd = 0x00; //无效指令
|
||||
m_CcuColCmd.powerBatCmd = 0x00; //无效指令
|
||||
m_CcuColCmd.powerBatEfficiency = 230; //默认为最大
|
||||
m_CcuColCmd.powerBatEfficiency = 00; //默认为最大
|
||||
m_CcuColCmd.heartbeat = 0;
|
||||
m_CcuColCmd.masterState = 0xAA;//主站状态,运行中
|
||||
//================初始化上位机指令=========================
|
||||
@@ -373,4 +373,25 @@ void PowerManger::injectFault(unsigned type,unsigned int faultCode){
|
||||
LOG_F(INFO, "注入故障: %d %d", type, faultCode);
|
||||
TestEvent testEvent("故障注入测试",type,faultCode);
|
||||
PowerManagerFsm::dispatch(testEvent);
|
||||
}
|
||||
|
||||
|
||||
void PowerManger::pushDeviceCommand(DeviceSwitchCmd cmd) {
|
||||
std::lock_guard<std::mutex> lock(m_deviceCmdMutex);
|
||||
m_deviceCmdQuenue.push(cmd);
|
||||
}
|
||||
|
||||
bool PowerManger::popDeviceCommand(DeviceSwitchCmd &cmd) {
|
||||
std::lock_guard<std::mutex> lock(m_deviceCmdMutex);
|
||||
if(m_deviceCmdQuenue.empty()) {
|
||||
return false;
|
||||
}
|
||||
cmd = m_deviceCmdQuenue.front();
|
||||
m_deviceCmdQuenue.pop();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PowerManger::isDeviceCmdEmpty() const {
|
||||
std::lock_guard<std::mutex> lock(m_deviceCmdMutex);
|
||||
return m_deviceCmdQuenue.empty();
|
||||
}
|
||||
Reference in New Issue
Block a user