From fec01cbfa4ad5530fc196690e80e9fc6d8c42a9e Mon Sep 17 00:00:00 2001 From: rcasteran Date: Mon, 2 Sep 2024 18:53:19 +0200 Subject: [PATCH] - #93 --- src/jarvis/command_parser.py | 4 ++-- src/open_modelica_adapter/open_modelica_connector.py | 6 +++--- src/open_modelica_adapter/util.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jarvis/command_parser.py b/src/jarvis/command_parser.py index 9a8a7da..ae5d27b 100644 --- a/src/jarvis/command_parser.py +++ b/src/jarvis/command_parser.py @@ -70,7 +70,7 @@ def __init__(self, generator, simulator): ] self.attribute_command_list = [ - (r'The ((?!type|alias|source|destination|description).*) of (.*?) is "((.|\n)*?)".', + (r'The ((?!type|alias|source|destination|description).*) of (.*?) is "((.|\n)*?)"', orchestrator_viewpoint_attribute.check_add_object_attribute), (r"The ((?!type|alias|source|destination|description).*) of (.*?) is ([^.|\n]*)", orchestrator_viewpoint_attribute.check_add_object_attribute) @@ -236,7 +236,7 @@ def matched_simulate(self, simulation_str_list, **kwargs): def matched_plot(self, plot_name_str, **kwargs): if Config.is_open_modelica: - self.simulator.plot(plot_name_str.replace('"', "").strip()) + self.simulator.plot(plot_name_str[0].replace('"', "").strip()) else: Logger.set_error(__name__, "Open modelica simulation is not activated") diff --git a/src/open_modelica_adapter/open_modelica_connector.py b/src/open_modelica_adapter/open_modelica_connector.py index 4d19355..0df690d 100644 --- a/src/open_modelica_adapter/open_modelica_connector.py +++ b/src/open_modelica_adapter/open_modelica_connector.py @@ -36,10 +36,10 @@ def simulate(self, p_om_name, p_om_directory, p_om_file, p_start_time, p_stop_ti f'Working directory change failed. Please check the directory: {p_om_directory}') def plot(self, p_var_list): - if self.sendExpression('plot({' + p_var_list[0] + '})'): - Logger.set_info(__name__, f'Variables "{p_var_list[0]}" displayed') + if self.sendExpression('plot({' + p_var_list + '})'): + Logger.set_info(__name__, f'Variables "{p_var_list}" displayed') else: - Logger.set_error(__name__, f'Variables "{p_var_list[0]}" not displayed') + Logger.set_error(__name__, f'Variables "{p_var_list}" not displayed') diff --git a/src/open_modelica_adapter/util.py b/src/open_modelica_adapter/util.py index 1881e7d..0aaf919 100644 --- a/src/open_modelica_adapter/util.py +++ b/src/open_modelica_adapter/util.py @@ -124,11 +124,11 @@ def create_state(self, p_state, p_is_initial=False, **kwargs): if not is_initial_value: Logger.set_error(__name__, f'No attribute "initial value" found for the data ' - f'"{xml_producer_function[0]}"') + f'"{xml_producer_function[0].name}"') else: Logger.set_error(__name__, f'No attribute "initial value" found for the data ' - f'"{xml_producer_function[0]}"') + f'"{xml_producer_function[0].name}"') # Else do nothing self.string_algorithm = self.string_algorithm + f'end if;\n' @@ -139,7 +139,7 @@ def create_transition(self, p_transition, **kwargs): if xml_state.id == p_transition.destination: data_attribute = query_object.query_object_by_name(datamodel.DesignAttributeLabel, **{XML_DICT_KEY_9_ATTRIBUTE_LIST: kwargs[ - XML_DICT_KEY_9_ATTRIBUTE_LIST]}) + XML_DICT_KEY_9_ATTRIBUTE_LIST]}) if data_attribute: for described_item in data_attribute.described_item_list: if described_item[0] == p_transition.id: