Index: leahi_dialin/td/treatment_delivery.py =================================================================== diff -u -r5ebadf2099b379c5ee6d8417be5e3121c74611cf -r5994adea1a1022175f9cc4e6dacfa02de3fc45a0 --- leahi_dialin/td/treatment_delivery.py (.../treatment_delivery.py) (revision 5ebadf2099b379c5ee6d8417be5e3121c74611cf) +++ leahi_dialin/td/treatment_delivery.py (.../treatment_delivery.py) (revision 5994adea1a1022175f9cc4e6dacfa02de3fc45a0) @@ -222,11 +222,11 @@ result = self.process_into_vars(decoder_list = msg_list, message = message) - if all([len(each) > 0 for each in [result['major'], result['minor'], result['micro'], result['build'], result['compatibility']]]): + if all([each is not None for each in [result['major'], result['minor'], result['micro'], result['build'], result['compatibility']]]): self.td_version = f"v{result['major']}.{result['minor']}.{result['micro']}-{result['build']}.{result['compatibility']}" self.logger.debug(f'TD VERSION: {self.td_version}') - if all([len(each) > 0 for each in [result['fpga_id'], result['fpga_major'], result['fpga_minor'], result['fpga_lab']]]): + if all([each is not None for each in [result['fpga_id'], result['fpga_major'], result['fpga_minor'], result['fpga_lab']]]): self.td_fpga_version = f"v{result['fpga_id']}.{result['fpga_major']}.{result['fpga_minor']}-{result['fpga_lab']}" self.logger.debug(f'TD FPGA VERSION: {self.td_fpga_version}') @@ -257,7 +257,7 @@ result = self.process_into_vars(decoder_list = msg_list, message = message) - if all([len(each) > 0 for each in [result['major'], result['minor'], result['micro'], result['build'], result['compatibility']]]): + if all([each is not None for each in [result['major'], result['minor'], result['micro'], result['build'], result['compatibility']]]): self.ui_version = f"v{result['major']}.{result['minor']}.{result['micro']}-{result['build']}.{result['compatibility']}" self.logger.debug(f'UI VERSION: {self.ui_version}') else: @@ -295,8 +295,8 @@ @return: 1 if logged in, 0 if log in failed """ message = CanMessage.build_message(channel_id=CanChannels.dialin_to_td_ch_id, - message_id=MsgIds.MSG_ID_TD_TESTER_LOGIN_REQUEST.value, - payload=list(map(int, map(ord, self.TD_LOGIN_PASSWORD)))) + message_id=MsgIds.MSG_ID_TD_TESTER_LOGIN_REQUEST.value, + payload=list(map(int, map(ord, self.TD_LOGIN_PASSWORD)))) self.logger.debug("Logging in...") @@ -404,13 +404,17 @@ @return: none """ - message = CanMessage.build_message(channel_id=CanChannels.dialin_to_td_ch_id, - message_id=MsgIds.MSG_ID_TD_UI_VERSION_INFO_REQUEST.value) + return cmd_generic_override( + payload = None, + reset = None, + channel_id = CanChannels.td_to_ui_ch_id, + msg_id = MsgIds.MSG_ID_TD_UI_VERSION_INFO_REQUEST, + entity_name = 'UI Versions Request', + override_text = '', + logger = self.logger, + can_interface = self.can_interface) - self.logger.debug("Sending an UI version request to the TD.") - self.can_interface.send(message, 0) - def cmd_training_test_override(self, value: int, reset: int = NO_RESET) -> int: """ Constructs and sends a training test override request to the TD.