0712提交
This commit is contained in:
@@ -24,6 +24,7 @@ UpperCommManager::UpperCommManager(PowerManger* pm) :
|
||||
m_msCmd(),
|
||||
m_driver() {
|
||||
}
|
||||
DriverTable uDevice_secdistStateMsg::fault_state = {0};
|
||||
|
||||
bool UpperCommManager::processUpperMsg(const string& key, const string& strJson) {
|
||||
if (key == m_sysStateMsg.key)
|
||||
@@ -63,8 +64,7 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
|
||||
m_secdistStateMsg_fb_debug = std::make_pair(key, strJson);
|
||||
#endif
|
||||
m_secdistStateMsg.parseMsg(strJson, m_pm->m_subDisSysState);
|
||||
//debug 接受到次级配电状态,自动更新到设备状态
|
||||
//TODO:自动更新到设备状态
|
||||
//TODO:自动更新到设备状态 调试
|
||||
//m_pm->m_subDisSysState = m_pm->m_deviceState;
|
||||
return true;
|
||||
}
|
||||
@@ -107,6 +107,7 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
|
||||
m_pm->m_msCmd.workCMD = m_setOpConditionMsg.getSetOpCondition(key, strJson);
|
||||
MasterCommandEvent event;
|
||||
PowerManagerFsm::dispatch(event);
|
||||
return true;
|
||||
}
|
||||
else if(key == m_setPMSysMsg.key)
|
||||
{
|
||||
@@ -161,13 +162,12 @@ void UpperCommManager::processPeriodicTasks() {
|
||||
buildSystemReport();
|
||||
std::string strJson;
|
||||
//发送当前设备状态
|
||||
//TODO: 修改设备状态
|
||||
m_pm->m_currentDriverState.ins = 1;
|
||||
strJson = m_equStateMsg.buildMsg(m_pm->m_currentDriverState);
|
||||
m_pm->sendNotification(m_equStateMsg.key, strJson);
|
||||
//发送次级配电指令 修改后的代码
|
||||
// strJson = getSubDisCmd(m_pm->m_subDisSysCmd);
|
||||
// TODO : 修改指令逻辑,当状态一致时发送保持指令
|
||||
// strJson = m_secdistStateMsg.buildMsg(m_pm->m_subDisSysCmd);
|
||||
strJson = m_secdistStateMsg.buildMsg(m_pm->m_subDisSysCmd,m_pm->m_subDisSysState,2);
|
||||
strJson = m_secdistStateMsg.buildMsg(m_pm->m_subDisSysCmd,m_pm->m_subDisSysState, m_pm->m_subDisSysFault);
|
||||
m_pm->sendNotification(m_secdistStateMsg.key_cmd, strJson);
|
||||
//发送仪表电状态
|
||||
m_pm->sendNotification(m_equInsStateMsg.key,m_equInsStateMsg.buildMsg(m_pm->m_subDisSysState));
|
||||
@@ -175,6 +175,8 @@ void UpperCommManager::processPeriodicTasks() {
|
||||
m_equInsStateMsg_fb_degub = std::make_pair(m_equInsStateMsg.key,m_equInsStateMsg.buildMsg(m_pm->m_subDisSysState));
|
||||
m_secdistStateMsg_cmd_debug = std::make_pair(m_secdistStateMsg.key_cmd,strJson);
|
||||
m_equStateMsg_fb_debug = std::make_pair(m_equStateMsg.key_cmd,m_equStateMsg.buildMsg(m_pm->m_currentDriverState));
|
||||
strJson = m_pm->m_driver.saveDriverTableToJson(&m_pm->m_subDisSysFault);
|
||||
m_pm->sendNotification("uPower_subDisFault_st",strJson);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -190,14 +192,14 @@ void UpperCommManager::buildSystemReport() {
|
||||
m_pmStateMsg.state.m_leakage = m_pm->m_leakage;
|
||||
m_pmStateMsg.state.m_faultNum = m_pm->m_faultNum;
|
||||
|
||||
m_pm->sendNotification(m_pmStateMsg.key, m_pmStateMsg.buildMsg());
|
||||
m_pm->sendNotification(m_pmStateMsg.key, m_pmStateMsg.buildMsg(*(m_pm->m_systemData)));
|
||||
m_pm->sendNotification(m_fcsStateMsg.key, m_fcsStateMsg.buildMsg(*(m_pm->m_systemData)));
|
||||
m_pm->sendNotification(m_liBatStateMsg.key, m_liBatStateMsg.buildMsg(*(m_pm->m_systemData)));
|
||||
m_pm->sendNotification(m_disSysStateMsg.key, m_disSysStateMsg.buildMsg(*(m_pm->m_systemData),m_pm->m_currentDisBreakerState));
|
||||
m_pm->sendNotification(m_currentStateMsg.key, m_currentStateMsg.buildMsg(m_pm->m_pmCurrentState));
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_pmStateMsg_fb_debug = std::make_pair(m_pmStateMsg.key, m_pmStateMsg.buildMsg());
|
||||
m_pmStateMsg_fb_debug = std::make_pair(m_pmStateMsg.key, m_pmStateMsg.buildMsg(*(m_pm->m_systemData)));
|
||||
m_fcsStateMsg_st_debug = std::make_pair(m_fcsStateMsg.key, m_fcsStateMsg.buildMsg(*(m_pm->m_systemData)));
|
||||
m_liBatStateMsg_st_debug = std::make_pair(m_liBatStateMsg.key, m_liBatStateMsg.buildMsg(*(m_pm->m_systemData)));
|
||||
m_disSysStateMsg_st_debug = std::make_pair(m_disSysStateMsg.key, m_disSysStateMsg.buildMsg(*(m_pm->m_systemData),m_pm->m_currentDisBreakerState));
|
||||
|
||||
Reference in New Issue
Block a user