Index: leahi_dialin/dd/modules/drybicart.py =================================================================== diff -u -r4fc29aead7deff5ba3ddb4c9e1290fc0d5b2b6e8 -r0dae30ee2608053ac19508c8a71ead2d2f4518e1 --- leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision 4fc29aead7deff5ba3ddb4c9e1290fc0d5b2b6e8) +++ leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision 0dae30ee2608053ac19508c8a71ead2d2f4518e1) @@ -54,12 +54,14 @@ self.dd_dry_bicart_timestamp = 0.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_drain_execution_state = 0 #: The Dry Bicart drain execution state + self.dd_dry_bicart_depressurize_execution_state = 0 #: The Dry Bicart depressurize 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_depressurize_request = 0 #: Is depressurize 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 @@ -241,7 +243,7 @@ logger=self.logger, can_interface=self.can_interface) - def cmd_dry_bicart_depressurise_override(self, depressurise: int, reset: int = NO_RESET) -> int: + def cmd_dry_bicart_depressurize_override(self, depressurise: int, reset: int = NO_RESET) -> int: """ Constructs and sends the dry bicart depressurise override command Constraints: @@ -263,3 +265,49 @@ override_text=str(depressurise), logger=self.logger, can_interface=self.can_interface) + + def cmd_dry_bicart_lower_cart_pressure_override(self, lower_cart_pressure: int, reset: int = NO_RESET) -> int: + """ + Constructs and sends the dry bicart lower cart pressure override command + Constraints: + Must be logged into DD. + + @param lower_cart_pressure: int - value for lower cart pressure ( + @return: 1 if successful, zero otherwise + """ + lower_cart_pressure = integer_to_bytearray(lower_cart_pressure) + reset_byte_array = integer_to_bytearray(reset) + payload = reset_byte_array + lower_cart_pressure + + return cmd_generic_override( + payload=payload, + reset=reset, + channel_id=CanChannels.dialin_to_dd_ch_id, + msg_id=MsgIds.MSG_ID_DD_BICART_LOWER_PRESSURE_OVERRIDE_REQUEST, + entity_name='Bicart Lower Cart Pressure', + override_text=str(lower_cart_pressure), + logger=self.logger, + can_interface=self.can_interface) + + def cmd_dry_bicart_upper_cart_pressure_override(self, upper_cart_pressure: int, reset: int = NO_RESET) -> int: + """ + Constructs and sends the dry bicart upper cart pressure override command + Constraints: + Must be logged into DD. + + @param upper_cart_pressure: int - value for upper cart pressure ( + @return: 1 if successful, zero otherwise + """ + upper_cart_pressure = integer_to_bytearray(upper_cart_pressure) + reset_byte_array = integer_to_bytearray(reset) + payload = reset_byte_array + upper_cart_pressure + + return cmd_generic_override( + payload=payload, + reset=reset, + channel_id=CanChannels.dialin_to_dd_ch_id, + msg_id=MsgIds.MSG_ID_DD_BICART_UPPER_PRESSURE_OVERRIDE_REQUEST, + entity_name='Bicart Upper Cart Pressure', + override_text=str(upper_cart_pressure), + logger=self.logger, + can_interface=self.can_interface)