Changes for integrating the docking parameters
This commit is contained in:
parent
7edb759bd9
commit
400fe40bcd
10
classCAN.py
10
classCAN.py
|
|
@ -211,12 +211,12 @@ class CANBackend:
|
|||
})
|
||||
|
||||
# ========== Docking Parameters ==========
|
||||
elif cob_id == 0x2AC and len(data) >= 2:
|
||||
elif cob_id == 0x2AC and len(data) >= 8:
|
||||
self.latest_data[0].update({
|
||||
"Ploop_sp": int.from_bytes(data[0:2], 'little'),
|
||||
"Pdilute_sp": int.from_bytes(data[2:4], 'little'),
|
||||
"Qdrain_sp": int.from_bytes(data[4:6], 'little'),
|
||||
"TankLevel": int.from_bytes(data[6:8], 'little'),
|
||||
"Ploop_sp": int.from_bytes(data[0:2], 'little') / 1.0,
|
||||
"Pdilute_sp": int.from_bytes(data[2:4], 'little') / 1.0,
|
||||
"Qdrain_sp": int.from_bytes(data[4:6], 'little') / 1.0,
|
||||
"TankLevel": int.from_bytes(data[6:8], 'little') / 1.0,
|
||||
})
|
||||
|
||||
elif cob_id == 0x2B3 and len(data) >= 8:
|
||||
|
|
|
|||
8
main.py
8
main.py
|
|
@ -277,12 +277,8 @@ async def update_latest_data():
|
|||
|
||||
|
||||
@app.get("/monitor")
|
||||
async def get_monitor_data(pu_number: Optional[float] = Query(None)):
|
||||
if pu_number is not None:
|
||||
return latest_data.get(f"PU_{pu_number}", {})
|
||||
else:
|
||||
# print(latest_data)
|
||||
return latest_data
|
||||
async def get_monitor_data():
|
||||
return JSONResponse(content=latest_data)
|
||||
|
||||
|
||||
@app.on_event("startup")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user