Index: leahi_dialin/ui/fp_messaging.py =================================================================== diff -u -re8a6ae1277d26e72f7e9f7b39d15bac75a860d01 -r1f2bf6d939eb4033dbedb7d7005494cc12fccbc6 --- leahi_dialin/ui/fp_messaging.py (.../fp_messaging.py) (revision e8a6ae1277d26e72f7e9f7b39d15bac75a860d01) +++ leahi_dialin/ui/fp_messaging.py (.../fp_messaging.py) (revision 1f2bf6d939eb4033dbedb7d7005494cc12fccbc6) @@ -24,7 +24,7 @@ def info(a1, a2): pass - self.can_interface = CAN.DenaliCanMessenger(can_interface=self.can_Channel, logger=fakeLogger() ) + self.can_interface = CAN.CanMessenger(can_interface=self.can_Channel, logger=fakeLogger() ) self.can_interface.start() if self.can_interface is not None: @@ -60,8 +60,8 @@ payload += conversions.unsigned_byte_to_bytearray (fpga_lab ) payload += conversions.unsigned_integer_to_bytearray(compatibility_rev) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_VERSION_RESPONSE.value, payload=payload) @@ -100,69 +100,13 @@ payload += conversions.float_to_bytearray(x3Pressure ) payload += conversions.float_to_bytearray(x4Pressure ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_PRESSURES_DATA.value, payload=payload) self.can_interface.send(message, 0) - def fp_valves(self, M4_VALV : bool, - P39_VALV : bool, - P6_VALV : bool, - P11_VALV : bool, - P33_VALV : bool, - P34_VALV : bool, - P37_VALV : bool, - M7_VALV : bool, - P20_VALV : bool, - P43_VALV : bool, - valvesensedState: list): - """ - Broadcasts the current FP Valve data (Msg ID: 0x31, 49) - Args: - M4_VALV (bool ): Valves (M4) - P39_VALV (bool ): Valves (P39) - P6_VALV (bool ): Valves (P6) - P11_VALV (bool ): Valves (P11) - P33_VALV (bool ): Valves (P33) - P34_VALV (bool ): Valves (P34) - P37_VALV (bool ): Valves (P37) - M7_VALV (bool ): Valves (M7) - P20_VALV (bool ): Valves (P20) - P43_VALV (bool ): Valves (P43) - valvesensedState[10] (list[int] ): Sense state of valves - @return: None - """ - # final 6 bits are unused and left as 0 - hydraulic_valves = (M4_VALV << 0 )|\ - (P39_VALV << 1 )|\ - (P6_VALV << 2 )|\ - (P11_VALV << 3 )|\ - (P33_VALV << 4 )|\ - (P34_VALV << 5 )|\ - (P37_VALV << 6 )|\ - (M7_VALV << 7 )|\ - (P20_VALV << 8 )|\ - (P43_VALV << 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 , @@ -196,8 +140,8 @@ payload += conversions.float_to_bytearray (p12PumpDutyCyclePct ) payload += conversions.float_to_bytearray (p12PumpFBDutyCyclePct ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_RO_PUMP_DATA.value, payload=payload) @@ -212,8 +156,8 @@ """ payload = conversions.unsigned_integer_to_bytearray(p25Level ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_LEVEL_DATA.value, payload=payload) @@ -237,8 +181,8 @@ payload += conversions.float_to_bytearray(p7Temp ) payload += conversions.float_to_bytearray(p16Temp ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_FLOW_DATA.value, payload=payload) @@ -256,8 +200,8 @@ payload = conversions.float_to_bytearray(p9Conductivity ) payload += conversions.float_to_bytearray(p18Conductivity ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_CONDUCTIVITY_DATA.value, payload=payload) @@ -308,8 +252,8 @@ payload += conversions.float_to_bytearray(p7Temp ) payload += conversions.float_to_bytearray(p16Temp ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_TEMPERATURE_DATA.value, payload=payload) @@ -348,8 +292,8 @@ payload += conversions.float_to_bytearray (p40PumpDutyCyclePct ) payload += conversions.float_to_bytearray (p40PumpFBDutyCyclePct ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.fp_sync_broadcast_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id, message_id=msg_ids.MsgIds.MSG_ID_FP_BOOST_PUMP_DATA.value, payload=payload)