Skip to content

API for communication with the OpenModelica Compiler

License

Notifications You must be signed in to change notification settings

THM-MoTE/omc-java-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OMC CORBA-interface for Java

A simple java implementation of OpenModelica's CORBA interface. Java-clients should use this library to communicate with omc.

Common workflow

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();

Helpers, Converters

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.

Maven coordinates

This library is available on Maven Central:

GroupId ArtifactId Version

de.thm.mni.mote

omc-java-api

0.2

Gradle

compile: group: "de.thm.mni.mote", name: "omc-java-api", version: "0.2"

Maven

<dependency>
	<groupId>de.thm.mni.mote</groupId>
	<artifactId>omc-java-api</artifactId>
	<version>0.2</version>
</dependency>

Logging

This library uses the slf4j api for logging. Provide a proper logging-framework for controlling logging output, for example logback.

License

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.

Notes

  • 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 subprocess stdin and stdout are redirected into $TMP/omc_home/omc.log.

  • Running 1 test in gradle: gradle test --tests <TESTNAME>

About

API for communication with the OpenModelica Compiler

Resources

License

Stars

Watchers

Forks

Packages

No packages published