Index: dialin/dg/calibration_record.py =================================================================== diff -u -r72335b185c277c008b114da7ad97bdc2978b3d76 -rc96c0b63250155c3bc1610cf9dab60cc56106df1 --- dialin/dg/calibration_record.py (.../calibration_record.py) (revision 72335b185c277c008b114da7ad97bdc2978b3d76) +++ dialin/dg/calibration_record.py (.../calibration_record.py) (revision c96c0b63250155c3bc1610cf9dab60cc56106df1) @@ -1,6 +1,5 @@ import struct -import datetime import time from collections import OrderedDict from ..common.msg_defs import MsgIds, MsgFieldPositions @@ -52,6 +51,7 @@ self.cal_data = 0 self._raw_cal_record = [] self._write_fw_data_to_excel = True + self._is_getting_cal_in_progress = False self._utilities = NVOpsUtils() # DG calibration_record main record self.dg_calibration_record = OrderedDict() @@ -82,11 +82,15 @@ @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_dg_fw_calibration_record() + # If getting the calibration is in progress, do not start another process + 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_dg_fw_calibration_record() + def _request_dg_fw_calibration_record(self): """ Handles getting DG calibration_record record from firmware. @@ -142,6 +146,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 getting all the calibration data. + 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.dg_calibration_record, self._raw_cal_record, write_to_excel=self._write_fw_data_to_excel)