Index: dialin/dg/scheduled_runs_record.py =================================================================== diff -u -r551e0a9620126efd158e93c45e9ed84ee6ec85fb -rd384151f5e4718f092f9cafbf537fbca34b44e07 --- dialin/dg/scheduled_runs_record.py (.../scheduled_runs_record.py) (revision 551e0a9620126efd158e93c45e9ed84ee6ec85fb) +++ dialin/dg/scheduled_runs_record.py (.../scheduled_runs_record.py) (revision d384151f5e4718f092f9cafbf537fbca34b44e07) @@ -59,7 +59,8 @@ self.logger = logger self.current_message = 0 self.total_messages = 0 - self.length = 0 + self.received_msg_length = 0 + self._is_getting_runs_in_progress = False self.cal_data = 0 self.raw_scheduled_runs_record = [] @@ -78,10 +79,12 @@ @return: None """ - # Clear the list for the next call - self.raw_scheduled_runs_record.clear() - # Run the firmware commands to get the system record - self._request_dg_fw_scheduled_runs_record() + if self._is_getting_runs_in_progress is not True: + self._is_getting_runs_in_progress = True + # Clear the list for the next call + self.raw_scheduled_runs_record.clear() + # Run the firmware commands to get the system record + self._request_dg_fw_scheduled_runs_record() def _request_dg_fw_scheduled_runs_record(self): """ @@ -122,11 +125,11 @@ self.current_message = curr self.total_messages = total - self.length = length + self.received_msg_length = length # The end of scheduled runs record payload is from the start index + 12 bytes for the current message + total # messages + the received_msg_length of scheduled runs record. The rest is the CAN messaging CRC and is not # needed. - end_of_data_index = self.SCHEDULED_RUNS_RECORD_START_INDEX + self.SCHEDULED_RECORD_SPECS_BYTES + self.length + end_of_data_index = self.SCHEDULED_RUNS_RECORD_START_INDEX + self.SCHEDULED_RECORD_SPECS_BYTES + self.received_msg_length # Get the scheduled runs data only self.cal_data = message['message'][self.SCHEDULED_RUNS_RECORD_START_INDEX:end_of_data_index] @@ -137,6 +140,8 @@ self.raw_scheduled_runs_record += (message['message'][self.SCHEDULED_RUNS_RECORD_START_INDEX + self.SCHEDULED_RECORD_SPECS_BYTES:end_of_data_index]) if self.current_message == self.total_messages: + # Done receiving the messages + self._is_getting_runs_in_progress = False # If all the messages have been received, call another function to process the raw data self._update_dg_scheduled_record_from_fw() Index: dialin/dg/service_record.py =================================================================== diff -u -r551e0a9620126efd158e93c45e9ed84ee6ec85fb -rd384151f5e4718f092f9cafbf537fbca34b44e07 --- dialin/dg/service_record.py (.../service_record.py) (revision 551e0a9620126efd158e93c45e9ed84ee6ec85fb) +++ dialin/dg/service_record.py (.../service_record.py) (revision d384151f5e4718f092f9cafbf537fbca34b44e07) @@ -43,8 +43,9 @@ self.logger = logger self.current_message = 0 self.total_messages = 0 - self.length = 0 + self.received_msg_length = 0 self.service_data = 0 + self._is_getting_service_in_progress = False self.raw_service_record = [] self.utilities = NVOpsUtils() # Service main record @@ -64,10 +65,12 @@ @return: None """ - # Clear the list for the next call - self.raw_service_record.clear() - # Run the firmware commands to get the record - self._request_dg_fw_service_record() + if self._is_getting_service_in_progress is not True: + self._is_getting_service_in_progress = True + # Clear the list for the next call + self.raw_service_record.clear() + # Run the firmware commands to get the record + self._request_dg_fw_service_record() def _request_dg_fw_service_record(self): """ @@ -109,11 +112,11 @@ self.current_message = curr self.total_messages = total - self.length = length + self.received_msg_length = length # The end of calibration_record record payload is from the start index + 12 bytes for the current message +total # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed # to be kept - end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.length + end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.received_msg_length # Get the data only and not specs of it (i.e current message number) self.service_data = message['message'][self._RECORD_START_INDEX:end_of_data_index] @@ -124,6 +127,8 @@ self.raw_service_record += (message['message'][self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES:end_of_data_index]) if self.current_message == self.total_messages: + # Done with receiving the messages + self._is_getting_service_in_progress = False # If all the messages have been received, call another function to process the raw data self.utilities.process_received_record_from_fw(self.dg_service_record, self.raw_service_record) Index: dialin/dg/system_record.py =================================================================== diff -u -r551e0a9620126efd158e93c45e9ed84ee6ec85fb -rd384151f5e4718f092f9cafbf537fbca34b44e07 --- dialin/dg/system_record.py (.../system_record.py) (revision 551e0a9620126efd158e93c45e9ed84ee6ec85fb) +++ dialin/dg/system_record.py (.../system_record.py) (revision d384151f5e4718f092f9cafbf537fbca34b44e07) @@ -45,7 +45,8 @@ self.logger = logger self.current_message = 0 self.total_messages = 0 - self.length = 0 + self.received_msg_length = 0 + self._is_getting_sys_in_progress = False self.sys_data = 0 self.raw_system_record = [] self._utilities = NVOpsUtils() @@ -69,10 +70,13 @@ @return: None """ - # Clear the list for the next call - self.raw_system_record.clear() - # Run the firmware commands to get the record - self._request_dg_fw_system_record() + if self._is_getting_sys_in_progress is not True: + # Receiving the system record is in progress + self._is_getting_sys_in_progress = True + # Clear the list for the next call + self.raw_system_record.clear() + # Run the firmware commands to get the record + self._request_dg_fw_system_record() def is_reading_record_done(self): """ @@ -122,11 +126,11 @@ self.current_message = curr self.total_messages = total - self.length = length + self.received_msg_length = length # The end of calibration_record record payload is from the start index + 12 bytes for the current message +total # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed # to be kept - end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.length + end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.received_msg_length # Get the data only and not specs of it (i.e current message number) self.sys_data = message['message'][self._RECORD_START_INDEX:end_of_data_index] @@ -137,6 +141,8 @@ self.raw_system_record += (message['message'][self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES:end_of_data_index]) if self.current_message == self.total_messages: + # Done with receiving the messages + self._is_getting_sys_in_progress = False # If all the messages have been received, call another function to process the raw data self._utilities.process_received_record_from_fw(self.dg_system_record, self.raw_system_record) Index: dialin/hd/calibration_record.py =================================================================== diff -u -r551e0a9620126efd158e93c45e9ed84ee6ec85fb -rd384151f5e4718f092f9cafbf537fbca34b44e07 --- dialin/hd/calibration_record.py (.../calibration_record.py) (revision 551e0a9620126efd158e93c45e9ed84ee6ec85fb) +++ dialin/hd/calibration_record.py (.../calibration_record.py) (revision d384151f5e4718f092f9cafbf537fbca34b44e07) @@ -45,6 +45,7 @@ self.current_message = 0 self.total_messages = 0 self.received_msg_length = 0 + self._is_getting_cal_in_progress = False self.cal_data = 0 self.raw_cal_record = [] self.utilities = NVOpsUtils() @@ -66,10 +67,12 @@ @return: None """ - # Clear the list for the next call - self.raw_cal_record.clear() - # Run the firmware commands to get the calibration_record record - self._request_hd_fw_calibration_record() + if self._is_getting_cal_in_progress is not True: + self._is_getting_cal_in_progress = True + # Clear the list for the next call + self.raw_cal_record.clear() + # Run the firmware commands to get the calibration_record record + self._request_hd_fw_calibration_record() def _request_hd_fw_calibration_record(self): """ @@ -113,7 +116,8 @@ self.total_messages = total self.received_msg_length = length # The end of calibration_record record payload is from the start index + 12 bytes for the current message +total - # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed to be kept + # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed + # to be kept end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.received_msg_length # Get the calibration_record data only @@ -125,6 +129,8 @@ self.raw_cal_record += (message['message'][self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES:end_of_data_index]) if self.current_message == self.total_messages: + # Done with receiving the messages + self._is_getting_cal_in_progress = False # If all the messages have been received, call another function to process the raw data self.utilities.process_received_record_from_fw(self.hd_calibration_record, self.raw_cal_record) Index: dialin/hd/service_record.py =================================================================== diff -u -r551e0a9620126efd158e93c45e9ed84ee6ec85fb -rd384151f5e4718f092f9cafbf537fbca34b44e07 --- dialin/hd/service_record.py (.../service_record.py) (revision 551e0a9620126efd158e93c45e9ed84ee6ec85fb) +++ dialin/hd/service_record.py (.../service_record.py) (revision d384151f5e4718f092f9cafbf537fbca34b44e07) @@ -43,7 +43,8 @@ self.logger = logger self.current_message = 0 self.total_messages = 0 - self.length = 0 + self.received_msg_length = 0 + self._is_getting_service_in_progress = False self.service_data = 0 self.raw_service_record = [] self.utilities = NVOpsUtils() @@ -64,10 +65,12 @@ @return: None """ - # Clear the list for the next call - self.raw_service_record.clear() - # Run the firmware commands to get the record - self._request_hd_fw_service_record() + if self._is_getting_service_in_progress is not True: + self._is_getting_service_in_progress = True + # Clear the list for the next call + self.raw_service_record.clear() + # Run the firmware commands to get the record + self._request_hd_fw_service_record() def _request_hd_fw_service_record(self): """ @@ -109,10 +112,11 @@ self.current_message = curr self.total_messages = total - self.length = length + self.received_msg_length = length # The end of calibration_record record payload is from the start index + 12 bytes for the current message +total - # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed to be kept - end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.length + # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed + # to be kept + end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.received_msg_length # Get the data only and not specs of it (i.e current message number) self.service_data = message['message'][self._RECORD_START_INDEX:end_of_data_index] @@ -123,6 +127,8 @@ self.raw_service_record += (message['message'][self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES:end_of_data_index]) if self.current_message == self.total_messages: + # Done with receiving the messages + self._is_getting_service_in_progress = False # If all the messages have been received, call another function to process the raw data self.utilities.process_received_record_from_fw(self.hd_service_record, self.raw_service_record) Index: dialin/hd/system_record.py =================================================================== diff -u -r551e0a9620126efd158e93c45e9ed84ee6ec85fb -rd384151f5e4718f092f9cafbf537fbca34b44e07 --- dialin/hd/system_record.py (.../system_record.py) (revision 551e0a9620126efd158e93c45e9ed84ee6ec85fb) +++ dialin/hd/system_record.py (.../system_record.py) (revision d384151f5e4718f092f9cafbf537fbca34b44e07) @@ -46,7 +46,8 @@ self.logger = logger self.current_message = 0 self.total_messages = 0 - self.length = 0 + self.received_msg_length = 0 + self._is_getting_system_in_progress = False self.sys_data = 0 self.raw_system_record = [] self.utilities = NVOpsUtils() @@ -66,10 +67,12 @@ @return: None """ - # Clear the list for the next call - self.raw_system_record.clear() - # Run the firmware commands to get the record - self._request_hd_fw_system_record() + if self._is_getting_system_in_progress is not True: + self._is_getting_system_in_progress = True + # Clear the list for the next call + self.raw_system_record.clear() + # Run the firmware commands to get the record + self._request_hd_fw_system_record() def _request_hd_fw_system_record(self): """ @@ -111,10 +114,11 @@ self.current_message = curr self.total_messages = total - self.length = length + self.received_msg_length = length # The end of calibration_record record payload is from the start index + 12 bytes for the current message +total - # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed to be kept - end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.length + # messages + the received_msg_length of calibration_record. The rest is the CAN messaging CRC that is not needed + # to be kept + end_of_data_index = self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES + self.received_msg_length # Get the data only and not specs of it (i.e current message number) self.sys_data = message['message'][self._RECORD_START_INDEX:end_of_data_index] @@ -125,6 +129,8 @@ self.raw_system_record += (message['message'][self._RECORD_START_INDEX + self._RECORD_SPECS_BYTES:end_of_data_index]) if self.current_message == self.total_messages: + # Done with receiving the messages + self._is_getting_system_in_progress = False # If all the messages have been received, call another function to process the raw data self.utilities.process_received_record_from_fw(self.hd_system_record, self.raw_system_record)