MVC State Editor Controllers (rafcon.gui.controllers.state_editor)

LinkageOverviewController (in linkage_overview)

class rafcon.gui.controllers.state_editor.linkage_overview.LinkageOverviewController(model, view)

Bases: rafcon.gui.controllers.utils.extended_controller.ExtendedController, rafcon.design_patterns.mvc.model.ModelMT

ScopedVariableListController (in scoped_variable_list)

class rafcon.gui.controllers.state_editor.scoped_variable_list.ScopedVariableListController(model, view)

Bases: rafcon.gui.controllers.utils.tree_view_controller.ListViewController

Controller handling the scoped variable list

Parameters
  • model (rafcon.gui.models.state.StateModel) – The state model, holding state data.

  • view (rafcon.gui.views.scoped_variables_list.ScopedVariablesListView) – The GTK view showing the list of scoped variables.

CORE_ELEMENT_CLASS

alias of rafcon.core.state_elements.scope.ScopedVariable

DATA_TYPE_NAME_STORAGE_ID = 1
DEFAULT_VALUE_STORAGE_ID = 2
ID_STORAGE_ID = 3
MODEL_STORAGE_ID = 4
NAME_STORAGE_ID = 0
apply_new_scoped_variable_default_value(path, new_default_value_str)

Applies the new default value of the scoped variable defined by path

Parameters
  • path (str) – The path identifying the edited variable

  • new_default_value_str (str) – New default value as string

apply_new_scoped_variable_name(path, new_name)

Applies the new name of the scoped variable defined by path

Parameters
  • path (str) – The path identifying the edited variable

  • new_name (str) – New name

apply_new_scoped_variable_type(path, new_variable_type_str)

Applies the new data type of the scoped variable defined by path

Parameters
  • path (str) – The path identifying the edited variable

  • new_variable_type_str (str) – New data type as str

static get_new_list_store()
on_add(widget, data=None)

Create a new scoped variable with default values

on_right_click_menu()

An abstract method called after right click events

paste_action_callback(*event, **kwargs)

Callback method for paste action

The method trigger the clipboard paste of the list of scoped variables in the clipboard or in case this list is empty and there are other port types selected in the clipboard it will trigger the paste with convert flag. The convert flag will cause the insertion of scoped variables with the same names, data types and default values the objects of differing port type (in the clipboard) have.

register_actions(shortcut_manager)

Register callback methods for triggered actions

Parameters

shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) – Shortcut Manager Object holding mappings between shortcuts and actions.

register_view(view)

Called when the View was registered

reload_scoped_variables_list_store()

Reloads the scoped variable list store from the data port models

remove_core_element(model)

Remove respective core element of handed scoped variable model

Parameters

model (ScopedVariableModel) – Scoped variable model which core element should be removed

Returns

scoped_variables_changed(model, prop_name, info)

SourceEditorController (in source_editor)

class rafcon.gui.controllers.state_editor.source_editor.SourceEditorController(model, view)

Bases: rafcon.gui.controllers.utils.editor.EditorController, rafcon.gui.utils.external_editor.AbstractExternalEditor

Controller handling the source editor in Execution States.

:param :param rafcon.gui.views.source_editor.SourceEditorView view: The GTK view showing the source editor.

apply_clicked(button)

Triggered when the Apply button in the source editor is clicked.

static format_error_string(message)
get_file_name()

Implements the abstract method of the ExternalEditor class.

load_and_set_file_content(file_system_path)

Implements the abstract method of the ExternalEditor class.

register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.

save_file_data(path)

Implements the abstract method of the ExternalEditor class.

set_editor_lock(lock)

Implements the abstract method of the ExternalEditor class.

property source_text
tmp_file = '/tmp/rafcon-docs/2410/tmpapipccve/file_to_get_pylinted.py'

StateDataFlowsListController (in data_flows)

class rafcon.gui.controllers.state_editor.data_flows.StateDataFlowsEditorController(model, view)

Bases: rafcon.gui.controllers.utils.extended_controller.ExtendedController

register_actions(shortcut_manager)

Register callback methods for triggered actions

Parameters

shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) –

register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application

toggled_button(button, name=None)
class rafcon.gui.controllers.state_editor.data_flows.StateDataFlowsListController(model, view)

Bases: rafcon.gui.controllers.state_editor.linkage_list.LinkageListController

Controller handling the view of transitions of the ContainerStateModel

This gtkmvc3.Controller class is the interface between the GTK widget view gui.views.data_flow.DataFlowListView and the transitions of the gui.models.state.ContainerStateModel. Changes made in the GUI are written back to the model and vice versa.

Parameters
  • model (rafcon.gui.models.ContainerStateModel) – The container state model containing the data

  • view (rafcon.gui.views.DataFlowListView) – The GTK view showing the data flows as a table

CORE_ELEMENT_CLASS

alias of rafcon.core.state_elements.data_flow.DataFlow

