diff --git a/.gitignore b/.gitignore index 18551ca6ac6..18e3a399048 100644 --- a/.gitignore +++ b/.gitignore @@ -231,4 +231,7 @@ io.openems.edge.controller.api.mqtt/edge0 io.openems.edge.application/c:/ ### Debian ### -!tools/debian/** \ No newline at end of file +!tools/debian/** + +# Exclude config.d files which are generated by executing the start scripts +/config.d/ \ No newline at end of file diff --git a/scripts/start-edge.sh b/scripts/start-edge.sh new file mode 100755 index 00000000000..8313a70f76c --- /dev/null +++ b/scripts/start-edge.sh @@ -0,0 +1,24 @@ +#!/usr/bin/zsh + +echo "Starting OpenEMS Edge" + +SCRIPTS_DIR="$( cd "$(dirname "$0")" ; pwd -P )" +WORK_DIR="$(dirname "$SCRIPTS_DIR")" +BUILD_DIR="$WORK_DIR/build" +PATH_TO_OPENEMS_EDGE_JAR="$BUILD_DIR/openems-edge.jar" +FELIX_CM_DIR="$WORK_DIR/config.d" + +# check if openems-edge.jar exists +if [ ! -f "$PATH_TO_OPENEMS_EDGE_JAR" ]; then + echo "openems-edge.jar not found. Please run './gradlew buildEdge' first." >&2 + exit 1 +fi + +# check if Java 17 is active +if [[ $(java -version 2>&1) != *"17"* ]]; then + echo "Java 17 is not active. Please run 'sdk use java 17'" >&2 + exit 1 +fi + + +java -agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n -XX:+ExitOnOutOfMemoryError -Dfelix.cm.dir="$FELIX_CM_DIR" -Djava.util.concurrent.ForkJoinPool.common.parallelism=100 -jar "$PATH_TO_OPENEMS_EDGE_JAR" \ No newline at end of file diff --git a/scripts/start-ui.sh b/scripts/start-ui.sh new file mode 100755 index 00000000000..170845bd18d --- /dev/null +++ b/scripts/start-ui.sh @@ -0,0 +1,19 @@ +#!/usr/bin/zsh + +echo "Starting OpenEMS UI" + +SCRIPTS_DIR="$( cd "$(dirname "$0")" ; pwd -P )" +WORK_DIR="$(dirname "$SCRIPTS_DIR")" + +cd "$WORK_DIR/ui" + +# check if @angular/cli is installed globally +if ! command -v ng &> /dev/null +then + echo "@angular/cli is not installed globally. Please run 'npm install -g @angular/cli'" >&2 + exit 1 +fi + +npm install +#Run OpenEMS UI +ng serve -c openems-edge-dev