OMPython icon indicating copy to clipboard operation
OMPython copied to clipboard

Execute and sendExpression do not give the same result for getComponentModifierValue

Open tinrabuzin opened this issue 10 years ago • 4 comments

When I run the command:

omc.sendExpression("getComponentModifierValue(iPSL.Examples.DevelopmentExamples.Electrical.Machines.PSSE.GENROE,pwLine.X)")

I get a parse exception but when I run

omc.execute("getComponentModifierValue(iPSL.Examples.DevelopmentExamples.Electrical.Machines.PSSE.GENROE,pwLine.X)")

I get the desired output.

tinrabuzin avatar Dec 03 '15 15:12 tinrabuzin

They are not supposed to give the same result. omc.execute is the OMPython1 format:

>>> omc.sendExpression("{1,2,3}")
(1, 2, 3)
>>> omc.execute("{1,2,3}")
{'SET1': {'Set1': [1, 2, 3]}}
>>> omc.ask("{1,2,3}",parsed=False)
'{1,2,3}\n'

API functions that are listed under the scripting API will work with sendExpression. Other calls are untyped in the compiler and will not parse using a standard Modelica expression parser.

sjoelund avatar Dec 03 '15 15:12 sjoelund

Ok. Are there any plans to extend supported functions?

tinrabuzin avatar Dec 03 '15 15:12 tinrabuzin

No; the only plans are to change the format of old, undocumented functions.

sjoelund avatar Dec 03 '15 15:12 sjoelund

So it will be possible to do sendExpression with getComponentModifierValue?

tinrabuzin avatar Dec 03 '15 16:12 tinrabuzin