增加了MOOSDB消息的订阅和处理函数
This commit is contained in:
@@ -1,47 +1,47 @@
|
||||
{
|
||||
"HVABFTDev123Cur_uint16": 0,
|
||||
"HVABactCur_uint16": 0,
|
||||
"HVABbowRudCur_uint16": 58353,
|
||||
"HVABbusBCur_uint16": 0,
|
||||
"HVABbusBVol_uint16": 0,
|
||||
"HVABmastSteGeaCur_uint16": 0,
|
||||
"HVABopenWaterCur_uint16": 52412,
|
||||
"HVABxczCur_uint16": 18176,
|
||||
"HVBBCCUCur_uint16": 193,
|
||||
"HVBBFCSSecurSysCur_uint16": 0,
|
||||
"HVBBbatInsCur_uint16": 22321,
|
||||
"HVBBbowLowVolDisBoxCur_uint16": 22321,
|
||||
"HVBBdcC1InsCur_uint16": 64995,
|
||||
"HVBBemer2BusVol_uint16": 22272,
|
||||
"HVBBemerBatCur_uint16": 47104,
|
||||
"HVBBinsBusVol_uint16": 49152,
|
||||
"HVBBplcCur_uint16": 0,
|
||||
"HVABFTDev123Cur_uint16": 65491,
|
||||
"HVABactCur_uint16": 65368,
|
||||
"HVABbowRudCur_uint16": 0,
|
||||
"HVABbusBCur_uint16": 46080,
|
||||
"HVABbusBVol_uint16": 127,
|
||||
"HVABmastSteGeaCur_uint16": 127,
|
||||
"HVABopenWaterCur_uint16": 0,
|
||||
"HVABxczCur_uint16": 1792,
|
||||
"HVBBCCUCur_uint16": 65492,
|
||||
"HVBBFCSSecurSysCur_uint16": 65368,
|
||||
"HVBBbatInsCur_uint16": 24700,
|
||||
"HVBBbowLowVolDisBoxCur_uint16": 25073,
|
||||
"HVBBdcC1InsCur_uint16": 19436,
|
||||
"HVBBemer2BusVol_uint16": 32768,
|
||||
"HVBBemerBatCur_uint16": 0,
|
||||
"HVBBinsBusVol_uint16": 18176,
|
||||
"HVBBplcCur_uint16": 127,
|
||||
"HVBBreservedCur1_uint16": 127,
|
||||
"HVBBreservedCur2_uint16": 127,
|
||||
"HVBBunit4Cur_uint16": 64995,
|
||||
"HVBFTDev45Cur_uint16": 32716,
|
||||
"HVBbatGroupCur_uint16": 64208,
|
||||
"HVBbowHVolDisBoxCur_uint16": 48482,
|
||||
"HVBBunit4Cur_uint16": 19436,
|
||||
"HVBFTDev45Cur_uint16": 0,
|
||||
"HVBbatGroupCur_uint16": 37,
|
||||
"HVBbowHVolDisBoxCur_uint16": 0,
|
||||
"HVBbusACur_uint16": 0,
|
||||
"HVBbusAVol_uint16": 48479,
|
||||
"HVBbusAVol_uint16": 60617,
|
||||
"HVBdcDc5Cur_uint16": 0,
|
||||
"HVBfbCur_uint16": 12532,
|
||||
"HVBmotorCur_uint16": 32716,
|
||||
"HVBpowerBusCur_uint16": 55488,
|
||||
"HVBpowerBusVol_uint16": 0,
|
||||
"HVBreservedCur1_uint16": 58199,
|
||||
"HVBfbCur_uint16": 47824,
|
||||
"HVBmotorCur_uint16": 32587,
|
||||
"HVBpowerBusCur_uint16": 8394,
|
||||
"HVBpowerBusVol_uint16": 32767,
|
||||
"HVBreservedCur1_uint16": 60616,
|
||||
"HVBreservedCur2_uint16": 0,
|
||||
"HVBreservedCur3_uint16": 58199,
|
||||
"HVBsternRud1Cur_uint16": 12536,
|
||||
"HVBsternRud2Cur_uint16": 32765,
|
||||
"HVBreservedCur3_uint16": 60619,
|
||||
"HVBsternRud1Cur_uint16": 39104,
|
||||
"HVBsternRud2Cur_uint16": 32587,
|
||||
"HVBtyzCur_uint16": 0,
|
||||
"LVBBbowPZDevCur_uint16": 0,
|
||||
"LVBBemerBatCur_uint16": 64768,
|
||||
"LVBBemerBusVol_uint16": 44966,
|
||||
"LVBBbowPZDevCur_uint16": 127,
|
||||
"LVBBemerBatCur_uint16": 1792,
|
||||
"LVBBemerBusVol_uint16": 0,
|
||||
"LVBBinsBusCur_uint16": 0,
|
||||
"LVBBunit1Cur_uint16": 0,
|
||||
"LVBBunit2Cur_uint16": 0,
|
||||
"LVBBunit3Cur_uint16": 0,
|
||||
"LVBBunit5Cur_uint16": 0,
|
||||
"LVBinsBusVol_uint16": 0
|
||||
"LVBBunit2Cur_uint16": 28672,
|
||||
"LVBBunit3Cur_uint16": 41536,
|
||||
"LVBBunit5Cur_uint16": 19436,
|
||||
"LVBinsBusVol_uint16": 193
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"HVolABusBreaker_unit16": 0,
|
||||
"HVolBBusBreaker_unit16": 1640,
|
||||
"HVolBusBreaker_uint16": 21943,
|
||||
"LVolBusBreaker_uint16": 48483,
|
||||
"HVolBBusBreaker_unit16": 0,
|
||||
"HVolBusBreaker_uint16": 0,
|
||||
"LVolBusBreaker_uint16": 0,
|
||||
"faultCode_array":
|
||||
[
|
||||
0
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
{
|
||||
"backpressure1_fp32": 1.129433109780545e-38,
|
||||
"backpressure2_fp32": 1.1736554268475541e-38,
|
||||
"ch4oConcent1_fp32": -1.6155215737897056e+25,
|
||||
"ch4oConcent2_fp32": 1.9618178500547439e-44,
|
||||
"ch4o_fp32": 1.1736554268475541e-38,
|
||||
"excTemp_fp32": 1.1736552867177076e-38,
|
||||
"faultCode1_uint16": 36880,
|
||||
"faultCode2_uint16": 48384,
|
||||
"faultCode3_uint16": 32716,
|
||||
"fcuCurIns_fp32": 8.602403116674333e-40,
|
||||
"fcuCurPower_fp32": 0.0,
|
||||
"fcuCur_fp32": -1.1078134507391041e+21,
|
||||
"fcuFaultLeve_uint8": 96,
|
||||
"fcuOutIns_fp32": 1.1754185405753675e-38,
|
||||
"fcuOutPower_fp32": 194012262694912.0,
|
||||
"fcuState_uint8": 92,
|
||||
"fcuVolIns_fp32": 6.4791036039165641e+19,
|
||||
"fcuVolPower_fp32": 1.1736554268475541e-38,
|
||||
"fcuVol_fp32": 3.4331812375958018e-43,
|
||||
"backpressure1_fp32": -261504.0,
|
||||
"backpressure2_fp32": 1.1690343649017501e-38,
|
||||
"ch4oConcent1_fp32": -641600.0,
|
||||
"ch4oConcent2_fp32": 1.1690343649017501e-38,
|
||||
"ch4o_fp32": 0.0,
|
||||
"excTemp_fp32": 3.4331812375958018e-43,
|
||||
"faultCode1_uint16": 1649,
|
||||
"faultCode2_uint16": 38944,
|
||||
"faultCode3_uint16": 0,
|
||||
"fcuCurIns_fp32": null,
|
||||
"fcuCurPower_fp32": 1.1754708090080869e-38,
|
||||
"fcuCur_fp32": -282240.0,
|
||||
"fcuFaultLeve_uint8": 201,
|
||||
"fcuOutIns_fp32": 1.1690343649017501e-38,
|
||||
"fcuOutPower_fp32": 6.9238340671194006e+19,
|
||||
"fcuState_uint8": 32,
|
||||
"fcuVolIns_fp32": 7.2147666030475346e+19,
|
||||
"fcuVolPower_fp32": 1.1690343649017501e-38,
|
||||
"fcuVol_fp32": 1.1690343649017501e-38,
|
||||
"flameDet_uint8": 0,
|
||||
"h2Concent1_fp32": 6.3595330338098774e+19,
|
||||
"h2Concent2_fp32": 1.1736554268475541e-38,
|
||||
"o2Concent1_fp32": 2.7580044118016918e+19,
|
||||
"o2Concent2_fp32": 1.1736554268475541e-38,
|
||||
"o2Level_fp32": 1.1736552867177076e-38,
|
||||
"o2_fp32": -1.7820938281008955e+23,
|
||||
"powLimit_fp32": 1.1736554268475541e-38,
|
||||
"powerGen_fp32": 2.9084246393558663e+19
|
||||
"h2Concent1_fp32": -658592.0,
|
||||
"h2Concent2_fp32": 1.1690343649017501e-38,
|
||||
"o2Concent1_fp32": 8.602403116674333e-40,
|
||||
"o2Concent2_fp32": 0.0,
|
||||
"o2Level_fp32": 1.1690343649017501e-38,
|
||||
"o2_fp32": -641600.0,
|
||||
"powLimit_fp32": 1.1690343649017501e-38,
|
||||
"powerGen_fp32": 1.8108811898653892e-39
|
||||
}
|
||||
@@ -1,38 +1,38 @@
|
||||
{
|
||||
"fcuCurToInsLimit1_uint8": 0,
|
||||
"fcuCurToInsLimit1_uint8": 127,
|
||||
"fcuCurToinsLimit2_uint8": 0,
|
||||
"insBatCurElect_uint16": 32716,
|
||||
"insBatLimit_uint16": 58199,
|
||||
"insBatCurElect_uint16": 32587,
|
||||
"insBatLimit_uint16": 60544,
|
||||
"insBatSoc_uint8": 0,
|
||||
"insBatTotalElect_uint16": 24778,
|
||||
"insChargeState_uint8": 209,
|
||||
"insCurSocHold1_uint8": 48,
|
||||
"insCurSocHold2_uint8": 0,
|
||||
"insCurSocHold3_uint8": 0,
|
||||
"insBatTotalElect_uint16": 36880,
|
||||
"insChargeState_uint8": 116,
|
||||
"insCurSocHold1_uint8": 201,
|
||||
"insCurSocHold2_uint8": 236,
|
||||
"insCurSocHold3_uint8": 75,
|
||||
"insCurrent_uint16": 0,
|
||||
"insLinkVol_uint16": 0,
|
||||
"insLinkVol_uint16": 22783,
|
||||
"insNegRelayState_uint8": 0,
|
||||
"insNegRes_uint16": 48480,
|
||||
"insPackVol_uint16": 0,
|
||||
"insNegRes_uint16": 60617,
|
||||
"insPackVol_uint16": 32767,
|
||||
"insPosRelayState_uint8": 0,
|
||||
"insPosRes_uint16": 23716,
|
||||
"insfaultCode_uint8": 228,
|
||||
"insPosRes_uint16": 8394,
|
||||
"insfaultCode_uint8": 164,
|
||||
"powBatCurElect_uint16": 0,
|
||||
"powBatSoc_uint8": 0,
|
||||
"powBatTotalElect_uint16": 48480,
|
||||
"powChargeState_uint8": 18,
|
||||
"powBatTotalElect_uint16": 60544,
|
||||
"powChargeState_uint8": 211,
|
||||
"powCurSocHold1_uint8": 0,
|
||||
"powCurSocHold2_uint8": 244,
|
||||
"powCurSocHold3_uint8": 212,
|
||||
"powCurToInsLimit1_uint8": 95,
|
||||
"powCurToinsLimit2_uint8": 189,
|
||||
"powCur_uint16": 64208,
|
||||
"powLinkVol_uint16": 32716,
|
||||
"powNegRelayState_uint8": 48,
|
||||
"powNegRes_uint16": 32716,
|
||||
"powPosRelayState_uint8": 180,
|
||||
"powPosRes_uint16": 48482,
|
||||
"powerBatLimit_uint16": 32765,
|
||||
"powCurSocHold2_uint8": 208,
|
||||
"powCurSocHold3_uint8": 186,
|
||||
"powCurToInsLimit1_uint8": 203,
|
||||
"powCurToinsLimit2_uint8": 236,
|
||||
"powCur_uint16": 3590,
|
||||
"powLinkVol_uint16": 32587,
|
||||
"powNegRelayState_uint8": 103,
|
||||
"powNegRes_uint16": 0,
|
||||
"powPosRelayState_uint8": 208,
|
||||
"powPosRes_uint16": 0,
|
||||
"powerBatLimit_uint16": 32587,
|
||||
"powerPackVol_uint16": 0,
|
||||
"powfaultCode_uint8": 85
|
||||
"powfaultCode_uint8": 28
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"CTD1" : 0,
|
||||
"CTD2" : 0,
|
||||
"DVL" : 0,
|
||||
"USBL" : 0,
|
||||
"bowCover1" : 0,
|
||||
@@ -28,6 +26,8 @@
|
||||
"buoyancyAdjust4" : 0,
|
||||
"buoyancyAdjust5" : 0,
|
||||
"commMast" : 0,
|
||||
"ctd1" : 0,
|
||||
"ctd2" : 0,
|
||||
"depth1" : 0,
|
||||
"depth2" : 0,
|
||||
"depth3" : 0,
|
||||
|
||||
@@ -92,11 +92,10 @@ bool PowerManger::OnNewMail(MOOSMSG_LIST &NewMail)
|
||||
{
|
||||
CMOOSMsg &msg = *p;
|
||||
string key = msg.GetKey();
|
||||
|
||||
string strJson = msg.GetString();
|
||||
//处理上位机发送的控制指令
|
||||
if(key == DB_TO_PM_MSCMD)
|
||||
{
|
||||
string strJson = msg.GetString();
|
||||
if(getMsCmdFromJson(m_msCmd,strJson))
|
||||
{
|
||||
cout << "get ms cmd:" << strJson << endl;
|
||||
@@ -106,7 +105,23 @@ bool PowerManger::OnNewMail(MOOSMSG_LIST &NewMail)
|
||||
cout << "get ms cmd error:" << strJson << endl;
|
||||
}
|
||||
}
|
||||
|
||||
//处理设备上电指令
|
||||
if (key == DB_TO_PM_EQUIPMENTCMD)
|
||||
{
|
||||
if(m_driver.loadDriverTableFromJson(strJson,m_subDisSysCmd) < 0)
|
||||
{
|
||||
cout << "get sub dis cmd error:" << strJson << endl;
|
||||
}
|
||||
}
|
||||
//处理设备状态反馈
|
||||
if(key == DB_TO_PM_SUBDISSTATE)
|
||||
{
|
||||
if(m_driver.loadDriverTableFromJson(strJson,m_subDisSysState) < 0)
|
||||
{
|
||||
cout << "get sub dis state error:" << strJson << endl;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0 // Keep these around just for template
|
||||
string comm = msg.GetCommunity();
|
||||
double dval = msg.GetDouble();
|
||||
@@ -243,6 +258,8 @@ void PowerManger::registerVariables()
|
||||
{
|
||||
AppCastingMOOSApp::RegisterVariables();
|
||||
Register(DB_TO_PM_MSCMD, 0);
|
||||
Register(DB_TO_PM_EQUIPMENTCMD, 0);
|
||||
Register(DB_TO_PM_SUBDISSTATE, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ class PowerManger : public AppCastingMOOSApp
|
||||
//故障处理
|
||||
FSM_State m_Fault_s99;
|
||||
static int handleFault_s99(FSM_State &fsm, void* pData);
|
||||
|
||||
//======================================================================================
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user