Skip to content

Commit

Permalink
- #93
Browse files Browse the repository at this point in the history
  • Loading branch information
rcasteran committed Sep 2, 2024
1 parent 465171f commit fec01cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/jarvis/command_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions src/open_modelica_adapter/open_modelica_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')



Expand Down
6 changes: 3 additions & 3 deletions src/open_modelica_adapter/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:
Expand Down

0 comments on commit fec01cb

Please sign in to comment.