Esempio n. 1
0
 def before_notification_state_machine_observation_control(
         self, model, prop_name, info):
     """Check for multi-actions and set respective no update flags. """
     if is_execution_status_update_notification_from_state_machine_model(
             prop_name, info):
         return
     # do not update while multi-actions
     self.check_info_on_no_update_flags(info)
Esempio n. 2
0
    def states_update_before(self, model, prop_name, info):

        if is_execution_status_update_notification_from_state_machine_model(prop_name, info):
            return

        overview = NotificationOverview(info, False, self.__class__.__name__)

        if overview['prop_name'][-1] == 'state' and \
                overview['method_name'][-1] in ["change_state_type"]:
            changed_model = self._selected_sm_model.get_state_model_by_path(overview['args'][-1][1].get_path())
            self.observe_model(changed_model)
Esempio n. 3
0
    def notify_state_name_change(self, model, prop_name, info):
        """Checks whether the name of a state was changed and change the tab label accordingly
        """
        # avoid updates or checks because of execution status updates
        if is_execution_status_update_notification_from_state_machine_model(prop_name, info):
            return

        overview = NotificationOverview(info, False, self.__class__.__name__)
        changed_model = overview['model'][-1]
        method_name = overview.get_cause()
        if isinstance(changed_model, AbstractStateModel) and method_name in ['name', 'script_text']:
            self.update_tab_label(changed_model)
Esempio n. 4
0
    def states_update_before(self, model, prop_name, info):

        if is_execution_status_update_notification_from_state_machine_model(
                prop_name, info):
            return

        overview = NotificationOverview(info)

        if overview.get_affected_property() == 'state' and \
                overview.get_cause() in ["change_state_type"]:
            changed_model = self._selected_sm_model.get_state_model_by_path(
                overview.get_method_args()[1].get_path())
            self.observe_model(changed_model)
Esempio n. 5
0
    def states_update(self, model, prop_name, info):

        if is_execution_status_update_notification_from_state_machine_model(prop_name, info) or \
                self._ongoing_complex_actions:
            return

        overview = NotificationOverview(info, False, self.__class__.__name__)

        if overview['prop_name'][-1] == 'state' and \
                overview['method_name'][-1] in ["name"]:  # , "add_state", "remove_state"]:
            self.update_tree_store_row(overview['model'][-1])
        # TODO check the work around for get_library_root_state -> maybe the notifications can be avoided if upper lib
        elif overview['prop_name'][-1] == 'state' and not overview['model'][-1].state.get_next_upper_library_root_state() and \
                overview['method_name'][-1] in ["add_state", "remove_state"]:
            self.update(overview['model'][-1])
Esempio n. 6
0
    def states_update(self, model, prop_name, info):

        if is_execution_status_update_notification_from_state_machine_model(prop_name, info) or \
                self._ongoing_complex_actions:
            return

        overview = NotificationOverview(info)

        if overview.get_affected_property() == 'state' and \
                overview.get_cause() in ["name"]:  # , "add_state", "remove_state"]:
            self.update_tree_store_row(overview.get_affected_model())
        # TODO check the work around for get_library_root_state -> maybe the notifications can be avoided if upper lib
        elif overview.get_affected_property() == 'state' and not overview.get_affected_model().state.get_next_upper_library_root_state() and \
                overview.get_cause() in ["add_state", "remove_state"]:
            self.update(overview.get_affected_model())