Skip to content

Commit

Permalink
Merge branch 'release/2024.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Jan 1, 2024
2 parents 9aae11e + af757b3 commit 29e0231
Show file tree
Hide file tree
Showing 263 changed files with 4,567 additions and 2,407 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build OpenEMS
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- develop

jobs:
build-java:
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ jobs:

- uses: kiancross/checkstyle-annotations-action@v1

- name: Validate BackendApp.bndrun and EdgeApp.bndrun
run: git diff --exit-code io.openems.backend.application/BackendApp.bndrun io.openems.edge.application/EdgeApp.bndrun
- name: Build all Java packages
run: ./gradlew build

- name: Clean Edge+Backend assets
run: ./gradlew cleanEdge cleanBackend
- name: Resolve OpenEMS bundles
run: ./gradlew resolve

- name: Validate BackendApp.bndrun
run: git diff --exit-code io.openems.backend.application/BackendApp.bndrun

- name: Validate EdgeApp.bndrun
run: git diff --exit-code io.openems.edge.application/EdgeApp.bndrun

- name: Prepare Edge+Backend assets
run: ./gradlew buildEdge buildBackend
Expand Down Expand Up @@ -63,6 +69,9 @@ jobs:
npm ci --prefer-offline --cache ~/.npm
node_modules/.bin/ng config cli.cache.path "~/.ng"
node_modules/.bin/ng build -c "openems,openems-edge-prod,prod"
node_modules/.bin/ng lint
export CHROME_BIN=/usr/bin/google-chrome-stable
npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
- name: Prepare UI asset
run: |
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ typings/

### Gradle ###
.gradle
**/build/
# do not ignore '/doc/build' directory
!*doc/build/
/build/

# Ignore Gradle GUI config
gradle-app.setting
Expand Down Expand Up @@ -231,4 +229,4 @@ io.openems.edge.controller.api.mqtt/edge0
io.openems.edge.application/c:/

