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/core/global_variable_manager.py | GlobalVariableManager.set_variable | def set_variable(self, key, value, per_reference=False, access_key=None, data_type=None):
"""Sets a global variable
:param key: the key of the global variable to be set
:param value: the new value of the global variable
:param per_reference: a flag to decide if the variable should be st... | python | def set_variable(self, key, value, per_reference=False, access_key=None, data_type=None):
"""Sets a global variable
:param key: the key of the global variable to be set
:param value: the new value of the global variable
:param per_reference: a flag to decide if the variable should be st... | [
"def",
"set_variable",
"(",
"self",
",",
"key",
",",
"value",
",",
"per_reference",
"=",
"False",
",",
"access_key",
"=",
"None",
",",
"data_type",
"=",
"None",
")",
":",
"key",
"=",
"str",
"(",
"key",
")",
"# Ensure that we have the same string type for all k... | Sets a global variable
:param key: the key of the global variable to be set
:param value: the new value of the global variable
:param per_reference: a flag to decide if the variable should be stored per reference or per value
:param access_key: if the variable was explicitly locked with... | [
"Sets",
"a",
"global",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L56-L102 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.get_variable | def get_variable(self, key, per_reference=None, access_key=None, default=None):
"""Fetches the value of a global variable
:param key: the key of the global variable to be fetched
:param bool per_reference: a flag to decide if the variable should be stored per reference or per value
:par... | python | def get_variable(self, key, per_reference=None, access_key=None, default=None):
"""Fetches the value of a global variable
:param key: the key of the global variable to be fetched
:param bool per_reference: a flag to decide if the variable should be stored per reference or per value
:par... | [
"def",
"get_variable",
"(",
"self",
",",
"key",
",",
"per_reference",
"=",
"None",
",",
"access_key",
"=",
"None",
",",
"default",
"=",
"None",
")",
":",
"key",
"=",
"str",
"(",
"key",
")",
"if",
"self",
".",
"variable_exist",
"(",
"key",
")",
":",
... | Fetches the value of a global variable
:param key: the key of the global variable to be fetched
:param bool per_reference: a flag to decide if the variable should be stored per reference or per value
:param access_key: if the variable was explicitly locked with the rafcon.state lock_variable
... | [
"Fetches",
"the",
"value",
"of",
"a",
"global",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L104-L147 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.variable_can_be_referenced | def variable_can_be_referenced(self, key):
"""Checks whether the value of the variable can be returned by reference
:param str key: Name of the variable
:return: True if value of variable can be returned by reference, False else
"""
key = str(key)
return key in self.__va... | python | def variable_can_be_referenced(self, key):
"""Checks whether the value of the variable can be returned by reference
:param str key: Name of the variable
:return: True if value of variable can be returned by reference, False else
"""
key = str(key)
return key in self.__va... | [
"def",
"variable_can_be_referenced",
"(",
"self",
",",
"key",
")",
":",
"key",
"=",
"str",
"(",
"key",
")",
"return",
"key",
"in",
"self",
".",
"__variable_references",
"and",
"self",
".",
"__variable_references",
"[",
"key",
"]"
] | Checks whether the value of the variable can be returned by reference
:param str key: Name of the variable
:return: True if value of variable can be returned by reference, False else | [
"Checks",
"whether",
"the",
"value",
"of",
"the",
"variable",
"can",
"be",
"returned",
"by",
"reference"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L149-L156 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.delete_variable | def delete_variable(self, key):
"""Deletes a global variable
:param key: the key of the global variable to be deleted
:raises exceptions.AttributeError: if the global variable does not exist
"""
key = str(key)
if self.is_locked(key):
raise RuntimeError("Glob... | python | def delete_variable(self, key):
"""Deletes a global variable
:param key: the key of the global variable to be deleted
:raises exceptions.AttributeError: if the global variable does not exist
"""
key = str(key)
if self.is_locked(key):
raise RuntimeError("Glob... | [
"def",
"delete_variable",
"(",
"self",
",",
"key",
")",
":",
"key",
"=",
"str",
"(",
"key",
")",
"if",
"self",
".",
"is_locked",
"(",
"key",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Global variable is locked\"",
")",
"with",
"self",
".",
"__global_lock",... | Deletes a global variable
:param key: the key of the global variable to be deleted
:raises exceptions.AttributeError: if the global variable does not exist | [
"Deletes",
"a",
"global",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L159-L179 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.lock_variable | def lock_variable(self, key, block=False):
"""Locks a global variable
:param key: the key of the global variable to be locked
:param block: a flag to specify if to wait for locking the variable in blocking mode
"""
key = str(key)
# watch out for releasing the __dictionar... | python | def lock_variable(self, key, block=False):
"""Locks a global variable
:param key: the key of the global variable to be locked
:param block: a flag to specify if to wait for locking the variable in blocking mode
"""
key = str(key)
# watch out for releasing the __dictionar... | [
"def",
"lock_variable",
"(",
"self",
",",
"key",
",",
"block",
"=",
"False",
")",
":",
"key",
"=",
"str",
"(",
"key",
")",
"# watch out for releasing the __dictionary_lock properly",
"try",
":",
"if",
"key",
"in",
"self",
".",
"__variable_locks",
":",
"# acqui... | Locks a global variable
:param key: the key of the global variable to be locked
:param block: a flag to specify if to wait for locking the variable in blocking mode | [
"Locks",
"a",
"global",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L182-L216 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.unlock_variable | def unlock_variable(self, key, access_key, force=False):
"""Unlocks a global variable
:param key: the key of the global variable to be unlocked
:param access_key: the access key to be able to unlock the global variable
:param force: if the variable should be unlocked forcefully
... | python | def unlock_variable(self, key, access_key, force=False):
"""Unlocks a global variable
:param key: the key of the global variable to be unlocked
:param access_key: the access key to be able to unlock the global variable
:param force: if the variable should be unlocked forcefully
... | [
"def",
"unlock_variable",
"(",
"self",
",",
"key",
",",
"access_key",
",",
"force",
"=",
"False",
")",
":",
"key",
"=",
"str",
"(",
"key",
")",
"if",
"self",
".",
"__access_keys",
"[",
"key",
"]",
"==",
"access_key",
"or",
"force",
":",
"if",
"key",
... | Unlocks a global variable
:param key: the key of the global variable to be unlocked
:param access_key: the access key to be able to unlock the global variable
:param force: if the variable should be unlocked forcefully
:raises exceptions.AttributeError: if the global variable does not e... | [
"Unlocks",
"a",
"global",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L219-L240 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.set_locked_variable | def set_locked_variable(self, key, access_key, value):
"""Set an already locked global variable
:param key: the key of the global variable to be set
:param access_key: the access key to the already locked global variable
:param value: the new value of the global variable
"""
... | python | def set_locked_variable(self, key, access_key, value):
"""Set an already locked global variable
:param key: the key of the global variable to be set
:param access_key: the access key to the already locked global variable
:param value: the new value of the global variable
"""
... | [
"def",
"set_locked_variable",
"(",
"self",
",",
"key",
",",
"access_key",
",",
"value",
")",
":",
"return",
"self",
".",
"set_variable",
"(",
"key",
",",
"value",
",",
"per_reference",
"=",
"False",
",",
"access_key",
"=",
"access_key",
")"
] | Set an already locked global variable
:param key: the key of the global variable to be set
:param access_key: the access key to the already locked global variable
:param value: the new value of the global variable | [
"Set",
"an",
"already",
"locked",
"global",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L243-L250 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.get_locked_variable | def get_locked_variable(self, key, access_key):
"""Returns the value of an global variable that is already locked
:param key: the key of the global variable
:param access_key: the access_key to the global variable that is already locked
"""
return self.get_variable(key, per_refe... | python | def get_locked_variable(self, key, access_key):
"""Returns the value of an global variable that is already locked
:param key: the key of the global variable
:param access_key: the access_key to the global variable that is already locked
"""
return self.get_variable(key, per_refe... | [
"def",
"get_locked_variable",
"(",
"self",
",",
"key",
",",
"access_key",
")",
":",
"return",
"self",
".",
"get_variable",
"(",
"key",
",",
"per_reference",
"=",
"False",
",",
"access_key",
"=",
"access_key",
")"
] | Returns the value of an global variable that is already locked
:param key: the key of the global variable
:param access_key: the access_key to the global variable that is already locked | [
"Returns",
"the",
"value",
"of",
"an",
"global",
"variable",
"that",
"is",
"already",
"locked"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L252-L258 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.is_locked | def is_locked(self, key):
"""Returns the status of the lock of a global variable
:param key: the unique key of the global variable
:return:
"""
key = str(key)
if key in self.__variable_locks:
return self.__variable_locks[key].locked()
return False | python | def is_locked(self, key):
"""Returns the status of the lock of a global variable
:param key: the unique key of the global variable
:return:
"""
key = str(key)
if key in self.__variable_locks:
return self.__variable_locks[key].locked()
return False | [
"def",
"is_locked",
"(",
"self",
",",
"key",
")",
":",
"key",
"=",
"str",
"(",
"key",
")",
"if",
"key",
"in",
"self",
".",
"__variable_locks",
":",
"return",
"self",
".",
"__variable_locks",
"[",
"key",
"]",
".",
"locked",
"(",
")",
"return",
"False"... | Returns the status of the lock of a global variable
:param key: the unique key of the global variable
:return: | [
"Returns",
"the",
"status",
"of",
"the",
"lock",
"of",
"a",
"global",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L278-L287 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.get_all_keys_starting_with | def get_all_keys_starting_with(self, start_key):
""" Returns all keys, which start with a certain pattern defined in :param start_key.
:param start_key: The start pattern to search all keys for.
:return:
"""
start_key = str(start_key)
output_list = []
if len(self... | python | def get_all_keys_starting_with(self, start_key):
""" Returns all keys, which start with a certain pattern defined in :param start_key.
:param start_key: The start pattern to search all keys for.
:return:
"""
start_key = str(start_key)
output_list = []
if len(self... | [
"def",
"get_all_keys_starting_with",
"(",
"self",
",",
"start_key",
")",
":",
"start_key",
"=",
"str",
"(",
"start_key",
")",
"output_list",
"=",
"[",
"]",
"if",
"len",
"(",
"self",
".",
"__global_variable_dictionary",
")",
"==",
"0",
":",
"return",
"output_... | Returns all keys, which start with a certain pattern defined in :param start_key.
:param start_key: The start pattern to search all keys for.
:return: | [
"Returns",
"all",
"keys",
"which",
"start",
"with",
"a",
"certain",
"pattern",
"defined",
"in",
":",
"param",
"start_key",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L289-L303 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.global_variable_dictionary | def global_variable_dictionary(self):
"""Property for the _global_variable_dictionary field"""
dict_copy = {}
for key, value in self.__global_variable_dictionary.items():
if key in self.__variable_references and self.__variable_references[key]:
dict_copy[key] = value
... | python | def global_variable_dictionary(self):
"""Property for the _global_variable_dictionary field"""
dict_copy = {}
for key, value in self.__global_variable_dictionary.items():
if key in self.__variable_references and self.__variable_references[key]:
dict_copy[key] = value
... | [
"def",
"global_variable_dictionary",
"(",
"self",
")",
":",
"dict_copy",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"self",
".",
"__global_variable_dictionary",
".",
"items",
"(",
")",
":",
"if",
"key",
"in",
"self",
".",
"__variable_references",
"and"... | Property for the _global_variable_dictionary field | [
"Property",
"for",
"the",
"_global_variable_dictionary",
"field"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L310-L319 |
DLR-RM/RAFCON | source/rafcon/core/global_variable_manager.py | GlobalVariableManager.check_value_and_type | def check_value_and_type(value, data_type):
"""Checks if a given value is of a specific type
:param value: the value to check
:param data_type: the type to be checked upon
:return:
"""
if value is not None and data_type is not type(None):
# if not isinstance(... | python | def check_value_and_type(value, data_type):
"""Checks if a given value is of a specific type
:param value: the value to check
:param data_type: the type to be checked upon
:return:
"""
if value is not None and data_type is not type(None):
# if not isinstance(... | [
"def",
"check_value_and_type",
"(",
"value",
",",
"data_type",
")",
":",
"if",
"value",
"is",
"not",
"None",
"and",
"data_type",
"is",
"not",
"type",
"(",
"None",
")",
":",
"# if not isinstance(value, data_type):",
"if",
"not",
"type_inherits_of_type",
"(",
"dat... | Checks if a given value is of a specific type
:param value: the value to check
:param data_type: the type to be checked upon
:return: | [
"Checks",
"if",
"a",
"given",
"value",
"is",
"of",
"a",
"specific",
"type"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/global_variable_manager.py#L341-L352 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/connector.py | RectanglePointPort.glue | def glue(self, pos):
"""Calculates the distance between the given position and the port
:param (float, float) pos: Distance to this position is calculated
:return: Distance to port
:rtype: float
"""
# Distance between border of rectangle and point
# Equation from... | python | def glue(self, pos):
"""Calculates the distance between the given position and the port
:param (float, float) pos: Distance to this position is calculated
:return: Distance to port
:rtype: float
"""
# Distance between border of rectangle and point
# Equation from... | [
"def",
"glue",
"(",
"self",
",",
"pos",
")",
":",
"# Distance between border of rectangle and point",
"# Equation from http://stackoverflow.com/a/18157551/3568069",
"dx",
"=",
"max",
"(",
"self",
".",
"point",
".",
"x",
"-",
"self",
".",
"width",
"/",
"2.",
"-",
"... | Calculates the distance between the given position and the port
:param (float, float) pos: Distance to this position is calculated
:return: Distance to port
:rtype: float | [
"Calculates",
"the",
"distance",
"between",
"the",
"given",
"position",
"and",
"the",
"port"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/connector.py#L43-L55 |
Cog-Creators/Red-Lavalink | lavalink/utils.py | format_time | def format_time(time):
""" Formats the given time into HH:MM:SS """
h, r = divmod(time / 1000, 3600)
m, s = divmod(r, 60)
return "%02d:%02d:%02d" % (h, m, s) | python | def format_time(time):
""" Formats the given time into HH:MM:SS """
h, r = divmod(time / 1000, 3600)
m, s = divmod(r, 60)
return "%02d:%02d:%02d" % (h, m, s) | [
"def",
"format_time",
"(",
"time",
")",
":",
"h",
",",
"r",
"=",
"divmod",
"(",
"time",
"/",
"1000",
",",
"3600",
")",
"m",
",",
"s",
"=",
"divmod",
"(",
"r",
",",
"60",
")",
"return",
"\"%02d:%02d:%02d\"",
"%",
"(",
"h",
",",
"m",
",",
"s",
... | Formats the given time into HH:MM:SS | [
"Formats",
"the",
"given",
"time",
"into",
"HH",
":",
"MM",
":",
"SS"
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/utils.py#L1-L6 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.__destroy | def __destroy(self):
"""Remove controller from parent controller and/or destroy it self."""
if self.parent:
self.parent.remove_controller(self)
else:
self.destroy() | python | def __destroy(self):
"""Remove controller from parent controller and/or destroy it self."""
if self.parent:
self.parent.remove_controller(self)
else:
self.destroy() | [
"def",
"__destroy",
"(",
"self",
")",
":",
"if",
"self",
".",
"parent",
":",
"self",
".",
"parent",
".",
"remove_controller",
"(",
"self",
")",
"else",
":",
"self",
".",
"destroy",
"(",
")"
] | Remove controller from parent controller and/or destroy it self. | [
"Remove",
"controller",
"from",
"parent",
"controller",
"and",
"/",
"or",
"destroy",
"it",
"self",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L70-L75 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.register_view | def register_view(self, view):
"""Called when the View was registered"""
super(PreferencesWindowController, self).register_view(view)
self.view['add_library_button'].connect('clicked', self._on_add_library)
self.view["remove_library_button"].connect('clicked', self._on_remove_library)
... | python | def register_view(self, view):
"""Called when the View was registered"""
super(PreferencesWindowController, self).register_view(view)
self.view['add_library_button'].connect('clicked', self._on_add_library)
self.view["remove_library_button"].connect('clicked', self._on_remove_library)
... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"PreferencesWindowController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"self",
".",
"view",
"[",
"'add_library_button'",
"]",
".",
"connect",
"(",
"'clicked'",
",",
... | Called when the View was registered | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L77-L119 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.on_config_value_changed | def on_config_value_changed(self, config_m, prop_name, info):
"""Callback when a config value has been changed
Only collects information, delegates handling further to _handle_config_update
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should... | python | def on_config_value_changed(self, config_m, prop_name, info):
"""Callback when a config value has been changed
Only collects information, delegates handling further to _handle_config_update
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should... | [
"def",
"on_config_value_changed",
"(",
"self",
",",
"config_m",
",",
"prop_name",
",",
"info",
")",
":",
"config_key",
"=",
"info",
"[",
"'args'",
"]",
"[",
"1",
"]",
"if",
"\"key\"",
"not",
"in",
"info",
"[",
"'kwargs'",
"]",
"else",
"info",
"[",
"'kw... | Callback when a config value has been changed
Only collects information, delegates handling further to _handle_config_update
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'config'
:param dict info: Information e.g. about the ... | [
"Callback",
"when",
"a",
"config",
"value",
"has",
"been",
"changed"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L122-L133 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.on_preliminary_config_changed | def on_preliminary_config_changed(self, config_m, prop_name, info):
"""Callback when a preliminary config value has been changed
Mainly collects information, delegates handling further to _handle_config_update
:param ConfigModel config_m: The config model that has been changed
:param s... | python | def on_preliminary_config_changed(self, config_m, prop_name, info):
"""Callback when a preliminary config value has been changed
Mainly collects information, delegates handling further to _handle_config_update
:param ConfigModel config_m: The config model that has been changed
:param s... | [
"def",
"on_preliminary_config_changed",
"(",
"self",
",",
"config_m",
",",
"prop_name",
",",
"info",
")",
":",
"self",
".",
"check_for_preliminary_config",
"(",
")",
"method_name",
"=",
"info",
"[",
"'method_name'",
"]",
"# __setitem__, __delitem__, clear, ...",
"if",... | Callback when a preliminary config value has been changed
Mainly collects information, delegates handling further to _handle_config_update
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'preliminary_config'
:param dict info: I... | [
"Callback",
"when",
"a",
"preliminary",
"config",
"value",
"has",
"been",
"changed"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L136-L158 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._handle_config_update | def _handle_config_update(self, config_m, config_key):
"""Handles changes in config values
The method ensure that the correct list stores are updated with the new values.
:param ConfigModel config_m: The config model that has been changed
:param config_key: The config key who's value ... | python | def _handle_config_update(self, config_m, config_key):
"""Handles changes in config values
The method ensure that the correct list stores are updated with the new values.
:param ConfigModel config_m: The config model that has been changed
:param config_key: The config key who's value ... | [
"def",
"_handle_config_update",
"(",
"self",
",",
"config_m",
",",
"config_key",
")",
":",
"if",
"config_key",
"==",
"\"LIBRARY_PATHS\"",
":",
"self",
".",
"update_libraries_list_store",
"(",
")",
"if",
"config_key",
"==",
"\"SHORTCUTS\"",
":",
"self",
".",
"upd... | Handles changes in config values
The method ensure that the correct list stores are updated with the new values.
:param ConfigModel config_m: The config model that has been changed
:param config_key: The config key who's value has been changed
:return: | [
"Handles",
"changes",
"in",
"config",
"values"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L160-L175 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.update_all | def update_all(self):
"""Shorthand method to update all collection information
"""
self.update_path_labels()
self.update_core_config_list_store()
self.update_gui_config_list_store()
self.update_libraries_list_store()
self.update_shortcut_settings()
self.ch... | python | def update_all(self):
"""Shorthand method to update all collection information
"""
self.update_path_labels()
self.update_core_config_list_store()
self.update_gui_config_list_store()
self.update_libraries_list_store()
self.update_shortcut_settings()
self.ch... | [
"def",
"update_all",
"(",
"self",
")",
":",
"self",
".",
"update_path_labels",
"(",
")",
"self",
".",
"update_core_config_list_store",
"(",
")",
"self",
".",
"update_gui_config_list_store",
"(",
")",
"self",
".",
"update_libraries_list_store",
"(",
")",
"self",
... | Shorthand method to update all collection information | [
"Shorthand",
"method",
"to",
"update",
"all",
"collection",
"information"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L177-L185 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.check_for_preliminary_config | def check_for_preliminary_config(self):
"""Activates the 'Apply' button if there are preliminary changes
"""
if any([self.model.preliminary_config, self.gui_config_model.preliminary_config]):
self.view['apply_button'].set_sensitive(True)
else:
self.view['apply_but... | python | def check_for_preliminary_config(self):
"""Activates the 'Apply' button if there are preliminary changes
"""
if any([self.model.preliminary_config, self.gui_config_model.preliminary_config]):
self.view['apply_button'].set_sensitive(True)
else:
self.view['apply_but... | [
"def",
"check_for_preliminary_config",
"(",
"self",
")",
":",
"if",
"any",
"(",
"[",
"self",
".",
"model",
".",
"preliminary_config",
",",
"self",
".",
"gui_config_model",
".",
"preliminary_config",
"]",
")",
":",
"self",
".",
"view",
"[",
"'apply_button'",
... | Activates the 'Apply' button if there are preliminary changes | [
"Activates",
"the",
"Apply",
"button",
"if",
"there",
"are",
"preliminary",
"changes"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L187-L193 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.update_path_labels | def update_path_labels(self):
"""Update labels showing config paths
"""
self.view['core_label'].set_text("Core Config Path: " + str(self.core_config_model.config.config_file_path))
self.view['gui_label'].set_text("GUI Config Path: " + str(self.gui_config_model.config.config_file_path)) | python | def update_path_labels(self):
"""Update labels showing config paths
"""
self.view['core_label'].set_text("Core Config Path: " + str(self.core_config_model.config.config_file_path))
self.view['gui_label'].set_text("GUI Config Path: " + str(self.gui_config_model.config.config_file_path)) | [
"def",
"update_path_labels",
"(",
"self",
")",
":",
"self",
".",
"view",
"[",
"'core_label'",
"]",
".",
"set_text",
"(",
"\"Core Config Path: \"",
"+",
"str",
"(",
"self",
".",
"core_config_model",
".",
"config",
".",
"config_file_path",
")",
")",
"self",
".... | Update labels showing config paths | [
"Update",
"labels",
"showing",
"config",
"paths"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L195-L199 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.update_config_value | def update_config_value(self, config_m, config_key):
"""Updates the corresponding list store of a changed config value
:param ConfigModel config_m: The config model that has been changed
:param str config_key: The config key who's value has been changed
"""
config_value = config... | python | def update_config_value(self, config_m, config_key):
"""Updates the corresponding list store of a changed config value
:param ConfigModel config_m: The config model that has been changed
:param str config_key: The config key who's value has been changed
"""
config_value = config... | [
"def",
"update_config_value",
"(",
"self",
",",
"config_m",
",",
"config_key",
")",
":",
"config_value",
"=",
"config_m",
".",
"get_current_config_value",
"(",
"config_key",
")",
"if",
"config_m",
"is",
"self",
".",
"core_config_model",
":",
"list_store",
"=",
"... | Updates the corresponding list store of a changed config value
:param ConfigModel config_m: The config model that has been changed
:param str config_key: The config key who's value has been changed | [
"Updates",
"the",
"corresponding",
"list",
"store",
"of",
"a",
"changed",
"config",
"value"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L201-L214 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._update_list_store_entry | def _update_list_store_entry(self, list_store, config_key, config_value):
"""Helper method to update a list store
:param Gtk.ListStore list_store: List store to be updated
:param str config_key: Config key to search for
:param config_value: New config value
:returns: Row of list... | python | def _update_list_store_entry(self, list_store, config_key, config_value):
"""Helper method to update a list store
:param Gtk.ListStore list_store: List store to be updated
:param str config_key: Config key to search for
:param config_value: New config value
:returns: Row of list... | [
"def",
"_update_list_store_entry",
"(",
"self",
",",
"list_store",
",",
"config_key",
",",
"config_value",
")",
":",
"for",
"row_num",
",",
"row",
"in",
"enumerate",
"(",
"list_store",
")",
":",
"if",
"row",
"[",
"self",
".",
"KEY_STORAGE_ID",
"]",
"==",
"... | Helper method to update a list store
:param Gtk.ListStore list_store: List store to be updated
:param str config_key: Config key to search for
:param config_value: New config value
:returns: Row of list store that has been updated
:rtype: int | [
"Helper",
"method",
"to",
"update",
"a",
"list",
"store"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L216-L229 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._update_list_store | def _update_list_store(config_m, list_store, ignore_keys=None):
"""Generic method to create list store for a given config model
:param ConfigModel config_m: Config model to read into list store
:param Gtk.ListStore list_store: List store to be filled
:param list ignore_keys: List of key... | python | def _update_list_store(config_m, list_store, ignore_keys=None):
"""Generic method to create list store for a given config model
:param ConfigModel config_m: Config model to read into list store
:param Gtk.ListStore list_store: List store to be filled
:param list ignore_keys: List of key... | [
"def",
"_update_list_store",
"(",
"config_m",
",",
"list_store",
",",
"ignore_keys",
"=",
"None",
")",
":",
"ignore_keys",
"=",
"[",
"]",
"if",
"ignore_keys",
"is",
"None",
"else",
"ignore_keys",
"list_store",
".",
"clear",
"(",
")",
"for",
"config_key",
"in... | Generic method to create list store for a given config model
:param ConfigModel config_m: Config model to read into list store
:param Gtk.ListStore list_store: List store to be filled
:param list ignore_keys: List of keys that should be ignored | [
"Generic",
"method",
"to",
"create",
"list",
"store",
"for",
"a",
"given",
"config",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L232-L249 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.update_libraries_list_store | def update_libraries_list_store(self):
"""Creates the list store for the libraries
"""
self.library_list_store.clear()
libraries = self.core_config_model.get_current_config_value("LIBRARY_PATHS", use_preliminary=True, default={})
library_names = sorted(libraries.keys())
f... | python | def update_libraries_list_store(self):
"""Creates the list store for the libraries
"""
self.library_list_store.clear()
libraries = self.core_config_model.get_current_config_value("LIBRARY_PATHS", use_preliminary=True, default={})
library_names = sorted(libraries.keys())
f... | [
"def",
"update_libraries_list_store",
"(",
"self",
")",
":",
"self",
".",
"library_list_store",
".",
"clear",
"(",
")",
"libraries",
"=",
"self",
".",
"core_config_model",
".",
"get_current_config_value",
"(",
"\"LIBRARY_PATHS\"",
",",
"use_preliminary",
"=",
"True"... | Creates the list store for the libraries | [
"Creates",
"the",
"list",
"store",
"for",
"the",
"libraries"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L261-L269 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController.update_shortcut_settings | def update_shortcut_settings(self):
"""Creates the list store for the shortcuts
"""
self.shortcut_list_store.clear()
shortcuts = self.gui_config_model.get_current_config_value("SHORTCUTS", use_preliminary=True, default={})
actions = sorted(shortcuts.keys())
for action in ... | python | def update_shortcut_settings(self):
"""Creates the list store for the shortcuts
"""
self.shortcut_list_store.clear()
shortcuts = self.gui_config_model.get_current_config_value("SHORTCUTS", use_preliminary=True, default={})
actions = sorted(shortcuts.keys())
for action in ... | [
"def",
"update_shortcut_settings",
"(",
"self",
")",
":",
"self",
".",
"shortcut_list_store",
".",
"clear",
"(",
")",
"shortcuts",
"=",
"self",
".",
"gui_config_model",
".",
"get_current_config_value",
"(",
"\"SHORTCUTS\"",
",",
"use_preliminary",
"=",
"True",
","... | Creates the list store for the shortcuts | [
"Creates",
"the",
"list",
"store",
"for",
"the",
"shortcuts"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L271-L279 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._select_row_by_column_value | def _select_row_by_column_value(tree_view, list_store, column, value):
"""Helper method to select a tree view row
:param Gtk.TreeView tree_view: Tree view who's row is to be selected
:param Gtk.ListStore list_store: List store of the tree view
:param int column: Column in which the valu... | python | def _select_row_by_column_value(tree_view, list_store, column, value):
"""Helper method to select a tree view row
:param Gtk.TreeView tree_view: Tree view who's row is to be selected
:param Gtk.ListStore list_store: List store of the tree view
:param int column: Column in which the valu... | [
"def",
"_select_row_by_column_value",
"(",
"tree_view",
",",
"list_store",
",",
"column",
",",
"value",
")",
":",
"for",
"row_num",
",",
"iter_elem",
"in",
"enumerate",
"(",
"list_store",
")",
":",
"if",
"iter_elem",
"[",
"column",
"]",
"==",
"value",
":",
... | Helper method to select a tree view row
:param Gtk.TreeView tree_view: Tree view who's row is to be selected
:param Gtk.ListStore list_store: List store of the tree view
:param int column: Column in which the value is searched
:param value: Value to search for
:returns: Row of l... | [
"Helper",
"method",
"to",
"select",
"a",
"tree",
"view",
"row"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L282-L295 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_add_library | def _on_add_library(self, *event):
"""Callback method handling the addition of a new library
"""
self.view['library_tree_view'].grab_focus()
if react_to_event(self.view, self.view['library_tree_view'], event):
temp_library_name = "<LIB_NAME_%s>" % self._lib_counter
... | python | def _on_add_library(self, *event):
"""Callback method handling the addition of a new library
"""
self.view['library_tree_view'].grab_focus()
if react_to_event(self.view, self.view['library_tree_view'], event):
temp_library_name = "<LIB_NAME_%s>" % self._lib_counter
... | [
"def",
"_on_add_library",
"(",
"self",
",",
"*",
"event",
")",
":",
"self",
".",
"view",
"[",
"'library_tree_view'",
"]",
".",
"grab_focus",
"(",
")",
"if",
"react_to_event",
"(",
"self",
".",
"view",
",",
"self",
".",
"view",
"[",
"'library_tree_view'",
... | Callback method handling the addition of a new library | [
"Callback",
"method",
"handling",
"the",
"addition",
"of",
"a",
"new",
"library"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L297-L310 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_remove_library | def _on_remove_library(self, *event):
"""Callback method handling the removal of an existing library
"""
self.view['library_tree_view'].grab_focus()
if react_to_event(self.view, self.view['library_tree_view'], event):
path = self.view["library_tree_view"].get_cursor()[0]
... | python | def _on_remove_library(self, *event):
"""Callback method handling the removal of an existing library
"""
self.view['library_tree_view'].grab_focus()
if react_to_event(self.view, self.view['library_tree_view'], event):
path = self.view["library_tree_view"].get_cursor()[0]
... | [
"def",
"_on_remove_library",
"(",
"self",
",",
"*",
"event",
")",
":",
"self",
".",
"view",
"[",
"'library_tree_view'",
"]",
".",
"grab_focus",
"(",
")",
"if",
"react_to_event",
"(",
"self",
".",
"view",
",",
"self",
".",
"view",
"[",
"'library_tree_view'"... | Callback method handling the removal of an existing library | [
"Callback",
"method",
"handling",
"the",
"removal",
"of",
"an",
"existing",
"library"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L312-L326 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_checkbox_toggled | def _on_checkbox_toggled(self, renderer, path, config_m, config_list_store):
"""Callback method handling a config toggle event
:param Gtk.CellRenderer renderer: Cell renderer that has been toggled
:param path: Path within the list store
:param ConfigModel config_m: The config model rela... | python | def _on_checkbox_toggled(self, renderer, path, config_m, config_list_store):
"""Callback method handling a config toggle event
:param Gtk.CellRenderer renderer: Cell renderer that has been toggled
:param path: Path within the list store
:param ConfigModel config_m: The config model rela... | [
"def",
"_on_checkbox_toggled",
"(",
"self",
",",
"renderer",
",",
"path",
",",
"config_m",
",",
"config_list_store",
")",
":",
"config_key",
"=",
"config_list_store",
"[",
"int",
"(",
"path",
")",
"]",
"[",
"self",
".",
"KEY_STORAGE_ID",
"]",
"config_value",
... | Callback method handling a config toggle event
:param Gtk.CellRenderer renderer: Cell renderer that has been toggled
:param path: Path within the list store
:param ConfigModel config_m: The config model related to the toggle option
:param Gtk.ListStore config_list_store: The list store ... | [
"Callback",
"method",
"handling",
"a",
"config",
"toggle",
"event"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L328-L339 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_import_config | def _on_import_config(self, *args):
"""Callback method the the import button was clicked
Shows a dialog allowing to import an existing configuration file
"""
def handle_import(dialog_text, path_name):
chooser = Gtk.FileChooserDialog(dialog_text, None,
... | python | def _on_import_config(self, *args):
"""Callback method the the import button was clicked
Shows a dialog allowing to import an existing configuration file
"""
def handle_import(dialog_text, path_name):
chooser = Gtk.FileChooserDialog(dialog_text, None,
... | [
"def",
"_on_import_config",
"(",
"self",
",",
"*",
"args",
")",
":",
"def",
"handle_import",
"(",
"dialog_text",
",",
"path_name",
")",
":",
"chooser",
"=",
"Gtk",
".",
"FileChooserDialog",
"(",
"dialog_text",
",",
"None",
",",
"Gtk",
".",
"FileChooserAction... | Callback method the the import button was clicked
Shows a dialog allowing to import an existing configuration file | [
"Callback",
"method",
"the",
"the",
"import",
"button",
"was",
"clicked"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L354-L390 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_export_config | def _on_export_config(self, *args):
"""Callback method the the export button was clicked
Shows dialogs allowing to export the configurations into separate files
"""
response = self._config_chooser_dialog("Export configuration",
"Please sele... | python | def _on_export_config(self, *args):
"""Callback method the the export button was clicked
Shows dialogs allowing to export the configurations into separate files
"""
response = self._config_chooser_dialog("Export configuration",
"Please sele... | [
"def",
"_on_export_config",
"(",
"self",
",",
"*",
"args",
")",
":",
"response",
"=",
"self",
".",
"_config_chooser_dialog",
"(",
"\"Export configuration\"",
",",
"\"Please select the configuration file(s) to be exported:\"",
")",
"if",
"response",
"==",
"Gtk",
".",
"... | Callback method the the export button was clicked
Shows dialogs allowing to export the configurations into separate files | [
"Callback",
"method",
"the",
"the",
"export",
"button",
"was",
"clicked"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L392-L437 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_ok_button_clicked | def _on_ok_button_clicked(self, *args):
"""OK button clicked: Applies the configurations and closes the window
"""
if self.core_config_model.preliminary_config or self.gui_config_model.preliminary_config:
self._on_apply_button_clicked()
self.__destroy() | python | def _on_ok_button_clicked(self, *args):
"""OK button clicked: Applies the configurations and closes the window
"""
if self.core_config_model.preliminary_config or self.gui_config_model.preliminary_config:
self._on_apply_button_clicked()
self.__destroy() | [
"def",
"_on_ok_button_clicked",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"self",
".",
"core_config_model",
".",
"preliminary_config",
"or",
"self",
".",
"gui_config_model",
".",
"preliminary_config",
":",
"self",
".",
"_on_apply_button_clicked",
"(",
")",
... | OK button clicked: Applies the configurations and closes the window | [
"OK",
"button",
"clicked",
":",
"Applies",
"the",
"configurations",
"and",
"closes",
"the",
"window"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L439-L444 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_cancel_button_clicked | def _on_cancel_button_clicked(self, *args):
"""Cancel button clicked: Dismiss preliminary config and close the window
"""
self.core_config_model.preliminary_config.clear()
self.gui_config_model.preliminary_config.clear()
self.__destroy() | python | def _on_cancel_button_clicked(self, *args):
"""Cancel button clicked: Dismiss preliminary config and close the window
"""
self.core_config_model.preliminary_config.clear()
self.gui_config_model.preliminary_config.clear()
self.__destroy() | [
"def",
"_on_cancel_button_clicked",
"(",
"self",
",",
"*",
"args",
")",
":",
"self",
".",
"core_config_model",
".",
"preliminary_config",
".",
"clear",
"(",
")",
"self",
".",
"gui_config_model",
".",
"preliminary_config",
".",
"clear",
"(",
")",
"self",
".",
... | Cancel button clicked: Dismiss preliminary config and close the window | [
"Cancel",
"button",
"clicked",
":",
"Dismiss",
"preliminary",
"config",
"and",
"close",
"the",
"window"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L446-L451 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_apply_button_clicked | def _on_apply_button_clicked(self, *args):
"""Apply button clicked: Apply the configuration
"""
refresh_required = self.core_config_model.apply_preliminary_config()
refresh_required |= self.gui_config_model.apply_preliminary_config()
if not self.gui_config_model.config.get_confi... | python | def _on_apply_button_clicked(self, *args):
"""Apply button clicked: Apply the configuration
"""
refresh_required = self.core_config_model.apply_preliminary_config()
refresh_required |= self.gui_config_model.apply_preliminary_config()
if not self.gui_config_model.config.get_confi... | [
"def",
"_on_apply_button_clicked",
"(",
"self",
",",
"*",
"args",
")",
":",
"refresh_required",
"=",
"self",
".",
"core_config_model",
".",
"apply_preliminary_config",
"(",
")",
"refresh_required",
"|=",
"self",
".",
"gui_config_model",
".",
"apply_preliminary_config"... | Apply button clicked: Apply the configuration | [
"Apply",
"button",
"clicked",
":",
"Apply",
"the",
"configuration"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L453-L466 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_library_name_changed | def _on_library_name_changed(self, renderer, path, new_library_name):
"""Callback handling a change of a library name
:param Gtk.CellRenderer renderer: Cell renderer showing the library name
:param path: Path of library within the list store
:param str new_library_name: New library name... | python | def _on_library_name_changed(self, renderer, path, new_library_name):
"""Callback handling a change of a library name
:param Gtk.CellRenderer renderer: Cell renderer showing the library name
:param path: Path of library within the list store
:param str new_library_name: New library name... | [
"def",
"_on_library_name_changed",
"(",
"self",
",",
"renderer",
",",
"path",
",",
"new_library_name",
")",
":",
"old_library_name",
"=",
"self",
".",
"library_list_store",
"[",
"int",
"(",
"path",
")",
"]",
"[",
"self",
".",
"KEY_STORAGE_ID",
"]",
"if",
"ol... | Callback handling a change of a library name
:param Gtk.CellRenderer renderer: Cell renderer showing the library name
:param path: Path of library within the list store
:param str new_library_name: New library name | [
"Callback",
"handling",
"a",
"change",
"of",
"a",
"library",
"name"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L494-L512 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_library_path_changed | def _on_library_path_changed(self, renderer, path, new_library_path):
"""Callback handling a change of a library path
:param Gtk.CellRenderer renderer: Cell renderer showing the library path
:param path: Path of library within the list store
:param str new_library_path: New library path... | python | def _on_library_path_changed(self, renderer, path, new_library_path):
"""Callback handling a change of a library path
:param Gtk.CellRenderer renderer: Cell renderer showing the library path
:param path: Path of library within the list store
:param str new_library_path: New library path... | [
"def",
"_on_library_path_changed",
"(",
"self",
",",
"renderer",
",",
"path",
",",
"new_library_path",
")",
":",
"library_name",
"=",
"self",
".",
"library_list_store",
"[",
"int",
"(",
"path",
")",
"]",
"[",
"self",
".",
"KEY_STORAGE_ID",
"]",
"library_config... | Callback handling a change of a library path
:param Gtk.CellRenderer renderer: Cell renderer showing the library path
:param path: Path of library within the list store
:param str new_library_path: New library path | [
"Callback",
"handling",
"a",
"change",
"of",
"a",
"library",
"path"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L514-L528 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_shortcut_changed | def _on_shortcut_changed(self, renderer, path, new_shortcuts):
"""Callback handling a change of a shortcut
:param Gtk.CellRenderer renderer: Cell renderer showing the shortcut
:param path: Path of shortcuts within the list store
:param str new_shortcuts: New shortcuts
"""
... | python | def _on_shortcut_changed(self, renderer, path, new_shortcuts):
"""Callback handling a change of a shortcut
:param Gtk.CellRenderer renderer: Cell renderer showing the shortcut
:param path: Path of shortcuts within the list store
:param str new_shortcuts: New shortcuts
"""
... | [
"def",
"_on_shortcut_changed",
"(",
"self",
",",
"renderer",
",",
"path",
",",
"new_shortcuts",
")",
":",
"action",
"=",
"self",
".",
"shortcut_list_store",
"[",
"int",
"(",
"path",
")",
"]",
"[",
"self",
".",
"KEY_STORAGE_ID",
"]",
"old_shortcuts",
"=",
"... | Callback handling a change of a shortcut
:param Gtk.CellRenderer renderer: Cell renderer showing the shortcut
:param path: Path of shortcuts within the list store
:param str new_shortcuts: New shortcuts | [
"Callback",
"handling",
"a",
"change",
"of",
"a",
"shortcut"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L530-L554 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._on_config_value_changed | def _on_config_value_changed(self, renderer, path, new_value, config_m, list_store):
"""Callback handling a change of a config value
:param Gtk.CellRenderer renderer: Cell renderer showing the shortcut
:param path: Path of shortcuts within the list store
:param ConfigModel config_m: The... | python | def _on_config_value_changed(self, renderer, path, new_value, config_m, list_store):
"""Callback handling a change of a config value
:param Gtk.CellRenderer renderer: Cell renderer showing the shortcut
:param path: Path of shortcuts within the list store
:param ConfigModel config_m: The... | [
"def",
"_on_config_value_changed",
"(",
"self",
",",
"renderer",
",",
"path",
",",
"new_value",
",",
"config_m",
",",
"list_store",
")",
":",
"config_key",
"=",
"list_store",
"[",
"int",
"(",
"path",
")",
"]",
"[",
"self",
".",
"KEY_STORAGE_ID",
"]",
"old_... | Callback handling a change of a config value
:param Gtk.CellRenderer renderer: Cell renderer showing the shortcut
:param path: Path of shortcuts within the list store
:param ConfigModel config_m: The config model that is to be changed
:param Gtk.ListStore list_store: The list store that... | [
"Callback",
"handling",
"a",
"change",
"of",
"a",
"config",
"value"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L556-L589 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/preferences_window.py | PreferencesWindowController._config_chooser_dialog | def _config_chooser_dialog(self, title_text, description):
"""Dialog to select which config shall be exported
:param title_text: Title text
:param description: Description
"""
dialog = Gtk.Dialog(title_text, self.view["preferences_window"],
flags=0, b... | python | def _config_chooser_dialog(self, title_text, description):
"""Dialog to select which config shall be exported
:param title_text: Title text
:param description: Description
"""
dialog = Gtk.Dialog(title_text, self.view["preferences_window"],
flags=0, b... | [
"def",
"_config_chooser_dialog",
"(",
"self",
",",
"title_text",
",",
"description",
")",
":",
"dialog",
"=",
"Gtk",
".",
"Dialog",
"(",
"title_text",
",",
"self",
".",
"view",
"[",
"\"preferences_window\"",
"]",
",",
"flags",
"=",
"0",
",",
"buttons",
"="... | Dialog to select which config shall be exported
:param title_text: Title text
:param description: Description | [
"Dialog",
"to",
"select",
"which",
"config",
"shall",
"be",
"exported"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/preferences_window.py#L591-L613 |
DLR-RM/RAFCON | source/rafcon/utils/dict_operations.py | check_if_dict_contains_object_reference_in_values | def check_if_dict_contains_object_reference_in_values(object_to_check, dict_to_check):
""" Method to check if an object is inside the values of a dict.
A simple object_to_check in dict_to_check.values() does not work as it uses the __eq__ function of the object
and not the object reference.
:param obje... | python | def check_if_dict_contains_object_reference_in_values(object_to_check, dict_to_check):
""" Method to check if an object is inside the values of a dict.
A simple object_to_check in dict_to_check.values() does not work as it uses the __eq__ function of the object
and not the object reference.
:param obje... | [
"def",
"check_if_dict_contains_object_reference_in_values",
"(",
"object_to_check",
",",
"dict_to_check",
")",
":",
"for",
"key",
",",
"value",
"in",
"dict_to_check",
".",
"items",
"(",
")",
":",
"if",
"object_to_check",
"is",
"value",
":",
"return",
"True",
"retu... | Method to check if an object is inside the values of a dict.
A simple object_to_check in dict_to_check.values() does not work as it uses the __eq__ function of the object
and not the object reference.
:param object_to_check: The target object.
:param dict_to_check: The dict to search in.
:return: | [
"Method",
"to",
"check",
"if",
"an",
"object",
"is",
"inside",
"the",
"values",
"of",
"a",
"dict",
".",
"A",
"simple",
"object_to_check",
"in",
"dict_to_check",
".",
"values",
"()",
"does",
"not",
"work",
"as",
"it",
"uses",
"the",
"__eq__",
"function",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/dict_operations.py#L15-L27 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/data_flows.py | update_data_flows | def update_data_flows(model, data_flow_dict, tree_dict_combos):
""" Updates data flow dictionary and combo dictionary of the widget according handed model.
:param model: model for which the data_flow_dict and tree_dict_combos should be updated
:param data_flow_dict: dictionary that holds all internal and e... | python | def update_data_flows(model, data_flow_dict, tree_dict_combos):
""" Updates data flow dictionary and combo dictionary of the widget according handed model.
:param model: model for which the data_flow_dict and tree_dict_combos should be updated
:param data_flow_dict: dictionary that holds all internal and e... | [
"def",
"update_data_flows",
"(",
"model",
",",
"data_flow_dict",
",",
"tree_dict_combos",
")",
":",
"data_flow_dict",
"[",
"'internal'",
"]",
"=",
"{",
"}",
"data_flow_dict",
"[",
"'external'",
"]",
"=",
"{",
"}",
"tree_dict_combos",
"[",
"'internal'",
"]",
"=... | Updates data flow dictionary and combo dictionary of the widget according handed model.
:param model: model for which the data_flow_dict and tree_dict_combos should be updated
:param data_flow_dict: dictionary that holds all internal and external data-flows and those respective row labels
:param tree_dict_... | [
"Updates",
"data",
"flow",
"dictionary",
"and",
"combo",
"dictionary",
"of",
"the",
"widget",
"according",
"handed",
"model",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/data_flows.py#L501-L763 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/data_flows.py | StateDataFlowsListController.register_view | def register_view(self, view):
"""Called when the View was registered
"""
super(StateDataFlowsListController, self).register_view(view)
def cell_text(column, cell_renderer, model, iter, container_model):
df_id = model.get_value(iter, self.ID_STORAGE_ID)
in_extern... | python | def register_view(self, view):
"""Called when the View was registered
"""
super(StateDataFlowsListController, self).register_view(view)
def cell_text(column, cell_renderer, model, iter, container_model):
df_id = model.get_value(iter, self.ID_STORAGE_ID)
in_extern... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"StateDataFlowsListController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"def",
"cell_text",
"(",
"column",
",",
"cell_renderer",
",",
"model",
",",
"iter",
",",
"co... | Called when the View was registered | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/data_flows.py#L93-L138 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/data_flows.py | StateDataFlowsListController.remove_core_element | def remove_core_element(self, model):
"""Remove respective core element of handed data flow model
:param DataFlowModel model: Data Flow model which core element should be removed
:return:
"""
assert model.data_flow.parent is self.model.state or model.data_flow.parent is self.mod... | python | def remove_core_element(self, model):
"""Remove respective core element of handed data flow model
:param DataFlowModel model: Data Flow model which core element should be removed
:return:
"""
assert model.data_flow.parent is self.model.state or model.data_flow.parent is self.mod... | [
"def",
"remove_core_element",
"(",
"self",
",",
"model",
")",
":",
"assert",
"model",
".",
"data_flow",
".",
"parent",
"is",
"self",
".",
"model",
".",
"state",
"or",
"model",
".",
"data_flow",
".",
"parent",
"is",
"self",
".",
"model",
".",
"parent",
... | Remove respective core element of handed data flow model
:param DataFlowModel model: Data Flow model which core element should be removed
:return: | [
"Remove",
"respective",
"core",
"element",
"of",
"handed",
"data",
"flow",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/data_flows.py#L243-L250 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/data_flows.py | StateDataFlowsEditorController.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
"""
super(StateDataFlowsEditorController, self).register_view(view)
view['add_d_button'].connect('clicked', s... | 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
"""
super(StateDataFlowsEditorController, self).register_view(view)
view['add_d_button'].connect('clicked', s... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"StateDataFlowsEditorController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"view",
"[",
"'add_d_button'",
"]",
".",
"connect",
"(",
"'clicked'",
",",
"self",
".",
"d... | Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/data_flows.py#L833-L859 |
DLR-RM/RAFCON | source/rafcon/core/state_machine.py | StateMachine.start | def start(self):
"""Starts the execution of the root state.
"""
# load default input data for the state
self._root_state.input_data = self._root_state.get_default_input_values_for_state(self._root_state)
self._root_state.output_data = self._root_state.create_output_dictionary_for... | python | def start(self):
"""Starts the execution of the root state.
"""
# load default input data for the state
self._root_state.input_data = self._root_state.get_default_input_values_for_state(self._root_state)
self._root_state.output_data = self._root_state.create_output_dictionary_for... | [
"def",
"start",
"(",
"self",
")",
":",
"# load default input data for the state",
"self",
".",
"_root_state",
".",
"input_data",
"=",
"self",
".",
"_root_state",
".",
"get_default_input_values_for_state",
"(",
"self",
".",
"_root_state",
")",
"self",
".",
"_root_sta... | Starts the execution of the root state. | [
"Starts",
"the",
"execution",
"of",
"the",
"root",
"state",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine.py#L138-L146 |
DLR-RM/RAFCON | source/rafcon/core/state_machine.py | StateMachine.join | def join(self):
"""Wait for root state to finish execution"""
self._root_state.join()
# execution finished, close execution history log file (if present)
if len(self._execution_histories) > 0:
if self._execution_histories[-1].execution_history_storage is not None:
... | python | def join(self):
"""Wait for root state to finish execution"""
self._root_state.join()
# execution finished, close execution history log file (if present)
if len(self._execution_histories) > 0:
if self._execution_histories[-1].execution_history_storage is not None:
... | [
"def",
"join",
"(",
"self",
")",
":",
"self",
".",
"_root_state",
".",
"join",
"(",
")",
"# execution finished, close execution history log file (if present)",
"if",
"len",
"(",
"self",
".",
"_execution_histories",
")",
">",
"0",
":",
"if",
"self",
".",
"_execut... | Wait for root state to finish execution | [
"Wait",
"for",
"root",
"state",
"to",
"finish",
"execution"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine.py#L148-L157 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView.get_port_area | def get_port_area(self, view):
"""Calculates the drawing area affected by the (hovered) port
"""
state_v = self.parent
center = self.handle.pos
margin = self.port_side_size / 4.
if self.side in [SnappedSide.LEFT, SnappedSide.RIGHT]:
height, width = self.port_s... | python | def get_port_area(self, view):
"""Calculates the drawing area affected by the (hovered) port
"""
state_v = self.parent
center = self.handle.pos
margin = self.port_side_size / 4.
if self.side in [SnappedSide.LEFT, SnappedSide.RIGHT]:
height, width = self.port_s... | [
"def",
"get_port_area",
"(",
"self",
",",
"view",
")",
":",
"state_v",
"=",
"self",
".",
"parent",
"center",
"=",
"self",
".",
"handle",
".",
"pos",
"margin",
"=",
"self",
".",
"port_side_size",
"/",
"4.",
"if",
"self",
".",
"side",
"in",
"[",
"Snapp... | Calculates the drawing area affected by the (hovered) port | [
"Calculates",
"the",
"drawing",
"area",
"affected",
"by",
"the",
"(",
"hovered",
")",
"port"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L225-L240 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView._draw_simple_state_port | def _draw_simple_state_port(self, context, direction, color, transparency):
"""Draw the port of a simple state (ExecutionState, LibraryState)
Connector for execution states can only be connected to the outside. Thus the connector fills the whole
border of the state.
:param context: Cai... | python | def _draw_simple_state_port(self, context, direction, color, transparency):
"""Draw the port of a simple state (ExecutionState, LibraryState)
Connector for execution states can only be connected to the outside. Thus the connector fills the whole
border of the state.
:param context: Cai... | [
"def",
"_draw_simple_state_port",
"(",
"self",
",",
"context",
",",
"direction",
",",
"color",
",",
"transparency",
")",
":",
"c",
"=",
"context",
"width",
",",
"height",
"=",
"self",
".",
"port_size",
"c",
".",
"set_line_width",
"(",
"self",
".",
"port_si... | Draw the port of a simple state (ExecutionState, LibraryState)
Connector for execution states can only be connected to the outside. Thus the connector fills the whole
border of the state.
:param context: Cairo context
:param direction: The direction the port is pointing to
:par... | [
"Draw",
"the",
"port",
"of",
"a",
"simple",
"state",
"(",
"ExecutionState",
"LibraryState",
")"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L387-L417 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView._draw_container_state_port | def _draw_container_state_port(self, context, direction, color, transparency):
"""Draw the port of a container state
Connector for container states are split in an inner connector and an outer connector.
:param context: Cairo context
:param direction: The direction the port is pointing... | python | def _draw_container_state_port(self, context, direction, color, transparency):
"""Draw the port of a container state
Connector for container states are split in an inner connector and an outer connector.
:param context: Cairo context
:param direction: The direction the port is pointing... | [
"def",
"_draw_container_state_port",
"(",
"self",
",",
"context",
",",
"direction",
",",
"color",
",",
"transparency",
")",
":",
"c",
"=",
"context",
"width",
",",
"height",
"=",
"self",
".",
"port_size",
"c",
".",
"set_line_width",
"(",
"self",
".",
"port... | Draw the port of a container state
Connector for container states are split in an inner connector and an outer connector.
:param context: Cairo context
:param direction: The direction the port is pointing to
:param color: Desired color of the port
:param float transparency: The... | [
"Draw",
"the",
"port",
"of",
"a",
"container",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L419-L464 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView._draw_single_connector | def _draw_single_connector(context, width, height):
"""Draw the connector for execution states
Connector for execution states can only be connected to the outside. Thus the connector fills the whole
border of the state.
:param context: Cairo context
:param float port_size: The ... | python | def _draw_single_connector(context, width, height):
"""Draw the connector for execution states
Connector for execution states can only be connected to the outside. Thus the connector fills the whole
border of the state.
:param context: Cairo context
:param float port_size: The ... | [
"def",
"_draw_single_connector",
"(",
"context",
",",
"width",
",",
"height",
")",
":",
"c",
"=",
"context",
"# Current pos is center",
"# Arrow is drawn upright",
"arrow_height",
"=",
"height",
"/",
"2.0",
"# First move to bottom left corner",
"c",
".",
"rel_move_to",
... | Draw the connector for execution states
Connector for execution states can only be connected to the outside. Thus the connector fills the whole
border of the state.
:param context: Cairo context
:param float port_size: The side length of the port | [
"Draw",
"the",
"connector",
"for",
"execution",
"states"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L483-L509 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView._draw_inner_connector | def _draw_inner_connector(context, width, height):
"""Draw the connector for container states
Connector for container states can be connected from the inside and the outside. Thus the connector is split
in two parts: A rectangle on the inside and an arrow on the outside. This methods draws the ... | python | def _draw_inner_connector(context, width, height):
"""Draw the connector for container states
Connector for container states can be connected from the inside and the outside. Thus the connector is split
in two parts: A rectangle on the inside and an arrow on the outside. This methods draws the ... | [
"def",
"_draw_inner_connector",
"(",
"context",
",",
"width",
",",
"height",
")",
":",
"c",
"=",
"context",
"# Current pos is center",
"# Arrow is drawn upright",
"gap",
"=",
"height",
"/",
"6.",
"connector_height",
"=",
"(",
"height",
"-",
"gap",
")",
"/",
"2... | Draw the connector for container states
Connector for container states can be connected from the inside and the outside. Thus the connector is split
in two parts: A rectangle on the inside and an arrow on the outside. This methods draws the inner rectangle.
:param context: Cairo context
... | [
"Draw",
"the",
"connector",
"for",
"container",
"states"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L512-L535 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView._draw_outer_connector | def _draw_outer_connector(context, width, height):
"""Draw the outer connector for container states
Connector for container states can be connected from the inside and the outside. Thus the connector is split
in two parts: A rectangle on the inside and an arrow on the outside. This method draws... | python | def _draw_outer_connector(context, width, height):
"""Draw the outer connector for container states
Connector for container states can be connected from the inside and the outside. Thus the connector is split
in two parts: A rectangle on the inside and an arrow on the outside. This method draws... | [
"def",
"_draw_outer_connector",
"(",
"context",
",",
"width",
",",
"height",
")",
":",
"c",
"=",
"context",
"# Current pos is center",
"# Arrow is drawn upright",
"arrow_height",
"=",
"height",
"/",
"2.5",
"gap",
"=",
"height",
"/",
"6.",
"connector_height",
"=",
... | Draw the outer connector for container states
Connector for container states can be connected from the inside and the outside. Thus the connector is split
in two parts: A rectangle on the inside and an arrow on the outside. This method draws the outer arrow.
:param context: Cairo context
... | [
"Draw",
"the",
"outer",
"connector",
"for",
"container",
"states"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L538-L567 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView._draw_rectangle | def _draw_rectangle(context, width, height):
"""Draw a rectangle
Assertion: The current point is the center point of the rectangle
:param context: Cairo context
:param width: Width of the rectangle
:param height: Height of the rectangle
"""
c = context
#... | python | def _draw_rectangle(context, width, height):
"""Draw a rectangle
Assertion: The current point is the center point of the rectangle
:param context: Cairo context
:param width: Width of the rectangle
:param height: Height of the rectangle
"""
c = context
#... | [
"def",
"_draw_rectangle",
"(",
"context",
",",
"width",
",",
"height",
")",
":",
"c",
"=",
"context",
"# First move to upper left corner",
"c",
".",
"rel_move_to",
"(",
"-",
"width",
"/",
"2.",
",",
"-",
"height",
"/",
"2.",
")",
"# Draw closed rectangle",
"... | Draw a rectangle
Assertion: The current point is the center point of the rectangle
:param context: Cairo context
:param width: Width of the rectangle
:param height: Height of the rectangle | [
"Draw",
"a",
"rectangle"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L570-L586 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | PortView._rotate_context | def _rotate_context(context, direction):
"""Moves the current position to 'position' and rotates the context according to 'direction'
:param context: Cairo context
:param direction: Direction enum
"""
if direction is Direction.UP:
pass
elif direction is Direc... | python | def _rotate_context(context, direction):
"""Moves the current position to 'position' and rotates the context according to 'direction'
:param context: Cairo context
:param direction: Direction enum
"""
if direction is Direction.UP:
pass
elif direction is Direc... | [
"def",
"_rotate_context",
"(",
"context",
",",
"direction",
")",
":",
"if",
"direction",
"is",
"Direction",
".",
"UP",
":",
"pass",
"elif",
"direction",
"is",
"Direction",
".",
"RIGHT",
":",
"context",
".",
"rotate",
"(",
"deg2rad",
"(",
"90",
")",
")",
... | Moves the current position to 'position' and rotates the context according to 'direction'
:param context: Cairo context
:param direction: Direction enum | [
"Moves",
"the",
"current",
"position",
"to",
"position",
"and",
"rotates",
"the",
"context",
"according",
"to",
"direction"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L589-L602 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | ScopedVariablePortView.draw_name | def draw_name(self, context, transparency, only_calculate_size=False):
"""Draws the name of the port
Offers the option to only calculate the size of the name.
:param context: The context to draw on
:param transparency: The transparency of the text
:param only_calculate_size: Wh... | python | def draw_name(self, context, transparency, only_calculate_size=False):
"""Draws the name of the port
Offers the option to only calculate the size of the name.
:param context: The context to draw on
:param transparency: The transparency of the text
:param only_calculate_size: Wh... | [
"def",
"draw_name",
"(",
"self",
",",
"context",
",",
"transparency",
",",
"only_calculate_size",
"=",
"False",
")",
":",
"c",
"=",
"context",
"cairo_context",
"=",
"c",
"if",
"isinstance",
"(",
"c",
",",
"CairoBoundingBoxContext",
")",
":",
"cairo_context",
... | Draws the name of the port
Offers the option to only calculate the size of the name.
:param context: The context to draw on
:param transparency: The transparency of the text
:param only_calculate_size: Whether to only calculate the size
:return: Size of the name
:rtype:... | [
"Draws",
"the",
"name",
"of",
"the",
"port"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L771-L826 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | ScopedVariablePortView._draw_rectangle_path | def _draw_rectangle_path(self, context, width, height, only_get_extents=False):
"""Draws the rectangle path for the port
The rectangle is correctly rotated. Height therefore refers to the border thickness and width to the length
of the port.
:param context: The context to draw on
... | python | def _draw_rectangle_path(self, context, width, height, only_get_extents=False):
"""Draws the rectangle path for the port
The rectangle is correctly rotated. Height therefore refers to the border thickness and width to the length
of the port.
:param context: The context to draw on
... | [
"def",
"_draw_rectangle_path",
"(",
"self",
",",
"context",
",",
"width",
",",
"height",
",",
"only_get_extents",
"=",
"False",
")",
":",
"c",
"=",
"context",
"# Current position is the center of the rectangle",
"c",
".",
"save",
"(",
")",
"if",
"self",
".",
"... | Draws the rectangle path for the port
The rectangle is correctly rotated. Height therefore refers to the border thickness and width to the length
of the port.
:param context: The context to draw on
:param float width: The width of the rectangle
:param float height: The height o... | [
"Draws",
"the",
"rectangle",
"path",
"for",
"the",
"port"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L828-L854 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/items/ports.py | ScopedVariablePortView._get_port_center_position | def _get_port_center_position(self, width):
"""Calculates the center position of the port rectangle
The port itself can be positioned in the corner, the center of the port rectangle however is restricted by
the width of the rectangle. This method therefore calculates the center, depending on th... | python | def _get_port_center_position(self, width):
"""Calculates the center position of the port rectangle
The port itself can be positioned in the corner, the center of the port rectangle however is restricted by
the width of the rectangle. This method therefore calculates the center, depending on th... | [
"def",
"_get_port_center_position",
"(",
"self",
",",
"width",
")",
":",
"x",
",",
"y",
"=",
"self",
".",
"pos",
".",
"x",
".",
"value",
",",
"self",
".",
"pos",
".",
"y",
".",
"value",
"if",
"self",
".",
"side",
"is",
"SnappedSide",
".",
"TOP",
... | Calculates the center position of the port rectangle
The port itself can be positioned in the corner, the center of the port rectangle however is restricted by
the width of the rectangle. This method therefore calculates the center, depending on the position of the
port and the width of the rec... | [
"Calculates",
"the",
"center",
"position",
"of",
"the",
"port",
"rectangle"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/items/ports.py#L856-L877 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.register_actions | def register_actions(self, shortcut_manager):
"""Register callback methods for triggered actions
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings
between shortcuts and actions.
"""
shortcut_manager.add_callback_for... | python | def register_actions(self, shortcut_manager):
"""Register callback methods for triggered actions
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings
between shortcuts and actions.
"""
shortcut_manager.add_callback_for... | [
"def",
"register_actions",
"(",
"self",
",",
"shortcut_manager",
")",
":",
"shortcut_manager",
".",
"add_callback_for_action",
"(",
"'rename'",
",",
"self",
".",
"rename_selected_state",
")",
"super",
"(",
"StatesEditorController",
",",
"self",
")",
".",
"register_a... | Register callback methods for triggered actions
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings
between shortcuts and actions. | [
"Register",
"callback",
"methods",
"for",
"triggered",
"actions"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L154-L161 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.on_config_value_changed | def on_config_value_changed(self, config_m, prop_name, info):
"""Callback when a config value has been changed
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'config'
:param dict info: Information e.g. about the changed config ... | python | def on_config_value_changed(self, config_m, prop_name, info):
"""Callback when a config value has been changed
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'config'
:param dict info: Information e.g. about the changed config ... | [
"def",
"on_config_value_changed",
"(",
"self",
",",
"config_m",
",",
"prop_name",
",",
"info",
")",
":",
"config_key",
"=",
"info",
"[",
"'args'",
"]",
"[",
"1",
"]",
"# config_value = info['args'][2]",
"if",
"config_key",
"==",
"\"SOURCE_EDITOR_STYLE\"",
":",
"... | Callback when a config value has been changed
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'config'
:param dict info: Information e.g. about the changed config key | [
"Callback",
"when",
"a",
"config",
"value",
"has",
"been",
"changed"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L168-L179 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.get_current_state_m | def get_current_state_m(self):
"""Returns the state model of the currently open tab"""
page_id = self.view.notebook.get_current_page()
if page_id == -1:
return None
page = self.view.notebook.get_nth_page(page_id)
state_identifier = self.get_state_identifier_for_page(p... | python | def get_current_state_m(self):
"""Returns the state model of the currently open tab"""
page_id = self.view.notebook.get_current_page()
if page_id == -1:
return None
page = self.view.notebook.get_nth_page(page_id)
state_identifier = self.get_state_identifier_for_page(p... | [
"def",
"get_current_state_m",
"(",
"self",
")",
":",
"page_id",
"=",
"self",
".",
"view",
".",
"notebook",
".",
"get_current_page",
"(",
")",
"if",
"page_id",
"==",
"-",
"1",
":",
"return",
"None",
"page",
"=",
"self",
".",
"view",
".",
"notebook",
"."... | Returns the state model of the currently open tab | [
"Returns",
"the",
"state",
"model",
"of",
"the",
"currently",
"open",
"tab"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L190-L197 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.state_machine_manager_notification | def state_machine_manager_notification(self, model, property, info):
"""Triggered whenever a new state machine is created, or an existing state machine is selected.
"""
if self.current_state_machine_m is not None:
selection = self.current_state_machine_m.selection
if len(... | python | def state_machine_manager_notification(self, model, property, info):
"""Triggered whenever a new state machine is created, or an existing state machine is selected.
"""
if self.current_state_machine_m is not None:
selection = self.current_state_machine_m.selection
if len(... | [
"def",
"state_machine_manager_notification",
"(",
"self",
",",
"model",
",",
"property",
",",
"info",
")",
":",
"if",
"self",
".",
"current_state_machine_m",
"is",
"not",
"None",
":",
"selection",
"=",
"self",
".",
"current_state_machine_m",
".",
"selection",
"i... | Triggered whenever a new state machine is created, or an existing state machine is selected. | [
"Triggered",
"whenever",
"a",
"new",
"state",
"machine",
"is",
"created",
"or",
"an",
"existing",
"state",
"machine",
"is",
"selected",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L224-L230 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.clean_up_tabs | def clean_up_tabs(self):
""" Method remove state-tabs for those no state machine exists anymore.
"""
tabs_to_close = []
for state_identifier, tab_dict in list(self.tabs.items()):
if tab_dict['sm_id'] not in self.model.state_machine_manager.state_machines:
tabs... | python | def clean_up_tabs(self):
""" Method remove state-tabs for those no state machine exists anymore.
"""
tabs_to_close = []
for state_identifier, tab_dict in list(self.tabs.items()):
if tab_dict['sm_id'] not in self.model.state_machine_manager.state_machines:
tabs... | [
"def",
"clean_up_tabs",
"(",
"self",
")",
":",
"tabs_to_close",
"=",
"[",
"]",
"for",
"state_identifier",
",",
"tab_dict",
"in",
"list",
"(",
"self",
".",
"tabs",
".",
"items",
"(",
")",
")",
":",
"if",
"tab_dict",
"[",
"'sm_id'",
"]",
"not",
"in",
"... | Method remove state-tabs for those no state machine exists anymore. | [
"Method",
"remove",
"state",
"-",
"tabs",
"for",
"those",
"no",
"state",
"machine",
"exists",
"anymore",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L232-L243 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.state_machines_set_notification | def state_machines_set_notification(self, model, prop_name, info):
"""Observe all open state machines and their root states
"""
if info['method_name'] == '__setitem__':
state_machine_m = info.args[1]
self.observe_model(state_machine_m) | python | def state_machines_set_notification(self, model, prop_name, info):
"""Observe all open state machines and their root states
"""
if info['method_name'] == '__setitem__':
state_machine_m = info.args[1]
self.observe_model(state_machine_m) | [
"def",
"state_machines_set_notification",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"info",
"[",
"'method_name'",
"]",
"==",
"'__setitem__'",
":",
"state_machine_m",
"=",
"info",
".",
"args",
"[",
"1",
"]",
"self",
".",
"obs... | Observe all open state machines and their root states | [
"Observe",
"all",
"open",
"state",
"machines",
"and",
"their",
"root",
"states"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L246-L251 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.state_machines_del_notification | def state_machines_del_notification(self, model, prop_name, info):
"""Relive models of closed state machine
"""
if info['method_name'] == '__delitem__':
state_machine_m = info["result"]
try:
self.relieve_model(state_machine_m)
except KeyError:
... | python | def state_machines_del_notification(self, model, prop_name, info):
"""Relive models of closed state machine
"""
if info['method_name'] == '__delitem__':
state_machine_m = info["result"]
try:
self.relieve_model(state_machine_m)
except KeyError:
... | [
"def",
"state_machines_del_notification",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"info",
"[",
"'method_name'",
"]",
"==",
"'__delitem__'",
":",
"state_machine_m",
"=",
"info",
"[",
"\"result\"",
"]",
"try",
":",
"self",
"."... | Relive models of closed state machine | [
"Relive",
"models",
"of",
"closed",
"state",
"machine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L254-L263 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.add_state_editor | def add_state_editor(self, state_m):
"""Triggered whenever a state is selected.
:param state_m: The selected state model.
"""
state_identifier = self.get_state_identifier(state_m)
if state_identifier in self.closed_tabs:
state_editor_ctrl = self.closed_tabs[state_id... | python | def add_state_editor(self, state_m):
"""Triggered whenever a state is selected.
:param state_m: The selected state model.
"""
state_identifier = self.get_state_identifier(state_m)
if state_identifier in self.closed_tabs:
state_editor_ctrl = self.closed_tabs[state_id... | [
"def",
"add_state_editor",
"(",
"self",
",",
"state_m",
")",
":",
"state_identifier",
"=",
"self",
".",
"get_state_identifier",
"(",
"state_m",
")",
"if",
"state_identifier",
"in",
"self",
".",
"closed_tabs",
":",
"state_editor_ctrl",
"=",
"self",
".",
"closed_t... | Triggered whenever a state is selected.
:param state_m: The selected state model. | [
"Triggered",
"whenever",
"a",
"state",
"is",
"selected",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L285-L333 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.script_text_changed | def script_text_changed(self, text_buffer, state_m):
""" Update gui elements according text buffer changes
Checks if the dirty flag needs to be set and the tab label to be updated.
:param TextBuffer text_buffer: Text buffer of the edited script
:param rafcon.gui.models.state.StateModel... | python | def script_text_changed(self, text_buffer, state_m):
""" Update gui elements according text buffer changes
Checks if the dirty flag needs to be set and the tab label to be updated.
:param TextBuffer text_buffer: Text buffer of the edited script
:param rafcon.gui.models.state.StateModel... | [
"def",
"script_text_changed",
"(",
"self",
",",
"text_buffer",
",",
"state_m",
")",
":",
"state_identifier",
"=",
"self",
".",
"get_state_identifier",
"(",
"state_m",
")",
"if",
"state_identifier",
"in",
"self",
".",
"tabs",
":",
"tab_list",
"=",
"self",
".",
... | Update gui elements according text buffer changes
Checks if the dirty flag needs to be set and the tab label to be updated.
:param TextBuffer text_buffer: Text buffer of the edited script
:param rafcon.gui.models.state.StateModel state_m: The state model related to the text buffer
:ret... | [
"Update",
"gui",
"elements",
"according",
"text",
"buffer",
"changes"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L348-L380 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.destroy_page | def destroy_page(self, tab_dict):
""" Destroys desired page
Disconnects the page from signals and removes interconnection to parent-controller or observables.
:param tab_dict: Tab-dictionary that holds all necessary information of a page and state-editor.
"""
# logger.info("des... | python | def destroy_page(self, tab_dict):
""" Destroys desired page
Disconnects the page from signals and removes interconnection to parent-controller or observables.
:param tab_dict: Tab-dictionary that holds all necessary information of a page and state-editor.
"""
# logger.info("des... | [
"def",
"destroy_page",
"(",
"self",
",",
"tab_dict",
")",
":",
"# logger.info(\"destroy page %s\" % tab_dict['controller'].model.state.get_path())",
"if",
"tab_dict",
"[",
"'source_code_changed_handler_id'",
"]",
"is",
"not",
"None",
":",
"handler_id",
"=",
"tab_dict",
"[",... | Destroys desired page
Disconnects the page from signals and removes interconnection to parent-controller or observables.
:param tab_dict: Tab-dictionary that holds all necessary information of a page and state-editor. | [
"Destroys",
"desired",
"page"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L382-L396 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.close_page | def close_page(self, state_identifier, delete=True):
"""Closes the desired page
The page belonging to the state with the specified state_identifier is closed. If the deletion flag is set to
False, the controller of the page is stored for later usage.
:param state_identifier: Identifier... | python | def close_page(self, state_identifier, delete=True):
"""Closes the desired page
The page belonging to the state with the specified state_identifier is closed. If the deletion flag is set to
False, the controller of the page is stored for later usage.
:param state_identifier: Identifier... | [
"def",
"close_page",
"(",
"self",
",",
"state_identifier",
",",
"delete",
"=",
"True",
")",
":",
"# delete old controller references",
"if",
"delete",
"and",
"state_identifier",
"in",
"self",
".",
"closed_tabs",
":",
"self",
".",
"destroy_page",
"(",
"self",
"."... | Closes the desired page
The page belonging to the state with the specified state_identifier is closed. If the deletion flag is set to
False, the controller of the page is stored for later usage.
:param state_identifier: Identifier of the page's state
:param delete: Whether to delete th... | [
"Closes",
"the",
"desired",
"page"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L398-L422 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.find_page_of_state_m | def find_page_of_state_m(self, state_m):
"""Return the identifier and page of a given state model
:param state_m: The state model to be searched
:return: page containing the state and the state_identifier
"""
for state_identifier, page_info in list(self.tabs.items()):
... | python | def find_page_of_state_m(self, state_m):
"""Return the identifier and page of a given state model
:param state_m: The state model to be searched
:return: page containing the state and the state_identifier
"""
for state_identifier, page_info in list(self.tabs.items()):
... | [
"def",
"find_page_of_state_m",
"(",
"self",
",",
"state_m",
")",
":",
"for",
"state_identifier",
",",
"page_info",
"in",
"list",
"(",
"self",
".",
"tabs",
".",
"items",
"(",
")",
")",
":",
"if",
"page_info",
"[",
"'state_m'",
"]",
"is",
"state_m",
":",
... | Return the identifier and page of a given state model
:param state_m: The state model to be searched
:return: page containing the state and the state_identifier | [
"Return",
"the",
"identifier",
"and",
"page",
"of",
"a",
"given",
"state",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L424-L433 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.on_tab_close_clicked | def on_tab_close_clicked(self, event, state_m):
"""Triggered when the states-editor close button is clicked
Closes the tab.
:param state_m: The desired state model (the selected state)
"""
[page, state_identifier] = self.find_page_of_state_m(state_m)
if page:
... | python | def on_tab_close_clicked(self, event, state_m):
"""Triggered when the states-editor close button is clicked
Closes the tab.
:param state_m: The desired state model (the selected state)
"""
[page, state_identifier] = self.find_page_of_state_m(state_m)
if page:
... | [
"def",
"on_tab_close_clicked",
"(",
"self",
",",
"event",
",",
"state_m",
")",
":",
"[",
"page",
",",
"state_identifier",
"]",
"=",
"self",
".",
"find_page_of_state_m",
"(",
"state_m",
")",
"if",
"page",
":",
"self",
".",
"close_page",
"(",
"state_identifier... | Triggered when the states-editor close button is clicked
Closes the tab.
:param state_m: The desired state model (the selected state) | [
"Triggered",
"when",
"the",
"states",
"-",
"editor",
"close",
"button",
"is",
"clicked"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L435-L444 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.on_toggle_sticky_clicked | def on_toggle_sticky_clicked(self, event, state_m):
"""Callback for the "toggle-sticky-check-button" emitted by custom TabLabel widget.
"""
[page, state_identifier] = self.find_page_of_state_m(state_m)
if not page:
return
self.tabs[state_identifier]['is_sticky'] = not... | python | def on_toggle_sticky_clicked(self, event, state_m):
"""Callback for the "toggle-sticky-check-button" emitted by custom TabLabel widget.
"""
[page, state_identifier] = self.find_page_of_state_m(state_m)
if not page:
return
self.tabs[state_identifier]['is_sticky'] = not... | [
"def",
"on_toggle_sticky_clicked",
"(",
"self",
",",
"event",
",",
"state_m",
")",
":",
"[",
"page",
",",
"state_identifier",
"]",
"=",
"self",
".",
"find_page_of_state_m",
"(",
"state_m",
")",
"if",
"not",
"page",
":",
"return",
"self",
".",
"tabs",
"[",
... | Callback for the "toggle-sticky-check-button" emitted by custom TabLabel widget. | [
"Callback",
"for",
"the",
"toggle",
"-",
"sticky",
"-",
"check",
"-",
"button",
"emitted",
"by",
"custom",
"TabLabel",
"widget",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L446-L453 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.close_all_pages | def close_all_pages(self):
"""Closes all tabs of the states editor"""
states_to_be_closed = []
for state_identifier in self.tabs:
states_to_be_closed.append(state_identifier)
for state_identifier in states_to_be_closed:
self.close_page(state_identifier, delete=Fal... | python | def close_all_pages(self):
"""Closes all tabs of the states editor"""
states_to_be_closed = []
for state_identifier in self.tabs:
states_to_be_closed.append(state_identifier)
for state_identifier in states_to_be_closed:
self.close_page(state_identifier, delete=Fal... | [
"def",
"close_all_pages",
"(",
"self",
")",
":",
"states_to_be_closed",
"=",
"[",
"]",
"for",
"state_identifier",
"in",
"self",
".",
"tabs",
":",
"states_to_be_closed",
".",
"append",
"(",
"state_identifier",
")",
"for",
"state_identifier",
"in",
"states_to_be_clo... | Closes all tabs of the states editor | [
"Closes",
"all",
"tabs",
"of",
"the",
"states",
"editor"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L455-L461 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.close_pages_for_specific_sm_id | def close_pages_for_specific_sm_id(self, sm_id):
"""Closes all tabs of the states editor for a specific sm_id"""
states_to_be_closed = []
for state_identifier in self.tabs:
state_m = self.tabs[state_identifier]["state_m"]
if state_m.state.get_state_machine().state_machine... | python | def close_pages_for_specific_sm_id(self, sm_id):
"""Closes all tabs of the states editor for a specific sm_id"""
states_to_be_closed = []
for state_identifier in self.tabs:
state_m = self.tabs[state_identifier]["state_m"]
if state_m.state.get_state_machine().state_machine... | [
"def",
"close_pages_for_specific_sm_id",
"(",
"self",
",",
"sm_id",
")",
":",
"states_to_be_closed",
"=",
"[",
"]",
"for",
"state_identifier",
"in",
"self",
".",
"tabs",
":",
"state_m",
"=",
"self",
".",
"tabs",
"[",
"state_identifier",
"]",
"[",
"\"state_m\""... | Closes all tabs of the states editor for a specific sm_id | [
"Closes",
"all",
"tabs",
"of",
"the",
"states",
"editor",
"for",
"a",
"specific",
"sm_id"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L463-L471 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.on_switch_page | def on_switch_page(self, notebook, page_pointer, page_num, user_param1=None):
"""Update state selection when the active tab was changed
"""
page = notebook.get_nth_page(page_num)
# find state of selected tab
for tab_info in list(self.tabs.values()):
if tab_info['page... | python | def on_switch_page(self, notebook, page_pointer, page_num, user_param1=None):
"""Update state selection when the active tab was changed
"""
page = notebook.get_nth_page(page_num)
# find state of selected tab
for tab_info in list(self.tabs.values()):
if tab_info['page... | [
"def",
"on_switch_page",
"(",
"self",
",",
"notebook",
",",
"page_pointer",
",",
"page_num",
",",
"user_param1",
"=",
"None",
")",
":",
"page",
"=",
"notebook",
".",
"get_nth_page",
"(",
"page_num",
")",
"# find state of selected tab",
"for",
"tab_info",
"in",
... | Update state selection when the active tab was changed | [
"Update",
"state",
"selection",
"when",
"the",
"active",
"tab",
"was",
"changed"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L473-L489 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.activate_state_tab | def activate_state_tab(self, state_m):
"""Opens the tab for the specified state model
The tab with the given state model is opened or set to foreground.
:param state_m: The desired state model (the selected state)
"""
# The current shown state differs from the desired one
... | python | def activate_state_tab(self, state_m):
"""Opens the tab for the specified state model
The tab with the given state model is opened or set to foreground.
:param state_m: The desired state model (the selected state)
"""
# The current shown state differs from the desired one
... | [
"def",
"activate_state_tab",
"(",
"self",
",",
"state_m",
")",
":",
"# The current shown state differs from the desired one",
"current_state_m",
"=",
"self",
".",
"get_current_state_m",
"(",
")",
"if",
"current_state_m",
"is",
"not",
"state_m",
":",
"state_identifier",
... | Opens the tab for the specified state model
The tab with the given state model is opened or set to foreground.
:param state_m: The desired state model (the selected state) | [
"Opens",
"the",
"tab",
"for",
"the",
"specified",
"state",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L491-L514 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.keep_only_sticked_and_selected_tabs | def keep_only_sticked_and_selected_tabs(self):
"""Close all tabs, except the currently active one and all sticked ones"""
# Only if the user didn't deactivate this behaviour
if not global_gui_config.get_config_value('KEEP_ONLY_STICKY_STATES_OPEN', True):
return
page_id = sel... | python | def keep_only_sticked_and_selected_tabs(self):
"""Close all tabs, except the currently active one and all sticked ones"""
# Only if the user didn't deactivate this behaviour
if not global_gui_config.get_config_value('KEEP_ONLY_STICKY_STATES_OPEN', True):
return
page_id = sel... | [
"def",
"keep_only_sticked_and_selected_tabs",
"(",
"self",
")",
":",
"# Only if the user didn't deactivate this behaviour",
"if",
"not",
"global_gui_config",
".",
"get_config_value",
"(",
"'KEEP_ONLY_STICKY_STATES_OPEN'",
",",
"True",
")",
":",
"return",
"page_id",
"=",
"se... | Close all tabs, except the currently active one and all sticked ones | [
"Close",
"all",
"tabs",
"except",
"the",
"currently",
"active",
"one",
"and",
"all",
"sticked",
"ones"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L516-L543 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.selection_notification | def selection_notification(self, model, property, info):
"""If a single state is selected, open the corresponding tab"""
if model is not self.current_state_machine_m or len(self.current_state_machine_m.ongoing_complex_actions) > 0:
return
state_machine_m = model
assert isinst... | python | def selection_notification(self, model, property, info):
"""If a single state is selected, open the corresponding tab"""
if model is not self.current_state_machine_m or len(self.current_state_machine_m.ongoing_complex_actions) > 0:
return
state_machine_m = model
assert isinst... | [
"def",
"selection_notification",
"(",
"self",
",",
"model",
",",
"property",
",",
"info",
")",
":",
"if",
"model",
"is",
"not",
"self",
".",
"current_state_machine_m",
"or",
"len",
"(",
"self",
".",
"current_state_machine_m",
".",
"ongoing_complex_actions",
")",... | If a single state is selected, open the corresponding tab | [
"If",
"a",
"single",
"state",
"is",
"selected",
"open",
"the",
"corresponding",
"tab"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L546-L553 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.notify_state_name_change | def notify_state_name_change(self, model, prop_name, info):
"""Checks whether the name of a state was changed and change the tab label accordingly
"""
# avoid updates or checks because of execution status updates
if is_execution_status_update_notification_from_state_machine_model(prop_na... | python | def notify_state_name_change(self, model, prop_name, info):
"""Checks whether the name of a state was changed and change the tab label accordingly
"""
# avoid updates or checks because of execution status updates
if is_execution_status_update_notification_from_state_machine_model(prop_na... | [
"def",
"notify_state_name_change",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"# avoid updates or checks because of execution status updates",
"if",
"is_execution_status_update_notification_from_state_machine_model",
"(",
"prop_name",
",",
"info",
")",
... | Checks whether the name of a state was changed and change the tab label accordingly | [
"Checks",
"whether",
"the",
"name",
"of",
"a",
"state",
"was",
"changed",
"and",
"change",
"the",
"tab",
"label",
"accordingly"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L556-L567 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.update_tab_label | def update_tab_label(self, state_m):
"""Update all tab labels
:param rafcon.state_machine.states.state.State state_m: State model who's tab label is to be updated
"""
state_identifier = self.get_state_identifier(state_m)
if state_identifier not in self.tabs and state_identifier ... | python | def update_tab_label(self, state_m):
"""Update all tab labels
:param rafcon.state_machine.states.state.State state_m: State model who's tab label is to be updated
"""
state_identifier = self.get_state_identifier(state_m)
if state_identifier not in self.tabs and state_identifier ... | [
"def",
"update_tab_label",
"(",
"self",
",",
"state_m",
")",
":",
"state_identifier",
"=",
"self",
".",
"get_state_identifier",
"(",
"state_m",
")",
"if",
"state_identifier",
"not",
"in",
"self",
".",
"tabs",
"and",
"state_identifier",
"not",
"in",
"self",
"."... | Update all tab labels
:param rafcon.state_machine.states.state.State state_m: State model who's tab label is to be updated | [
"Update",
"all",
"tab",
"labels"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L569-L579 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.get_state_identifier_for_page | def get_state_identifier_for_page(self, page):
"""Return the state identifier for a given page
"""
for identifier, page_info in list(self.tabs.items()):
if page_info["page"] is page: # reference comparison on purpose
return identifier | python | def get_state_identifier_for_page(self, page):
"""Return the state identifier for a given page
"""
for identifier, page_info in list(self.tabs.items()):
if page_info["page"] is page: # reference comparison on purpose
return identifier | [
"def",
"get_state_identifier_for_page",
"(",
"self",
",",
"page",
")",
":",
"for",
"identifier",
",",
"page_info",
"in",
"list",
"(",
"self",
".",
"tabs",
".",
"items",
"(",
")",
")",
":",
"if",
"page_info",
"[",
"\"page\"",
"]",
"is",
"page",
":",
"# ... | Return the state identifier for a given page | [
"Return",
"the",
"state",
"identifier",
"for",
"a",
"given",
"page"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L581-L586 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/states_editor.py | StatesEditorController.rename_selected_state | def rename_selected_state(self, key_value, modifier_mask):
"""Callback method for shortcut action rename
Searches for a single selected state model and open the according page. Page is created if it is not
existing. Then the rename method of the state controller is called.
:param key_v... | python | def rename_selected_state(self, key_value, modifier_mask):
"""Callback method for shortcut action rename
Searches for a single selected state model and open the according page. Page is created if it is not
existing. Then the rename method of the state controller is called.
:param key_v... | [
"def",
"rename_selected_state",
"(",
"self",
",",
"key_value",
",",
"modifier_mask",
")",
":",
"selection",
"=",
"self",
".",
"current_state_machine_m",
".",
"selection",
"if",
"len",
"(",
"selection",
".",
"states",
")",
"==",
"1",
"and",
"len",
"(",
"selec... | Callback method for shortcut action rename
Searches for a single selected state model and open the according page. Page is created if it is not
existing. Then the rename method of the state controller is called.
:param key_value:
:param modifier_mask: | [
"Callback",
"method",
"for",
"shortcut",
"action",
"rename"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/states_editor.py#L588-L603 |
DLR-RM/RAFCON | source/rafcon/core/id_generator.py | generate_semantic_data_key | def generate_semantic_data_key(used_semantic_keys):
""" Create a new and unique semantic data key
:param list used_semantic_keys: Handed list of keys already in use
:rtype: str
:return: semantic_data_id
"""
semantic_data_id_counter = -1
while True:
semantic_data_id_counter += 1
... | python | def generate_semantic_data_key(used_semantic_keys):
""" Create a new and unique semantic data key
:param list used_semantic_keys: Handed list of keys already in use
:rtype: str
:return: semantic_data_id
"""
semantic_data_id_counter = -1
while True:
semantic_data_id_counter += 1
... | [
"def",
"generate_semantic_data_key",
"(",
"used_semantic_keys",
")",
":",
"semantic_data_id_counter",
"=",
"-",
"1",
"while",
"True",
":",
"semantic_data_id_counter",
"+=",
"1",
"if",
"\"semantic data key \"",
"+",
"str",
"(",
"semantic_data_id_counter",
")",
"not",
"... | Create a new and unique semantic data key
:param list used_semantic_keys: Handed list of keys already in use
:rtype: str
:return: semantic_data_id | [
"Create",
"a",
"new",
"and",
"unique",
"semantic",
"data",
"key"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/id_generator.py#L90-L102 |
DLR-RM/RAFCON | source/rafcon/core/id_generator.py | state_id_generator | def state_id_generator(size=STATE_ID_LENGTH, chars=string.ascii_uppercase, used_state_ids=None):
""" Create a new and unique state id
Generates an id for a state. It randomly samples from random ascii uppercase letters size times
and concatenates them. If the id already exists it draws a new one.
:par... | python | def state_id_generator(size=STATE_ID_LENGTH, chars=string.ascii_uppercase, used_state_ids=None):
""" Create a new and unique state id
Generates an id for a state. It randomly samples from random ascii uppercase letters size times
and concatenates them. If the id already exists it draws a new one.
:par... | [
"def",
"state_id_generator",
"(",
"size",
"=",
"STATE_ID_LENGTH",
",",
"chars",
"=",
"string",
".",
"ascii_uppercase",
",",
"used_state_ids",
"=",
"None",
")",
":",
"new_state_id",
"=",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"chars",
")",
"f... | Create a new and unique state id
Generates an id for a state. It randomly samples from random ascii uppercase letters size times
and concatenates them. If the id already exists it draws a new one.
:param size: the length of the generated keys
:param chars: the set of characters a sample draws from
... | [
"Create",
"a",
"new",
"and",
"unique",
"state",
"id"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/id_generator.py#L125-L140 |
DLR-RM/RAFCON | source/rafcon/core/id_generator.py | global_variable_id_generator | def global_variable_id_generator(size=10, chars=string.ascii_uppercase):
""" Create a new and unique global variable id
Generates an id for a global variable. It randomly samples from random ascii uppercase letters size times
and concatenates them. If the id already exists it draws a new one.
:param s... | python | def global_variable_id_generator(size=10, chars=string.ascii_uppercase):
""" Create a new and unique global variable id
Generates an id for a global variable. It randomly samples from random ascii uppercase letters size times
and concatenates them. If the id already exists it draws a new one.
:param s... | [
"def",
"global_variable_id_generator",
"(",
"size",
"=",
"10",
",",
"chars",
"=",
"string",
".",
"ascii_uppercase",
")",
":",
"new_global_variable_id",
"=",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"chars",
")",
"for",
"x",
"in",
"range",
"(",... | Create a new and unique global variable id
Generates an id for a global variable. It randomly samples from random ascii uppercase letters size times
and concatenates them. If the id already exists it draws a new one.
:param size: the length of the generated keys
:param chars: the set of characters a s... | [
"Create",
"a",
"new",
"and",
"unique",
"global",
"variable",
"id"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/id_generator.py#L143-L156 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | Color.set | def set(self):
"""Set the color as current OpenGL color
"""
glColor4f(self.r, self.g, self.b, self.a) | python | def set(self):
"""Set the color as current OpenGL color
"""
glColor4f(self.r, self.g, self.b, self.a) | [
"def",
"set",
"(",
"self",
")",
":",
"glColor4f",
"(",
"self",
".",
"r",
",",
"self",
".",
"g",
",",
"self",
".",
"b",
",",
"self",
".",
"a",
")"
] | Set the color as current OpenGL color | [
"Set",
"the",
"color",
"as",
"current",
"OpenGL",
"color"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L137-L140 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor._configure | def _configure(self, *args):
"""Configure viewport
This method is called when the widget is resized or something triggers a redraw. The method configures the
view to show all elements in an orthogonal perspective.
"""
# Obtain a reference to the OpenGL drawable
# and ren... | python | def _configure(self, *args):
"""Configure viewport
This method is called when the widget is resized or something triggers a redraw. The method configures the
view to show all elements in an orthogonal perspective.
"""
# Obtain a reference to the OpenGL drawable
# and ren... | [
"def",
"_configure",
"(",
"self",
",",
"*",
"args",
")",
":",
"# Obtain a reference to the OpenGL drawable",
"# and rendering context.",
"gldrawable",
"=",
"self",
".",
"get_gl_drawable",
"(",
")",
"glcontext",
"=",
"self",
".",
"get_gl_context",
"(",
")",
"# logger... | Configure viewport
This method is called when the widget is resized or something triggers a redraw. The method configures the
view to show all elements in an orthogonal perspective. | [
"Configure",
"viewport"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L250-L281 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor.pixel_to_size_ratio | def pixel_to_size_ratio(self):
"""Calculates the ratio between pixel and OpenGL distances
OpenGL keeps its own coordinate system. This method can be used to transform between pixel and OpenGL
coordinates.
:return: pixel/size ratio
"""
left, right, _, _ = self.get_view_c... | python | def pixel_to_size_ratio(self):
"""Calculates the ratio between pixel and OpenGL distances
OpenGL keeps its own coordinate system. This method can be used to transform between pixel and OpenGL
coordinates.
:return: pixel/size ratio
"""
left, right, _, _ = self.get_view_c... | [
"def",
"pixel_to_size_ratio",
"(",
"self",
")",
":",
"left",
",",
"right",
",",
"_",
",",
"_",
"=",
"self",
".",
"get_view_coordinates",
"(",
")",
"width",
"=",
"right",
"-",
"left",
"display_width",
"=",
"self",
".",
"get_allocation",
"(",
")",
".",
"... | Calculates the ratio between pixel and OpenGL distances
OpenGL keeps its own coordinate system. This method can be used to transform between pixel and OpenGL
coordinates.
:return: pixel/size ratio | [
"Calculates",
"the",
"ratio",
"between",
"pixel",
"and",
"OpenGL",
"distances"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L295-L306 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor.expose_init | def expose_init(self, *args):
"""Process the drawing routine
"""
# Obtain a reference to the OpenGL drawable
# and rendering context.
gldrawable = self.get_gl_drawable()
glcontext = self.get_gl_context()
# OpenGL begin
if not gldrawable or not gldrawable.... | python | def expose_init(self, *args):
"""Process the drawing routine
"""
# Obtain a reference to the OpenGL drawable
# and rendering context.
gldrawable = self.get_gl_drawable()
glcontext = self.get_gl_context()
# OpenGL begin
if not gldrawable or not gldrawable.... | [
"def",
"expose_init",
"(",
"self",
",",
"*",
"args",
")",
":",
"# Obtain a reference to the OpenGL drawable",
"# and rendering context.",
"gldrawable",
"=",
"self",
".",
"get_gl_drawable",
"(",
")",
"glcontext",
"=",
"self",
".",
"get_gl_context",
"(",
")",
"# OpenG... | Process the drawing routine | [
"Process",
"the",
"drawing",
"routine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L308-L330 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor.expose_finish | def expose_finish(self, *args):
"""Finish drawing process
"""
# Obtain a reference to the OpenGL drawable
# and rendering context.
gldrawable = self.get_gl_drawable()
# glcontext = self.get_gl_context()
if not gldrawable:
return
# Put the buf... | python | def expose_finish(self, *args):
"""Finish drawing process
"""
# Obtain a reference to the OpenGL drawable
# and rendering context.
gldrawable = self.get_gl_drawable()
# glcontext = self.get_gl_context()
if not gldrawable:
return
# Put the buf... | [
"def",
"expose_finish",
"(",
"self",
",",
"*",
"args",
")",
":",
"# Obtain a reference to the OpenGL drawable",
"# and rendering context.",
"gldrawable",
"=",
"self",
".",
"get_gl_drawable",
"(",
")",
"# glcontext = self.get_gl_context()",
"if",
"not",
"gldrawable",
":",
... | Finish drawing process | [
"Finish",
"drawing",
"process"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L332-L350 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor.draw_state | def draw_state(self, name, pos, size, outcomes=None, input_ports_m=None, output_ports_m=None, selected=False,
active=False, depth=0):
"""Draw a state with the given properties
This method is called by the controller to draw the specified (container) state.
:param name: Name ... | python | def draw_state(self, name, pos, size, outcomes=None, input_ports_m=None, output_ports_m=None, selected=False,
active=False, depth=0):
"""Draw a state with the given properties
This method is called by the controller to draw the specified (container) state.
:param name: Name ... | [
"def",
"draw_state",
"(",
"self",
",",
"name",
",",
"pos",
",",
"size",
",",
"outcomes",
"=",
"None",
",",
"input_ports_m",
"=",
"None",
",",
"output_ports_m",
"=",
"None",
",",
"selected",
"=",
"False",
",",
"active",
"=",
"False",
",",
"depth",
"=",
... | Draw a state with the given properties
This method is called by the controller to draw the specified (container) state.
:param name: Name of the state
:param pos: position (x, y) of the state
:param size: size (width, height) of the state
:param outcomes: outcomes of the state ... | [
"Draw",
"a",
"state",
"with",
"the",
"given",
"properties"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L360-L530 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor.draw_transition | def draw_transition(self, from_pos, to_pos, width, waypoints=None, selected=False, depth=0):
"""Draw a state with the given properties
This method is called by the controller to draw the specified transition.
:param tuple from_pos: Starting position
:param tuple to_pos: Ending position... | python | def draw_transition(self, from_pos, to_pos, width, waypoints=None, selected=False, depth=0):
"""Draw a state with the given properties
This method is called by the controller to draw the specified transition.
:param tuple from_pos: Starting position
:param tuple to_pos: Ending position... | [
"def",
"draw_transition",
"(",
"self",
",",
"from_pos",
",",
"to_pos",
",",
"width",
",",
"waypoints",
"=",
"None",
",",
"selected",
"=",
"False",
",",
"depth",
"=",
"0",
")",
":",
"if",
"not",
"waypoints",
":",
"waypoints",
"=",
"[",
"]",
"# \"Generat... | Draw a state with the given properties
This method is called by the controller to draw the specified transition.
:param tuple from_pos: Starting position
:param tuple to_pos: Ending position
:param float width: A measure for the width of a transition line
:param list waypoints:... | [
"Draw",
"a",
"state",
"with",
"the",
"given",
"properties"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L600-L650 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor._write_string | def _write_string(self, string, pos_x, pos_y, height, color, bold=False, align_right=False, depth=0.):
"""Write a string
Writes a string with a simple OpenGL method in the given size at the given position.
:param string: The string to draw
:param pos_x: x starting position
:par... | python | def _write_string(self, string, pos_x, pos_y, height, color, bold=False, align_right=False, depth=0.):
"""Write a string
Writes a string with a simple OpenGL method in the given size at the given position.
:param string: The string to draw
:param pos_x: x starting position
:par... | [
"def",
"_write_string",
"(",
"self",
",",
"string",
",",
"pos_x",
",",
"pos_y",
",",
"height",
",",
"color",
",",
"bold",
"=",
"False",
",",
"align_right",
"=",
"False",
",",
"depth",
"=",
"0.",
")",
":",
"stroke_width",
"=",
"height",
"/",
"8.",
"if... | Write a string
Writes a string with a simple OpenGL method in the given size at the given position.
:param string: The string to draw
:param pos_x: x starting position
:param pos_y: y starting position
:param height: desired height
:param bold: flag whether to use a bol... | [
"Write",
"a",
"string"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L704-L737 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor.prepare_selection | def prepare_selection(self, pos_x, pos_y, width, height):
"""Prepares the selection rendering
In order to find out the object being clicked on, the scene has to be rendered again around the clicked position
:param pos_x: x coordinate
:param pos_y: y coordinate
"""
glSel... | python | def prepare_selection(self, pos_x, pos_y, width, height):
"""Prepares the selection rendering
In order to find out the object being clicked on, the scene has to be rendered again around the clicked position
:param pos_x: x coordinate
:param pos_y: y coordinate
"""
glSel... | [
"def",
"prepare_selection",
"(",
"self",
",",
"pos_x",
",",
"pos_y",
",",
"width",
",",
"height",
")",
":",
"glSelectBuffer",
"(",
"self",
".",
"name_counter",
"*",
"6",
")",
"viewport",
"=",
"glGetInteger",
"(",
"GL_VIEWPORT",
")",
"glMatrixMode",
"(",
"G... | Prepares the selection rendering
In order to find out the object being clicked on, the scene has to be rendered again around the clicked position
:param pos_x: x coordinate
:param pos_y: y coordinate | [
"Prepares",
"the",
"selection",
"rendering"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L748-L775 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor.find_selection | def find_selection():
"""Finds the selected ids
After the scene has been rendered again in selection mode, this method gathers and returns the ids of the
selected object and restores the matrices.
:return: The selection stack
"""
hits = glRenderMode(GL_RENDER)
... | python | def find_selection():
"""Finds the selected ids
After the scene has been rendered again in selection mode, this method gathers and returns the ids of the
selected object and restores the matrices.
:return: The selection stack
"""
hits = glRenderMode(GL_RENDER)
... | [
"def",
"find_selection",
"(",
")",
":",
"hits",
"=",
"glRenderMode",
"(",
"GL_RENDER",
")",
"glMatrixMode",
"(",
"GL_PROJECTION",
")",
"glPopMatrix",
"(",
")",
"glMatrixMode",
"(",
"GL_MODELVIEW",
")",
"return",
"hits"
] | Finds the selected ids
After the scene has been rendered again in selection mode, this method gathers and returns the ids of the
selected object and restores the matrices.
:return: The selection stack | [
"Finds",
"the",
"selected",
"ids"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L778-L792 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor._set_closest_stroke_width | def _set_closest_stroke_width(self, width):
"""Sets the line width to the closest supported one
Not all line widths are supported. This function queries both minimum and maximum as well as the step size of
the line width and calculates the width, which is closest to the given one. This width is... | python | def _set_closest_stroke_width(self, width):
"""Sets the line width to the closest supported one
Not all line widths are supported. This function queries both minimum and maximum as well as the step size of
the line width and calculates the width, which is closest to the given one. This width is... | [
"def",
"_set_closest_stroke_width",
"(",
"self",
",",
"width",
")",
":",
"# Adapt line width to zooming level",
"width",
"*=",
"self",
".",
"pixel_to_size_ratio",
"(",
")",
"/",
"6.",
"stroke_width_range",
"=",
"glGetFloatv",
"(",
"GL_LINE_WIDTH_RANGE",
")",
"stroke_w... | Sets the line width to the closest supported one
Not all line widths are supported. This function queries both minimum and maximum as well as the step size of
the line width and calculates the width, which is closest to the given one. This width is then set.
:param width: The desired line widt... | [
"Sets",
"the",
"line",
"width",
"to",
"the",
"closest",
"supported",
"one"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L802-L822 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor._draw_circle | def _draw_circle(self, pos_x, pos_y, radius, depth, stroke_width=1., fill_color=None, border_color=None,
from_angle=0., to_angle=2 * pi):
"""Draws a circle
Draws a circle with a line segment a desired position with desired size.
:param float pos_x: Center x position
... | python | def _draw_circle(self, pos_x, pos_y, radius, depth, stroke_width=1., fill_color=None, border_color=None,
from_angle=0., to_angle=2 * pi):
"""Draws a circle
Draws a circle with a line segment a desired position with desired size.
:param float pos_x: Center x position
... | [
"def",
"_draw_circle",
"(",
"self",
",",
"pos_x",
",",
"pos_y",
",",
"radius",
",",
"depth",
",",
"stroke_width",
"=",
"1.",
",",
"fill_color",
"=",
"None",
",",
"border_color",
"=",
"None",
",",
"from_angle",
"=",
"0.",
",",
"to_angle",
"=",
"2",
"*",... | Draws a circle
Draws a circle with a line segment a desired position with desired size.
:param float pos_x: Center x position
:param float pos_y: Center y position
:param float depth: The Z layer
:param float radius: Radius of the circle | [
"Draws",
"a",
"circle"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L915-L975 |
DLR-RM/RAFCON | source/rafcon/gui/views/graphical_editor.py | GraphicalEditor._apply_orthogonal_view | def _apply_orthogonal_view(self):
"""Orthogonal view with respect to current aspect ratio
"""
left, right, bottom, top = self.get_view_coordinates()
glOrtho(left, right, bottom, top, -10, 0) | python | def _apply_orthogonal_view(self):
"""Orthogonal view with respect to current aspect ratio
"""
left, right, bottom, top = self.get_view_coordinates()
glOrtho(left, right, bottom, top, -10, 0) | [
"def",
"_apply_orthogonal_view",
"(",
"self",
")",
":",
"left",
",",
"right",
",",
"bottom",
",",
"top",
"=",
"self",
".",
"get_view_coordinates",
"(",
")",
"glOrtho",
"(",
"left",
",",
"right",
",",
"bottom",
",",
"top",
",",
"-",
"10",
",",
"0",
")... | Orthogonal view with respect to current aspect ratio | [
"Orthogonal",
"view",
"with",
"respect",
"to",
"current",
"aspect",
"ratio"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/graphical_editor.py#L1018-L1022 |
openego/eTraGo | etrago/cluster/snapshot.py | tsam_cluster | def tsam_cluster(timeseries_df, typical_periods=10, how='daily'):
"""
Parameters
----------
df : pd.DataFrame
DataFrame with timeseries to cluster
Returns
-------
timeseries : pd.DataFrame
Clustered timeseries
"""
if how == 'daily':
hours = 24
if how == ... | python | def tsam_cluster(timeseries_df, typical_periods=10, how='daily'):
"""
Parameters
----------
df : pd.DataFrame
DataFrame with timeseries to cluster
Returns
-------
timeseries : pd.DataFrame
Clustered timeseries
"""
if how == 'daily':
hours = 24
if how == ... | [
"def",
"tsam_cluster",
"(",
"timeseries_df",
",",
"typical_periods",
"=",
"10",
",",
"how",
"=",
"'daily'",
")",
":",
"if",
"how",
"==",
"'daily'",
":",
"hours",
"=",
"24",
"if",
"how",
"==",
"'weekly'",
":",
"hours",
"=",
"168",
"aggregation",
"=",
"t... | Parameters
----------
df : pd.DataFrame
DataFrame with timeseries to cluster
Returns
-------
timeseries : pd.DataFrame
Clustered timeseries | [
"Parameters",
"----------",
"df",
":",
"pd",
".",
"DataFrame",
"DataFrame",
"with",
"timeseries",
"to",
"cluster"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/cluster/snapshot.py#L56-L106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.