Start met EmbeddedControl lib
This commit is contained in:
14
exporttest/export_controller.log
Normal file
14
exporttest/export_controller.log
Normal file
@@ -0,0 +1,14 @@
|
||||
true
|
||||
true
|
||||
"Check of EmbeddedControl.Math.DDifference completed successfully.
|
||||
Class EmbeddedControl.Math.DDifference has 4 equation(s) and 4 variable(s).
|
||||
1 of these are trivial equation(s)."
|
||||
|
||||
Notification: Automatically loaded package Modelica 4.1.0 due to uses annotation from EmbeddedControl.
|
||||
Notification: Automatically loaded package Complex 4.1.0 due to uses annotation from Modelica.
|
||||
Notification: Automatically loaded package ModelicaServices 4.1.0 due to uses annotation from Modelica.
|
||||
|
||||
true
|
||||
translateModel(test2d.Dcontroller) = true
|
||||
|
||||
|
||||
11
exporttest/export_controller.mos
Normal file
11
exporttest/export_controller.mos
Normal file
@@ -0,0 +1,11 @@
|
||||
setCommandLineOptions("--simCodeTarget=ExperimentalEmbeddedC");
|
||||
|
||||
loadFile("/work/EmbeddedControl.mo");
|
||||
|
||||
okCheck := checkModel(EmbeddedControl.Math.DDifference);
|
||||
print("checkModel(EmbeddedControl.Math.DDifference) = " + String(okCheck) + "\n");
|
||||
print(getErrorString());
|
||||
|
||||
okTranslate := translateModel(EmbeddedControl.Math.DDifference, fileNamePrefix="difference");
|
||||
print("translateModel(test2d.Dcontroller) = " + String(okTranslate) + "\n");
|
||||
print(getErrorString());
|
||||
19
exporttest/run_mos_docker.sh
Executable file
19
exporttest/run_mos_docker.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
MOS_FILE="/work/exporttest/export_controller.mos"
|
||||
LOG_FILE="$ROOT_DIR/exporttest/export_controller.log"
|
||||
|
||||
docker run --rm \
|
||||
-v "$ROOT_DIR:/work" \
|
||||
-v "$HOME/.openmodelica/libraries:/home/ubuntu/.openmodelica/libraries:ro" \
|
||||
-w /work/exporttest/out \
|
||||
openmodelica omc "$MOS_FILE" 2>&1 | tee "$LOG_FILE"
|
||||
|
||||
if grep -E "Error:|= false" "$LOG_FILE" >/dev/null; then
|
||||
echo "Failed. See: $LOG_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Success. Log: $LOG_FILE"
|
||||
Reference in New Issue
Block a user