Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -rc5493e8477c3bd058517d2c56a7460357bfc029e -re16372ac648dd4efca346c889348b08c8653ee17 --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision c5493e8477c3bd058517d2c56a7460357bfc029e) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision e16372ac648dd4efca346c889348b08c8653ee17) @@ -286,6 +286,7 @@ MSG_ID_DD_DRY_BICART_FILL_CYCLE_MAX_OVERRIDE_REQUEST = 0xA055 MSG_ID_DD_DRY_BICART_FILL_REQUEST_OVERRIDE_REQUEST = 0xA056 MSG_ID_DD_BICARB_CHAMBER_FILL_REQUEST_OVERRIDE_REQUEST = 0xA057 + MSG_ID_DD_BICART_DRAIN_REQUEST_OVERRIDE_REQUEST = 0xA058 # Placeholder messages MSG_ID_DD_ALARM_STATE_OVERRIDE_REQUEST = 0xAF03 Index: leahi_dialin/common/test_config_defs.py =================================================================== diff -u -r9c785697827d1a21021b48b57d5a14f157856ec2 -re16372ac648dd4efca346c889348b08c8653ee17 --- leahi_dialin/common/test_config_defs.py (.../test_config_defs.py) (revision 9c785697827d1a21021b48b57d5a14f157856ec2) +++ leahi_dialin/common/test_config_defs.py (.../test_config_defs.py) (revision e16372ac648dd4efca346c889348b08c8653ee17) @@ -20,11 +20,9 @@ @unique class DDTestConfigOptions(DialinEnum): - TEST_CONFIG_BETA_HW = 0 # Test configuration using Beta Hardware - TEST_CONFIG_DISABLE_BC_PRES_ALARM = 1 # Test configuration disabling BC pressure alarms - TEST_CONFIG_DISABLE_DIENER_CONC_PUMP = 2 # Test configuration disabling Diener concentrate pump - TEST_CONFIG_ENABLE_4WIRE_RINSE_PUMP = 3 # Test configuration Enabling 4 wire rinse pump - NUM_OF_TEST_CONFIGS = 4 # Number of Test Configs + TEST_CONFIG_DISABLE_BC_PRES_ALARM = 0 # Test configuration disabling BC pressure alarms + TEST_CONFIG_ENABLE_DRY_BICART_FILL = 1 # Test configuration for enabling drybicart fill + NUM_OF_TEST_CONFIGS = 2 # Number of Test Configs @unique class FPTestConfigOptions(DialinEnum): Index: leahi_dialin/dd/modules/drybicart.py =================================================================== diff -u -rc5493e8477c3bd058517d2c56a7460357bfc029e -re16372ac648dd4efca346c889348b08c8653ee17 --- leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision c5493e8477c3bd058517d2c56a7460357bfc029e) +++ leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision e16372ac648dd4efca346c889348b08c8653ee17) @@ -49,19 +49,21 @@ self.dd_dry_bicart_fill_execution_state = 0 self.dd_bicarb_chamber_fill_execution_state = 0 + self.dd_dry_bicart_drain_execution_state = 0 self.dd_dry_bicart_fill_cycle_counter = 0 self.dd_dry_bicart_max_fill_cycle_count = 0 self.dd_dry_bicart_fill_request = 0 self.dd_bicarb_chamber_fill_request = 0 + self.dd_dry_bicart_drain_request = 0 self.dd_dry_bicart_last_fill_time = 0 self.dd_dry_bicart_current_fill_time = 0 self.dd_dry_bicart_timestamp = 0 @publish(["msg_id_dd_dry_bicart_data", - "dd_dry_bicart_fill_execution_state", "dd_bicarb_chamber_fill_execution_state", + "dd_dry_bicart_fill_execution_state", "dd_bicarb_chamber_fill_execution_state", "dd_dry_bicart_drain_execution_state", "dd_dry_bicart_fill_cycle_counter", "dd_dry_bicart_max_fill_cycle_count", - "dd_dry_bicart_fill_request", "dry_bicarb_chamber_fill_request", "dd_dry_bicart_last_fill_time", - "dd_dry_bicart_current_fill_time", + "dd_dry_bicart_fill_request", "dry_bicarb_chamber_fill_request", "dd_dry_bicart_drain_request", + "dd_dry_bicart_last_fill_time", "dd_dry_bicart_current_fill_time", "dd_dry_bicart_timestamp"]) def _handler_dry_bicart_sync(self, message, timestamp=0.0): """ @@ -75,18 +77,22 @@ message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] self.dd_bicarb_chamber_fill_execution_state = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] - self.dd_dry_bicart_fill_cycle_counter = struct.unpack('I', bytearray( + self.dd_dry_bicart_drain_execution_state = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] - self.dd_dry_bicart_max_fill_cycle_count = struct.unpack('I', bytearray( + self.dd_dry_bicart_fill_cycle_counter = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] - self.ddd_dry_bicart_fill_request = struct.unpack('I', bytearray( + self.dd_dry_bicart_max_fill_cycle_count = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] - self.dd_bicarb_chamber_fill_request = struct.unpack('I', bytearray( + self.ddd_dry_bicart_fill_request = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] - self.dd_dry_bicart_last_fill_time = struct.unpack('I', bytearray( + self.dd_bicarb_chamber_fill_request = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7]))[0] - self.dd_dry_bicart_current_fill_time = struct.unpack('I', bytearray( + self.ddd_dry_bicart_drain_request = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] + self.dd_dry_bicart_last_fill_time = struct.unpack('I', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] + self.dd_dry_bicart_current_fill_time = struct.unpack('I', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_10:MsgFieldPositions.END_POS_FIELD_10]))[0] self.dd_dry_bicart_timestamp = timestamp @@ -220,3 +226,32 @@ else: self.logger.error("Timeout!!!!") return False + def cmd_dry_bicart_drain_request_override(self, start_stop: int, reset: int = NO_RESET) -> int: + """ + Constructs and sends the dry bicart drain request override command + Constraints: + Must be logged into DD. + + @param start_stop: int - value to start or stop dry bicart drain ( start = 1, stop = 0 + @return: 1 if successful, zero otherwise + + """ + + request = integer_to_bytearray(start_stop) + reset_byte_array = integer_to_bytearray(reset) + payload = reset_byte_array + request + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dd_ch_id, + message_id=MsgIds.MSG_ID_DD_BICART_DRAIN_REQUEST_OVERRIDE_REQUEST.value, + payload=payload) + + # Send message + 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.error("Timeout!!!!") + return False \ No newline at end of file