### Debian ###
!tools/debian/**
!tools/debian/**
Binary file modified .gradle-wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion .gradle-wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ task copyBundleReadmes() {
return // ignore
}

} else if(bundle.startsWith("io.openems.wrapper")) {
} else if(bundle.startsWith("io.openems.wrapper")
|| bundle.startsWith("io.openems.oem.")) {
// ignore
return
}
Expand Down
2 changes: 1 addition & 1 deletion cnf/build.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ buildpath: \
org.osgi.service.metatype;version='1.4.1',\
org.osgi.service.metatype.annotations;version='1.4.1',\
org.osgi.util.promise;version='1.2.0',\
com.google.guava;version='32.1.3.jre',\
com.google.guava;version='33.0.0.jre',\
com.google.gson;version='2.10.1',\

testpath: \
Expand Down
24 changes: 12 additions & 12 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.3-jre</version>
<version>33.0.0-jre</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -60,7 +60,7 @@
<!-- Used by com.squareup.okhttp3: okhttp -->
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.6.0</version>
<version>3.7.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb-client -->
Expand Down Expand Up @@ -109,7 +109,7 @@
<!-- Changelog: https://commons.apache.org/proper/commons-io/changes-report.html -->
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.0</version>
<version>2.15.1</version>
</dependency>
<!-- de -->
<dependency>
Expand Down Expand Up @@ -174,7 +174,7 @@
<!-- Used by SDNotify -->
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.13.0</version>
<version>5.14.0</version>
</dependency>
<!-- org -->
<dependency>
Expand Down Expand Up @@ -215,7 +215,7 @@
<!-- Changelog: https://github.com/apache/felix-dev/commits/master/http -->
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.jetty</artifactId>
<version>5.1.4</version>
<version>5.1.6</version>
</dependency>
<dependency>
<!-- Apache Felix Servlet API -->
Expand Down Expand Up @@ -266,7 +266,7 @@
<dependency>
<groupId>org.dhatim</groupId>
<artifactId>fastexcel</artifactId>
<version>0.16.4</version>
<version>0.16.5</version>
</dependency>
<dependency>
<!-- Eclipse Paho MQTTv5 Client -->
Expand All @@ -277,22 +277,22 @@
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-java</artifactId>
<version>6.10.0</version>
<version>6.12.0</version>
</dependency>
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-core</artifactId>
<version>6.10.0</version>
<version>6.12.0</version>
</dependency>
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-utils</artifactId>
<version>6.10.0</version>
<version>6.12.0</version>
</dependency>
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>flux-dsl</artifactId>
<version>6.10.0</version>
<version>6.12.0</version>
</dependency>
<dependency>
<groupId>org.java-websocket</groupId>
Expand All @@ -302,7 +302,7 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-osgi-bundle</artifactId>
<version>1.9.21</version>
<version>1.9.22</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
Expand Down Expand Up @@ -400,7 +400,7 @@
<!-- Used by io.openems.backend.metadata.odoo -->
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.0</version>
<version>42.7.1</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb -->
Expand Down
1 change: 0 additions & 1 deletion doc/.gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions doc/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mode_modules/
/www/
8 changes: 3 additions & 5 deletions doc/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"name": "openems-doc",
"version": "1.0.0",
"dependencies": {
"@antora/cli": "^3.1.1",
"@antora/site-generator-default": "^3.1.1"
},
"devDependencies": {}
}
"antora": "^3.1.6"
}
}
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/backend/timedata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:imagesdir: ../../assets/images

Live and historical data of an OpenEMS Edge are handled by a https://github.com/OpenEMS/openems/blob/develop/io.openems.backend.common/src/io/openems/backend/common/timedata/Timedata.java[Timedata] service.
It describes basically methods to write and read Edge data to/from a database. There are different kind of timedata providers within OpenEMS (see xref:service.adoc[Service] for concrete implementations).
It describes basically methods to write and read Edge data to/from a database. There are different kind of timedata providers within OpenEMS (see xref:backend/service.adoc[Service] for concrete implementations).

Within OpenEMS Backend the only component which uses the different timedata services directly is the https://github.com/OpenEMS/openems/blob/develop/io.openems.backend.core/src/io/openems/backend/core/timedatamanager/TimedataManagerImpl.java[TimedataManager].
It passes Edge relevant data to **all** Timedata service and it reads the data from the **first** Timedata providers which can deliver it.
Expand Down Expand Up @@ -41,5 +41,5 @@ Also due to performance reasons the computation of `AggregatedDataNotification`
This helps keeping CPU load on the database server low.

To get a better understanding of the new Edge data concept, have a look at the
xref:service.adoc.d/io.openems.backend.timedata.aggregatedinflux.adoc[Aggregated Influx] bundle.
xref:backend/service.adoc.d/io.openems.backend.timedata.aggregatedinflux.adoc[Aggregated Influx] bundle.

2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/edge/implement.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ If you experience any errors you can always run OpenEMS Edge using the btn:[Debu

=== Alternative Device Development Flow

Instead of adding the device to the btn:[EdgeApp.bndrun] file (as described in xref:implement.adoc#_enable_the_component[Enable the Component]), the device can be loaded dynamically by using [Apache Felix File Install]. Copying the device's built jar file into a `load` folder, relative to the project's root directory. Apache Felix File Install watches this folder and handles the device automatically.
Instead of adding the device to the btn:[EdgeApp.bndrun] file (as described in xref:#_enable_the_component[Enable the Component]), the device can be loaded dynamically by using [Apache Felix File Install]. Copying the device's built jar file into a `load` folder, relative to the project's root directory. Apache Felix File Install watches this folder and handles the device automatically.

The folder is configurable by supplying the `felix.fileinstall.dir` option when starting the edge app. More configuration options can be found in the https://felix.apache.org/documentation/subprojects/apache-felix-file-install.html[Apache Felix File Install documentation].

Expand Down
24 changes: 23 additions & 1 deletion doc/tools/create_single_page_html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,26 @@ cd ${DIR}/../modules/ROOT/pages

echo "Creating ${DIR}/../modules/ROOT/pages/single_document.html"

asciidoctor -b html5 -o single_document.html single_document.adoc
SED_ARG="s/xref:/include::/"
for NUM in $(seq 1 1 5); do
SED_ARG="${SED_ARG} -e s/^*\{$NUM\}.\(inc.*\)\[.*\]$/\1[leveloffset=+$NUM]/"
done

cat << SEC | asciidoctor -b html5 -o single_document.html -
= OpenEMS - Open Energy Management System
ifndef::toc[]
(c) 2023 OpenEMS Association e.V.
:doctype: book
:sectnums:
:sectnumlevels: 4
:toc:
:toclevels: 2
:toc-title: Inhalt
:experimental:
:keywords: AsciiDoc
:source-highlighter: highlight.js
:icons: font
endif::toc[]
$(cat ../nav.adoc | sed -e $(echo ${SED_ARG}) -e 's/^* \(.*\)$/== \1/g' | head -n-1)
SEC
24 changes: 23 additions & 1 deletion doc/tools/create_single_page_pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,26 @@ cd ${DIR}/../modules/ROOT/${LANG}

echo "Creating ${DIR}/../modules/ROOT/${LANG}/single_document.pdf"

asciidoctor-pdf -o single_document.pdf single_document.adoc
SED_ARG="s/xref:/include::/"
for NUM in $(seq 1 1 5); do
SED_ARG="${SED_ARG} -e s/^*\{$NUM\}.\(inc.*\)\[.*\]$/\1[leveloffset=+$NUM]/"
done

cat << SEC | asciidoctor-pdf -o single_document.pdf -
= OpenEMS - Open Energy Management System
ifndef::toc[]
(c) 2023 OpenEMS Association e.V.
:doctype: book
:sectnums:
:sectnumlevels: 4
:toc:
:toclevels: 2
:toc-title: Inhalt
:experimental:
:keywords: AsciiDoc
:source-highlighter: highlight.js
:icons: font
endif::toc[]
$(cat ../nav.adoc | sed -e $(echo ${SED_ARG}) -e 's/^* \(.*\)$/== \1/g' | head -n-1)
SEC
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.openems.backend.alerting.scheduler.MessageSchedulerService;
import io.openems.backend.alerting.scheduler.TimedExecutor;
import io.openems.backend.alerting.scheduler.TimedExecutor.TimedTask;
import io.openems.backend.common.metadata.AlertingSetting;
import io.openems.backend.common.metadata.UserAlertingSettings;
import io.openems.backend.common.metadata.Edge;
import io.openems.backend.common.metadata.Mailer;
import io.openems.backend.common.metadata.Metadata;
Expand Down Expand Up @@ -175,7 +175,7 @@ protected OfflineEdgeMessage getEdgeMessage(Edge edge) {
return null;
}

private boolean shouldReceiveMail(Edge edge, AlertingSetting setting) {
private boolean shouldReceiveMail(Edge edge, UserAlertingSettings setting) {
final var lastMailRecievedAt = setting.getLastNotification();
final var edgeOfflineSince = edge.getLastmessage();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
import com.google.gson.JsonPrimitive;

import io.openems.backend.alerting.Message;
import io.openems.backend.common.metadata.AlertingSetting;
import io.openems.backend.common.metadata.UserAlertingSettings;
import io.openems.common.utils.JsonUtils;

public class OfflineEdgeMessage extends Message {

public static final String TEMPLATE = "alerting_email";

private final ZonedDateTime offlineAt;
private final TreeMap<Integer, List<AlertingSetting>> recipients;
private final TreeMap<Integer, List<UserAlertingSettings>> recipients;

private OfflineEdgeMessage(String edgeId, ZonedDateTime offlineAt, TreeMap<Integer, List<AlertingSetting>> map) {
private OfflineEdgeMessage(String edgeId, ZonedDateTime offlineAt, TreeMap<Integer, List<UserAlertingSettings>> map) {
super(edgeId);
this.offlineAt = offlineAt;
this.recipients = map;
Expand All @@ -41,13 +41,13 @@ public ZonedDateTime getNotifyStamp() {
*
* @param setting of user to whom to send the mail to
*/
public void addRecipient(AlertingSetting setting) {
public void addRecipient(UserAlertingSettings setting) {
this.recipients.putIfAbsent(setting.getDelayTime(), new ArrayList<>());
var settings = this.recipients.get(setting.getDelayTime());
settings.add(setting);
}

public List<AlertingSetting> getCurrentRecipients() {
public List<UserAlertingSettings> getCurrentRecipients() {
return this.recipients.get(this.recipients.firstKey());
}

Expand Down Expand Up @@ -84,7 +84,7 @@ public JsonObject getParams() {

@Override
public String toString() {
var rec = this.getCurrentRecipients().stream().map(AlertingSetting::getUserId).collect(Collectors.joining(","));
var rec = this.getCurrentRecipients().stream().map(UserAlertingSettings::getUserId).collect(Collectors.joining(","));
return "OfflineEdgeMessage{for=" + this.getEdgeId() + ", to=[" + rec + "], at=" + this.getNotifyStamp() + "}";
}
}
Loading

0 comments on commit 29e0231

Please sign in to comment.