FROM_STATE_STORAGE_ID = 1
ID_STORAGE_ID = 0
IS_EXTERNAL_STORAGE_ID = 5
MODEL_STORAGE_ID = 11
TO_KEY_STORAGE_ID = 4
TO_STATE_STORAGE_ID = 3
after_notification_of_parent_or_state(model, prop_name, info)
after_notification_of_parent_or_state_from_lists(model, prop_name, info)
before_notification_of_parent_or_state(model, prop_name, info)

Set the no update flag to avoid updates in between of a state removal.

destroy()

Recursively destroy all Controllers

The method remove all controllers, which calls the destroy method of the child controllers. Then, all registered models are relieved and and the widget hand by the initial view argument is destroyed.

find_free_and_valid_data_flows(depend_to_state_id=None)
free_to_port_external = None
free_to_port_internal = None
from_port_external = None
from_port_internal = None
on_add(button, info=None)

An abstract add method for a respective new core element and final selection of those

on_combo_changed_from_key(widget, path, text)
on_combo_changed_from_state(widget, path, text)
on_combo_changed_to_key(widget, path, text)
on_combo_changed_to_state(widget, path, text)
on_focus(widget, data=None)
on_right_click_menu()

An abstract method called after right click events

register_view(view)

Called when the View was registered

remove_core_element(model)

Remove respective core element of handed data flow model

Parameters

model (DataFlowModel) – Data Flow model which core element should be removed

Returns

update(initiator='Unknown')
rafcon.gui.controllers.state_editor.data_flows.find_free_keys(model)
rafcon.gui.controllers.state_editor.data_flows.get_key_combos(ports, keys_store, not_key=None)
rafcon.gui.controllers.state_editor.data_flows.get_state_model(state_m, state_id)
rafcon.gui.controllers.state_editor.data_flows.update_data_flows(model, data_flow_dict, tree_dict_combos)

Updates data flow dictionary and combo dictionary of the widget according handed model.

Parameters
  • model – model for which the data_flow_dict and tree_dict_combos should be updated

  • data_flow_dict – dictionary that holds all internal and external data-flows and those respective row labels

  • tree_dict_combos – dictionary that holds all internal and external data-flow-adaptation-combos

Returns

DescriptionEditorController (in description_editor)

class rafcon.gui.controllers.state_editor.description_editor.DescriptionEditorController(model, view)

Bases: rafcon.gui.controllers.utils.editor.EditorController

Controller handling the description editor of States.

:param :param rafcon.gui.views.source_editor.SourceEditorView view: The GTK view showing the source editor.

on_focus_out(*args, **kwargs)
register_actions(shortcut_manager)

Register callback methods for triggered actions

Parameters

shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) – Shortcut Manager Object holding mappings between shortcuts and actions.

register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.

scroll_to_bottom(widget, data=None)
property source_text

StateEditorController (in state_editor)

class rafcon.gui.controllers.state_editor.state_editor.StateEditorController(model, view)

Bases: rafcon.gui.controllers.utils.extended_controller.ExtendedController

Controller handles the organization of the Logic-Data oriented State-Editor. Widgets concerning logic flow (outcomes and transitions) are grouped in the Logic Linkage expander. Widgets concerning data flow (data-ports and data-flows) are grouped in the data linkage expander.

Parameters

model (rafcon.gui.models.state.StateModel) – The state model

register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application

rename()
show_content_changed(model, prop_name, info)
state_destruction(model, prop_name, info)

Close state editor when state is being destructed

StateOutcomesListController (in outcomes)

class rafcon.gui.controllers.state_editor.outcomes.StateOutcomesEditorController(model, view)

Bases: rafcon.gui.controllers.utils.extended_controller.ExtendedController

paste_action_callback(*event, **kwargs)

Callback method for paste action

register_actions(shortcut_manager)

Register callback methods for triggered actions

Parameters

shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) –

register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application

class rafcon.gui.controllers.state_editor.outcomes.StateOutcomesListController(model, view)

Bases: rafcon.gui.controllers.utils.tree_view_controller.ListViewController

The controller handles the outcomes of one respective state

The controller allows to add and remove outcomes as well as to add, remove and to modify the related transition.

The related transition can be set to a sibling-state, to the state it self or to a outcome of the parent. Hereby the transition also can switch from pointing to an outcome or to a state. It react to changes in the state’s respective outcomes-list, transitions-list or change of parent-state and use additionally the focus change to update after a modification (e.g. the focus change updates if not observed state-names change).

CORE_ELEMENT_CLASS

alias of rafcon.core.state_elements.logical_port.Outcome

CORE_PARENT_STORAGE_ID = 5
CORE_STORAGE_ID = 4
ID_STORAGE_ID = 0
MODEL_STORAGE_ID = 6
NAME_STORAGE_ID = 1
apply_new_outcome_name(path, new_name)

Apply the newly entered outcome name it is was changed

Parameters
  • path (str) – The path string of the renderer

  • new_name (str) – Newly entered outcome name

destroy()

Recursively destroy all Controllers

The method remove all controllers, which calls the destroy method of the child controllers. Then, all registered models are relieved and and the widget hand by the initial view argument is destroyed.

