This Readme currently provides a guideline to set up the MopeConsoleClient:
• Guide currently is only for linux systems due to a omc path issue on windows
• We currently work on delivering jars to make the setup easier
-
Install Openmodelica as guided here or below:
1.1 Open a terminal/shell
1.2 To update the sources.list of the releases, execute:
for deb in deb deb-src; do echo "$deb http://build.openmodelica.org/apt `lsb_release -cs` stable"; done | sudo tee /etc/apt/sources.list.d/openmodelica.list
1.3 Execute the following command to import the GPG key used to sign the releases :
wget -q http://build.openmodelica.org/apt/openmodelica.asc -O- | sudo apt-key add -
1.4 Execute
sudo apt update
, then executesudo apt install openmodelica
-
Install a Java JDK (version >= 11). 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>
-
Inside your terminal, navigate to the folder where you want to clone the repository. Then execute
git clone [email protected]:MopeSWTP-SS21/LspConsole.git
-
Navigate to the newly cloned folder LspConsole to get finally started using the server and consoleclient.
| TIP: It is recommended to start two instances of the shell, one for the server task and one for the client task. |
-
Execute
./gradlew startMopeServer
in one of the shells. After the build is completed, the server should run on port 4200. -
Execute
./gradlew startConsoleClient
in the other shell. -
After the build is completed, you are asked for the serverip & serverport.
• Serverip: Type
127.0.0.1
orlocalhost
and confirm.• Port: Type 4200 and confirm.
-
You are now connected with the server and can control it by typing and confirming the right instruction-number out oft the following list:
1: Initialize server
2: Get compiler version
3: Load File
4: Load model
5: Check Model
6: Initialize Model
7: Add Folder to ModelicaPath
8: Show ModelicaPath
9: Complete
10: Get Documentation
98: Exit - Disconnect
99: Exit - Shutdown Server
-
1: Initialize server
Currently it is necessary to proceed this instruction as the first one to initialize the server and its capabilities. The Server will launch an Instance of OMC, connect to it and Load the ModelicaStandardLibrary.
-
After Initialization you can view the compiler version by typing
2
in the menue -
Typing
8
shows you the folder(s), which are in the scope of modelica and where your models are stored -
Typing
7
lets you add a folder to the modelica path. Obviously, this folder should contain at least one model. -
The commands
3
,4
,5
,6
are proposed for loading a file, loading a model, check a model or initialize a model -
Typing
9
allows you to use the completion feature. It will ask you for a file and you have to specify which line and column. -
Typing
10
will return a html-documentation to a provided modelica-class name. -
The commands
98
and99
are used to disconnect the client. Additionally command99
will shutdown the server.