Index: leahi_dialin/common/dd_defs.py =================================================================== diff -u -ra6c8026470fbbead9a90b727be257d3076397670 -r372d9868eab437585688e307e166881c42d2fc9b --- leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision a6c8026470fbbead9a90b727be257d3076397670) +++ leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision 372d9868eab437585688e307e166881c42d2fc9b) @@ -360,7 +360,15 @@ SPARE5_VALV = 29 # Spare Valve 5 SPARE6_VALV = 30 # Spare Valve 6 SPARE7_VALV = 31 # Spare Valve 7 - NUM_OF_DD_VALVES = 32 # Number of Valves for the DD + M4_VALV = 32 # First IO valve (M4) + M12_VALV = 33 # Last IO valve IO valve (M12) + P11_VALV = 34 # First FP Valve (P11) + P33_VALV = 35 # Valve (P33) + P34_VALV = 36 # Valve (P34) + P37_VALV = 37 # Valve (P37) + P39_VALV = 38 # Valve (P39) + P6_VALV = 39 # Last FP Valve (P6) + NUM_OF_DD_VALVES = 40 # Number of Valves for the DD @unique class DDNotLegalStates(DialinEnum): Index: leahi_dialin/ui/dd_messaging.py =================================================================== diff -u -r82673b44f61604336cf70c0e72db0e332325c8af -r372d9868eab437585688e307e166881c42d2fc9b --- leahi_dialin/ui/dd_messaging.py (.../dd_messaging.py) (revision 82673b44f61604336cf70c0e72db0e332325c8af) +++ leahi_dialin/ui/dd_messaging.py (.../dd_messaging.py) (revision 372d9868eab437585688e307e166881c42d2fc9b) @@ -543,53 +543,77 @@ D40_VALV : bool, D47_VALV : bool, D3_VALV : bool, - M4_VALV : bool, + D80_VALV : bool, + D81_VALV : bool, RSRVD_SPACE1 : bool, - RSRVD_SPACE2 : bool, D23_VALV : bool, D19_VALV : bool, D25_VALV : bool, - D26_VALV : bool, + D21_VALV : bool, D24_VALV : bool, D20_VALV : bool, - D21_VALV : bool, + D26_VALV : bool, D22_VALV : bool, - D69_VALV : bool, - D71_VALV : bool, - D70_VALV : bool, - D72_VALV : bool, + D79_PMP_VALV : bool, + SPARE1_VALV : bool, + SPARE2_VALV : bool, + SPARE3_VALV : bool, + SPARE4_VALV : bool, + SPARE5_VALV : bool, + SPARE6_VALV : bool, + SPARE7_VALV : bool, + M4_VALV : bool, + M12_VALV : bool, + P11_VALV : bool, + P33_VALV : bool, + P34_VALV : bool, + P37_VALV : bool, + P39_VALV : bool, + P6_VALV : bool, valvesensedState: list): """ Broadcasts the current DD Valve data (Msg ID: 0x1B, 27) Args: - D14_VALV (bool ): Valve Hydraulics Outlet (D14) - D52_VALV (bool ): Valve Thermal Disinfect (D52) - D8_VALV (bool ): Valve Hydraulics Bypass (D8) - D54_VALV (bool ): Valve Rinse Port (D54) - D53_VALV (bool ): Valve Drain (D53) - D34_VALV (bool ): Valve Dialyzer Bypass (D34) - D64_VALV (bool ): Valve Purge 1 (D64) - D31_VALV (bool ): Valve Pressure Test (D31) - D65_VALV (bool ): Valve DryBcarb Inlet (D65) - D35_VALV (bool ): Valve Dialyzer Inlet (D35) - D40_VALV (bool ): Valve Dialyzer Outlet (D40) - D47_VALV (bool ): Valve Dialysate Out Purge 2 (D47) - D3_VALV (bool ): Valve Hydraulics Inlet (D3) - M4_VALV (bool ): Valve Water Inlet (M4) - RSRVD_SPACE1 (bool ): This space has been reserved - RSRVD_SPACE2 (bool ): This space has been reserved - D23_VALV (bool ): Balancing chamber Valve 1 (D23) - D19_VALV (bool ): Balancing chamber Valve 2 (D19) - D25_VALV (bool ): Balancing chamber Valve 3 (D25) - D26_VALV (bool ): Balancing chamber Valve 7 (D26) - D24_VALV (bool ): Balancing chamber Valve 5 (D24) - D20_VALV (bool ): Balancing chamber Valve 6 (D20) - D21_VALV (bool ): Balancing chamber Valve 4 (D21) - D22_VALV (bool ): Balancing chamber Valve 8 (D22) - D69_VALV (bool ): Ultrafiltration Valve 1 Inlet (D69) - D71_VALV (bool ): Ultrafiltration Valve 2 Inlet (D71) - D70_VALV (bool ): Ultrafiltration Valve 1 Outlet (D70) - D72_VALV (bool ): Ultrafiltration Valve 2 Outlet (D72) + D14_VALV (bool ): Valve Hydraulics Outlet (D14) + D52_VALV (bool ): Valve Thermal Disinfect (D52) + D8_VALV (bool ): Valve Hydraulics Bypass (D8) + D54_VALV (bool ): Valve Rinse Port (D54) + D53_VALV (bool ): Valve Drain (D53) + D34_VALV (bool ): Valve Dialyzer Bypass (D34) + D64_VALV (bool ): Valve Purge 1 (D64) + D31_VALV (bool ): Valve Pressure Test (D31) + D65_VALV (bool ): Valve DryBcarb Inlet (D65) + D35_VALV (bool ): Valve Dialyzer Inlet (D35) + D40_VALV (bool ): Valve Dialyzer Outlet (D40) + D47_VALV (bool ): Valve Dialysate Out Purge 2 (D47) + D3_VALV (bool ): Valve Hydraulics Inlet (D3) + D80_VALV (bool ): Valve Dry Bicarb (D80) + D81_VALV (bool ): Valve De-scaler (D81) + RSRVD_SPACE1 (bool ): This space has been reserved + D23_VALV (bool ): Balancing chamber Valve 1 (D23) + D19_VALV (bool ): Balancing chamber Valve 2 (D19) + D25_VALV (bool ): Balancing chamber Valve 3 (D25) + D21_VALV (bool ): Balancing chamber Valve 4 (D21) + D24_VALV (bool ): Balancing chamber Valve 5 (D24) + D20_VALV (bool ): Balancing chamber Valve 6 (D20) + D26_VALV (bool ): Balancing chamber Valve 7 (D26) + D22_VALV (bool ): Balancing chamber Valve 8 (D22) + D79_PMP_VALV (bool ): D79 pump mapped to spare valve 0 + SPARE1_VALV (bool ): Spare Valve 1 + SPARE2_VALV (bool ): Spare Valve 2 + SPARE3_VALV (bool ): Spare Valve 3 + SPARE4_VALV (bool ): Spare Valve 4 + SPARE5_VALV (bool ): Spare Valve 5 + SPARE6_VALV (bool ): Spare Valve 6 + SPARE7_VALV (bool ): Spare Valve 7 + M4_VALV (bool ): First IO valve (M4) + M12_VALV (bool ): Last IO valve IO valve (M12) + P11_VALV (bool ): First FP Valve (P11) + P33_VALV (bool ): Valve (P33) + P34_VALV (bool ): Valve (P34) + P37_VALV (bool ): Valve (P37) + P39_VALV (bool ): Valve (P39) + P6_VALV (bool ): Last FP Valve (P6) valvesensedState[28] (list[int] ): Sense state of valves """ hydraulic_valves = (D14_VALV << 0 )|\ @@ -605,32 +629,51 @@ (D40_VALV << 10)|\ (D47_VALV << 11)|\ (D3_VALV << 12)|\ - (M4_VALV << 13)|\ - (RSRVD_SPACE1 << 14)|\ - (RSRVD_SPACE2 << 15) + (D80_VALV << 13)|\ + (D81_VALV << 14)|\ + (RSRVD_SPACE1 << 15) - balancing_chamber_valves = (D23_VALV << 0 ) | \ - (D19_VALV << 1 )|\ - (D25_VALV << 2 )|\ - (D26_VALV << 3 )|\ - (D24_VALV << 4 )|\ - (D20_VALV << 5 )|\ - (D21_VALV << 6 )|\ - (D22_VALV << 7 ) + balancing_chamber_valves = (D23_VALV << 0 )| \ + (D19_VALV << 1 )|\ + (D25_VALV << 2 )|\ + (D21_VALV << 3 )|\ + (D24_VALV << 4 )|\ + (D20_VALV << 5 )|\ + (D26_VALV << 6 )|\ + (D22_VALV << 7 ) - # final 4 bits are reserved and left as 0 - ultrafiltration_valves = (D69_VALV << 0 )|\ - (D71_VALV << 1 )|\ - (D70_VALV << 2 )|\ - (D72_VALV << 3 )|\ - (0 << 4 )|\ - (0 << 5 )|\ - (0 << 6 )|\ - (0 << 7 ) + spare_valves = (D79_PMP_VALV << 0 )|\ + (SPARE1_VALV << 1 )|\ + (SPARE2_VALV << 2 )|\ + (SPARE3_VALV << 3 )|\ + (SPARE4_VALV << 4 )|\ + (SPARE5_VALV << 5 )|\ + (SPARE6_VALV << 6 )|\ + (SPARE7_VALV << 7 ) + io_valves = (M4_VALV << 0 )|\ + (M12_VALV << 1 )|\ + (0 << 2 )|\ + (0 << 3 )|\ + (0 << 4 )|\ + (0 << 5 )|\ + (0 << 6 )|\ + (0 << 7 ) + + fp_valves = (P11_VALV << 0 )|\ + (P33_VALV << 1 )|\ + (P34_VALV << 2 )|\ + (P37_VALV << 3 )|\ + (P39_VALV << 4 )|\ + (P6_VALV << 5 )|\ + (0 << 6 )|\ + (0 << 7 ) + payload = conversions.unsigned_short_to_bytearray(hydraulic_valves ) payload += conversions.unsigned_byte_to_bytearray (balancing_chamber_valves ) - payload += conversions.unsigned_byte_to_bytearray (ultrafiltration_valves ) + payload += conversions.unsigned_byte_to_bytearray (spare_valves ) + payload += conversions.unsigned_byte_to_bytearray (io_valves ) + payload += conversions.unsigned_byte_to_bytearray (fp_valves ) for i in range(len(valvesensedState)): payload += conversions.unsigned_byte_to_bytearray(valvesensedState[i]) Index: leahi_dialin/ui/fp_messaging.py =================================================================== diff -u -rcb3b4b4cffc07204d74bb502bc25205780ec4f57 -r372d9868eab437585688e307e166881c42d2fc9b --- leahi_dialin/ui/fp_messaging.py (.../fp_messaging.py) (revision cb3b4b4cffc07204d74bb502bc25205780ec4f57) +++ leahi_dialin/ui/fp_messaging.py (.../fp_messaging.py) (revision 372d9868eab437585688e307e166881c42d2fc9b) @@ -107,59 +107,6 @@ self.can_interface.send(message, 0) - def fp_valves(self, M4_VALV : bool, - M12_VALV : bool, - P11_VALV : bool, - P33_VALV : bool, - P34_VALV : bool, - P37_VALV : bool, - P39_VALV : bool, - P6_VALV : bool, - valvesensedState: list): - """ - Broadcasts the current FP Valve data (Msg ID: 0x31, 49) - Args: - M4_VALV (bool ): Valves (M4) - M12_VALV (bool ): Valves (M12) - P11_VALV (bool ): Valves (P11) - P33_VALV (bool ): Valves (P33) - P34_VALV (bool ): Valves (P34) - P37_VALV (bool ): Valves (P37) - P39_VALV (bool ): Valves (P39) - P6_VALV (bool ): Valves (P6) - - valvesensedState[10] (list[int] ): Sense state of valves - @return: None - """ - # final 6 bits are unused and left as 0 - hydraulic_valves = (M4_VALV << 0 ) | \ - (M12_VALV << 1) | \ - (P11_VALV << 2 ) | \ - (P33_VALV << 3 ) | \ - (P34_VALV << 4 ) | \ - (P37_VALV << 5 ) | \ - (P39_VALV << 6) | \ - (P6_VALV << 7) | \ - (0 << 8) | \ - (0 << 9) | \ - (0 << 10) | \ - (0 << 11) | \ - (0 << 12) | \ - (0 << 13) | \ - (0 << 14) | \ - (0 << 15) - - payload = conversions.unsigned_short_to_bytearray(hydraulic_valves ) - for i in range(len(valvesensedState)): - payload += conversions.unsigned_byte_to_bytearray(valvesensedState[i]) - - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, - message_id=msg_ids.MsgIds.MSG_ID_FP_VALVES_STATES_DATA.value, - payload=payload) - - self.can_interface.send(message, 0) - def fp_ro_pump(self, p12PumpState : int , p12PumpDutyCycle : int , p12PumpFBDutyCycle : int ,