on_add(button, info=None)

An abstract add method for a respective new core element and final selection of those

on_right_click_menu()

An abstract method called after right click events

on_to_outcome_edited(renderer, path, new_outcome_identifier)

Connects the outcome with a transition to the newly set outcome

Parameters
  • renderer (Gtk.CellRendererText) – The cell renderer that was edited

  • path (str) – The path string of the renderer

  • new_outcome_identifier (str) – An identifier for the new outcome that was selected

on_to_state_edited(renderer, path, new_state_identifier)

Connects the outcome with a transition to the newly set state

Parameters
  • renderer (Gtk.CellRendererText) – The cell renderer that was edited

  • path (str) – The path string of the renderer

  • new_state_identifier (str) – An identifier for the new state that was selected

outcomes_changed(model, prop_name, info)
register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application

remove_core_element(model)

Remove respective core element of handed outcome model

Parameters

model (OutcomeModel) – Outcome model which core element should be removed

Returns

update(initiator='Unknown')
update_internal_data_base()
update_list_store()

StateOverviewController (in overview)

class rafcon.gui.controllers.state_editor.overview.StateOverviewController(model, view, with_is_start_state_check_box=False)

Bases: rafcon.gui.controllers.utils.extended_controller.ExtendedController

Controller handling the view of properties/attributes of the ContainerStateModel

This design_patterns.mvc.controller.Controller class is the interface between the GTK widget view gui.views.source_editor.SourceEditorView and the properties of the gui.models.state.StateModel. Changes made in the GUI are written back to the model and vice versa.

Parameters
  • model (rafcon.gui.models.StateModel) – The state model containing the data

  • view (rafcon.gui.views.SourceEditorView) – The GTK view showing the data as a table

change_name(new_name)
change_type(widget, model=None, info=None)
check_for_enter(entry, event)
static get_allowed_state_classes(state)
notify_is_start(model, prop_name, info)
notify_name_change(model, prop_name, info)
on_focus_out(entry, event)
on_toggle_is_start_state(button)
on_toggle_show_content(checkbox)
register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application

Parameters

view (rafcon.gui.views.state_editor.overview.StateOverviewView) – A state overview view instance

rename()
show_content_changed(model, prop_name, info)

StateTransitionsListController (in transitions)

class rafcon.gui.controllers.state_editor.transitions.StateTransitionsEditorController(model, view)

Bases: rafcon.gui.controllers.utils.extended_controller.ExtendedController

register_actions(shortcut_manager)

Register callback methods for triggered actions

Parameters

shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) –

register_view(view)

Called when the View was registered

Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application

toggled_button(button, name=None)
class rafcon.gui.controllers.state_editor.transitions.StateTransitionsListController(model, view)

Bases: rafcon.gui.controllers.state_editor.linkage_list.LinkageListController

Controller handling the view of transitions of the ContainerStateModel

This gtkmvc3.Controller class is the interface between the GTK widget view gui.views.transitions.TransitionListView and the transitions of the gui.models.state.ContainerStateModel. Changes made in the GUI are written back to the model and vice versa.

Parameters
  • model (rafcon.gui.models.ContainerStateModel) – The container state model containing the data

  • view (rafcon.gui.views.TransitionListView) – The GTK view showing the transitions as a table

CORE_ELEMENT_CLASS

alias of rafcon.core.state_elements.transition.Transition

FROM_OUTCOME_STORAGE_ID = 2
FROM_STATE_STORAGE_ID = 1
ID_STORAGE_ID = 0
IS_EXTERNAL_STORAGE_ID = 5
MODEL_STORAGE_ID = 9
TO_OUTCOME_STORAGE_ID = 4
TO_STATE_STORAGE_ID = 3
after_notification_of_parent_or_state_from_lists(model, prop_name, info)

Activates the update after update if outcomes, transitions or states list has been changed.

after_notification_state(model, prop_name, info)
before_notification_of_parent_or_state(model, prop_name, info)

Set the no update flag to avoid updates in between of a state removal.

destroy()

Recursively destroy all Controllers

The method remove all controllers, which calls the destroy method of the child controllers. Then, all registered models are relieved and and the widget hand by the initial view argument is destroyed.

static get_possible_combos_for_transition(trans, model, self_model, is_external=False)

The function provides combos for a transition and its respective

Parameters
  • trans

  • model

  • self_model

  • is_external

Returns

on_add(button, info=None)

An abstract add method for a respective new core element and final selection of those

on_combo_changed_from_outcome(widget, path, text)
on_combo_changed_from_state(widget, path, text)
on_combo_changed_to_outcome(widget, path, text)
on_combo_changed_to_state(widget, path, text)
on_focus(widget, data=None)
on_right_click_menu()

An abstract method called after right click events

register_view(view)

Called when the View was registered

remove_core_element(model)

Remove respective core element of handed transition model

Parameters

model (TransitionModel) – Transition model which core element should be removed

Returns

update(initiator='Unknown')