repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | create_new_state_from_state_with_type | def create_new_state_from_state_with_type(source_state, target_state_class):
"""The function duplicates/transforms a state to a new state type. If the source state type and the new state
type both are ContainerStates the new state will have not transitions to force the user to explicitly re-order
the logica... | python | def create_new_state_from_state_with_type(source_state, target_state_class):
"""The function duplicates/transforms a state to a new state type. If the source state type and the new state
type both are ContainerStates the new state will have not transitions to force the user to explicitly re-order
the logica... | [
"def",
"create_new_state_from_state_with_type",
"(",
"source_state",
",",
"target_state_class",
")",
":",
"current_state_is_container",
"=",
"isinstance",
"(",
"source_state",
",",
"ContainerState",
")",
"new_state_is_container",
"=",
"issubclass",
"(",
"target_state_class",
... | The function duplicates/transforms a state to a new state type. If the source state type and the new state
type both are ContainerStates the new state will have not transitions to force the user to explicitly re-order
the logical flow according the paradigm of the new state type.
:param source_state: previ... | [
"The",
"function",
"duplicates",
"/",
"transforms",
"a",
"state",
"to",
"a",
"new",
"state",
"type",
".",
"If",
"the",
"source",
"state",
"type",
"and",
"the",
"new",
"state",
"type",
"both",
"are",
"ContainerStates",
"the",
"new",
"state",
"will",
"have",... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L147-L230 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | extract_child_models_of_state | def extract_child_models_of_state(state_m, new_state_class):
"""Retrieve child models of state model
The function extracts the child state and state element models of the given state model into a dict. It only
extracts those properties that are required for a state of type `new_state_class`. Transitions ar... | python | def extract_child_models_of_state(state_m, new_state_class):
"""Retrieve child models of state model
The function extracts the child state and state element models of the given state model into a dict. It only
extracts those properties that are required for a state of type `new_state_class`. Transitions ar... | [
"def",
"extract_child_models_of_state",
"(",
"state_m",
",",
"new_state_class",
")",
":",
"# check if root state and which type of state",
"assert",
"isinstance",
"(",
"state_m",
",",
"StateModel",
")",
"assert",
"issubclass",
"(",
"new_state_class",
",",
"State",
")",
... | Retrieve child models of state model
The function extracts the child state and state element models of the given state model into a dict. It only
extracts those properties that are required for a state of type `new_state_class`. Transitions are always left out.
:param state_m: state model of which childre... | [
"Retrieve",
"child",
"models",
"of",
"state",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L233-L286 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | create_state_model_for_state | def create_state_model_for_state(new_state, meta, state_element_models):
"""Create a new state model with the defined properties
A state model is created for a state of the type of new_state. All child models in state_element_models (
model list for port, connections and states) are added to the new model.... | python | def create_state_model_for_state(new_state, meta, state_element_models):
"""Create a new state model with the defined properties
A state model is created for a state of the type of new_state. All child models in state_element_models (
model list for port, connections and states) are added to the new model.... | [
"def",
"create_state_model_for_state",
"(",
"new_state",
",",
"meta",
",",
"state_element_models",
")",
":",
"from",
"rafcon",
".",
"gui",
".",
"models",
".",
"abstract_state",
"import",
"get_state_model_class_for_state",
"state_m_class",
"=",
"get_state_model_class_for_s... | Create a new state model with the defined properties
A state model is created for a state of the type of new_state. All child models in state_element_models (
model list for port, connections and states) are added to the new model.
:param StateModel new_state: The new state object with the correct type
... | [
"Create",
"a",
"new",
"state",
"model",
"with",
"the",
"defined",
"properties"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L289-L306 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | prepare_state_m_for_insert_as | def prepare_state_m_for_insert_as(state_m_to_insert, previous_state_size):
"""Prepares and scales the meta data to fit into actual size of the state."""
# TODO check how much code is duplicated or could be reused for library fit functionality meta data helper
# TODO DO REFACTORING !!! and move maybe the hol... | python | def prepare_state_m_for_insert_as(state_m_to_insert, previous_state_size):
"""Prepares and scales the meta data to fit into actual size of the state."""
# TODO check how much code is duplicated or could be reused for library fit functionality meta data helper
# TODO DO REFACTORING !!! and move maybe the hol... | [
"def",
"prepare_state_m_for_insert_as",
"(",
"state_m_to_insert",
",",
"previous_state_size",
")",
":",
"# TODO check how much code is duplicated or could be reused for library fit functionality meta data helper",
"# TODO DO REFACTORING !!! and move maybe the hole method to meta data and rename it... | Prepares and scales the meta data to fit into actual size of the state. | [
"Prepares",
"and",
"scales",
"the",
"meta",
"data",
"to",
"fit",
"into",
"actual",
"size",
"of",
"the",
"state",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L414-L454 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | insert_state_as | def insert_state_as(target_state_m, state, as_template):
""" Add a state into a target state
In case the state to be insert is a LibraryState it can be chosen to be insert as template.
:param rafcon.gui.models.container_state.ContainerStateModel target_state_m: State model of the target state
:param r... | python | def insert_state_as(target_state_m, state, as_template):
""" Add a state into a target state
In case the state to be insert is a LibraryState it can be chosen to be insert as template.
:param rafcon.gui.models.container_state.ContainerStateModel target_state_m: State model of the target state
:param r... | [
"def",
"insert_state_as",
"(",
"target_state_m",
",",
"state",
",",
"as_template",
")",
":",
"if",
"not",
"isinstance",
"(",
"target_state_m",
",",
"ContainerStateModel",
")",
"or",
"not",
"isinstance",
"(",
"target_state_m",
".",
"state",
",",
"ContainerState",
... | Add a state into a target state
In case the state to be insert is a LibraryState it can be chosen to be insert as template.
:param rafcon.gui.models.container_state.ContainerStateModel target_state_m: State model of the target state
:param rafcon.core.states.State state: State to be insert as template or ... | [
"Add",
"a",
"state",
"into",
"a",
"target",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L457-L498 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | substitute_state | def substitute_state(target_state_m, state_m_to_insert, as_template=False):
""" Substitutes the target state
Both, the state to be replaced (the target state) and the state to be inserted (the new state) are passed via
parameters.
The new state adapts the size and position of the target state.
Stat... | python | def substitute_state(target_state_m, state_m_to_insert, as_template=False):
""" Substitutes the target state
Both, the state to be replaced (the target state) and the state to be inserted (the new state) are passed via
parameters.
The new state adapts the size and position of the target state.
Stat... | [
"def",
"substitute_state",
"(",
"target_state_m",
",",
"state_m_to_insert",
",",
"as_template",
"=",
"False",
")",
":",
"# print(\"substitute_state\")",
"state_to_insert",
"=",
"state_m_to_insert",
".",
"state",
"action_parent_m",
"=",
"target_state_m",
".",
"parent",
"... | Substitutes the target state
Both, the state to be replaced (the target state) and the state to be inserted (the new state) are passed via
parameters.
The new state adapts the size and position of the target state.
State elements of the new state are resized but kepp their proportion.
:param rafco... | [
"Substitutes",
"the",
"target",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L501-L594 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | substitute_state_as | def substitute_state_as(target_state_m, state, as_template, keep_name=False):
""" Substitute a target state with a handed state
The method generates a state model for the state to be inserted and use function substitute_state to finally
substitute the state.
In case the state to be inserted is a Librar... | python | def substitute_state_as(target_state_m, state, as_template, keep_name=False):
""" Substitute a target state with a handed state
The method generates a state model for the state to be inserted and use function substitute_state to finally
substitute the state.
In case the state to be inserted is a Librar... | [
"def",
"substitute_state_as",
"(",
"target_state_m",
",",
"state",
",",
"as_template",
",",
"keep_name",
"=",
"False",
")",
":",
"state_m",
"=",
"get_state_model_class_for_state",
"(",
"state",
")",
"(",
"state",
")",
"# If inserted as template, we have to extract the s... | Substitute a target state with a handed state
The method generates a state model for the state to be inserted and use function substitute_state to finally
substitute the state.
In case the state to be inserted is a LibraryState it can be chosen to be inserted as template.
It can be chosen that the inse... | [
"Substitute",
"a",
"target",
"state",
"with",
"a",
"handed",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L597-L623 |
DLR-RM/RAFCON | source/rafcon/utils/multi_event.py | orify | def orify(e, changed_callback):
"""Add another event to the multi_event
:param e: the event to be added to the multi_event
:param changed_callback: a method to call if the event status changes, this method has access to the multi_event
:return:
"""
if not hasattr(e, "callbacks"): # Event has n... | python | def orify(e, changed_callback):
"""Add another event to the multi_event
:param e: the event to be added to the multi_event
:param changed_callback: a method to call if the event status changes, this method has access to the multi_event
:return:
"""
if not hasattr(e, "callbacks"): # Event has n... | [
"def",
"orify",
"(",
"e",
",",
"changed_callback",
")",
":",
"if",
"not",
"hasattr",
"(",
"e",
",",
"\"callbacks\"",
")",
":",
"# Event has not been orified yet",
"e",
".",
"_set",
"=",
"e",
".",
"set",
"e",
".",
"_clear",
"=",
"e",
".",
"clear",
"e",
... | Add another event to the multi_event
:param e: the event to be added to the multi_event
:param changed_callback: a method to call if the event status changes, this method has access to the multi_event
:return: | [
"Add",
"another",
"event",
"to",
"the",
"multi_event"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/multi_event.py#L44-L58 |
DLR-RM/RAFCON | source/rafcon/utils/multi_event.py | create | def create(*events):
"""Creates a new multi_event
The multi_event listens to all events passed in the "events" parameter.
:param events: a list of threading.Events
:return: The multi_event
:rtype: threading.Event
"""
or_event = threading.Event()
def changed():
if any([event.is... | python | def create(*events):
"""Creates a new multi_event
The multi_event listens to all events passed in the "events" parameter.
:param events: a list of threading.Events
:return: The multi_event
:rtype: threading.Event
"""
or_event = threading.Event()
def changed():
if any([event.is... | [
"def",
"create",
"(",
"*",
"events",
")",
":",
"or_event",
"=",
"threading",
".",
"Event",
"(",
")",
"def",
"changed",
"(",
")",
":",
"if",
"any",
"(",
"[",
"event",
".",
"is_set",
"(",
")",
"for",
"event",
"in",
"events",
"]",
")",
":",
"or_even... | Creates a new multi_event
The multi_event listens to all events passed in the "events" parameter.
:param events: a list of threading.Events
:return: The multi_event
:rtype: threading.Event | [
"Creates",
"a",
"new",
"multi_event"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/multi_event.py#L61-L82 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/logging_console.py | LoggingConsoleController.model_changed | def model_changed(self, model, prop_name, info):
""" React to configuration changes
Update internal hold enable state, propagates it to view and refresh the text buffer."""
current_enables = self._get_config_enables()
if not self._enables == current_enables:
# check if filte... | python | def model_changed(self, model, prop_name, info):
""" React to configuration changes
Update internal hold enable state, propagates it to view and refresh the text buffer."""
current_enables = self._get_config_enables()
if not self._enables == current_enables:
# check if filte... | [
"def",
"model_changed",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"current_enables",
"=",
"self",
".",
"_get_config_enables",
"(",
")",
"if",
"not",
"self",
".",
"_enables",
"==",
"current_enables",
":",
"# check if filtered buffer upda... | React to configuration changes
Update internal hold enable state, propagates it to view and refresh the text buffer. | [
"React",
"to",
"configuration",
"changes"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/logging_console.py#L102-L120 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/execution_log_viewer.py | ExecutionLogTreeController._handle_double_click | def _handle_double_click(self, event):
""" Double click with left mouse button focuses the state and toggles the collapse status"""
if event.get_button()[1] == 1: # Left mouse button
path_info = self.view.tree_view.get_path_at_pos(int(event.x), int(event.y))
if path_info: # Val... | python | def _handle_double_click(self, event):
""" Double click with left mouse button focuses the state and toggles the collapse status"""
if event.get_button()[1] == 1: # Left mouse button
path_info = self.view.tree_view.get_path_at_pos(int(event.x), int(event.y))
if path_info: # Val... | [
"def",
"_handle_double_click",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"get_button",
"(",
")",
"[",
"1",
"]",
"==",
"1",
":",
"# Left mouse button",
"path_info",
"=",
"self",
".",
"view",
".",
"tree_view",
".",
"get_path_at_pos",
"(",
"i... | Double click with left mouse button focuses the state and toggles the collapse status | [
"Double",
"click",
"with",
"left",
"mouse",
"button",
"focuses",
"the",
"state",
"and",
"toggles",
"the",
"collapse",
"status"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/execution_log_viewer.py#L134-L147 |
DLR-RM/RAFCON | source/rafcon/utils/filesystem.py | create_path | def create_path(path):
"""Creates a absolute path in the file system.
:param path: The path to be created
"""
import os
if not os.path.exists(path):
os.makedirs(path) | python | def create_path(path):
"""Creates a absolute path in the file system.
:param path: The path to be created
"""
import os
if not os.path.exists(path):
os.makedirs(path) | [
"def",
"create_path",
"(",
"path",
")",
":",
"import",
"os",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"os",
".",
"makedirs",
"(",
"path",
")"
] | Creates a absolute path in the file system.
:param path: The path to be created | [
"Creates",
"a",
"absolute",
"path",
"in",
"the",
"file",
"system",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/filesystem.py#L27-L34 |
DLR-RM/RAFCON | source/rafcon/utils/filesystem.py | get_md5_file_hash | def get_md5_file_hash(filename):
"""Calculates the MD5 hash of a file
:param str filename: The filename (including the path) of the file
:return: Md5 hash of the file
:rtype: str
"""
import hashlib
BLOCKSIZE = 65536
hasher = hashlib.md5()
with open(filename, 'rb') as afile:
... | python | def get_md5_file_hash(filename):
"""Calculates the MD5 hash of a file
:param str filename: The filename (including the path) of the file
:return: Md5 hash of the file
:rtype: str
"""
import hashlib
BLOCKSIZE = 65536
hasher = hashlib.md5()
with open(filename, 'rb') as afile:
... | [
"def",
"get_md5_file_hash",
"(",
"filename",
")",
":",
"import",
"hashlib",
"BLOCKSIZE",
"=",
"65536",
"hasher",
"=",
"hashlib",
".",
"md5",
"(",
")",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"afile",
":",
"buf",
"=",
"afile",
".",
"rea... | Calculates the MD5 hash of a file
:param str filename: The filename (including the path) of the file
:return: Md5 hash of the file
:rtype: str | [
"Calculates",
"the",
"MD5",
"hash",
"of",
"a",
"file"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/filesystem.py#L37-L52 |
DLR-RM/RAFCON | source/rafcon/utils/filesystem.py | file_needs_update | def file_needs_update(target_file, source_file):
"""Checks if target_file is not existing or differing from source_file
:param target_file: File target for a copy action
:param source_file: File to be copied
:return: True, if target_file not existing or differing from source_file, else False
:rtype... | python | def file_needs_update(target_file, source_file):
"""Checks if target_file is not existing or differing from source_file
:param target_file: File target for a copy action
:param source_file: File to be copied
:return: True, if target_file not existing or differing from source_file, else False
:rtype... | [
"def",
"file_needs_update",
"(",
"target_file",
",",
"source_file",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"target_file",
")",
"or",
"get_md5_file_hash",
"(",
"target_file",
")",
"!=",
"get_md5_file_hash",
"(",
"source_file",
")",
":",
... | Checks if target_file is not existing or differing from source_file
:param target_file: File target for a copy action
:param source_file: File to be copied
:return: True, if target_file not existing or differing from source_file, else False
:rtype: False | [
"Checks",
"if",
"target_file",
"is",
"not",
"existing",
"or",
"differing",
"from",
"source_file"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/filesystem.py#L55-L65 |
DLR-RM/RAFCON | source/rafcon/utils/filesystem.py | copy_file_if_update_required | def copy_file_if_update_required(source_file, target_file):
"""Copies source_file to target_file if latter one in not existing or outdated
:param source_file: Source file of the copy operation
:param target_file: Target file of the copy operation
"""
if file_needs_update(target_file, source_file):
... | python | def copy_file_if_update_required(source_file, target_file):
"""Copies source_file to target_file if latter one in not existing or outdated
:param source_file: Source file of the copy operation
:param target_file: Target file of the copy operation
"""
if file_needs_update(target_file, source_file):
... | [
"def",
"copy_file_if_update_required",
"(",
"source_file",
",",
"target_file",
")",
":",
"if",
"file_needs_update",
"(",
"target_file",
",",
"source_file",
")",
":",
"shutil",
".",
"copy",
"(",
"source_file",
",",
"target_file",
")"
] | Copies source_file to target_file if latter one in not existing or outdated
:param source_file: Source file of the copy operation
:param target_file: Target file of the copy operation | [
"Copies",
"source_file",
"to",
"target_file",
"if",
"latter",
"one",
"in",
"not",
"existing",
"or",
"outdated"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/filesystem.py#L68-L75 |
DLR-RM/RAFCON | source/rafcon/utils/filesystem.py | read_file | def read_file(file_path, filename=None):
""" Open file by path and optional filename
If no file name is given the path is interpreted as direct path to the file to be read.
If there is no file at location the return value will be None to offer a option for case handling.
:param str file_path: Path str... | python | def read_file(file_path, filename=None):
""" Open file by path and optional filename
If no file name is given the path is interpreted as direct path to the file to be read.
If there is no file at location the return value will be None to offer a option for case handling.
:param str file_path: Path str... | [
"def",
"read_file",
"(",
"file_path",
",",
"filename",
"=",
"None",
")",
":",
"file_path",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"file_path",
")",
"if",
"filename",
":",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"file_path",
",",
... | Open file by path and optional filename
If no file name is given the path is interpreted as direct path to the file to be read.
If there is no file at location the return value will be None to offer a option for case handling.
:param str file_path: Path string.
:param str filename: File name of the fi... | [
"Open",
"file",
"by",
"path",
"and",
"optional",
"filename"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/filesystem.py#L78-L97 |
DLR-RM/RAFCON | source/rafcon/utils/filesystem.py | clean_file_system_paths_from_not_existing_paths | def clean_file_system_paths_from_not_existing_paths(file_system_paths):
"""Cleans list of paths from elements that do not exist
If a path is no more valid/existing, it is removed from the list.
:param list[str] file_system_paths: list of file system paths to be checked for existing
"""
paths_to_de... | python | def clean_file_system_paths_from_not_existing_paths(file_system_paths):
"""Cleans list of paths from elements that do not exist
If a path is no more valid/existing, it is removed from the list.
:param list[str] file_system_paths: list of file system paths to be checked for existing
"""
paths_to_de... | [
"def",
"clean_file_system_paths_from_not_existing_paths",
"(",
"file_system_paths",
")",
":",
"paths_to_delete",
"=",
"[",
"]",
"for",
"path",
"in",
"file_system_paths",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"paths_to_delete",
... | Cleans list of paths from elements that do not exist
If a path is no more valid/existing, it is removed from the list.
:param list[str] file_system_paths: list of file system paths to be checked for existing | [
"Cleans",
"list",
"of",
"paths",
"from",
"elements",
"that",
"do",
"not",
"exist"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/filesystem.py#L123-L135 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel.model_changed | def model_changed(self, model, prop_name, info):
"""This method notifies the model lists and the parent state about changes
The method is called each time, the model is changed. This happens, when the state itself changes or one of
its children (outcomes, ports) changes. Changes of the children... | python | def model_changed(self, model, prop_name, info):
"""This method notifies the model lists and the parent state about changes
The method is called each time, the model is changed. This happens, when the state itself changes or one of
its children (outcomes, ports) changes. Changes of the children... | [
"def",
"model_changed",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"# If this model has been changed (and not one of its child states), then we have to update all child models",
"# This must be done before notifying anybody else, because other may relay on the upda... | This method notifies the model lists and the parent state about changes
The method is called each time, the model is changed. This happens, when the state itself changes or one of
its children (outcomes, ports) changes. Changes of the children cannot be observed directly,
therefore children not... | [
"This",
"method",
"notifies",
"the",
"model",
"lists",
"and",
"the",
"parent",
"state",
"about",
"changes"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L50-L111 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel.update_models | def update_models(self, model, name, info):
""" This method is always triggered when the core state changes
It keeps the following models/model-lists consistent:
input-data-port models
output-data-port models
outcome models
"""
if info.method_nam... | python | def update_models(self, model, name, info):
""" This method is always triggered when the core state changes
It keeps the following models/model-lists consistent:
input-data-port models
output-data-port models
outcome models
"""
if info.method_nam... | [
"def",
"update_models",
"(",
"self",
",",
"model",
",",
"name",
",",
"info",
")",
":",
"if",
"info",
".",
"method_name",
"in",
"[",
"\"add_input_data_port\"",
",",
"\"remove_input_data_port\"",
",",
"\"input_data_ports\"",
"]",
":",
"(",
"model_list",
",",
"da... | This method is always triggered when the core state changes
It keeps the following models/model-lists consistent:
input-data-port models
output-data-port models
outcome models | [
"This",
"method",
"is",
"always",
"triggered",
"when",
"the",
"core",
"state",
"changes"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L139-L165 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel._load_input_data_port_models | def _load_input_data_port_models(self):
"""Reloads the input data port models directly from the the state
"""
self.input_data_ports = []
for input_data_port in self.state.input_data_ports.values():
self._add_model(self.input_data_ports, input_data_port, DataPortModel) | python | def _load_input_data_port_models(self):
"""Reloads the input data port models directly from the the state
"""
self.input_data_ports = []
for input_data_port in self.state.input_data_ports.values():
self._add_model(self.input_data_ports, input_data_port, DataPortModel) | [
"def",
"_load_input_data_port_models",
"(",
"self",
")",
":",
"self",
".",
"input_data_ports",
"=",
"[",
"]",
"for",
"input_data_port",
"in",
"self",
".",
"state",
".",
"input_data_ports",
".",
"values",
"(",
")",
":",
"self",
".",
"_add_model",
"(",
"self",... | Reloads the input data port models directly from the the state | [
"Reloads",
"the",
"input",
"data",
"port",
"models",
"directly",
"from",
"the",
"the",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L167-L172 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel._load_output_data_port_models | def _load_output_data_port_models(self):
"""Reloads the output data port models directly from the the state
"""
self.output_data_ports = []
for output_data_port in self.state.output_data_ports.values():
self._add_model(self.output_data_ports, output_data_port, DataPortModel) | python | def _load_output_data_port_models(self):
"""Reloads the output data port models directly from the the state
"""
self.output_data_ports = []
for output_data_port in self.state.output_data_ports.values():
self._add_model(self.output_data_ports, output_data_port, DataPortModel) | [
"def",
"_load_output_data_port_models",
"(",
"self",
")",
":",
"self",
".",
"output_data_ports",
"=",
"[",
"]",
"for",
"output_data_port",
"in",
"self",
".",
"state",
".",
"output_data_ports",
".",
"values",
"(",
")",
":",
"self",
".",
"_add_model",
"(",
"se... | Reloads the output data port models directly from the the state | [
"Reloads",
"the",
"output",
"data",
"port",
"models",
"directly",
"from",
"the",
"the",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L174-L179 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel._load_income_model | def _load_income_model(self):
""" Create income model from core income """
self._add_model(self.income, self.state.income, IncomeModel) | python | def _load_income_model(self):
""" Create income model from core income """
self._add_model(self.income, self.state.income, IncomeModel) | [
"def",
"_load_income_model",
"(",
"self",
")",
":",
"self",
".",
"_add_model",
"(",
"self",
".",
"income",
",",
"self",
".",
"state",
".",
"income",
",",
"IncomeModel",
")"
] | Create income model from core income | [
"Create",
"income",
"model",
"from",
"core",
"income"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L181-L183 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel._load_outcome_models | def _load_outcome_models(self):
""" Create outcome models from core outcomes """
self.outcomes = []
for outcome in self.state.outcomes.values():
self._add_model(self.outcomes, outcome, OutcomeModel) | python | def _load_outcome_models(self):
""" Create outcome models from core outcomes """
self.outcomes = []
for outcome in self.state.outcomes.values():
self._add_model(self.outcomes, outcome, OutcomeModel) | [
"def",
"_load_outcome_models",
"(",
"self",
")",
":",
"self",
".",
"outcomes",
"=",
"[",
"]",
"for",
"outcome",
"in",
"self",
".",
"state",
".",
"outcomes",
".",
"values",
"(",
")",
":",
"self",
".",
"_add_model",
"(",
"self",
".",
"outcomes",
",",
"... | Create outcome models from core outcomes | [
"Create",
"outcome",
"models",
"from",
"core",
"outcomes"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L185-L189 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel.re_initiate_model_list | def re_initiate_model_list(self, model_list_or_dict, core_objects_dict, model_name, model_class, model_key):
"""Recreate model list
The method re-initiate a handed list or dictionary of models with the new dictionary of core-objects.
:param model_list_or_dict: could be a list or dictionary of ... | python | def re_initiate_model_list(self, model_list_or_dict, core_objects_dict, model_name, model_class, model_key):
"""Recreate model list
The method re-initiate a handed list or dictionary of models with the new dictionary of core-objects.
:param model_list_or_dict: could be a list or dictionary of ... | [
"def",
"re_initiate_model_list",
"(",
"self",
",",
"model_list_or_dict",
",",
"core_objects_dict",
",",
"model_name",
",",
"model_class",
",",
"model_key",
")",
":",
"if",
"model_name",
"==",
"\"income\"",
":",
"if",
"self",
".",
"income",
".",
"income",
"!=",
... | Recreate model list
The method re-initiate a handed list or dictionary of models with the new dictionary of core-objects.
:param model_list_or_dict: could be a list or dictionary of one model type
:param core_objects_dict: new dictionary of one type of core-elements (rafcon.core)
:para... | [
"Recreate",
"model",
"list"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L191-L214 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel._add_model | def _add_model(self, model_list_or_dict, core_element, model_class, model_key=None, load_meta_data=True):
"""Adds one model for a given core element.
The method will add a model for a given core object and checks if there is a corresponding model object in the
future expected model list. The me... | python | def _add_model(self, model_list_or_dict, core_element, model_class, model_key=None, load_meta_data=True):
"""Adds one model for a given core element.
The method will add a model for a given core object and checks if there is a corresponding model object in the
future expected model list. The me... | [
"def",
"_add_model",
"(",
"self",
",",
"model_list_or_dict",
",",
"core_element",
",",
"model_class",
",",
"model_key",
"=",
"None",
",",
"load_meta_data",
"=",
"True",
")",
":",
"found_model",
"=",
"self",
".",
"_get_future_expected_model",
"(",
"core_element",
... | Adds one model for a given core element.
The method will add a model for a given core object and checks if there is a corresponding model object in the
future expected model list. The method does not check if an object with corresponding model has already been
inserted.
:param model_li... | [
"Adds",
"one",
"model",
"for",
"a",
"given",
"core",
"element",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L216-L244 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel.add_missing_model | def add_missing_model(self, model_list_or_dict, core_elements_dict, model_name, model_class, model_key):
"""Adds one missing model
The method will search for the first core-object out of core_object_dict
not represented in the list or dict of models handed by model_list_or_dict, adds it and ret... | python | def add_missing_model(self, model_list_or_dict, core_elements_dict, model_name, model_class, model_key):
"""Adds one missing model
The method will search for the first core-object out of core_object_dict
not represented in the list or dict of models handed by model_list_or_dict, adds it and ret... | [
"def",
"add_missing_model",
"(",
"self",
",",
"model_list_or_dict",
",",
"core_elements_dict",
",",
"model_name",
",",
"model_class",
",",
"model_key",
")",
":",
"def",
"core_element_has_model",
"(",
"core_object",
")",
":",
"for",
"model_or_key",
"in",
"model_list_... | Adds one missing model
The method will search for the first core-object out of core_object_dict
not represented in the list or dict of models handed by model_list_or_dict, adds it and returns without continue
to search for more objects which maybe are missing in model_list_or_dict with respect ... | [
"Adds",
"one",
"missing",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L246-L296 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel.remove_additional_model | def remove_additional_model(self, model_list_or_dict, core_objects_dict, model_name, model_key, destroy=True):
"""Remove one unnecessary model
The method will search for the first model-object out of
model_list_or_dict that represents no core-object in the dictionary of core-objects handed by c... | python | def remove_additional_model(self, model_list_or_dict, core_objects_dict, model_name, model_key, destroy=True):
"""Remove one unnecessary model
The method will search for the first model-object out of
model_list_or_dict that represents no core-object in the dictionary of core-objects handed by c... | [
"def",
"remove_additional_model",
"(",
"self",
",",
"model_list_or_dict",
",",
"core_objects_dict",
",",
"model_name",
",",
"model_key",
",",
"destroy",
"=",
"True",
")",
":",
"if",
"model_name",
"==",
"\"income\"",
":",
"self",
".",
"income",
".",
"prepare_dest... | Remove one unnecessary model
The method will search for the first model-object out of
model_list_or_dict that represents no core-object in the dictionary of core-objects handed by core_objects_dict,
remove it and return without continue to search for more model-objects which maybe are unnecessa... | [
"Remove",
"one",
"unnecessary",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L317-L352 |
DLR-RM/RAFCON | source/rafcon/gui/models/state.py | StateModel._get_future_expected_model | def _get_future_expected_model(self, core_element):
"""Hand model for an core element from expected model list and remove the model from this list"""
for model in self.expected_future_models:
if model.core_element is core_element:
# print("expected_future_model found -> remov... | python | def _get_future_expected_model(self, core_element):
"""Hand model for an core element from expected model list and remove the model from this list"""
for model in self.expected_future_models:
if model.core_element is core_element:
# print("expected_future_model found -> remov... | [
"def",
"_get_future_expected_model",
"(",
"self",
",",
"core_element",
")",
":",
"for",
"model",
"in",
"self",
".",
"expected_future_models",
":",
"if",
"model",
".",
"core_element",
"is",
"core_element",
":",
"# print(\"expected_future_model found -> remove model:\", mod... | Hand model for an core element from expected model list and remove the model from this list | [
"Hand",
"model",
"for",
"an",
"core",
"element",
"from",
"expected",
"model",
"list",
"and",
"remove",
"the",
"model",
"from",
"this",
"list"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state.py#L354-L361 |
DLR-RM/RAFCON | source/rafcon/gui/models/config_model.py | ConfigModel.as_dict | def as_dict(self, use_preliminary=False):
"""Create a copy of the config in form of a dict
:param bool use_preliminary: Whether to include the preliminary config
:return: A dict with the copy of the config
:rtype: dict
"""
config = dict()
for key in self.config.k... | python | def as_dict(self, use_preliminary=False):
"""Create a copy of the config in form of a dict
:param bool use_preliminary: Whether to include the preliminary config
:return: A dict with the copy of the config
:rtype: dict
"""
config = dict()
for key in self.config.k... | [
"def",
"as_dict",
"(",
"self",
",",
"use_preliminary",
"=",
"False",
")",
":",
"config",
"=",
"dict",
"(",
")",
"for",
"key",
"in",
"self",
".",
"config",
".",
"keys",
":",
"if",
"use_preliminary",
"and",
"key",
"in",
"self",
".",
"preliminary_config",
... | Create a copy of the config in form of a dict
:param bool use_preliminary: Whether to include the preliminary config
:return: A dict with the copy of the config
:rtype: dict | [
"Create",
"a",
"copy",
"of",
"the",
"config",
"in",
"form",
"of",
"a",
"dict"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/config_model.py#L45-L59 |
DLR-RM/RAFCON | source/rafcon/gui/models/config_model.py | ConfigModel.update_config | def update_config(self, config_dict, config_file):
"""Update the content and reference of the config
:param dict config_dict: The new configuration
:param str config_file: The new file reference
"""
config_path = path.dirname(config_file)
self.config.config_file_path = c... | python | def update_config(self, config_dict, config_file):
"""Update the content and reference of the config
:param dict config_dict: The new configuration
:param str config_file: The new file reference
"""
config_path = path.dirname(config_file)
self.config.config_file_path = c... | [
"def",
"update_config",
"(",
"self",
",",
"config_dict",
",",
"config_file",
")",
":",
"config_path",
"=",
"path",
".",
"dirname",
"(",
"config_file",
")",
"self",
".",
"config",
".",
"config_file_path",
"=",
"config_file",
"self",
".",
"config",
".",
"path"... | Update the content and reference of the config
:param dict config_dict: The new configuration
:param str config_file: The new file reference | [
"Update",
"the",
"content",
"and",
"reference",
"of",
"the",
"config"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/config_model.py#L61-L72 |
DLR-RM/RAFCON | source/rafcon/gui/models/config_model.py | ConfigModel.get_current_config_value | def get_current_config_value(self, config_key, use_preliminary=True, default=None):
"""Returns the current config value for the given config key
:param str config_key: Config key who's value is requested
:param bool use_preliminary: Whether the preliminary config should be queried first
... | python | def get_current_config_value(self, config_key, use_preliminary=True, default=None):
"""Returns the current config value for the given config key
:param str config_key: Config key who's value is requested
:param bool use_preliminary: Whether the preliminary config should be queried first
... | [
"def",
"get_current_config_value",
"(",
"self",
",",
"config_key",
",",
"use_preliminary",
"=",
"True",
",",
"default",
"=",
"None",
")",
":",
"if",
"use_preliminary",
"and",
"config_key",
"in",
"self",
".",
"preliminary_config",
":",
"return",
"copy",
"(",
"s... | Returns the current config value for the given config key
:param str config_key: Config key who's value is requested
:param bool use_preliminary: Whether the preliminary config should be queried first
:param default: The value to return if config key does not exist
:return: Copy of the ... | [
"Returns",
"the",
"current",
"config",
"value",
"for",
"the",
"given",
"config",
"key"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/config_model.py#L74-L84 |
DLR-RM/RAFCON | source/rafcon/gui/models/config_model.py | ConfigModel.set_preliminary_config_value | def set_preliminary_config_value(self, config_key, config_value):
"""Stores a config value as preliminary new value
The config value is not yet applied to the configuration. If the value is identical to the one from the
configuration, the entry is deleted from the preliminary config.
:... | python | def set_preliminary_config_value(self, config_key, config_value):
"""Stores a config value as preliminary new value
The config value is not yet applied to the configuration. If the value is identical to the one from the
configuration, the entry is deleted from the preliminary config.
:... | [
"def",
"set_preliminary_config_value",
"(",
"self",
",",
"config_key",
",",
"config_value",
")",
":",
"if",
"config_value",
"!=",
"self",
".",
"config",
".",
"get_config_value",
"(",
"config_key",
")",
":",
"self",
".",
"preliminary_config",
"[",
"config_key",
"... | Stores a config value as preliminary new value
The config value is not yet applied to the configuration. If the value is identical to the one from the
configuration, the entry is deleted from the preliminary config.
:param str config_key: Key of the entry
:param config_value: New value | [
"Stores",
"a",
"config",
"value",
"as",
"preliminary",
"new",
"value"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/config_model.py#L86-L99 |
DLR-RM/RAFCON | source/rafcon/gui/models/config_model.py | ConfigModel.apply_preliminary_config | def apply_preliminary_config(self, save=True):
"""Applies the preliminary config to the configuration
:param bool save: Whether the config file is be be written to the file system
:return: Whether the applied changes require a refresh of the state machines
:rtype: bool
"""
... | python | def apply_preliminary_config(self, save=True):
"""Applies the preliminary config to the configuration
:param bool save: Whether the config file is be be written to the file system
:return: Whether the applied changes require a refresh of the state machines
:rtype: bool
"""
... | [
"def",
"apply_preliminary_config",
"(",
"self",
",",
"save",
"=",
"True",
")",
":",
"state_machine_refresh_required",
"=",
"False",
"for",
"config_key",
",",
"config_value",
"in",
"self",
".",
"preliminary_config",
".",
"items",
"(",
")",
":",
"self",
".",
"co... | Applies the preliminary config to the configuration
:param bool save: Whether the config file is be be written to the file system
:return: Whether the applied changes require a refresh of the state machines
:rtype: bool | [
"Applies",
"the",
"preliminary",
"config",
"to",
"the",
"configuration"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/config_model.py#L101-L125 |
DLR-RM/RAFCON | source/rafcon/core/state_elements/state_element.py | StateElement.parent | def parent(self, parent):
"""Setter for the parent state of the state element
:param rafcon.core.states.state.State parent: Parent state or None
"""
if parent is None:
self._parent = None
else:
from rafcon.core.states.state import State
assert... | python | def parent(self, parent):
"""Setter for the parent state of the state element
:param rafcon.core.states.state.State parent: Parent state or None
"""
if parent is None:
self._parent = None
else:
from rafcon.core.states.state import State
assert... | [
"def",
"parent",
"(",
"self",
",",
"parent",
")",
":",
"if",
"parent",
"is",
"None",
":",
"self",
".",
"_parent",
"=",
"None",
"else",
":",
"from",
"rafcon",
".",
"core",
".",
"states",
".",
"state",
"import",
"State",
"assert",
"isinstance",
"(",
"p... | Setter for the parent state of the state element
:param rafcon.core.states.state.State parent: Parent state or None | [
"Setter",
"for",
"the",
"parent",
"state",
"of",
"the",
"state",
"element"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_elements/state_element.py#L96-L128 |
DLR-RM/RAFCON | source/rafcon/core/state_elements/state_element.py | StateElement._change_property_with_validity_check | def _change_property_with_validity_check(self, property_name, value):
"""Helper method to change a property and reset it if the validity check fails
:param str property_name: The name of the property to be changed, e.g. '_data_flow_id'
:param value: The new desired value for this property
... | python | def _change_property_with_validity_check(self, property_name, value):
"""Helper method to change a property and reset it if the validity check fails
:param str property_name: The name of the property to be changed, e.g. '_data_flow_id'
:param value: The new desired value for this property
... | [
"def",
"_change_property_with_validity_check",
"(",
"self",
",",
"property_name",
",",
"value",
")",
":",
"assert",
"isinstance",
"(",
"property_name",
",",
"string_types",
")",
"old_value",
"=",
"getattr",
"(",
"self",
",",
"property_name",
")",
"setattr",
"(",
... | Helper method to change a property and reset it if the validity check fails
:param str property_name: The name of the property to be changed, e.g. '_data_flow_id'
:param value: The new desired value for this property
:raises exceptions.ValueError: if a property could not be changed | [
"Helper",
"method",
"to",
"change",
"a",
"property",
"and",
"reset",
"it",
"if",
"the",
"validity",
"check",
"fails"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_elements/state_element.py#L169-L184 |
DLR-RM/RAFCON | source/rafcon/core/state_elements/state_element.py | StateElement._check_validity | def _check_validity(self):
"""Checks the validity of the state element's properties
Some validity checks can only be performed by the parent. Thus, the existence of a parent and a check
function must be ensured and this function be queried.
:return: validity and messages
:rtype... | python | def _check_validity(self):
"""Checks the validity of the state element's properties
Some validity checks can only be performed by the parent. Thus, the existence of a parent and a check
function must be ensured and this function be queried.
:return: validity and messages
:rtype... | [
"def",
"_check_validity",
"(",
"self",
")",
":",
"from",
"rafcon",
".",
"core",
".",
"states",
".",
"state",
"import",
"State",
"if",
"not",
"self",
".",
"parent",
":",
"return",
"True",
",",
"\"no parent\"",
"if",
"not",
"isinstance",
"(",
"self",
".",
... | Checks the validity of the state element's properties
Some validity checks can only be performed by the parent. Thus, the existence of a parent and a check
function must be ensured and this function be queried.
:return: validity and messages
:rtype: bool, str | [
"Checks",
"the",
"validity",
"of",
"the",
"state",
"element",
"s",
"properties"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_elements/state_element.py#L186-L201 |
DLR-RM/RAFCON | share/examples/plugins/templates/gtkmvc_template_observer.py | RootStateModificationObserver.register_new_state_machines | def register_new_state_machines(self, model, prop_name, info):
""" The method register self as observer newly added StateMachineModels after those were added to the list of
state_machines hold by observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerMo... | python | def register_new_state_machines(self, model, prop_name, info):
""" The method register self as observer newly added StateMachineModels after those were added to the list of
state_machines hold by observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerMo... | [
"def",
"register_new_state_machines",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"info",
"[",
"'method_name'",
"]",
"==",
"'__setitem__'",
":",
"self",
".",
"observe_model",
"(",
"info",
"[",
"'args'",
"]",
"[",
"1",
"]",
"... | The method register self as observer newly added StateMachineModels after those were added to the list of
state_machines hold by observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerModel.state_machines. | [
"The",
"method",
"register",
"self",
"as",
"observer",
"newly",
"added",
"StateMachineModels",
"after",
"those",
"were",
"added",
"to",
"the",
"list",
"of",
"state_machines",
"hold",
"by",
"observed",
"StateMachineMangerModel",
".",
"The",
"method",
"register",
"a... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/gtkmvc_template_observer.py#L23-L33 |
DLR-RM/RAFCON | share/examples/plugins/templates/gtkmvc_template_observer.py | RootStateModificationObserver.relieve_state_machines | def relieve_state_machines(self, model, prop_name, info):
""" The method relieves observed models before those get removed from the list of state_machines hold by
observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerModel.state_machines."""
if... | python | def relieve_state_machines(self, model, prop_name, info):
""" The method relieves observed models before those get removed from the list of state_machines hold by
observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerModel.state_machines."""
if... | [
"def",
"relieve_state_machines",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"info",
"[",
"'method_name'",
"]",
"==",
"'__setitem__'",
":",
"pass",
"elif",
"info",
"[",
"'method_name'",
"]",
"==",
"'__delitem__'",
":",
"self",
... | The method relieves observed models before those get removed from the list of state_machines hold by
observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerModel.state_machines. | [
"The",
"method",
"relieves",
"observed",
"models",
"before",
"those",
"get",
"removed",
"from",
"the",
"list",
"of",
"state_machines",
"hold",
"by",
"observed",
"StateMachineMangerModel",
".",
"The",
"method",
"register",
"as",
"observer",
"of",
"observable",
"Sta... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/gtkmvc_template_observer.py#L36-L46 |
DLR-RM/RAFCON | share/examples/plugins/templates/gtkmvc_template_observer.py | RootStateModificationObserver.all_after_notification | def all_after_notification(self, model, prop_name, info):
""" The method logs all changes that notified recursively trough the hierarchies of the states after the change
occurs in the rafcon.core object. The method register as observer of observable
StateMachineModel.state_machine of any observe... | python | def all_after_notification(self, model, prop_name, info):
""" The method logs all changes that notified recursively trough the hierarchies of the states after the change
occurs in the rafcon.core object. The method register as observer of observable
StateMachineModel.state_machine of any observe... | [
"def",
"all_after_notification",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"NotificationOverview",
"(",
"info",
")",
")"
] | The method logs all changes that notified recursively trough the hierarchies of the states after the change
occurs in the rafcon.core object. The method register as observer of observable
StateMachineModel.state_machine of any observed StateMachineModel.
:param model: StateMachineModel that is r... | [
"The",
"method",
"logs",
"all",
"changes",
"that",
"notified",
"recursively",
"trough",
"the",
"hierarchies",
"of",
"the",
"states",
"after",
"the",
"change",
"occurs",
"in",
"the",
"rafcon",
".",
"core",
"object",
".",
"The",
"method",
"register",
"as",
"ob... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/gtkmvc_template_observer.py#L49-L58 |
DLR-RM/RAFCON | share/examples/plugins/templates/gtkmvc_template_observer.py | MetaSignalModificationObserver.relieve_state_machines | def relieve_state_machines(self, model, prop_name, info):
""" The method relieves observed models before those get removed from the list of state_machines hold by
observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerModel.state_machines."""
if... | python | def relieve_state_machines(self, model, prop_name, info):
""" The method relieves observed models before those get removed from the list of state_machines hold by
observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerModel.state_machines."""
if... | [
"def",
"relieve_state_machines",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"info",
"[",
"'method_name'",
"]",
"==",
"'__setitem__'",
":",
"pass",
"elif",
"info",
"[",
"'method_name'",
"]",
"==",
"'__delitem__'",
":",
"self",
... | The method relieves observed models before those get removed from the list of state_machines hold by
observed StateMachineMangerModel. The method register as observer of observable
StateMachineMangerModel.state_machines. | [
"The",
"method",
"relieves",
"observed",
"models",
"before",
"those",
"get",
"removed",
"from",
"the",
"list",
"of",
"state_machines",
"hold",
"by",
"observed",
"StateMachineMangerModel",
".",
"The",
"method",
"register",
"as",
"observer",
"of",
"observable",
"Sta... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/gtkmvc_template_observer.py#L90-L103 |
DLR-RM/RAFCON | share/examples/plugins/templates/gtkmvc_template_observer.py | MetaSignalModificationObserver.observe_root_state_assignments | def observe_root_state_assignments(self, model, prop_name, info):
""" The method relieves observed root_state models and observes newly assigned root_state models.
"""
if info['old']:
self.relieve_model(info['old'])
if info['new']:
self.observe_model(info['new'])
... | python | def observe_root_state_assignments(self, model, prop_name, info):
""" The method relieves observed root_state models and observes newly assigned root_state models.
"""
if info['old']:
self.relieve_model(info['old'])
if info['new']:
self.observe_model(info['new'])
... | [
"def",
"observe_root_state_assignments",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"info",
"[",
"'old'",
"]",
":",
"self",
".",
"relieve_model",
"(",
"info",
"[",
"'old'",
"]",
")",
"if",
"info",
"[",
"'new'",
"]",
":",
... | The method relieves observed root_state models and observes newly assigned root_state models. | [
"The",
"method",
"relieves",
"observed",
"root_state",
"models",
"and",
"observes",
"newly",
"assigned",
"root_state",
"models",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/gtkmvc_template_observer.py#L106-L114 |
DLR-RM/RAFCON | share/examples/plugins/templates/gtkmvc_template_observer.py | MetaSignalModificationObserver.observe_meta_signal_changes | def observe_meta_signal_changes(self, changed_model, prop_name, info):
"""" The method prints the structure of all meta_signal-notifications as log-messages.
"""
self.logger.info(NotificationOverview(info)) | python | def observe_meta_signal_changes(self, changed_model, prop_name, info):
"""" The method prints the structure of all meta_signal-notifications as log-messages.
"""
self.logger.info(NotificationOverview(info)) | [
"def",
"observe_meta_signal_changes",
"(",
"self",
",",
"changed_model",
",",
"prop_name",
",",
"info",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"NotificationOverview",
"(",
"info",
")",
")"
] | The method prints the structure of all meta_signal-notifications as log-messages. | [
"The",
"method",
"prints",
"the",
"structure",
"of",
"all",
"meta_signal",
"-",
"notifications",
"as",
"log",
"-",
"messages",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/gtkmvc_template_observer.py#L117-L120 |
DLR-RM/RAFCON | source/rafcon/utils/vividict.py | Vividict.set_dict | def set_dict(self, new_dict):
"""Sets the dictionary of the Vividict
The method is able to handle nested dictionaries, by calling the method recursively.
:param new_dict: The dict that will be added to the own dict
"""
for key, value in new_dict.items():
if isinstan... | python | def set_dict(self, new_dict):
"""Sets the dictionary of the Vividict
The method is able to handle nested dictionaries, by calling the method recursively.
:param new_dict: The dict that will be added to the own dict
"""
for key, value in new_dict.items():
if isinstan... | [
"def",
"set_dict",
"(",
"self",
",",
"new_dict",
")",
":",
"for",
"key",
",",
"value",
"in",
"new_dict",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"self",
"[",
"str",
"(",
"key",
")",
"]",
"=",
"Vividic... | Sets the dictionary of the Vividict
The method is able to handle nested dictionaries, by calling the method recursively.
:param new_dict: The dict that will be added to the own dict | [
"Sets",
"the",
"dictionary",
"of",
"the",
"Vividict"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/vividict.py#L58-L69 |
DLR-RM/RAFCON | source/rafcon/utils/vividict.py | Vividict.vividict_to_dict | def vividict_to_dict(vividict):
"""Helper method to create Python dicts from arbitrary Vividict objects
:param Vividict vividict: A Vividict to be converted
:return: A Python dict
:rtype: dict
"""
try:
from numpy import ndarray
except ImportError:
... | python | def vividict_to_dict(vividict):
"""Helper method to create Python dicts from arbitrary Vividict objects
:param Vividict vividict: A Vividict to be converted
:return: A Python dict
:rtype: dict
"""
try:
from numpy import ndarray
except ImportError:
... | [
"def",
"vividict_to_dict",
"(",
"vividict",
")",
":",
"try",
":",
"from",
"numpy",
"import",
"ndarray",
"except",
"ImportError",
":",
"ndarray",
"=",
"dict",
"dictionary",
"=",
"{",
"}",
"def",
"np_to_native",
"(",
"np_val",
")",
":",
"\"\"\"Recursively conver... | Helper method to create Python dicts from arbitrary Vividict objects
:param Vividict vividict: A Vividict to be converted
:return: A Python dict
:rtype: dict | [
"Helper",
"method",
"to",
"create",
"Python",
"dicts",
"from",
"arbitrary",
"Vividict",
"objects"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/vividict.py#L90-L136 |
DLR-RM/RAFCON | source/rafcon/utils/vividict.py | Vividict.to_yaml | def to_yaml(cls, dumper, vividict):
"""Implementation for the abstract method of the base class YAMLObject
"""
dictionary = cls.vividict_to_dict(vividict)
node = dumper.represent_mapping(cls.yaml_tag, dictionary)
return node | python | def to_yaml(cls, dumper, vividict):
"""Implementation for the abstract method of the base class YAMLObject
"""
dictionary = cls.vividict_to_dict(vividict)
node = dumper.represent_mapping(cls.yaml_tag, dictionary)
return node | [
"def",
"to_yaml",
"(",
"cls",
",",
"dumper",
",",
"vividict",
")",
":",
"dictionary",
"=",
"cls",
".",
"vividict_to_dict",
"(",
"vividict",
")",
"node",
"=",
"dumper",
".",
"represent_mapping",
"(",
"cls",
".",
"yaml_tag",
",",
"dictionary",
")",
"return",... | Implementation for the abstract method of the base class YAMLObject | [
"Implementation",
"for",
"the",
"abstract",
"method",
"of",
"the",
"base",
"class",
"YAMLObject"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/vividict.py#L139-L144 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.register_view | def register_view(self, 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
:param rafcon.gui.views.state_editor.semantic_data_editor.SemanticDataEditorView view: An view to show all
seman... | python | def register_view(self, 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
:param rafcon.gui.views.state_editor.semantic_data_editor.SemanticDataEditorView view: An view to show all
seman... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"SemanticDataEditorController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"if",
"isinstance",
"(",
"self",
".",
"model",
".",
"state",
",",
"LibraryState",
")",
"or",... | Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
:param rafcon.gui.views.state_editor.semantic_data_editor.SemanticDataEditorView view: An view to show all
semantic data of a state | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L72-L93 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.set_editor_lock | def set_editor_lock(self, locked=True):
""" Implements the abstract method of the ExternalEditor class.
"""
self.view['new_entry'].set_sensitive(not locked)
self.view['new_dict_entry'].set_sensitive(not locked)
self.view['delete_entry'].set_sensitive(not locked)
# self.vi... | python | def set_editor_lock(self, locked=True):
""" Implements the abstract method of the ExternalEditor class.
"""
self.view['new_entry'].set_sensitive(not locked)
self.view['new_dict_entry'].set_sensitive(not locked)
self.view['delete_entry'].set_sensitive(not locked)
# self.vi... | [
"def",
"set_editor_lock",
"(",
"self",
",",
"locked",
"=",
"True",
")",
":",
"self",
".",
"view",
"[",
"'new_entry'",
"]",
".",
"set_sensitive",
"(",
"not",
"locked",
")",
"self",
".",
"view",
"[",
"'new_dict_entry'",
"]",
".",
"set_sensitive",
"(",
"not... | Implements the abstract method of the ExternalEditor class. | [
"Implements",
"the",
"abstract",
"method",
"of",
"the",
"ExternalEditor",
"class",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L95-L104 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.get_selected_object | def get_selected_object(self):
""" Gets the selected object in the treeview
:return:
"""
model, paths = self.tree_view.get_selection().get_selected_rows()
if len(paths) == 1:
return self.tree_store.get_iter(paths[0]), paths[0]
else:
return None, p... | python | def get_selected_object(self):
""" Gets the selected object in the treeview
:return:
"""
model, paths = self.tree_view.get_selection().get_selected_rows()
if len(paths) == 1:
return self.tree_store.get_iter(paths[0]), paths[0]
else:
return None, p... | [
"def",
"get_selected_object",
"(",
"self",
")",
":",
"model",
",",
"paths",
"=",
"self",
".",
"tree_view",
".",
"get_selection",
"(",
")",
".",
"get_selected_rows",
"(",
")",
"if",
"len",
"(",
"paths",
")",
"==",
"1",
":",
"return",
"self",
".",
"tree_... | Gets the selected object in the treeview
:return: | [
"Gets",
"the",
"selected",
"object",
"in",
"the",
"treeview"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L127-L136 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.on_add | def on_add(self, widget, new_dict=False):
"""" Adds a new entry to the semantic data of a state. Reloads the tree store.
:param widget: The source widget of the action
:param bool new_dict: A flag to indicate if the new value is of type dict
:return:
"""
self.semantic_da... | python | def on_add(self, widget, new_dict=False):
"""" Adds a new entry to the semantic data of a state. Reloads the tree store.
:param widget: The source widget of the action
:param bool new_dict: A flag to indicate if the new value is of type dict
:return:
"""
self.semantic_da... | [
"def",
"on_add",
"(",
"self",
",",
"widget",
",",
"new_dict",
"=",
"False",
")",
":",
"self",
".",
"semantic_data_counter",
"+=",
"1",
"treeiter",
",",
"path",
"=",
"self",
".",
"get_selected_object",
"(",
")",
"value",
"=",
"dict",
"(",
")",
"if",
"ne... | Adds a new entry to the semantic data of a state. Reloads the tree store.
:param widget: The source widget of the action
:param bool new_dict: A flag to indicate if the new value is of type dict
:return: | [
"Adds",
"a",
"new",
"entry",
"to",
"the",
"semantic",
"data",
"of",
"a",
"state",
".",
"Reloads",
"the",
"tree",
"store",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L138-L168 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.add_action_callback | def add_action_callback(self, key_value, modifier_mask, a_dict=False):
"""Callback method for add action"""
if react_to_event(self.view, self.tree_view, event=(key_value, modifier_mask)) and self.active_entry_widget is None:
self.on_add(None, a_dict)
return True | python | def add_action_callback(self, key_value, modifier_mask, a_dict=False):
"""Callback method for add action"""
if react_to_event(self.view, self.tree_view, event=(key_value, modifier_mask)) and self.active_entry_widget is None:
self.on_add(None, a_dict)
return True | [
"def",
"add_action_callback",
"(",
"self",
",",
"key_value",
",",
"modifier_mask",
",",
"a_dict",
"=",
"False",
")",
":",
"if",
"react_to_event",
"(",
"self",
".",
"view",
",",
"self",
".",
"tree_view",
",",
"event",
"=",
"(",
"key_value",
",",
"modifier_m... | Callback method for add action | [
"Callback",
"method",
"for",
"add",
"action"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L170-L174 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.on_remove | def on_remove(self, widget, data=None):
""" Removes an entry of semantic data of a state.
:param widget:
:return:
"""
treeiter, path = self.get_selected_object()
if not treeiter:
return
# check if an element is selected
dict_path_as_list = se... | python | def on_remove(self, widget, data=None):
""" Removes an entry of semantic data of a state.
:param widget:
:return:
"""
treeiter, path = self.get_selected_object()
if not treeiter:
return
# check if an element is selected
dict_path_as_list = se... | [
"def",
"on_remove",
"(",
"self",
",",
"widget",
",",
"data",
"=",
"None",
")",
":",
"treeiter",
",",
"path",
"=",
"self",
".",
"get_selected_object",
"(",
")",
"if",
"not",
"treeiter",
":",
"return",
"# check if an element is selected",
"dict_path_as_list",
"=... | Removes an entry of semantic data of a state.
:param widget:
:return: | [
"Removes",
"an",
"entry",
"of",
"semantic",
"data",
"of",
"a",
"state",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L180-L209 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.add_items_to_tree_iter | def add_items_to_tree_iter(self, input_dict, treeiter, parent_dict_path=None):
""" Adds all values of the input dict to self.tree_store
:param input_dict: The input dictionary holds all values, which are going to be added.
:param treeiter: The pointer inside the tree store to add the input dict... | python | def add_items_to_tree_iter(self, input_dict, treeiter, parent_dict_path=None):
""" Adds all values of the input dict to self.tree_store
:param input_dict: The input dictionary holds all values, which are going to be added.
:param treeiter: The pointer inside the tree store to add the input dict... | [
"def",
"add_items_to_tree_iter",
"(",
"self",
",",
"input_dict",
",",
"treeiter",
",",
"parent_dict_path",
"=",
"None",
")",
":",
"if",
"parent_dict_path",
"is",
"None",
":",
"parent_dict_path",
"=",
"[",
"]",
"self",
".",
"get_view_selection",
"(",
")",
"for"... | Adds all values of the input dict to self.tree_store
:param input_dict: The input dictionary holds all values, which are going to be added.
:param treeiter: The pointer inside the tree store to add the input dict
:return: | [
"Adds",
"all",
"values",
"of",
"the",
"input",
"dict",
"to",
"self",
".",
"tree_store"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L211-L227 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.reload_tree_store_data | def reload_tree_store_data(self):
""" Reloads the data of the tree store
:return:
"""
model, paths = self.tree_view.get_selection().get_selected_rows()
self.tree_store.clear()
self.add_items_to_tree_iter(self.model.state.semantic_data, None)
self.tree_view.expan... | python | def reload_tree_store_data(self):
""" Reloads the data of the tree store
:return:
"""
model, paths = self.tree_view.get_selection().get_selected_rows()
self.tree_store.clear()
self.add_items_to_tree_iter(self.model.state.semantic_data, None)
self.tree_view.expan... | [
"def",
"reload_tree_store_data",
"(",
"self",
")",
":",
"model",
",",
"paths",
"=",
"self",
".",
"tree_view",
".",
"get_selection",
"(",
")",
".",
"get_selected_rows",
"(",
")",
"self",
".",
"tree_store",
".",
"clear",
"(",
")",
"self",
".",
"add_items_to_... | Reloads the data of the tree store
:return: | [
"Reloads",
"the",
"data",
"of",
"the",
"tree",
"store"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L229-L244 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.copy_action_callback | def copy_action_callback(self, *event):
"""Add a copy of all selected row dict value pairs to the clipboard"""
if react_to_event(self.view, self.tree_view, event) and self.active_entry_widget is None:
_, dict_paths = self.get_view_selection()
selected_data_list = []
f... | python | def copy_action_callback(self, *event):
"""Add a copy of all selected row dict value pairs to the clipboard"""
if react_to_event(self.view, self.tree_view, event) and self.active_entry_widget is None:
_, dict_paths = self.get_view_selection()
selected_data_list = []
f... | [
"def",
"copy_action_callback",
"(",
"self",
",",
"*",
"event",
")",
":",
"if",
"react_to_event",
"(",
"self",
".",
"view",
",",
"self",
".",
"tree_view",
",",
"event",
")",
"and",
"self",
".",
"active_entry_widget",
"is",
"None",
":",
"_",
",",
"dict_pat... | Add a copy of all selected row dict value pairs to the clipboard | [
"Add",
"a",
"copy",
"of",
"all",
"selected",
"row",
"dict",
"value",
"pairs",
"to",
"the",
"clipboard"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L256-L266 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.paste_action_callback | def paste_action_callback(self, *event):
"""Add clipboard key value pairs into all selected sub-dictionary"""
if react_to_event(self.view, self.tree_view, event) and self.active_entry_widget is None:
_, dict_paths = self.get_view_selection()
selected_data_list = rafcon.gui.clipbo... | python | def paste_action_callback(self, *event):
"""Add clipboard key value pairs into all selected sub-dictionary"""
if react_to_event(self.view, self.tree_view, event) and self.active_entry_widget is None:
_, dict_paths = self.get_view_selection()
selected_data_list = rafcon.gui.clipbo... | [
"def",
"paste_action_callback",
"(",
"self",
",",
"*",
"event",
")",
":",
"if",
"react_to_event",
"(",
"self",
".",
"view",
",",
"self",
".",
"tree_view",
",",
"event",
")",
"and",
"self",
".",
"active_entry_widget",
"is",
"None",
":",
"_",
",",
"dict_pa... | Add clipboard key value pairs into all selected sub-dictionary | [
"Add",
"clipboard",
"key",
"value",
"pairs",
"into",
"all",
"selected",
"sub",
"-",
"dictionary"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L268-L290 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.cut_action_callback | def cut_action_callback(self, *event):
"""Add a copy and cut all selected row dict value pairs to the clipboard"""
if react_to_event(self.view, self.tree_view, event) and self.active_entry_widget is None:
_, dict_paths = self.get_view_selection()
stored_data_list = []
... | python | def cut_action_callback(self, *event):
"""Add a copy and cut all selected row dict value pairs to the clipboard"""
if react_to_event(self.view, self.tree_view, event) and self.active_entry_widget is None:
_, dict_paths = self.get_view_selection()
stored_data_list = []
... | [
"def",
"cut_action_callback",
"(",
"self",
",",
"*",
"event",
")",
":",
"if",
"react_to_event",
"(",
"self",
".",
"view",
",",
"self",
".",
"tree_view",
",",
"event",
")",
"and",
"self",
".",
"active_entry_widget",
"is",
"None",
":",
"_",
",",
"dict_path... | Add a copy and cut all selected row dict value pairs to the clipboard | [
"Add",
"a",
"copy",
"and",
"cut",
"all",
"selected",
"row",
"dict",
"value",
"pairs",
"to",
"the",
"clipboard"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L292-L306 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.key_edited | def key_edited(self, path, new_key_str):
""" Edits the key of a semantic data entry
:param path: The path inside the tree store to the target entry
:param str new_key_str: The new value of the target cell
:return:
"""
tree_store_path = self.create_tree_store_path_from_ke... | python | def key_edited(self, path, new_key_str):
""" Edits the key of a semantic data entry
:param path: The path inside the tree store to the target entry
:param str new_key_str: The new value of the target cell
:return:
"""
tree_store_path = self.create_tree_store_path_from_ke... | [
"def",
"key_edited",
"(",
"self",
",",
"path",
",",
"new_key_str",
")",
":",
"tree_store_path",
"=",
"self",
".",
"create_tree_store_path_from_key_string",
"(",
"path",
")",
"if",
"isinstance",
"(",
"path",
",",
"string_types",
")",
"else",
"path",
"if",
"self... | Edits the key of a semantic data entry
:param path: The path inside the tree store to the target entry
:param str new_key_str: The new value of the target cell
:return: | [
"Edits",
"the",
"key",
"of",
"a",
"semantic",
"data",
"entry"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L308-L331 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.value_edited | def value_edited(self, path, new_value_str):
""" Adds the value of the semantic data entry
:param path: The path inside the tree store to the target entry
:param str new_value_str: The new value of the target cell
:return:
"""
tree_store_path = self.create_tree_store_pat... | python | def value_edited(self, path, new_value_str):
""" Adds the value of the semantic data entry
:param path: The path inside the tree store to the target entry
:param str new_value_str: The new value of the target cell
:return:
"""
tree_store_path = self.create_tree_store_pat... | [
"def",
"value_edited",
"(",
"self",
",",
"path",
",",
"new_value_str",
")",
":",
"tree_store_path",
"=",
"self",
".",
"create_tree_store_path_from_key_string",
"(",
"path",
")",
"if",
"isinstance",
"(",
"path",
",",
"string_types",
")",
"else",
"path",
"if",
"... | Adds the value of the semantic data entry
:param path: The path inside the tree store to the target entry
:param str new_value_str: The new value of the target cell
:return: | [
"Adds",
"the",
"value",
"of",
"the",
"semantic",
"data",
"entry"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L333-L346 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.get_path_for_core_element | def get_path_for_core_element(self, core_element_id):
"""Get path to the row representing core element described by handed core_element_id
:param list core_element_id: Core element identifier used in the respective list store column
:rtype: tuple
:return: path
"""
def ch... | python | def get_path_for_core_element(self, core_element_id):
"""Get path to the row representing core element described by handed core_element_id
:param list core_element_id: Core element identifier used in the respective list store column
:rtype: tuple
:return: path
"""
def ch... | [
"def",
"get_path_for_core_element",
"(",
"self",
",",
"core_element_id",
")",
":",
"def",
"check_function",
"(",
"row_iter",
",",
"iter_found",
")",
":",
"row_id",
"=",
"self",
".",
"tree_store",
".",
"get_value",
"(",
"row_iter",
",",
"self",
".",
"ID_STORAGE... | Get path to the row representing core element described by handed core_element_id
:param list core_element_id: Core element identifier used in the respective list store column
:rtype: tuple
:return: path | [
"Get",
"path",
"to",
"the",
"row",
"representing",
"core",
"element",
"described",
"by",
"handed",
"core_element_id"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L359-L374 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.save_file_data | def save_file_data(self, path):
""" Implements the abstract method of the ExternalEditor class.
"""
try:
# just create file with empty text first; this command also creates the whole path to the file
filesystem.write_file(os.path.join(path, storage.SCRIPT_FILE), "", creat... | python | def save_file_data(self, path):
""" Implements the abstract method of the ExternalEditor class.
"""
try:
# just create file with empty text first; this command also creates the whole path to the file
filesystem.write_file(os.path.join(path, storage.SCRIPT_FILE), "", creat... | [
"def",
"save_file_data",
"(",
"self",
",",
"path",
")",
":",
"try",
":",
"# just create file with empty text first; this command also creates the whole path to the file",
"filesystem",
".",
"write_file",
"(",
"os",
".",
"path",
".",
"join",
"(",
"path",
",",
"storage",
... | Implements the abstract method of the ExternalEditor class. | [
"Implements",
"the",
"abstract",
"method",
"of",
"the",
"ExternalEditor",
"class",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L381-L391 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/semantic_data_editor.py | SemanticDataEditorController.load_and_set_file_content | def load_and_set_file_content(self, file_system_path):
""" Implements the abstract method of the ExternalEditor class.
"""
semantic_data = load_data_file(os.path.join(file_system_path, storage.SEMANTIC_DATA_FILE))
self.model.state.semantic_data = semantic_data | python | def load_and_set_file_content(self, file_system_path):
""" Implements the abstract method of the ExternalEditor class.
"""
semantic_data = load_data_file(os.path.join(file_system_path, storage.SEMANTIC_DATA_FILE))
self.model.state.semantic_data = semantic_data | [
"def",
"load_and_set_file_content",
"(",
"self",
",",
"file_system_path",
")",
":",
"semantic_data",
"=",
"load_data_file",
"(",
"os",
".",
"path",
".",
"join",
"(",
"file_system_path",
",",
"storage",
".",
"SEMANTIC_DATA_FILE",
")",
")",
"self",
".",
"model",
... | Implements the abstract method of the ExternalEditor class. | [
"Implements",
"the",
"abstract",
"method",
"of",
"the",
"ExternalEditor",
"class",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/semantic_data_editor.py#L393-L397 |
DLR-RM/RAFCON | source/rafcon/gui/runtime_config.py | RuntimeConfig.store_widget_properties | def store_widget_properties(self, widget, widget_name):
"""Sets configuration values for widgets
If the widget is a window, then the size and position are stored. If the widget is a pane, then only the
position is stored. If the window is maximized the last insert position before being maximize... | python | def store_widget_properties(self, widget, widget_name):
"""Sets configuration values for widgets
If the widget is a window, then the size and position are stored. If the widget is a pane, then only the
position is stored. If the window is maximized the last insert position before being maximize... | [
"def",
"store_widget_properties",
"(",
"self",
",",
"widget",
",",
"widget_name",
")",
":",
"if",
"isinstance",
"(",
"widget",
",",
"Gtk",
".",
"Window",
")",
":",
"maximized",
"=",
"bool",
"(",
"widget",
".",
"is_maximized",
"(",
")",
")",
"self",
".",
... | Sets configuration values for widgets
If the widget is a window, then the size and position are stored. If the widget is a pane, then only the
position is stored. If the window is maximized the last insert position before being maximized is keep in the
config and the maximized flag set to True.... | [
"Sets",
"configuration",
"values",
"for",
"widgets"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/runtime_config.py#L41-L64 |
DLR-RM/RAFCON | source/rafcon/gui/runtime_config.py | RuntimeConfig.update_recently_opened_state_machines_with | def update_recently_opened_state_machines_with(self, state_machine):
""" Update recently opened list with file system path of handed state machine model
The inserts handed state machine file system path into the recent opened state machines or moves it to be the
first element in the list.
... | python | def update_recently_opened_state_machines_with(self, state_machine):
""" Update recently opened list with file system path of handed state machine model
The inserts handed state machine file system path into the recent opened state machines or moves it to be the
first element in the list.
... | [
"def",
"update_recently_opened_state_machines_with",
"(",
"self",
",",
"state_machine",
")",
":",
"if",
"state_machine",
".",
"file_system_path",
":",
"# check if path is in recent path already",
"# logger.info(\"update recent state machine: {}\".format(sm.file_system_path))",
"recentl... | Update recently opened list with file system path of handed state machine model
The inserts handed state machine file system path into the recent opened state machines or moves it to be the
first element in the list.
:param rafcon.core.state_machine.StateMachine state_machine: State machine to... | [
"Update",
"recently",
"opened",
"list",
"with",
"file",
"system",
"path",
"of",
"handed",
"state",
"machine",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/runtime_config.py#L73-L89 |
DLR-RM/RAFCON | source/rafcon/gui/runtime_config.py | RuntimeConfig.extend_recently_opened_by_current_open_state_machines | def extend_recently_opened_by_current_open_state_machines(self):
""" Update list with all in the state machine manager opened state machines """
from rafcon.gui.singleton import state_machine_manager_model as state_machine_manager_m
for sm_m in state_machine_manager_m.state_machines.values():
... | python | def extend_recently_opened_by_current_open_state_machines(self):
""" Update list with all in the state machine manager opened state machines """
from rafcon.gui.singleton import state_machine_manager_model as state_machine_manager_m
for sm_m in state_machine_manager_m.state_machines.values():
... | [
"def",
"extend_recently_opened_by_current_open_state_machines",
"(",
"self",
")",
":",
"from",
"rafcon",
".",
"gui",
".",
"singleton",
"import",
"state_machine_manager_model",
"as",
"state_machine_manager_m",
"for",
"sm_m",
"in",
"state_machine_manager_m",
".",
"state_machi... | Update list with all in the state machine manager opened state machines | [
"Update",
"list",
"with",
"all",
"in",
"the",
"state",
"machine",
"manager",
"opened",
"state",
"machines"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/runtime_config.py#L91-L95 |
DLR-RM/RAFCON | source/rafcon/gui/runtime_config.py | RuntimeConfig.prepare_recently_opened_state_machines_list_for_storage | def prepare_recently_opened_state_machines_list_for_storage(self):
""" Reduce number of paths in the recent opened state machines to limit from gui config """
from rafcon.gui.singleton import global_gui_config
num = global_gui_config.get_config_value('NUMBER_OF_RECENT_OPENED_STATE_MACHINES_STORE... | python | def prepare_recently_opened_state_machines_list_for_storage(self):
""" Reduce number of paths in the recent opened state machines to limit from gui config """
from rafcon.gui.singleton import global_gui_config
num = global_gui_config.get_config_value('NUMBER_OF_RECENT_OPENED_STATE_MACHINES_STORE... | [
"def",
"prepare_recently_opened_state_machines_list_for_storage",
"(",
"self",
")",
":",
"from",
"rafcon",
".",
"gui",
".",
"singleton",
"import",
"global_gui_config",
"num",
"=",
"global_gui_config",
".",
"get_config_value",
"(",
"'NUMBER_OF_RECENT_OPENED_STATE_MACHINES_STOR... | Reduce number of paths in the recent opened state machines to limit from gui config | [
"Reduce",
"number",
"of",
"paths",
"in",
"the",
"recent",
"opened",
"state",
"machines",
"to",
"limit",
"from",
"gui",
"config"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/runtime_config.py#L97-L102 |
DLR-RM/RAFCON | source/rafcon/gui/runtime_config.py | RuntimeConfig.clean_recently_opened_state_machines | def clean_recently_opened_state_machines(self):
"""Remove state machines who's file system path does not exist"""
state_machine_paths = self.get_config_value('recently_opened_state_machines', [])
filesystem.clean_file_system_paths_from_not_existing_paths(state_machine_paths)
self.set_con... | python | def clean_recently_opened_state_machines(self):
"""Remove state machines who's file system path does not exist"""
state_machine_paths = self.get_config_value('recently_opened_state_machines', [])
filesystem.clean_file_system_paths_from_not_existing_paths(state_machine_paths)
self.set_con... | [
"def",
"clean_recently_opened_state_machines",
"(",
"self",
")",
":",
"state_machine_paths",
"=",
"self",
".",
"get_config_value",
"(",
"'recently_opened_state_machines'",
",",
"[",
"]",
")",
"filesystem",
".",
"clean_file_system_paths_from_not_existing_paths",
"(",
"state_... | Remove state machines who's file system path does not exist | [
"Remove",
"state",
"machines",
"who",
"s",
"file",
"system",
"path",
"does",
"not",
"exist"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/runtime_config.py#L104-L108 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.pause | def pause(self):
"""Set the execution mode to paused
"""
if self.state_machine_manager.active_state_machine_id is None:
logger.info("'Pause' is not a valid action to initiate state machine execution.")
return
if self.state_machine_manager.get_active_state_machine(... | python | def pause(self):
"""Set the execution mode to paused
"""
if self.state_machine_manager.active_state_machine_id is None:
logger.info("'Pause' is not a valid action to initiate state machine execution.")
return
if self.state_machine_manager.get_active_state_machine(... | [
"def",
"pause",
"(",
"self",
")",
":",
"if",
"self",
".",
"state_machine_manager",
".",
"active_state_machine_id",
"is",
"None",
":",
"logger",
".",
"info",
"(",
"\"'Pause' is not a valid action to initiate state machine execution.\"",
")",
"return",
"if",
"self",
"."... | Set the execution mode to paused | [
"Set",
"the",
"execution",
"mode",
"to",
"paused"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L70-L80 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.finished_or_stopped | def finished_or_stopped(self):
""" Condition check on finished or stopped status
The method returns a value which is equivalent with not 'active' status of the current state machine.
:return: outcome of condition check stopped or finished
:rtype: bool
"""
return (self._... | python | def finished_or_stopped(self):
""" Condition check on finished or stopped status
The method returns a value which is equivalent with not 'active' status of the current state machine.
:return: outcome of condition check stopped or finished
:rtype: bool
"""
return (self._... | [
"def",
"finished_or_stopped",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_status",
".",
"execution_mode",
"is",
"StateMachineExecutionStatus",
".",
"STOPPED",
")",
"or",
"(",
"self",
".",
"_status",
".",
"execution_mode",
"is",
"StateMachineExecutionStatu... | Condition check on finished or stopped status
The method returns a value which is equivalent with not 'active' status of the current state machine.
:return: outcome of condition check stopped or finished
:rtype: bool | [
"Condition",
"check",
"on",
"finished",
"or",
"stopped",
"status"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L82-L91 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.start | def start(self, state_machine_id=None, start_state_path=None):
""" Start state machine
If no state machine is running start a specific state machine.
If no state machine is provided the currently active state machine is started.
If there is already a state machine running, just resume i... | python | def start(self, state_machine_id=None, start_state_path=None):
""" Start state machine
If no state machine is running start a specific state machine.
If no state machine is provided the currently active state machine is started.
If there is already a state machine running, just resume i... | [
"def",
"start",
"(",
"self",
",",
"state_machine_id",
"=",
"None",
",",
"start_state_path",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"finished_or_stopped",
"(",
")",
":",
"logger",
".",
"debug",
"(",
"\"Resume execution engine ...\"",
")",
"self",
".... | Start state machine
If no state machine is running start a specific state machine.
If no state machine is provided the currently active state machine is started.
If there is already a state machine running, just resume it without taking the passed state_machine_id argument
into account.... | [
"Start",
"state",
"machine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L94-L147 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.stop | def stop(self):
"""Set the execution mode to stopped
"""
logger.debug("Stop the state machine execution ...")
if self.state_machine_manager.get_active_state_machine() is not None:
self.state_machine_manager.get_active_state_machine().root_state.recursively_preempt_states()
... | python | def stop(self):
"""Set the execution mode to stopped
"""
logger.debug("Stop the state machine execution ...")
if self.state_machine_manager.get_active_state_machine() is not None:
self.state_machine_manager.get_active_state_machine().root_state.recursively_preempt_states()
... | [
"def",
"stop",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Stop the state machine execution ...\"",
")",
"if",
"self",
".",
"state_machine_manager",
".",
"get_active_state_machine",
"(",
")",
"is",
"not",
"None",
":",
"self",
".",
"state_machine_manager... | Set the execution mode to stopped | [
"Set",
"the",
"execution",
"mode",
"to",
"stopped"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L150-L162 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.join | def join(self, timeout=None):
"""Blocking wait for the execution to finish
:param float timeout: Maximum time to wait or None for infinitely
:return: True if the execution finished, False if no state machine was started or a timeout occurred
:rtype: bool
"""
if self.__wa... | python | def join(self, timeout=None):
"""Blocking wait for the execution to finish
:param float timeout: Maximum time to wait or None for infinitely
:return: True if the execution finished, False if no state machine was started or a timeout occurred
:rtype: bool
"""
if self.__wa... | [
"def",
"join",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"if",
"self",
".",
"__wait_for_finishing_thread",
":",
"if",
"not",
"timeout",
":",
"# signal handlers won't work if timeout is None and the thread is joined",
"while",
"True",
":",
"self",
".",
"__w... | Blocking wait for the execution to finish
:param float timeout: Maximum time to wait or None for infinitely
:return: True if the execution finished, False if no state machine was started or a timeout occurred
:rtype: bool | [
"Blocking",
"wait",
"for",
"the",
"execution",
"to",
"finish"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L164-L183 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine._run_active_state_machine | def _run_active_state_machine(self):
"""Store running state machine and observe its status
"""
# Create new concurrency queue for root state to be able to synchronize with the execution
self.__running_state_machine = self.state_machine_manager.get_active_state_machine()
if not s... | python | def _run_active_state_machine(self):
"""Store running state machine and observe its status
"""
# Create new concurrency queue for root state to be able to synchronize with the execution
self.__running_state_machine = self.state_machine_manager.get_active_state_machine()
if not s... | [
"def",
"_run_active_state_machine",
"(",
"self",
")",
":",
"# Create new concurrency queue for root state to be able to synchronize with the execution",
"self",
".",
"__running_state_machine",
"=",
"self",
".",
"state_machine_manager",
".",
"get_active_state_machine",
"(",
")",
"... | Store running state machine and observe its status | [
"Store",
"running",
"state",
"machine",
"and",
"observe",
"its",
"status"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L195-L212 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine._wait_for_finishing | def _wait_for_finishing(self):
"""Observe running state machine and stop engine if execution has finished"""
self.state_machine_running = True
self.__running_state_machine.join()
self.__set_execution_mode_to_finished()
self.state_machine_manager.active_state_machine_id = None
... | python | def _wait_for_finishing(self):
"""Observe running state machine and stop engine if execution has finished"""
self.state_machine_running = True
self.__running_state_machine.join()
self.__set_execution_mode_to_finished()
self.state_machine_manager.active_state_machine_id = None
... | [
"def",
"_wait_for_finishing",
"(",
"self",
")",
":",
"self",
".",
"state_machine_running",
"=",
"True",
"self",
".",
"__running_state_machine",
".",
"join",
"(",
")",
"self",
".",
"__set_execution_mode_to_finished",
"(",
")",
"self",
".",
"state_machine_manager",
... | Observe running state machine and stop engine if execution has finished | [
"Observe",
"running",
"state",
"machine",
"and",
"stop",
"engine",
"if",
"execution",
"has",
"finished"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L214-L222 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.backward_step | def backward_step(self):
"""Take a backward step for all active states in the state machine
"""
logger.debug("Executing backward step ...")
self.run_to_states = []
self.set_execution_mode(StateMachineExecutionStatus.BACKWARD) | python | def backward_step(self):
"""Take a backward step for all active states in the state machine
"""
logger.debug("Executing backward step ...")
self.run_to_states = []
self.set_execution_mode(StateMachineExecutionStatus.BACKWARD) | [
"def",
"backward_step",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Executing backward step ...\"",
")",
"self",
".",
"run_to_states",
"=",
"[",
"]",
"self",
".",
"set_execution_mode",
"(",
"StateMachineExecutionStatus",
".",
"BACKWARD",
")"
] | Take a backward step for all active states in the state machine | [
"Take",
"a",
"backward",
"step",
"for",
"all",
"active",
"states",
"in",
"the",
"state",
"machine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L224-L229 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.step_mode | def step_mode(self, state_machine_id=None):
"""Set the execution mode to stepping mode. Transitions are only triggered if a new step is triggered
"""
logger.debug("Activate step mode")
if state_machine_id is not None:
self.state_machine_manager.active_state_machine_id = stat... | python | def step_mode(self, state_machine_id=None):
"""Set the execution mode to stepping mode. Transitions are only triggered if a new step is triggered
"""
logger.debug("Activate step mode")
if state_machine_id is not None:
self.state_machine_manager.active_state_machine_id = stat... | [
"def",
"step_mode",
"(",
"self",
",",
"state_machine_id",
"=",
"None",
")",
":",
"logger",
".",
"debug",
"(",
"\"Activate step mode\"",
")",
"if",
"state_machine_id",
"is",
"not",
"None",
":",
"self",
".",
"state_machine_manager",
".",
"active_state_machine_id",
... | Set the execution mode to stepping mode. Transitions are only triggered if a new step is triggered | [
"Set",
"the",
"execution",
"mode",
"to",
"stepping",
"mode",
".",
"Transitions",
"are",
"only",
"triggered",
"if",
"a",
"new",
"step",
"is",
"triggered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L232-L245 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.step_into | def step_into(self):
"""Take a forward step (into) for all active states in the state machine
"""
logger.debug("Execution step into ...")
self.run_to_states = []
if self.finished_or_stopped():
self.set_execution_mode(StateMachineExecutionStatus.FORWARD_INTO)
... | python | def step_into(self):
"""Take a forward step (into) for all active states in the state machine
"""
logger.debug("Execution step into ...")
self.run_to_states = []
if self.finished_or_stopped():
self.set_execution_mode(StateMachineExecutionStatus.FORWARD_INTO)
... | [
"def",
"step_into",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Execution step into ...\"",
")",
"self",
".",
"run_to_states",
"=",
"[",
"]",
"if",
"self",
".",
"finished_or_stopped",
"(",
")",
":",
"self",
".",
"set_execution_mode",
"(",
"StateMa... | Take a forward step (into) for all active states in the state machine | [
"Take",
"a",
"forward",
"step",
"(",
"into",
")",
"for",
"all",
"active",
"states",
"in",
"the",
"state",
"machine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L247-L256 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.step_over | def step_over(self):
"""Take a forward step (over) for all active states in the state machine
"""
logger.debug("Execution step over ...")
self.run_to_states = []
if self.finished_or_stopped():
self.set_execution_mode(StateMachineExecutionStatus.FORWARD_OVER)
... | python | def step_over(self):
"""Take a forward step (over) for all active states in the state machine
"""
logger.debug("Execution step over ...")
self.run_to_states = []
if self.finished_or_stopped():
self.set_execution_mode(StateMachineExecutionStatus.FORWARD_OVER)
... | [
"def",
"step_over",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Execution step over ...\"",
")",
"self",
".",
"run_to_states",
"=",
"[",
"]",
"if",
"self",
".",
"finished_or_stopped",
"(",
")",
":",
"self",
".",
"set_execution_mode",
"(",
"StateMa... | Take a forward step (over) for all active states in the state machine | [
"Take",
"a",
"forward",
"step",
"(",
"over",
")",
"for",
"all",
"active",
"states",
"in",
"the",
"state",
"machine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L258-L267 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.step_out | def step_out(self):
"""Take a forward step (out) for all active states in the state machine
"""
logger.debug("Execution step out ...")
self.run_to_states = []
if self.finished_or_stopped():
self.set_execution_mode(StateMachineExecutionStatus.FORWARD_OUT)
s... | python | def step_out(self):
"""Take a forward step (out) for all active states in the state machine
"""
logger.debug("Execution step out ...")
self.run_to_states = []
if self.finished_or_stopped():
self.set_execution_mode(StateMachineExecutionStatus.FORWARD_OUT)
s... | [
"def",
"step_out",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Execution step out ...\"",
")",
"self",
".",
"run_to_states",
"=",
"[",
"]",
"if",
"self",
".",
"finished_or_stopped",
"(",
")",
":",
"self",
".",
"set_execution_mode",
"(",
"StateMach... | Take a forward step (out) for all active states in the state machine | [
"Take",
"a",
"forward",
"step",
"(",
"out",
")",
"for",
"all",
"active",
"states",
"in",
"the",
"state",
"machine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L269-L278 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.run_to_selected_state | def run_to_selected_state(self, path, state_machine_id=None):
"""Execute the state machine until a specific state. This state won't be executed. This is an asynchronous task
"""
if self.state_machine_manager.get_active_state_machine() is not None:
self.state_machine_manager.get_activ... | python | def run_to_selected_state(self, path, state_machine_id=None):
"""Execute the state machine until a specific state. This state won't be executed. This is an asynchronous task
"""
if self.state_machine_manager.get_active_state_machine() is not None:
self.state_machine_manager.get_activ... | [
"def",
"run_to_selected_state",
"(",
"self",
",",
"path",
",",
"state_machine_id",
"=",
"None",
")",
":",
"if",
"self",
".",
"state_machine_manager",
".",
"get_active_state_machine",
"(",
")",
"is",
"not",
"None",
":",
"self",
".",
"state_machine_manager",
".",
... | Execute the state machine until a specific state. This state won't be executed. This is an asynchronous task | [
"Execute",
"the",
"state",
"machine",
"until",
"a",
"specific",
"state",
".",
"This",
"state",
"won",
"t",
"be",
"executed",
".",
"This",
"is",
"an",
"asynchronous",
"task"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L280-L298 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine._wait_while_in_pause_or_in_step_mode | def _wait_while_in_pause_or_in_step_mode(self):
""" Waits as long as the execution_mode is in paused or step_mode
"""
while (self._status.execution_mode is StateMachineExecutionStatus.PAUSED) \
or (self._status.execution_mode is StateMachineExecutionStatus.STEP_MODE):
... | python | def _wait_while_in_pause_or_in_step_mode(self):
""" Waits as long as the execution_mode is in paused or step_mode
"""
while (self._status.execution_mode is StateMachineExecutionStatus.PAUSED) \
or (self._status.execution_mode is StateMachineExecutionStatus.STEP_MODE):
... | [
"def",
"_wait_while_in_pause_or_in_step_mode",
"(",
"self",
")",
":",
"while",
"(",
"self",
".",
"_status",
".",
"execution_mode",
"is",
"StateMachineExecutionStatus",
".",
"PAUSED",
")",
"or",
"(",
"self",
".",
"_status",
".",
"execution_mode",
"is",
"StateMachin... | Waits as long as the execution_mode is in paused or step_mode | [
"Waits",
"as",
"long",
"as",
"the",
"execution_mode",
"is",
"in",
"paused",
"or",
"step_mode"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L300-L311 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine._wait_if_required | def _wait_if_required(self, container_state, next_child_state_to_execute, woke_up_from_pause_or_step_mode):
""" Calls a blocking wait for the calling thread, depending on the execution mode.
:param container_state: the current hierarhcy state to handle the execution mode for
:param next_child_s... | python | def _wait_if_required(self, container_state, next_child_state_to_execute, woke_up_from_pause_or_step_mode):
""" Calls a blocking wait for the calling thread, depending on the execution mode.
:param container_state: the current hierarhcy state to handle the execution mode for
:param next_child_s... | [
"def",
"_wait_if_required",
"(",
"self",
",",
"container_state",
",",
"next_child_state_to_execute",
",",
"woke_up_from_pause_or_step_mode",
")",
":",
"wait",
"=",
"True",
"# if there is a state in self.run_to_states then RAFCON was commanded",
"# a) a step_over",
"# b) a ste... | Calls a blocking wait for the calling thread, depending on the execution mode.
:param container_state: the current hierarhcy state to handle the execution mode for
:param next_child_state_to_execute: the next child state for :param container_state to be executed
:param woke_up_from_pause_or_ste... | [
"Calls",
"a",
"blocking",
"wait",
"for",
"the",
"calling",
"thread",
"depending",
"on",
"the",
"execution",
"mode",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L313-L364 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.handle_execution_mode | def handle_execution_mode(self, container_state, next_child_state_to_execute=None):
"""Checks the current execution status and returns it.
Depending on the execution state, the calling thread (currently only hierarchy states) waits for the
execution to continue.
If the execution mode i... | python | def handle_execution_mode(self, container_state, next_child_state_to_execute=None):
"""Checks the current execution status and returns it.
Depending on the execution state, the calling thread (currently only hierarchy states) waits for the
execution to continue.
If the execution mode i... | [
"def",
"handle_execution_mode",
"(",
"self",
",",
"container_state",
",",
"next_child_state_to_execute",
"=",
"None",
")",
":",
"self",
".",
"state_counter_lock",
".",
"acquire",
"(",
")",
"self",
".",
"state_counter",
"+=",
"1",
"# logger.verbose(\"Increase state_cou... | Checks the current execution status and returns it.
Depending on the execution state, the calling thread (currently only hierarchy states) waits for the
execution to continue.
If the execution mode is any of the step modes, a condition variable stops the current execution,
until it get... | [
"Checks",
"the",
"current",
"execution",
"status",
"and",
"returns",
"it",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L366-L449 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine._modify_run_to_states | def _modify_run_to_states(self, state):
"""
This is a special case. Inside a hierarchy state a step_over is triggered and affects the last child.
In this case the self.run_to_states has to be modified in order to contain the parent of the hierarchy state.
Otherwise the execution won't re... | python | def _modify_run_to_states(self, state):
"""
This is a special case. Inside a hierarchy state a step_over is triggered and affects the last child.
In this case the self.run_to_states has to be modified in order to contain the parent of the hierarchy state.
Otherwise the execution won't re... | [
"def",
"_modify_run_to_states",
"(",
"self",
",",
"state",
")",
":",
"if",
"self",
".",
"_status",
".",
"execution_mode",
"is",
"StateMachineExecutionStatus",
".",
"FORWARD_OVER",
"or",
"self",
".",
"_status",
".",
"execution_mode",
"is",
"StateMachineExecutionStatu... | This is a special case. Inside a hierarchy state a step_over is triggered and affects the last child.
In this case the self.run_to_states has to be modified in order to contain the parent of the hierarchy state.
Otherwise the execution won't respect the step_over any more and run until the end of the st... | [
"This",
"is",
"a",
"special",
"case",
".",
"Inside",
"a",
"hierarchy",
"state",
"a",
"step_over",
"is",
"triggered",
"and",
"affects",
"the",
"last",
"child",
".",
"In",
"this",
"case",
"the",
"self",
".",
"run_to_states",
"has",
"to",
"be",
"modified",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L451-L474 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.execute_state_machine_from_path | def execute_state_machine_from_path(self, state_machine=None, path=None, start_state_path=None, wait_for_execution_finished=True):
""" A helper function to start an arbitrary state machine at a given path.
:param path: The path where the state machine resides
:param start_state_path: The path t... | python | def execute_state_machine_from_path(self, state_machine=None, path=None, start_state_path=None, wait_for_execution_finished=True):
""" A helper function to start an arbitrary state machine at a given path.
:param path: The path where the state machine resides
:param start_state_path: The path t... | [
"def",
"execute_state_machine_from_path",
"(",
"self",
",",
"state_machine",
"=",
"None",
",",
"path",
"=",
"None",
",",
"start_state_path",
"=",
"None",
",",
"wait_for_execution_finished",
"=",
"True",
")",
":",
"import",
"rafcon",
".",
"core",
".",
"singleton"... | A helper function to start an arbitrary state machine at a given path.
:param path: The path where the state machine resides
:param start_state_path: The path to the state from which the execution will start
:return: a reference to the created state machine | [
"A",
"helper",
"function",
"to",
"start",
"an",
"arbitrary",
"state",
"machine",
"at",
"a",
"given",
"path",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L476-L497 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.set_execution_mode | def set_execution_mode(self, execution_mode, notify=True):
""" An observed setter for the execution mode of the state machine status. This is necessary for the
monitoring client to update the local state machine in the same way as the root state machine of the server.
:param execution_mode: the... | python | def set_execution_mode(self, execution_mode, notify=True):
""" An observed setter for the execution mode of the state machine status. This is necessary for the
monitoring client to update the local state machine in the same way as the root state machine of the server.
:param execution_mode: the... | [
"def",
"set_execution_mode",
"(",
"self",
",",
"execution_mode",
",",
"notify",
"=",
"True",
")",
":",
"if",
"not",
"isinstance",
"(",
"execution_mode",
",",
"StateMachineExecutionStatus",
")",
":",
"raise",
"TypeError",
"(",
"\"status must be of type StateMachineExec... | An observed setter for the execution mode of the state machine status. This is necessary for the
monitoring client to update the local state machine in the same way as the root state machine of the server.
:param execution_mode: the new execution mode of the state machine
:raises exceptions.Typ... | [
"An",
"observed",
"setter",
"for",
"the",
"execution",
"mode",
"of",
"the",
"state",
"machine",
"status",
".",
"This",
"is",
"necessary",
"for",
"the",
"monitoring",
"client",
"to",
"update",
"the",
"local",
"state",
"machine",
"in",
"the",
"same",
"way",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L500-L513 |
DLR-RM/RAFCON | source/rafcon/core/execution/execution_engine.py | ExecutionEngine.run_to_states | def run_to_states(self):
"""Property for the _run_to_states field
"""
self.execution_engine_lock.acquire()
return_value = self._run_to_states
self.execution_engine_lock.release()
return return_value | python | def run_to_states(self):
"""Property for the _run_to_states field
"""
self.execution_engine_lock.acquire()
return_value = self._run_to_states
self.execution_engine_lock.release()
return return_value | [
"def",
"run_to_states",
"(",
"self",
")",
":",
"self",
".",
"execution_engine_lock",
".",
"acquire",
"(",
")",
"return_value",
"=",
"self",
".",
"_run_to_states",
"self",
".",
"execution_engine_lock",
".",
"release",
"(",
")",
"return",
"return_value"
] | Property for the _run_to_states field | [
"Property",
"for",
"the",
"_run_to_states",
"field"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_engine.py#L527-L534 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.recursively_preempt_states | def recursively_preempt_states(self):
""" Preempt the state and all of it child states.
"""
super(ContainerState, self).recursively_preempt_states()
# notify the transition condition variable to let the state instantaneously stop
self._transitions_cv.acquire()
self._trans... | python | def recursively_preempt_states(self):
""" Preempt the state and all of it child states.
"""
super(ContainerState, self).recursively_preempt_states()
# notify the transition condition variable to let the state instantaneously stop
self._transitions_cv.acquire()
self._trans... | [
"def",
"recursively_preempt_states",
"(",
"self",
")",
":",
"super",
"(",
"ContainerState",
",",
"self",
")",
".",
"recursively_preempt_states",
"(",
")",
"# notify the transition condition variable to let the state instantaneously stop",
"self",
".",
"_transitions_cv",
".",
... | Preempt the state and all of it child states. | [
"Preempt",
"the",
"state",
"and",
"all",
"of",
"it",
"child",
"states",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L222-L231 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.recursively_pause_states | def recursively_pause_states(self):
""" Pause the state and all of it child states.
"""
super(ContainerState, self).recursively_pause_states()
for state in self.states.values():
state.recursively_pause_states() | python | def recursively_pause_states(self):
""" Pause the state and all of it child states.
"""
super(ContainerState, self).recursively_pause_states()
for state in self.states.values():
state.recursively_pause_states() | [
"def",
"recursively_pause_states",
"(",
"self",
")",
":",
"super",
"(",
"ContainerState",
",",
"self",
")",
".",
"recursively_pause_states",
"(",
")",
"for",
"state",
"in",
"self",
".",
"states",
".",
"values",
"(",
")",
":",
"state",
".",
"recursively_pause... | Pause the state and all of it child states. | [
"Pause",
"the",
"state",
"and",
"all",
"of",
"it",
"child",
"states",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L233-L238 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.recursively_resume_states | def recursively_resume_states(self):
""" Resume the state and all of it child states.
"""
super(ContainerState, self).recursively_resume_states()
for state in self.states.values():
state.recursively_resume_states() | python | def recursively_resume_states(self):
""" Resume the state and all of it child states.
"""
super(ContainerState, self).recursively_resume_states()
for state in self.states.values():
state.recursively_resume_states() | [
"def",
"recursively_resume_states",
"(",
"self",
")",
":",
"super",
"(",
"ContainerState",
",",
"self",
")",
".",
"recursively_resume_states",
"(",
")",
"for",
"state",
"in",
"self",
".",
"states",
".",
"values",
"(",
")",
":",
"state",
".",
"recursively_res... | Resume the state and all of it child states. | [
"Resume",
"the",
"state",
"and",
"all",
"of",
"it",
"child",
"states",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L240-L245 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.setup_run | def setup_run(self):
""" Executes a generic set of actions that has to be called in the run methods of each derived state class.
:return:
"""
super(ContainerState, self).setup_run()
# reset the scoped data
self._scoped_data = {}
self._start_state_modified = False... | python | def setup_run(self):
""" Executes a generic set of actions that has to be called in the run methods of each derived state class.
:return:
"""
super(ContainerState, self).setup_run()
# reset the scoped data
self._scoped_data = {}
self._start_state_modified = False... | [
"def",
"setup_run",
"(",
"self",
")",
":",
"super",
"(",
"ContainerState",
",",
"self",
")",
".",
"setup_run",
"(",
")",
"# reset the scoped data",
"self",
".",
"_scoped_data",
"=",
"{",
"}",
"self",
".",
"_start_state_modified",
"=",
"False",
"self",
".",
... | Executes a generic set of actions that has to be called in the run methods of each derived state class.
:return: | [
"Executes",
"a",
"generic",
"set",
"of",
"actions",
"that",
"has",
"to",
"be",
"called",
"in",
"the",
"run",
"methods",
"of",
"each",
"derived",
"state",
"class",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L247-L257 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.handle_no_transition | def handle_no_transition(self, state):
""" This function handles the case that there is no transition for a specific outcome of a sub-state.
The method waits on a condition variable to a new transition that will be connected by the programmer or
GUI-user.
:param state: The sub-state to... | python | def handle_no_transition(self, state):
""" This function handles the case that there is no transition for a specific outcome of a sub-state.
The method waits on a condition variable to a new transition that will be connected by the programmer or
GUI-user.
:param state: The sub-state to... | [
"def",
"handle_no_transition",
"(",
"self",
",",
"state",
")",
":",
"transition",
"=",
"None",
"while",
"not",
"transition",
":",
"# (child) state preempted or aborted",
"if",
"self",
".",
"preempted",
"or",
"state",
".",
"final_outcome",
".",
"outcome_id",
"in",
... | This function handles the case that there is no transition for a specific outcome of a sub-state.
The method waits on a condition variable to a new transition that will be connected by the programmer or
GUI-user.
:param state: The sub-state to find a transition for
:return: The transit... | [
"This",
"function",
"handles",
"the",
"case",
"that",
"there",
"is",
"no",
"transition",
"for",
"a",
"specific",
"outcome",
"of",
"a",
"sub",
"-",
"state",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L259-L306 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.handle_no_start_state | def handle_no_start_state(self):
"""Handles the situation, when no start state exists during execution
The method waits, until a transition is created. It then checks again for an existing start state and waits
again, if this is not the case. It returns the None state if the the state machine w... | python | def handle_no_start_state(self):
"""Handles the situation, when no start state exists during execution
The method waits, until a transition is created. It then checks again for an existing start state and waits
again, if this is not the case. It returns the None state if the the state machine w... | [
"def",
"handle_no_start_state",
"(",
"self",
")",
":",
"start_state",
"=",
"self",
".",
"get_start_state",
"(",
"set_final_outcome",
"=",
"True",
")",
"while",
"not",
"start_state",
":",
"# depending on the execution mode pause execution",
"execution_signal",
"=",
"stat... | Handles the situation, when no start state exists during execution
The method waits, until a transition is created. It then checks again for an existing start state and waits
again, if this is not the case. It returns the None state if the the state machine was stopped. | [
"Handles",
"the",
"situation",
"when",
"no",
"start",
"state",
"exists",
"during",
"execution"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L308-L326 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.group_states | def group_states(self, state_ids, scoped_variable_ids=None):
""" Group states and scoped variables into a new hierarchy state and remain internal connections.
Interconnecting transitions and data flows to parent and other child states are removed, at the moment.
:param state_ids: state_id's... | python | def group_states(self, state_ids, scoped_variable_ids=None):
""" Group states and scoped variables into a new hierarchy state and remain internal connections.
Interconnecting transitions and data flows to parent and other child states are removed, at the moment.
:param state_ids: state_id's... | [
"def",
"group_states",
"(",
"self",
",",
"state_ids",
",",
"scoped_variable_ids",
"=",
"None",
")",
":",
"# TODO remember changed state or state element ids and provide them for the model functionalities",
"assert",
"all",
"(",
"[",
"state_id",
"in",
"self",
".",
"states",
... | Group states and scoped variables into a new hierarchy state and remain internal connections.
Interconnecting transitions and data flows to parent and other child states are removed, at the moment.
:param state_ids: state_id's of all states that are to be grouped.
:param scoped_variable_ids... | [
"Group",
"states",
"and",
"scoped",
"variables",
"into",
"a",
"new",
"hierarchy",
"state",
"and",
"remain",
"internal",
"connections",
".",
"Interconnecting",
"transitions",
"and",
"data",
"flows",
"to",
"parent",
"and",
"other",
"child",
"states",
"are",
"remov... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L334-L628 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.ungroup_state | def ungroup_state(self, state_id):
""" Ungroup state with state id state_id into its parent and remain internal linkage in parent.
Interconnecting transitions and data flows to parent and other child states are preserved except:
- a transition that is going from income to outcome directl... | python | def ungroup_state(self, state_id):
""" Ungroup state with state id state_id into its parent and remain internal linkage in parent.
Interconnecting transitions and data flows to parent and other child states are preserved except:
- a transition that is going from income to outcome directl... | [
"def",
"ungroup_state",
"(",
"self",
",",
"state_id",
")",
":",
"state",
"=",
"self",
".",
"states",
"[",
"state_id",
"]",
"assert",
"isinstance",
"(",
"state",
",",
"ContainerState",
")",
"from",
"rafcon",
".",
"core",
".",
"states",
".",
"barrier_concurr... | Ungroup state with state id state_id into its parent and remain internal linkage in parent.
Interconnecting transitions and data flows to parent and other child states are preserved except:
- a transition that is going from income to outcome directly and
- a data-flow that is linking... | [
"Ungroup",
"state",
"with",
"state",
"id",
"state_id",
"into",
"its",
"parent",
"and",
"remain",
"internal",
"linkage",
"in",
"parent",
".",
"Interconnecting",
"transitions",
"and",
"data",
"flows",
"to",
"parent",
"and",
"other",
"child",
"states",
"are",
"pr... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L632-L761 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.add_state | def add_state(self, state, storage_load=False):
"""Adds a state to the container state.
:param state: the state that is going to be added
:param storage_load: True if the state was directly loaded from filesystem
:return: the state_id of the new state
:raises exceptions.Attribut... | python | def add_state(self, state, storage_load=False):
"""Adds a state to the container state.
:param state: the state that is going to be added
:param storage_load: True if the state was directly loaded from filesystem
:return: the state_id of the new state
:raises exceptions.Attribut... | [
"def",
"add_state",
"(",
"self",
",",
"state",
",",
"storage_load",
"=",
"False",
")",
":",
"assert",
"isinstance",
"(",
"state",
",",
"State",
")",
"# logger.info(\"add state {}\".format(state))",
"# handle the case that the child state id is the same as the container state ... | Adds a state to the container state.
:param state: the state that is going to be added
:param storage_load: True if the state was directly loaded from filesystem
:return: the state_id of the new state
:raises exceptions.AttributeError: if state.state_id already exist | [
"Adds",
"a",
"state",
"to",
"the",
"container",
"state",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L765-L787 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.remove_state | def remove_state(self, state_id, recursive=True, force=False, destroy=True):
"""Remove a state from the container state.
:param state_id: the id of the state to remove
:param recursive: a flag to indicate a recursive disassembling of all substates
:param force: a flag to indicate forcef... | python | def remove_state(self, state_id, recursive=True, force=False, destroy=True):
"""Remove a state from the container state.
:param state_id: the id of the state to remove
:param recursive: a flag to indicate a recursive disassembling of all substates
:param force: a flag to indicate forcef... | [
"def",
"remove_state",
"(",
"self",
",",
"state_id",
",",
"recursive",
"=",
"True",
",",
"force",
"=",
"False",
",",
"destroy",
"=",
"True",
")",
":",
"if",
"state_id",
"not",
"in",
"self",
".",
"states",
":",
"raise",
"AttributeError",
"(",
"\"State_id ... | Remove a state from the container state.
:param state_id: the id of the state to remove
:param recursive: a flag to indicate a recursive disassembling of all substates
:param force: a flag to indicate forcefully deletion of all states (important for the decider state in the
barr... | [
"Remove",
"a",
"state",
"from",
"the",
"container",
"state",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L791-L832 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.destroy | def destroy(self, recursive):
""" Removes all the state elements.
:param recursive: Flag whether to destroy all state elements which are removed
"""
for transition_id in list(self.transitions.keys()):
self.remove_transition(transition_id, destroy=recursive)
for data_... | python | def destroy(self, recursive):
""" Removes all the state elements.
:param recursive: Flag whether to destroy all state elements which are removed
"""
for transition_id in list(self.transitions.keys()):
self.remove_transition(transition_id, destroy=recursive)
for data_... | [
"def",
"destroy",
"(",
"self",
",",
"recursive",
")",
":",
"for",
"transition_id",
"in",
"list",
"(",
"self",
".",
"transitions",
".",
"keys",
"(",
")",
")",
":",
"self",
".",
"remove_transition",
"(",
"transition_id",
",",
"destroy",
"=",
"recursive",
"... | Removes all the state elements.
:param recursive: Flag whether to destroy all state elements which are removed | [
"Removes",
"all",
"the",
"state",
"elements",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L835-L851 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.related_linkage_state | def related_linkage_state(self, state_id):
""" TODO: document
"""
related_transitions = {'external': {'ingoing': [], 'outgoing': []},
'internal': {'enclosed': [], 'ingoing': [], 'outgoing': []}}
related_data_flows = {'external': {'ingoing': [], 'outgoing':... | python | def related_linkage_state(self, state_id):
""" TODO: document
"""
related_transitions = {'external': {'ingoing': [], 'outgoing': []},
'internal': {'enclosed': [], 'ingoing': [], 'outgoing': []}}
related_data_flows = {'external': {'ingoing': [], 'outgoing':... | [
"def",
"related_linkage_state",
"(",
"self",
",",
"state_id",
")",
":",
"related_transitions",
"=",
"{",
"'external'",
":",
"{",
"'ingoing'",
":",
"[",
"]",
",",
"'outgoing'",
":",
"[",
"]",
"}",
",",
"'internal'",
":",
"{",
"'enclosed'",
":",
"[",
"]",
... | TODO: document | [
"TODO",
":",
"document"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L853-L902 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.related_linkage_states_and_scoped_variables | def related_linkage_states_and_scoped_variables(self, state_ids, scoped_variables):
""" TODO: document
"""
# find all related transitions
related_transitions = {'enclosed': [], 'ingoing': [], 'outgoing': []}
for t in self.transitions.values():
# check if internal of ... | python | def related_linkage_states_and_scoped_variables(self, state_ids, scoped_variables):
""" TODO: document
"""
# find all related transitions
related_transitions = {'enclosed': [], 'ingoing': [], 'outgoing': []}
for t in self.transitions.values():
# check if internal of ... | [
"def",
"related_linkage_states_and_scoped_variables",
"(",
"self",
",",
"state_ids",
",",
"scoped_variables",
")",
":",
"# find all related transitions",
"related_transitions",
"=",
"{",
"'enclosed'",
":",
"[",
"]",
",",
"'ingoing'",
":",
"[",
"]",
",",
"'outgoing'",
... | TODO: document | [
"TODO",
":",
"document"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L904-L934 |
DLR-RM/RAFCON | source/rafcon/core/states/container_state.py | ContainerState.change_state_type | def change_state_type(self, state, new_state_class):
""" Changes the type of the state to another type
:param state: the state to be changed
:param new_state_class: the new type of the state
:return: the new state having the new state type
:rtype: :py:class:`rafcon.core.states.s... | python | def change_state_type(self, state, new_state_class):
""" Changes the type of the state to another type
:param state: the state to be changed
:param new_state_class: the new type of the state
:return: the new state having the new state type
:rtype: :py:class:`rafcon.core.states.s... | [
"def",
"change_state_type",
"(",
"self",
",",
"state",
",",
"new_state_class",
")",
":",
"from",
"rafcon",
".",
"gui",
".",
"helpers",
".",
"state",
"import",
"create_new_state_from_state_with_type",
"state_id",
"=",
"state",
".",
"state_id",
"if",
"state_id",
"... | Changes the type of the state to another type
:param state: the state to be changed
:param new_state_class: the new type of the state
:return: the new state having the new state type
:rtype: :py:class:`rafcon.core.states.state.State`
:raises exceptions.ValueError: if the state d... | [
"Changes",
"the",
"type",
"of",
"the",
"state",
"to",
"another",
"type"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/container_state.py#L1047-L1070 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.