Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joerg Wangemann
committed
Oct 3, 2014
1 parent
082e43a
commit e602298
Showing
1 changed file
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()") | ||
|
||
|