Skip to content
Snippets Groups Projects
Commit 08c1e87c authored by Constantin WdP's avatar Constantin WdP
Browse files

FEATURE: added the optional parameter post for the method execute_simtalk in plantsim.py

parent 01809d05
No related branches found
No related tags found
No related merge requests found
......@@ -102,10 +102,19 @@ class Plantsim:
self.plantsim.SetValue(object_name, value)
def execute_simtalk(self, command_string):
def execute_simtalk(self, command_string, parameter=None):
# passed command_string to be executed in "SimTalk" starts from self.path_context
# optionally pass a parameter value, if the command string contains a parameter
# according to COM documentation:
# PlantSim.ExecuteSimTalk("->real; return 3.14159")
# PlantSim.ExecuteSimTalk("param r:real->real; return r*r", 3.14159)
command_string = f'{self.path_context}.{command_string}'
if parameter == None:
self.plantsim.ExecuteSimTalk(command_string)
else:
self.plantsim.ExecuteSimTalk(command_string, parameter)
def quit(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment