Added other tpdo variables
This commit is contained in:
parent
7984e11514
commit
7d2e11a4ce
|
|
@ -210,11 +210,11 @@ 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)
|
||||
|
||||
# ========== Docking Parameters ==========
|
||||
elif cob_id == 0x2AC and len(data) >= 8:
|
||||
elif cob_id == 0x2AC and len(data) >= 2:
|
||||
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'),
|
||||
})
|
||||
|
|
|
|||
10
main.py
10
main.py
|
|
@ -106,7 +106,7 @@ def format_DS_data(data):
|
|||
return {
|
||||
"timestamp": datetime.datetime.now().isoformat(),
|
||||
"Q_conso_filt": np.round(data.get("Qdrain_sp", 0.0), 1),
|
||||
"TankLevel": np.round(data.get("TankLevel", 0.0), 1),
|
||||
"TankLevel": np.round(data.get("TankLevel", 0.0), 2),
|
||||
"Qinlet": np.round(data.get("Inlet_flow", 0.0), 1),
|
||||
"Qoutlet": np.round(data.get("Outlet_flow", 0.0), 1),
|
||||
|
||||
|
|
@ -253,13 +253,15 @@ def get_pu_status():
|
|||
async def update_latest_data():
|
||||
global active_PUs
|
||||
while True:
|
||||
#DS
|
||||
data = can_backend.get_latest_data(pu_number=0)
|
||||
latest_data[f"DS"] = format_DS_data(data)
|
||||
|
||||
# PUs
|
||||
for pu in active_PUs:
|
||||
data = can_backend.get_latest_data(pu_number=pu)
|
||||
latest_data[f"PU_{pu}"] = format_PU_data(data)
|
||||
#DS
|
||||
data = can_backend.get_latest_data(pu_number=0)
|
||||
latest_data[f"DS"] = format_DS_data(data)
|
||||
|
||||
|
||||
logging.debug(f"[MONITOR DS BUFFER] latest_data: {latest_data}")
|
||||
await asyncio.sleep(0.05)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user