Index: leahi_dialin/dd/modules/drybicart.py =================================================================== diff -u -rbe50641ca58589da9cfcd9e837578c6662311ee2 -r20c821bd230fc7689a0275a2918981669ff5cc19 --- leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision be50641ca58589da9cfcd9e837578c6662311ee2) +++ leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision 20c821bd230fc7689a0275a2918981669ff5cc19) @@ -46,35 +46,34 @@ self.can_interface.register_receiving_publication_function(channel_id, self.msg_id_dd_dry_bicart_data, self._handler_dry_bicart_sync) - 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 - self.dd_dryBiCartType = 0 - self.dd_dryBiCartDrainTimePeriod = 0 + self.dd_dry_bicart_timestamp = 0 #: The timestamp of the last message + self.dd_dry_bicart_fill_execution_state = 0 #: The Dry Bicart fill execution state + self.dd_bicarb_chamber_fill_execution_state = 0 #: The Bicarb chamber fill execution state + self.dd_dry_bicart_drain_execution_state = 0 #: The Dry Bicart drain execution state + self.dd_dry_bicart_fill_cycle_counter = 0 #: The Dry Bicart fill cycle counter + self.dd_dry_bicart_max_fill_cycle_count = 0 #: The Dry Bicart max fill cycle state + self.dd_dry_bicart_fill_request = 0 #: Is fill requested for Dry Bicart or not + self.dd_bicarb_chamber_fill_request = 0 #: Is fill requested for Bicarb Chamber or not + self.dd_dry_bicart_drain_request = 0 #: Is drain requested for Dry Bicart or not + self.dd_dry_bicart_last_fill_time = 0 #: The Dry Bicart last fill time + self.dd_dry_bicart_current_fill_time = 0 #: The Dry Bicart current fill time + self.dd_dryBiCartType = 0 #: The Dry Bicart concentrate option index + self.dd_dryBiCartDrainTimePeriod = 0 #: The Dry Bicart drain time period in sec + @publish(["msg_id_dd_dry_bicart_data", "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_drain_request", "dd_dry_bicart_last_fill_time", "dd_dry_bicart_current_fill_time", "dd_dryBiCartType", "dd_dryBiCartDrainTimePeriod", "dd_dry_bicart_timestamp"]) - def _handler_dry_bicart_sync(self, message, timestamp=0.0): """ Handles published dry bicart data messages. @param message: published dry bicart data message @return: None """ - self.dd_dry_bicart_fill_execution_state = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] self.dd_bicarb_chamber_fill_execution_state = struct.unpack('I', bytearray( @@ -102,6 +101,7 @@ self.dd_dry_bicart_timestamp = timestamp + def cmd_dry_bicart_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the dry bicart data broadcast interval override command @@ -113,7 +113,6 @@ @param reset: integer - 1 to reset a previous override, 0 to override @return: 1 if successful, zero otherwise """ - return cmd_generic_broadcast_interval_override( ms=ms, reset=reset, @@ -123,6 +122,7 @@ logger=self.logger, can_interface=self.can_interface) + def cmd_bicart_max_fill_cycle_count_override(self, count: int, reset: int = NO_RESET) -> int: """ Constructs and sends the dry bicart max cycle count override command @@ -132,7 +132,6 @@ @param count: int - count value to override max fill cycle count @param reset: integer - 1 to reset a previous override, 0 to override @return: 1 if successful, zero otherwise - """ cycle_count = integer_to_bytearray(count) reset_byte_array = integer_to_bytearray(reset) @@ -148,6 +147,7 @@ logger=self.logger, can_interface=self.can_interface) + def cmd_dry_bicart_fill_request_override(self, start_stop: int, reset: int = NO_RESET) -> int: """ Constructs and sends the dry bicart fill request override command @@ -156,9 +156,7 @@ @param start_stop: int - value to start or stop dry bicart fill ( 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 @@ -173,6 +171,7 @@ logger=self.logger, can_interface=self.can_interface) + def cmd_dry_bicart_bicarb_chamber_fill_request_override(self, start_stop: int, reset: int = NO_RESET) -> int: """ Constructs and sends the dry bicart bicarbonate chamber F fill request override command @@ -181,9 +180,7 @@ @param start_stop: int - value to start or stop dry bicart fill ( 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 @@ -198,6 +195,7 @@ logger=self.logger, can_interface=self.can_interface) + 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 @@ -206,9 +204,7 @@ @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 @@ -223,6 +219,7 @@ logger=self.logger, can_interface=self.can_interface) + def cmd_dry_bicart_cartridge_size_override(self, small_large: int, reset: int = NO_RESET) -> int: """ Constructs and sends the dry bicart cartridge size override command @@ -231,9 +228,7 @@ @param small_large: int - value for small or large dry bicart ( small = 0, large = 1 @return: 1 if successful, zero otherwise - """ - cartridge_size = integer_to_bytearray(small_large) reset_byte_array = integer_to_bytearray(reset) payload = reset_byte_array + cartridge_size