Skip to content

THM-MoTE/mope-server

Repository files navigation

MoPE - Modelica Integration for Editors

MoPE

MoPE brings IDE-features for Modelica into your favourite Editor.

Note
This is the server-process for MoPE.
Caution
Since Version 0.6.2 the JModelica support is broken due to changes in the compiler commmunication.

Subprojects

MoPE uses the following sub projects:

Running as Docker Container

This repository contains a docker-compose file which starts a local docker container containing OpenModelica and MoPE. The compose file mounts your home directory into the container. You don’t have to install OpenModelica locally, just docker and docker-compose. Just start the compose file through: docker-compose up and you are all set for projects inside your home directory.

Developer setup

Important
Installation instructions for users are available here.

The following guide is for developers:

  1. Please install OpenModelica and check that its working correctly (which omc).

  2. Install a Java JDK (version >= 8) and sbt.

  3. Set up a $JAVA_HOME environment variable. On Linux-Systems you can create one by adding the following line to your ~/.bashrc-file:

    export JAVA_HOME=<path-to-java>
    Tip
    There is a script which automates step 4 till 6 and 8 available: setup.sh
  4. Because MoPE uses sub projects you need to clone all sub projects and this project into one directory. This should look like this:

    parent/
      - mope-server/
      - omc-java-api/
      - EnhancedWatchService/
      - recently/
  5. compile the omc-java-api:

    $ cd omc-java-api/
    $ sbt compile
  6. open up sbt in the mope-server and type compile into the sbt prompt:

    $ cd mope-server/
    $ sbt
    sbt: compile
  7. Execute run to start the server. MoPE will produce several logs during runtime. Especially the starting log should look similar to this:

    [info] Running de.thm.mope.MoPE
    2016-07-08 19:26:50,077 [INFO ] a.e.s.Slf4jLogger [] - Slf4jLogger started
    2016-07-08 19:26:50,077 [INFO ] a.e.s.Slf4jLogger [] - Slf4jLogger started
    2016-07-08 19:26:50,828 [INFO ] d.t.m.s.Server [mope-server] - Server running at localhost:9001
    2016-07-08 19:26:50,838 [INFO ] d.t.m.s.Server [mope-server] - Press Enter to interrupt

    The log tells you on which server (localhost) and port (9001) the server is listening.

  8. Setup the Atom plugin

  9. Set the interface and port in the Atom plugin in order to connect to the server.

Note

After first execution, MoPE generates a configuration file located at ~/.mope/mope.conf. You can change it to suit your needs.

DO NOT CHANGE THE akka { .. }-SECTION! If you messed up your configuration just kill the whole ~/.moie directory.

Creating a jar

You can create an executable-jar using the sbt assembly command. This command packages everything - including all dependencies - in one jar which is executable using java -jar <jar>.

REST-API / Protocol documentation

A documentation for the REST-API can be found in doc/protocol/. The documentation is in asciidoc and can be converted into html or pdf by executing make html & make pdf in the protocl directory.

Notes

  • The idea of an server-process and several editors that are communicating with the server isn’t new. This project is heavily inspired by the ENSIME-project. ENSIME is a convenient way to develop Scala projects. If you are a Scala developer please give it a try.

Note
Our main goal is to provide a similar development environment for Modelica like ENSIME for Scala.