重构了与DB的交互逻辑,以及与任务\上位机指令的消息,使用新的loguru库进行日志管理

This commit is contained in:
zjk
2025-04-20 22:42:28 +08:00
parent c5e28cee54
commit 06226b6704
35 changed files with 5430 additions and 175 deletions
+326
View File
@@ -0,0 +1,326 @@
{
"navigationParam_obj" :
{
"limitedNavRegion_obj" : [],
"maxDepth_fp32" : -1,
"maxSpeed_fp32" : -1,
"maxVerSpeed_fp32" : -1,
"minHeight_fp32" : -1,
"minPitch_fp32" : -1,
"minTurnLimit_fp32" : -1
},
"planHash_int32" : -2031201612,
"planID_int32" : 1817399773,
"planName_str" : "pl_test2",
"taskSort_array_int32" :
[
68991759,
1726048938,
68991758,
-2127541611,
1275525031,
-725793762
],
"task_obj" :
{
"-2127541611" :
{
"bowRudderUnfold_bool" : false,
"depthPoints_array_fp32" :
[
0.0
],
"desiredDepth_fp32" : 0,
"desiredHeight_fp32" : 0,
"desiredSpeed_fp32" : 2.0577776432037354,
"destination_array_fp64" :
[
20.636590882471154,
111.41261861598258
],
"endDuration_int32" : 30,
"estimatedConsume_fp32" : 0,
"estimatedTime_fp32" : 0,
"fixedType_int32" : 1,
"latPoints_array_fp64" :
[
20.636590882471154
],
"lonPoints_array_fp64" :
[
111.41261861598258
],
"pastPointIndex_int32" : -1,
"pathLength_fp32" : 0,
"pointID_array_str" :
[
"-2127541611_0"
],
"radius_fp32" : 20,
"source_int32" : 1,
"speedType_int32" : 1,
"taskID_int32" : -2127541611,
"taskName_str" : "Hover1",
"taskType_str" : "hover"
},
"-725793762" :
{
"bowRudderUnfold_bool" : false,
"cyclePoints_array_int32" :
[
1
],
"depthPoints_array_fp32" :
[
0.0
],
"desiredSpeed_fp32" : 1,
"destination_array_fp64" :
[
20.633257427671467,
111.42364785945182
],
"endWay_int32" : 1,
"estimatedConsume_fp32" : 0,
"estimatedTime_fp32" : 0,
"latPoints_array_fp64" :
[
20.633257427671467
],
"lonPoints_array_fp64" :
[
111.42364785945182
],
"pastPointIndex_int32" : -1,
"pathLength_fp32" : 0,
"pointID_array_str" :
[
"-725793762_0"
],
"radius_fp32" : 20,
"source_int32" : 1,
"speedType_int32" : 2,
"taskID_int32" : -725793762,
"taskName_str" : "Recycle1",
"taskType_str" : "recycle"
},
"1275525031" :
{
"bowRudderUnfold_bool" : false,
"calibrateMode_int32" : 1,
"depthPoints_array_fp32" :
[
0.0
],
"desiredSpeed_fp32" : 1,
"destination_array_fp64" :
[
20.641771649173037,
111.42562196528678
],
"doubleCalibrateSetting_int32" : 0,
"estimatedConsume_fp32" : 0,
"estimatedTime_fp32" : 0,
"latPoints_array_fp64" :
[
20.641771649173037
],
"lonPoints_array_fp64" :
[
111.42562196528678
],
"pastPointIndex_int32" : -1,
"pathLength_fp32" : 0,
"pointID_array_str" :
[
"1275525031_0"
],
"source_int32" : 1,
"speedType_int32" : 2,
"taskID_int32" : 1275525031,
"taskName_str" : "Calibration1",
"taskType_str" : "satCalibrate"
},
"1726048938" :
{
"attack_int32" : 0,
"balanceEnabled_bool" : false,
"bowRudderUnfold_bool" : false,
"calibPointsExtend_array_int32" :
[
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"calibPoints_array_int32" :
[
0,
0,
0
],
"calibrateMode_int32" : 1,
"depthPointsExtend_array_fp32" :
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"desiredDepth_fp32" : 0,
"desiredHeight_fp32" : 0,
"desiredSpeed_fp32" : 2,
"estimatedConsume_fp32" : 0,
"estimatedTime_fp32" : 0,
"fixedType_int32" : 1,
"flankArray_int32" : 0,
"latPointsExtend_array_fp64" :
[
20.672185454579221,
20.654677472562906,
20.660540464584184,
20.672185454579221,
20.654677472562906,
20.660540464584184,
20.672185454579221,
20.654677472562906,
20.660540464584184
],
"latPoints_array_fp64" :
[
20.672185454579221,
20.654677472562906,
20.660540464584184
],
"lonPointsExtend_array_fp64" :
[
111.41573055186512,
111.41349821869244,
111.39761978934951,
111.41573055186512,
111.41349821869244,
111.39761978934951,
111.41573055186512,
111.41349821869244,
111.39761978934951
],
"lonPoints_array_fp64" :
[
111.41573055186512,
111.41349821869244,
111.39761978934951
],
"loop_int32" : 3,
"magnet_int32" : 0,
"optronic_int32" : 0,
"pastPointIndex_int32" : -1,
"pathLength_fp32" : 0,
"pointID_array_str" :
[
"1726048938_0",
"1726048938_1",
"1726048938_2",
"1726048938_3",
"1726048938_4",
"1726048938_5",
"1726048938_6",
"1726048938_7",
"1726048938_8"
],
"source_int32" : 1,
"speedType_int32" : 2,
"taskID_int32" : 1726048938,
"taskName_str" : "AreaSurvey1",
"taskType_str" : "tour",
"towArray_int32" : 0
},
"68991758" :
{
"balanceEnabled_bool" : false,
"bowRudderUnfold_bool" : false,
"depthPoints_array_fp32" :
[
0.0
],
"desiredDepth_fp32" : 0,
"desiredHeight_fp32" : 0,
"desiredSpeed_fp32" : 2,
"destination_array_fp64" :
[
20.643378052620122,
111.4050226000524
],
"estimatedConsume_fp32" : 0,
"estimatedTime_fp32" : 0,
"fixedType_int32" : 1,
"latPoints_array_fp64" :
[
20.643378052620122
],
"lonPoints_array_fp64" :
[
111.4050226000524
],
"pastPointIndex_int32" : -1,
"pathLength_fp32" : 0,
"pointID_array_str" :
[
"68991758_0"
],
"source_int32" : 1,
"speedType_int32" : 2,
"taskID_int32" : 68991758,
"taskName_str" : "Goto1",
"taskType_str" : "sail"
},
"68991759" :
{
"balanceEnabled_bool" : false,
"bowRudderUnfold_bool" : false,
"depthPoints_array_fp32" :
[
0.0
],
"desiredDepth_fp32" : 0,
"desiredHeight_fp32" : 0,
"desiredSpeed_fp32" : 2,
"destination_array_fp64" :
[
20.650305473106499,
111.4256434229589
],
"estimatedConsume_fp32" : 0,
"estimatedTime_fp32" : 0,
"fixedType_int32" : 1,
"latPoints_array_fp64" :
[
20.650305473106499
],
"lonPoints_array_fp64" :
[
111.4256434229589
],
"pastPointIndex_int32" : -1,
"pathLength_fp32" : 0,
"pointID_array_str" :
[
"68991759_0"
],
"source_int32" : 1,
"speedType_int32" : 2,
"taskID_int32" : 68991759,
"taskName_str" : "Goto2",
"taskType_str" : "sail"
}
}
}
+48 -47
View File
@@ -1,47 +1,48 @@
{
"HVABFTDev123Cur_uint16": 0,
"HVABactCur_uint16": 0,
"HVABbowRudCur_uint16": 0,
"HVABbusBCur_uint16": 0,
"HVABbusBVol_uint16": 0,
"HVABmastSteGeaCur_uint16": 0,
"HVABopenWaterCur_uint16": 0,
"HVABxczCur_uint16": 1,
"HVBBCCUCur_uint16": 0,
"HVBBFCSSecurSysCur_uint16": 0,
"HVBBbatInsCur_uint16": 0,
"HVBBbowLowVolDisBoxCur_uint16": 0,
"HVBBdcC1InsCur_uint16": 0,
"HVBBemer2BusVol_uint16": 0,
"HVBBemerBatCur_uint16": 0,
"HVBBinsBusVol_uint16": 0,
"HVBBplcCur_uint16": 0,
"HVBBreservedCur1_uint16": 0,
"HVBBreservedCur2_uint16": 0,
"HVBBunit4Cur_uint16": 0,
"HVBFTDev45Cur_uint16": 0,
"HVBbatGroupCur_uint16": 0,
"HVBbowHVolDisBoxCur_uint16": 0,
"HVBbusACur_uint16": 0,
"HVBbusAVol_uint16": 0,
"HVBdcDc5Cur_uint16": 0,
"HVBfbCur_uint16": 0,
"HVBmotorCur_uint16": 0,
"HVBpowerBusCur_uint16": 0,
"HVBpowerBusVol_uint16": 0,
"HVBreservedCur1_uint16": 0,
"HVBreservedCur2_uint16": 0,
"HVBreservedCur3_uint16": 0,
"HVBsternRud1Cur_uint16": 0,
"HVBsternRud2Cur_uint16": 0,
"HVBtyzCur_uint16": 0,
"LVBBbowPZDevCur_uint16": 0,
"LVBBemerBatCur_uint16": 0,
"LVBBemerBusVol_uint16": 0,
"LVBBinsBusCur_uint16": 0,
"LVBBunit1Cur_uint16": 0,
"LVBBunit2Cur_uint16": 0,
"LVBBunit3Cur_uint16": 0,
"LVBBunit5Cur_uint16": 0,
"LVBinsBusVol_uint16": 0
}
{"uPower_currentState_st":{
"HVABFTDev123Cur_uint16" : 0,
"HVABactCur_uint16" : 0,
"HVABbowRudCur_uint16" : 0,
"HVABbusBCur_uint16" : 0,
"HVABbusBVol_uint16" : 0,
"HVABmastSteGeaCur_uint16" : 0,
"HVABopenWaterCur_uint16" : 0,
"HVABxczCur_uint16" : 0,
"HVBBCCUCur_uint16" : 0,
"HVBBFCSSecurSysCur_uint16" : 0,
"HVBBbatInsCur_uint16" : 0,
"HVBBbowLowVolDisBoxCur_uint16" : 0,
"HVBBdcC1InsCur_uint16" : 0,
"HVBBemer2BusVol_uint16" : 0,
"HVBBemerBatCur_uint16" : 0,
"HVBBinsBusVol_uint16" : 0,
"HVBBplcCur_uint16" : 0,
"HVBBreservedCur1_uint16" : 0,
"HVBBreservedCur2_uint16" : 0,
"HVBBunit4Cur_uint16" : 0,
"HVBFTDev45Cur_uint16" : 0,
"HVBbatGroupCur_uint16" : 0,
"HVBbowHVolDisBoxCur_uint16" : 0,
"HVBbusACur_uint16" : 0,
"HVBbusAVol_uint16" : 0,
"HVBdcDc5Cur_uint16" : 0,
"HVBfbCur_uint16" : 0,
"HVBmotorCur_uint16" : 0,
"HVBpowerBusCur_uint16" : 0,
"HVBpowerBusVol_uint16" : 0,
"HVBreservedCur1_uint16" : 0,
"HVBreservedCur2_uint16" : 0,
"HVBreservedCur3_uint16" : 0,
"HVBsternRud1Cur_uint16" : 0,
"HVBsternRud2Cur_uint16" : 0,
"HVBtyzCur_uint16" : 0,
"LVBBbowPZDevCur_uint16" : 0,
"LVBBemerBatCur_uint16" : 0,
"LVBBemerBusVol_uint16" : 0,
"LVBBinsBusCur_uint16" : 0,
"LVBBunit1Cur_uint16" : 0,
"LVBBunit2Cur_uint16" : 0,
"LVBBunit3Cur_uint16" : 0,
"LVBBunit5Cur_uint16" : 0,
"LVBinsBusVol_uint16" : 0
}
}
+11 -10
View File
@@ -1,10 +1,11 @@
{
"HVolABusBreaker_unit16": 0,
"HVolBBusBreaker_unit16": 79,
"HVolBusBreaker_uint16": 58,
"LVolBusBreaker_uint16": 159,
"faultCode_array":
[
0
]
}
{"uPower_disSysState_st":{
"HVolABusBreaker_unit16" : 0,
"HVolBBusBreaker_unit16" : 0,
"HVolBusBreaker_uint16" : 0,
"LVolBusBreaker_uint16" : 0,
"faultCode_array" :
[
0
]
}
}
+65
View File
@@ -0,0 +1,65 @@
{"uPower_equState_fb":{
"DVL" : 0,
"USBL" : 0,
"bowCover1" : 0,
"bowCover2" : 0,
"bowCover3" : 0,
"bowCover4" : 0,
"bowCover5" : 0,
"bowCover6" : 0,
"bowRudderDeploy" : 0,
"bowRudderServo1" : 0,
"bowRudderServo2" : 0,
"bowThrow" : 0,
"bowWaterlnet1" : 0,
"bowWaterlnet2" : 0,
"bowWaterlnet3" : 0,
"bowWaterlnet4" : 0,
"bowWaterlnet5" : 0,
"bowWaterlnet6" : 0,
"bowWaterlnet7" : 0,
"bowWaterlnet8" : 0,
"buoyage" : 0,
"buoyancyAdjust1" : 0,
"buoyancyAdjust2" : 0,
"buoyancyAdjust3" : 0,
"buoyancyAdjust4" : 0,
"buoyancyAdjust5" : 0,
"commMast" : 0,
"ctd1" : 0,
"ctd2" : 0,
"depth1" : 0,
"depth2" : 0,
"depth3" : 0,
"electSensor" : 0,
"forwardSonar" : 0,
"inputWaterSensor1" : 0,
"inputWaterSensor2" : 0,
"inputWaterSensor3" : 0,
"ins" : 0,
"launchControler" : 0,
"lowFreqSonar" : 0,
"mastLiftingServo" : 0,
"ntp" : 0,
"overDeep1" : 0,
"overDeep2" : 0,
"photoSensor" : 0,
"sideSonar" : 0,
"singleBeamSonar1" : 0,
"singleBeamSonar2" : 0,
"singleBeamSonar3" : 0,
"singleBeamSonar4" : 0,
"singleBeamSonar5" : 0,
"singleBeamSonar6" : 0,
"singleBeamSonar7" : 0,
"singleBeamSonar8" : 0,
"soundVeloc" : 0,
"sternRudderServo1" : 0,
"sternRudderServo2" : 0,
"sternRudderServo3" : 0,
"sternRudderServo4" : 0,
"sternThrow" : 0,
"thruster" : 0,
"waterInject" : 0
}
}
+31 -30
View File
@@ -1,30 +1,31 @@
{
"backpressure1_fp32": 1.0,
"backpressure2_fp32": 2.0,
"ch4oConcent1_fp32": 29.0,
"ch4oConcent2_fp32": 96.0,
"ch4o_fp32": 0.0,
"excTemp_fp32": 23.0,
"faultCode1_uint16": 0,
"faultCode2_uint16": 0,
"faultCode3_uint16": 0,
"fcuCurIns_fp32": 0.0,
"fcuCurPower_fp32": 0.0,
"fcuCur_fp32": 84.0,
"fcuFaultLeve_uint8": 0,
"fcuOutIns_fp32": 53.0,
"fcuOutPower_fp32": 100.0,
"fcuState_uint8": 0,
"fcuVolIns_fp32": 0.0,
"fcuVolPower_fp32": 0.0,
"fcuVol_fp32": 377.0,
"flameDet_uint8": 1,
"h2Concent1_fp32": 89.0,
"h2Concent2_fp32": 62.0,
"o2Concent1_fp32": 74.0,
"o2Concent2_fp32": 21.0,
"o2Level_fp32": 0.0,
"o2_fp32": 0.0,
"powLimit_fp32": 88.0,
"powerGen_fp32": 622.0
}
{"uPower_fcsState_st":{
"backpressure1_fp32" : 0.0,
"backpressure2_fp32" : 0.0,
"ch4oConcent1_fp32" : 0.0,
"ch4oConcent2_fp32" : 0.0,
"ch4o_fp32" : 0.0,
"excTemp_fp32" : 0.0,
"faultCode1_uint16" : 0,
"faultCode2_uint16" : 0,
"faultCode3_uint16" : 0,
"fcuCurIns_fp32" : 0.0,
"fcuCurPower_fp32" : 0.0,
"fcuCur_fp32" : 0.0,
"fcuFaultLeve_uint8" : 0,
"fcuOutIns_fp32" : 0.0,
"fcuOutPower_fp32" : 0.0,
"fcuState_uint8" : 0,
"fcuVolIns_fp32" : 0.0,
"fcuVolPower_fp32" : 0.0,
"fcuVol_fp32" : 0.0,
"flameDet_uint8" : 0,
"h2Concent1_fp32" : 0.0,
"h2Concent2_fp32" : 0.0,
"o2Concent1_fp32" : 0.0,
"o2Concent2_fp32" : 0.0,
"o2Level_fp32" : 0.0,
"o2_fp32" : 0.0,
"powLimit_fp32" : 0.0,
"powerGen_fp32" : 0.0
}
}
+39 -38
View File
@@ -1,38 +1,39 @@
{
"fcuCurToInsLimit1_uint8": 0,
"fcuCurToinsLimit2_uint8": 0,
"insBatCurElect_uint16": 0,
"insBatLimit_uint16": 41,
"insBatSoc_uint8": 42,
"insBatTotalElect_uint16": 617,
"insChargeState_uint8": 0,
"insCurSocHold1_uint8": 0,
"insCurSocHold2_uint8": 0,
"insCurSocHold3_uint8": 0,
"insCurrent_uint16": 2,
"insLinkVol_uint16": 0,
"insNegRelayState_uint8": 0,
"insNegRes_uint16": 0,
"insPackVol_uint16": 0,
"insPosRelayState_uint8": 1,
"insPosRes_uint16": 0,
"insfaultCode_uint8": 0,
"powBatCurElect_uint16": 0,
"powBatSoc_uint8": 31,
"powBatTotalElect_uint16": 763,
"powChargeState_uint8": 0,
"powCurSocHold1_uint8": 0,
"powCurSocHold2_uint8": 0,
"powCurSocHold3_uint8": 0,
"powCurToInsLimit1_uint8": 0,
"powCurToinsLimit2_uint8": 0,
"powCur_uint16": 21,
"powLinkVol_uint16": 0,
"powNegRelayState_uint8": 1,
"powNegRes_uint16": 0,
"powPosRelayState_uint8": 1,
"powPosRes_uint16": 0,
"powerBatLimit_uint16": 13,
"powerPackVol_uint16": 0,
"powfaultCode_uint8": 0
}
{"uPower_liBatState_st":{
"fcuCurToInsLimit1_uint8" : 0,
"fcuCurToinsLimit2_uint8" : 0,
"insBatCurElect_uint16" : 0,
"insBatLimit_uint16" : 0,
"insBatSoc_uint8" : 0,
"insBatTotalElect_uint16" : 0,
"insChargeState_uint8" : 0,
"insCurSocHold1_uint8" : 0,
"insCurSocHold2_uint8" : 0,
"insCurSocHold3_uint8" : 0,
"insCurrent_uint16" : 0,
"insLinkVol_uint16" : 0,
"insNegRelayState_uint8" : 0,
"insNegRes_uint16" : 0,
"insPackVol_uint16" : 0,
"insPosRelayState_uint8" : 0,
"insPosRes_uint16" : 0,
"insfaultCode_uint8" : 0,
"powBatCurElect_uint16" : 0,
"powBatSoc_uint8" : 0,
"powBatTotalElect_uint16" : 0,
"powChargeState_uint8" : 0,
"powCurSocHold1_uint8" : 0,
"powCurSocHold2_uint8" : 0,
"powCurSocHold3_uint8" : 0,
"powCurToInsLimit1_uint8" : 0,
"powCurToinsLimit2_uint8" : 0,
"powCur_uint16" : 0,
"powLinkVol_uint16" : 0,
"powNegRelayState_uint8" : 0,
"powNegRes_uint16" : 0,
"powPosRelayState_uint8" : 0,
"powPosRes_uint16" : 0,
"powerBatLimit_uint16" : 0,
"powerPackVol_uint16" : 0,
"powfaultCode_uint8" : 0
}
}
+13 -12
View File
@@ -1,12 +1,13 @@
{
"currentMod_uint8": 0,
"falutLevel_uint8": 0,
"faultCode_array":
[
0
],
"powerState_uint8": 0,
"soc_uint32": 0,
"sustainableTime_uint32": 0,
"workCondition_uint8": 0
}
{"uPower_pmState_st":{
"currentMod_uint8" : 1,
"falutLevel_uint8" : 0,
"faultCode_array" :
[
0
],
"powerState_uint8" : 0,
"soc_uint32" : 0,
"sustainableTime_uint32" : 0,
"workCondition_uint8" : 1
}
}
+65
View File
@@ -0,0 +1,65 @@
{"uPower_secdistState_cmd":{
"DVL" : 0,
"USBL" : 0,
"bowCover1" : 0,
"bowCover2" : 0,
"bowCover3" : 0,
"bowCover4" : 0,
"bowCover5" : 0,
"bowCover6" : 0,
"bowRudderDeploy" : 0,
"bowRudderServo1" : 0,
"bowRudderServo2" : 0,
"bowThrow" : 0,
"bowWaterlnet1" : 0,
"bowWaterlnet2" : 0,
"bowWaterlnet3" : 0,
"bowWaterlnet4" : 0,
"bowWaterlnet5" : 0,
"bowWaterlnet6" : 0,
"bowWaterlnet7" : 0,
"bowWaterlnet8" : 0,
"buoyage" : 0,
"buoyancyAdjust1" : 0,
"buoyancyAdjust2" : 0,
"buoyancyAdjust3" : 0,
"buoyancyAdjust4" : 0,
"buoyancyAdjust5" : 0,
"commMast" : 1,
"ctd1" : 1,
"ctd2" : 1,
"depth1" : 1,
"depth2" : 1,
"depth3" : 1,
"electSensor" : 0,
"forwardSonar" : 0,
"inputWaterSensor1" : 1,
"inputWaterSensor2" : 1,
"inputWaterSensor3" : 1,
"ins" : 1,
"launchControler" : 0,
"lowFreqSonar" : 0,
"mastLiftingServo" : 0,
"ntp" : 1,
"overDeep1" : 1,
"overDeep2" : 1,
"photoSensor" : 0,
"sideSonar" : 0,
"singleBeamSonar1" : 0,
"singleBeamSonar2" : 0,
"singleBeamSonar3" : 0,
"singleBeamSonar4" : 0,
"singleBeamSonar5" : 0,
"singleBeamSonar6" : 0,
"singleBeamSonar7" : 0,
"singleBeamSonar8" : 0,
"soundVeloc" : 1,
"sternRudderServo1" : 0,
"sternRudderServo2" : 0,
"sternRudderServo3" : 0,
"sternRudderServo4" : 0,
"sternThrow" : 0,
"thruster" : 0,
"waterInject" : 0
}
}