Index: leahi_dialin/dd/modules/balancing_chamber.py =================================================================== diff -u -r4c11f61e1e328407ed98a1b81a3e8b0adb278bd5 -rba415df9f8e76d6b0f21e8f69ba99346e42f7b09 --- leahi_dialin/dd/modules/balancing_chamber.py (.../balancing_chamber.py) (revision 4c11f61e1e328407ed98a1b81a3e8b0adb278bd5) +++ leahi_dialin/dd/modules/balancing_chamber.py (.../balancing_chamber.py) (revision ba415df9f8e76d6b0f21e8f69ba99346e42f7b09) @@ -49,17 +49,115 @@ message_id = MsgIds.MSG_ID_DD_BAL_CHAMBER_DATA.value, function = self._handler_balancing_chamber_sync) - self.execution_state = 0 #: The Execution state - self.switching_state = 0 #: The Switching state - self.switching_frequency = 0.0 #: The Switching frequency of the balancing chamber - self.is_spent_fill_complete = 0 #: Is Spent fill complete or not - self.current_bal_chamber_switching_counter = 0 #: The Balancing Chamber's switching counter - self.is_pressure_stabilized_during_fill = 0 #: Is pressure stabilized during fill or not - self.bal_chamber_switch_only_state = 0 #: The balancing chamber's switch only state - self.is_bal_chamber_switching_active = 0 #: Is balancing chamber switching active + self.execution_state = 0 + self.switching_state = 0 + self.switching_frequency = 0.0 + self.is_spent_fill_complete = False + self.current_bal_chamber_switching_counter = 0 + self.is_pressure_stabilized_during_fill = False + self.bal_chamber_switch_only_state = False + self.is_bal_chamber_switching_active = False self.dd_bal_chamber_timestamp = 0 #: The timestamp of the last message +# ============================================================ Properties ============================================================ + @property + def execution_state(self) -> int: + """ + The Execution State + """ + return self._execution_state + + @execution_state.setter + def execution_state(self, value: int): + self._execution_state = value + + + @property + def switching_state(self) -> int: + """ + The Switching State + """ + return self._switching_state + + @switching_state.setter + def switching_state(self, value: int): + self._switching_state = value + + + @property + def switching_frequency(self) -> float: + """ + The Switching frequency of the balancing chamber + """ + return self._switching_frequency + + @switching_frequency.setter + def switching_frequency(self, value: float): + self._switching_frequency = value + + + @property + def is_spent_fill_complete(self) -> bool: + """ + Is Spent fill complete or not + """ + return self._is_spent_fill_complete + + @is_spent_fill_complete.setter + def is_spent_fill_complete(self, value: bool): + self._is_spent_fill_complete = value + + + @property + def is_pressure_stabilized_during_fill(self) -> bool: + """ + Is pressure stabilized during fill or not + """ + return self._is_pressure_stabilized_during_fill + + @is_pressure_stabilized_during_fill.setter + def is_pressure_stabilized_during_fill(self, value: bool): + self._is_pressure_stabilized_during_fill = value + + + @property + def bal_chamber_switch_only_state(self) -> bool: + """ + The balancing chamber's switch only state + """ + return self._switch_only_state + + @bal_chamber_switch_only_state.setter + def bal_chamber_switch_only_state(self, value: bool): + self._switch_only_state = value + + + @property + def is_bal_chamber_switching_active(self) -> bool: + """ + Is balancing chamber switching active + """ + return self._is_bal_chamber_switching_active + + @is_bal_chamber_switching_active.setter + def is_bal_chamber_switching_active(self, value: bool): + self._is_bal_chamber_switching_active = value + + + @property + def current_bal_chamber_switching_counter(self) -> int: + """ + The Balancing Chamber's switching counter + """ + return self._current_bal_chamber_switching_counter + + @current_bal_chamber_switching_counter.setter + def current_bal_chamber_switching_counter(self, value: int): + self._current_bal_chamber_switching_counter = value + + +# ============================================================ Handlers ============================================================ @publish(["msg_id_dd_bal_chamber_data", "execution_state", "switching_state", "switching_frequency", @@ -75,21 +173,21 @@ @return: None """ msg_list = [] - msg_list.append(('self.execution_state', DataTypes.U32)) - msg_list.append(('self.switching_state', DataTypes.U32)) - msg_list.append(('self.switching_frequency', DataTypes.F32)) - msg_list.append(('self.is_spent_fill_complete', DataTypes.U32)) - msg_list.append(('self.current_bal_chamber_switching_counter', DataTypes.U32)) - msg_list.append(('self.is_pressure_stabilized_during_fill', DataTypes.U32)) - msg_list.append(('self.bal_chamber_switch_only_state', DataTypes.U32)) - msg_list.append(('self.is_bal_chamber_switching_active', DataTypes.U32)) + msg_list.append((type(self).execution_state, DataTypes.U32)) + msg_list.append((type(self).switching_state, DataTypes.U32)) + msg_list.append((type(self).switching_frequency, DataTypes.F32)) + msg_list.append((type(self).is_spent_fill_complete, DataTypes.BOOL)) + msg_list.append((type(self).current_bal_chamber_switching_counter, DataTypes.U32)) + msg_list.append((type(self).is_pressure_stabilized_during_fill, DataTypes.BOOL)) + msg_list.append((type(self).bal_chamber_switch_only_state, DataTypes.BOOL)) + msg_list.append((type(self).is_bal_chamber_switching_active, DataTypes.BOOL)) - self.process_into_vars(decoder_list = msg_list, - message = message) - + self.process_into_vars(decoder_list = msg_list, message = message) self.dd_bal_chamber_timestamp = timestamp + +# ============================================================ Overrides and Requests ============================================================ def cmd_balancing_chamber_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the balancing chamber data broadcast interval override command