Skip to content

Commit

Permalink
API of OMPython was modified.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerg Wangemann committed Oct 3, 2014
1 parent 082e43a commit e602298
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions python/test.py
@@ -1,13 +1,17 @@
# file: test.py
#!/usr/bin/python
import OMPython
cmds = ["loadModel(Modelica)",
"model test end test;",
"loadFile(\"../OpenBLDC/package.mo\")",
"simulate(OpenBLDC.Assemblies.HallCalibration, stopTime=0.25)",
"plot(h)"]
cmds = ["loadModel(Modelica)",
"model test end test;",
"loadFile(\"../OpenBLDC/package.mo\")",
"simulate(OpenBLDC.Tests.TestPWM, fileNamePrefix=\"Result\", stopTime=0.25)",
"plotAll()"]

_omc = OMPython.OMCSession()
for cmd in cmds:
answer = OMPython.execute(cmd)
print "\nResult:\n%s" %answer
answer = _omc.sendExpression(cmd)
print "\nResult:\n%s" %answer
if not answer:
print _omc.sendExpression("getErrorString()")


0 comments on commit e602298

Please sign in to comment.