A simple java implementation of
OpenModelica's CORBA interface. Java-clients
should use this library to communicate with omc
.
A common workflow example:
OMCInterface omci = new OMCClient();
//1. connect to server; now omci is usable
omci.connect();
//2. start communication
Result res = omc.sendExpression("model abc Real x=1; end abc;");
System.out.println(res);
//3. disconnect from server;
//omci isn't usable until a call to connect()
omci.disconnect();
We provide converters which makes the creation of an Modelica-expression easier. For example if you want to create a modelica-array from a list:
List<Integer> xs = Arrays.toList(1,2,3,4);
String modelicaArray = ScriptingHelper.asArray(xs);
The helpers avoid common pitfalls like missing "
, ,
{
, etc.
This library is available on Maven Central:
GroupId | ArtifactId | Version |
---|---|---|
de.thm.mni.mote |
omc-java-api |
0.2 |
<dependency>
<groupId>de.thm.mni.mote</groupId>
<artifactId>omc-java-api</artifactId>
<version>0.2</version>
</dependency>
This library is distributed under the terms of the GNU General Public License Version 3.0. For more information see the LICENSE and the OpenModelica License.
-
This implementation is based on OpenModelica’s System Documentation V. 2013-01-28
-
omc’s scripting-API is documented at API
-
If an
omc
-instance gets started as subprocessstdin
andstdout
are redirected into$TMP/omc_home/omc.log
. -
Running 1 test in gradle:
gradle test --tests <TESTNAME>