Added docking board parameters on hmi backend

This commit is contained in:
aniketSaha 2025-08-06 10:13:45 +02:00
parent efd44dbf3e
commit 6d29fa0059
2 changed files with 20 additions and 3 deletions

View File

@ -172,6 +172,21 @@ class CANBackend:
"Pump_sp": int.from_bytes(data[6:8], 'little') / 100.0,
})
elif cob_id == 0x2AC and len(data) >= 8:
self.latest_data[2].update({
"Qdrain_sp": int.from_bytes(data[4:6], 'little'),
"TankLevel": int.from_bytes(data[6:8], 'little'),
})
elif cob_id == 0x2B3 and len(data) >= 8:
self.latest_data[2].update({
"Inlet_flow": int.from_bytes(data[0:2], 'little') / 100.0,
"Outlet_flow": int.from_bytes(data[2:4], 'little') / 100.0,
"Pressure_perm": int.from_bytes(data[4:6], 'little') / 1000.0,
"Pressure_ro": int.from_bytes(data[6:8], 'little') / 1000.0,
})
elif cob_id == 0x2B1 and len(data) >= 7:
data = list(data)
self.latest_data[2].update({
@ -209,6 +224,8 @@ class CANBackend:
"Conductivity_Product" : int.from_bytes(data[5:7], 'little') / 100.0,
})
print("Conductivity_Product",int.from_bytes(data[5:7], 'little') / 100.0)
# # ========== PU1 DRIFT CHECK ==========
# if cob_id in (0x2A6, 0x2A8): # FM1 or MV03_sp updates for PU1
# mv03_sp = self.latest_data[1].get("MV03_sp")

View File

@ -81,9 +81,9 @@ def format_data(data):
"Pro": np.round(data.get("PS2", 0.0), 2),
"Pdilute": np.round(data.get("PS3", 0.0), 2),
"Pretentate": np.round(data.get("PS1", 0.0), 2),
"Cfeed": np.round(data.get("Conductivity_Feed", 0.0), 3),
"Cperm": np.round(data.get("Conductivity_Permeate", 0.0), 3),
"Cdilute": np.round(data.get("Conductivity_Product", 0.0), 3),
"Cfeed": data.get("Conductivity_Feed", 0.0),
"Cperm": data.get("Conductivity_Permeate", 0.0),
"Cdilute": data.get("Conductivity_Product", 0.0),
"MV02": np.round(data.get("MV02", 0.0), 1),
"MV02_sp": np.round(data.get("MV02_sp", 0.0), 1),
"MV03": np.round(data.get("MV03", 0.0), 1),