Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r14369e7587dfe8de1cc117d021bdbd5af0386bd1 -r780b246f56ba5af6173f96b12917f077eceded71 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 14369e7587dfe8de1cc117d021bdbd5af0386bd1) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 780b246f56ba5af6173f96b12917f077eceded71) @@ -53,26 +53,26 @@ self.can_interface.send(message, 0) - def td_temperatures(self, board_temp: float = 0): + def td_temperatures(self, board_temp: float): """ Broadcasts the current TD Temperatures Data @param board_temp : TD Board temperature @return: None """ - # TODO: replace with proper payload and message ID once message is defined + # TODO: replace with proper payload and message ID once message is defined if not self.can_enabled: raise ValueError("CAN Interface is not enabled") payload = conversions.float_to_bytearray(board_temp) message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, - message_id=0x91, + message_id=msg_ids.MsgIds.MSG_ID_TD_TEMPERATURE_DATA.value, payload=payload) self.can_interface.send(message, 0) - def td_blood_pump(self, set_flow: int, meas_flow: float, rot_speed: float, mot_speed: float, curr_motor: float, set_rpm: float, rot_count: int, pres_flow: int, rot_hall_state: int = 0): + def td_blood_pump(self, set_flow: int, meas_flow: float, rot_speed: float, mot_speed: float, curr_motor: float, set_rpm: float, rot_count: int, pres_flow: int, rot_hall_state: int): """ Broadcasts the current TD Blood Pump Data @param set_flow : set flow rate @@ -138,7 +138,7 @@ self.can_interface.send(message, 0) - def td_ejector(self, state: int, set_speed: float = 0): + def td_ejector(self, state: int, set_speed: float): """ Broadcasts the current TD operation mode @param state : ejector state @@ -154,7 +154,7 @@ message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, - message_id=0x4E, # TODO replace with Dialin enum + message_id=msg_ids.MsgIds.MSG_ID_TD_EJECTOR_DATA.value, payload=payload) self.can_interface.send(message, 0) @@ -165,7 +165,6 @@ @param door : door status @return: None """ - # TODO: replace with proper payload and message ID once message is defined if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -174,12 +173,12 @@ message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, - message_id=0x21, # TODO replace with Dialin enum + message_id=msg_ids.MsgIds.MSG_ID_TD_SWITCHES_DATA.value, payload=payload) self.can_interface.send(message, 0) - def td_battery(self, capacity: int, ac_power: int = 0): + def td_battery(self, capacity: int, ac_power: int): """ Broadcasts the current TD Battery Data @param capacity : battery capacity @@ -196,7 +195,7 @@ message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, - message_id=0x94, + message_id=msg_ids.MsgIds.MSG_ID_TD_BATTERY_DATA.value, payload=payload) self.can_interface.send(message, 0) @@ -229,10 +228,10 @@ self.can_interface.send(message, 0) - def td_voltages(self, line_1_2v: float = 1.2, line_3_3v: float = 3.3, line_logic_5v: float = 5.0, - line_sensors_5v: float = 5.0, line_24v: float = 24.0, line_regen_24v: float = 24.0, - fpga_adc_ref: float = 1.0, res_ref: float = 3.0, fpga_vcc: float = 3.0, - fpga_vaux: float = 3.0, fpga_vpvn: float = 1.0): + def td_voltages(self, line_1_2v: float, line_3_3v: float, line_logic_5v: float, + line_sensors_5v: float, line_24v: float, line_regen_24v: float, + fpga_adc_ref: float, res_ref: float, fpga_vcc: float, + fpga_vaux: float, fpga_vpvn: float): """ Broadcasts the current TD voltage data @param line_1_2v : 1.2V line @@ -288,7 +287,6 @@ @param compatibility_rev: (uint) - The FWs/UI compatibility revision @return: None """ - # TODO: Place holder for versions, not all information for versions may be in the same message so structure will vary if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -310,7 +308,7 @@ self.can_interface.send(message, 0) - def cmd_send_serial_td_data(self, serial: str): + def td_serial(self, serial: str): """ the td version serial response message method @param serial: serial number @@ -321,7 +319,7 @@ message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_to_ui_ch_id, - message_id=0x99, + message_id=msg_ids.MsgIds.MSG_ID_TD_SERIAL_RESPONSE.value, payload=payload) self.can_interface.send(message, 0) \ No newline at end of file