Index: dialin/dg/flush.py =================================================================== diff -u -r01db18a18769df2048346f868412fc8a12631fc0 -r7c9dd1487f23d6bf314dcff09b77a25d9a26d1c2 --- dialin/dg/flush.py (.../flush.py) (revision 01db18a18769df2048346f868412fc8a12631fc0) +++ dialin/dg/flush.py (.../flush.py) (revision 7c9dd1487f23d6bf314dcff09b77a25d9a26d1c2) @@ -66,33 +66,3 @@ self.overall_elapsed_time = int(elapsed_time / 1000) self.state_elapsed_time = int(state_elapsed_time / 1000) - def cmd_start_stop_flush(self, start=True): - """ - Constructs and sends the start/stop DG flush command - - @param start: (bool) True = start flush, False = stop flush. - @return: non-zero integer if successful, False otherwise - """ - # 1 is to start - if start: - cmd = 1 - str = "Starting" - else: - cmd = 0 - str = "Stopping" - payload = integer_to_bytearray(cmd) - message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, - message_id=MsgIds.MSG_ID_DG_START_STOP_FLUSH.value, - payload=payload) - - self.logger.debug(str + " DG flush mode") - - received_message = self.can_interface.send(message) - - # If there is content... - if received_message is not None: - # response payload is OK or not OK - return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] - else: - self.logger.debug("Timeout!!!!") - return False Index: dialin/dg/scheduled_runs_record.py =================================================================== diff -u -rdd42e4d9cfe821b0a755ccc86cc1a4a2a3dd2f37 -r7c9dd1487f23d6bf314dcff09b77a25d9a26d1c2 --- dialin/dg/scheduled_runs_record.py (.../scheduled_runs_record.py) (revision dd42e4d9cfe821b0a755ccc86cc1a4a2a3dd2f37) +++ dialin/dg/scheduled_runs_record.py (.../scheduled_runs_record.py) (revision 7c9dd1487f23d6bf314dcff09b77a25d9a26d1c2) @@ -7,6 +7,7 @@ from ..common.msg_defs import MsgIds, MsgFieldPositions from ..protocols.CAN import (DenaliMessage, DenaliChannels) from ..utils.base import _AbstractSubSystem, DialinEnum +from ..utils.nv_ops_utils import NVOpsUtils from logging import Logger @@ -44,8 +45,9 @@ PAYLOAD_TOTAL_MSG_INDEX = 1 PAYLOAD_SCHEDULED_RUNS_BYTES_INDEX = 2 - # DG scheduled runs main record as an ordered dictionary - DG_SCHEDULED_RUNS_RECORD = OrderedDict() + # Delay in between each payload transfer + _PAYLOAD_TRANSFER_DELAY_S = 0.2 + _DIALIN_RECORD_UPDATE_DELAY_S = 0.2 def __init__(self, can_interface, logger: Logger): """ @@ -61,9 +63,14 @@ self.total_messages = 0 self.received_msg_length = 0 self._is_getting_runs_in_progress = False + self._write_fw_data_to_excel = True self.cal_data = 0 self.raw_scheduled_runs_record = [] + self._utilities = NVOpsUtils() + # DG scheduled runs main record as an ordered dictionary + self.dg_scheduled_runs_record = OrderedDict() + if self.can_interface is not None: channel_id = DenaliChannels.dg_to_dialin_ch_id @@ -159,38 +166,39 @@ # DG_Calibration : {pressure_sensors : { ppi : { gain: [' self.MIN_PAYLOAD_BYTES_SPACE: - current_payload_length += data_type_bytes - temp_buffer[self.PAYLOAD_TOTAL_MSG_INDEX] = struct.pack(' self.MIN_PAYLOAD_BYTES_SPACE: - - current_payload_length += data_type_bytes - # Insert a 4-byte 0 to the index of the total messages. This is a place holder and it will - # be updated with the right value later. - temp_buffer[self.PAYLOAD_TOTAL_MSG_INDEX] = struct.pack('