Skip to content

Commit

Permalink
Merge branch 'release/2020.18.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Aug 27, 2020
2 parents 6adbb71 + d206c0a commit 2638e8f
Show file tree
Hide file tree
Showing 178 changed files with 5,391 additions and 4,033 deletions.
2 changes: 1 addition & 1 deletion .gradle-wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 6 additions & 6 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<!-- Used by org.influxdb: influxdb-java -->
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi</artifactId>
<version>1.9.3</version>
<version>1.10.0</version>
</dependency>
<dependency>
<!-- Used by org.influxdb: influxdb-java -->
Expand Down Expand Up @@ -177,7 +177,7 @@
<dependency>
<groupId>org.dhatim</groupId>
<artifactId>fastexcel</artifactId>
<version>0.10.16</version>
<version>0.10.17</version>
</dependency>
<dependency>
<groupId>org.eclipse.platform</groupId>
Expand Down Expand Up @@ -207,12 +207,12 @@
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-log4j1</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
Expand All @@ -233,13 +233,13 @@
<!-- Used by io.openems.backend.metadata.odoo -->
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.14</version>
<version>42.2.16</version>
</dependency>
<dependency>
<!-- Used by io.openems.edge.timedata.rrd4j -->
<groupId>org.rrd4j</groupId>
<artifactId>rrd4j</artifactId>
<version>3.6</version>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/single_document.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= OpenEMS - Open Energy Management System
ifndef::toc[]
(c) 2020 OpenEMS Association e.V.
Version 2020.17.0
Version 2020.18.0
:sectnums:
:sectnumlevels: 4
:toc:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bnd_version=5.0.0
bnd_version=5.0.0
6 changes: 3 additions & 3 deletions io.openems.backend.application/BackendApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
org.apache.servicemix.bundles.ws-commons-util;version='[1.0.2,1.0.3)',\
org.apache.servicemix.bundles.xmlrpc-client;version='[3.1.3,3.1.4)',\
org.jsr-305;version='[3.0.2,3.0.3)',\
org.ops4j.pax.logging.pax-logging-api;version='[2.0.4,2.0.5)',\
org.ops4j.pax.logging.pax-logging-log4j1;version='[2.0.4,2.0.5)',\
org.ops4j.pax.logging.pax-logging-api;version='[2.0.5,2.0.6)',\
org.ops4j.pax.logging.pax-logging-log4j1;version='[2.0.5,2.0.6)',\
org.osgi.service.jdbc;version='[1.0.0,1.0.1)',\
org.osgi.util.function;version='[1.1.0,1.1.1)',\
org.osgi.util.promise;version='[1.1.1,1.1.2)',\
org.postgresql.jdbc;version='[42.2.14,42.2.15)'
org.postgresql.jdbc;version='[42.2.16,42.2.17)'
2 changes: 1 addition & 1 deletion io.openems.backend.metadata.odoo/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Bundle-Version: 1.0.0.${tstamp}
io.openems.backend.metadata.api,\
io.openems.common,\
org.apache.servicemix.bundles.xmlrpc-client,\
org.postgresql.jdbc;version=42.2.14
org.postgresql.jdbc;version=42.2.16

-testpath: \
${testpath}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@AttributeDefinition(name = "Database", description = "The database name")
String database();

@AttributeDefinition(name = "URL", description = "The InfluxDB server URL")
@AttributeDefinition(name = "URL", description = "The InfluxDB server IP address")
String url();

@AttributeDefinition(name = "Port", description = "The InfluxDB server port")
Expand All @@ -25,7 +25,7 @@

@AttributeDefinition(name = "Measurement", description = "The InfluxDB measurement")
String measurement() default "data";

@AttributeDefinition(name = "Retention-Policy", description = "The InfluxDB retention policy")
String retentionPolicy() default "autogen";

Expand Down
3 changes: 2 additions & 1 deletion io.openems.common/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Bundle-Version: 1.0.0.${tstamp}
-buildpath: \
${buildpath},\
io.openems.wrapper.fastexcel,\
io.openems.wrapper.opczip,\
Java-WebSocket;version=1.4.1,\
org.ops4j.pax.logging.pax-logging-api,\

-testpath: \
${testpath}

Expand Down
4 changes: 2 additions & 2 deletions io.openems.common/src/io/openems/common/OpenemsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class OpenemsConstants {
*
* This is usually the number of the sprint within the year
*/
public final static short VERSION_MINOR = 17;
public final static short VERSION_MINOR = 18;

/**
* The patch version of OpenEMS.
Expand Down Expand Up @@ -54,7 +54,7 @@ public class OpenemsConstants {
*
* Note: this should be max. 32 ASCII characters long
*/
public final static String MANUFACTURER_MODEL = "";
public final static String MANUFACTURER_MODEL = "OpenEMS";

/**
* The options of the device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public enum OpenemsError {
JSON_NO_ENUM_MEMBER(5018, "JSON [%s:%s] is not an Enum"), //
JSON_NO_INET4ADDRESS(5020, "JSON [%s] is not an IPv4 address"), //
JSON_NO_ENUM(5021, "JSON [%s] is not an Enum"), //
JSON_NO_FLOAT(5022, "JSON [%s] is not a Float"), //
/*
* XML Errors. 6000-6999
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public JsonrpcRequest(UUID id, String method) {
}

public UUID getId() {
return id;
return this.id;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.TreeSet;
import java.util.UUID;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

import io.openems.common.exceptions.OpenemsException;
import io.openems.common.exceptions.OpenemsError.OpenemsNamedException;
import io.openems.common.exceptions.OpenemsException;
import io.openems.common.jsonrpc.base.JsonrpcRequest;
import io.openems.common.types.ChannelAddress;
import io.openems.common.utils.JsonUtils;

/**
Expand All @@ -28,101 +24,61 @@
* "params": {
* "timezone": Number,
* "fromDate": YYYY-MM-DD,
* "toDate": YYYY-MM-DD,
* "dataChannels": ChannelAddress[],
* "energyChannels": ChannelAddress[]
* "toDate": YYYY-MM-DD
* }
* }
* </pre>
*/
public class QueryHistoricTimeseriesExportXlxsRequest extends JsonrpcRequest {

public final static String METHOD = "queryHistoricTimeseriesExportXlxs";
public static final String METHOD = "queryHistoricTimeseriesExportXlxs";

private final static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_LOCAL_DATE;
private static final DateTimeFormatter FORMAT = DateTimeFormatter.ISO_LOCAL_DATE;

public static QueryHistoricTimeseriesExportXlxsRequest from(JsonrpcRequest r) throws OpenemsNamedException {
JsonObject p = r.getParams();
JsonObject p = r.getParams();
int timezoneDiff = JsonUtils.getAsInt(p, "timezone");
ZoneId timezone = ZoneId.ofOffset("", ZoneOffset.ofTotalSeconds(timezoneDiff * -1));
ZonedDateTime fromDate = JsonUtils.getAsZonedDateTime(p, "fromDate", timezone);
ZonedDateTime toDate = JsonUtils.getAsZonedDateTime(p, "toDate", timezone).plusDays(1);
QueryHistoricTimeseriesExportXlxsRequest result = new QueryHistoricTimeseriesExportXlxsRequest(r.getId(), fromDate, toDate);

JsonArray datachannels = JsonUtils.getAsJsonArray(p, "dataChannels");
for (JsonElement channel : datachannels) {
ChannelAddress address = ChannelAddress.fromString(JsonUtils.getAsString(channel));
result.addDataChannel(address);
}
JsonArray energyChannels = JsonUtils.getAsJsonArray(p, "energyChannels");
for (JsonElement channel : energyChannels) {
ChannelAddress address = ChannelAddress.fromString(JsonUtils.getAsString(channel));
result.addEnergyChannel(address);
}
QueryHistoricTimeseriesExportXlxsRequest result = new QueryHistoricTimeseriesExportXlxsRequest(r.getId(),
fromDate, toDate);
return result;

}

private final int timezoneDiff;
private final ZonedDateTime fromDate;
private final ZonedDateTime toDate;
private final TreeSet<ChannelAddress> dataChannels = new TreeSet<>();
private final TreeSet<ChannelAddress> energyChannels = new TreeSet<>();

public QueryHistoricTimeseriesExportXlxsRequest(UUID id, ZonedDateTime fromDate, ZonedDateTime toDate)
throws OpenemsNamedException {
super(id, METHOD);

this.timezoneDiff = ZoneOffset.from(fromDate).getTotalSeconds();
if (timezoneDiff != ZoneOffset.from(toDate).getTotalSeconds()) {
if (this.timezoneDiff != ZoneOffset.from(toDate).getTotalSeconds()) {
throw new OpenemsException("FromDate and ToDate need to be in the same timezone!");
}

this.fromDate = fromDate;
this.toDate = toDate;
}

private void addDataChannel(ChannelAddress address) {
this.dataChannels.add(address);
}

private void addEnergyChannel(ChannelAddress address) {
this.energyChannels.add(address);
}

@Override
public JsonObject getParams() {
JsonArray dataChannels = new JsonArray();
for (ChannelAddress address : this.dataChannels) {
dataChannels.add(address.toString());
}
JsonArray energyChannels = new JsonArray();
for (ChannelAddress address : this.dataChannels) {
energyChannels.add(address.toString());
}
return JsonUtils.buildJsonObject() //
.addProperty("timezone", this.timezoneDiff) //
.addProperty("fromDate", FORMAT.format(this.fromDate)) //
.addProperty("toDate", FORMAT.format(this.toDate)) //
.add("dataChannels", dataChannels) //
.add("energyChannels", energyChannels)
.build();
}

public ZonedDateTime getFromDate() {
return fromDate;
return this.fromDate;
}

public ZonedDateTime getToDate() {
return toDate;
}

public TreeSet<ChannelAddress> getDataChannels() {
return dataChannels;
}

public TreeSet<ChannelAddress> getEnergyChannels() {
return energyChannels;
return this.toDate;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.openems.common.jsonrpc.request;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -41,7 +42,7 @@ public static SetGridConnScheduleRequest from(JsonrpcRequest r) throws OpenemsNa
return new SetGridConnScheduleRequest(r.getId(), edgeId, schedule);
}

public final static String METHOD = "setGridConnSchedule";
public static final String METHOD = "setGridConnSchedule";

private final String edgeId;
private final List<GridConnSchedule> schedule;
Expand Down Expand Up @@ -77,11 +78,11 @@ public JsonObject getParams() {
}

public String getEdgeId() {
return edgeId;
return this.edgeId;
}

public List<GridConnSchedule> getSchedule() {
return schedule;
return this.schedule;
}

public static class GridConnSchedule {
Expand All @@ -94,6 +95,7 @@ public static List<GridConnSchedule> from(JsonArray j) throws OpenemsNamedExcept
int activePowerSetPoint = JsonUtils.getAsInt(se, "activePowerSetPoint");
schedule.add(new GridConnSchedule(startTimestamp, duration, activePowerSetPoint));
}
schedule.sort(Comparator.comparing(GridConnSchedule::getStartTimestamp).reversed());
return schedule;
}

Expand All @@ -102,6 +104,8 @@ public static List<GridConnSchedule> from(JsonArray j) throws OpenemsNamedExcept
private final int activePowerSetPoint;

/**
* Construct an instance of {@link GridConnSchedule}.
*
* @param startTimestamp epoch in seconds
* @param duration in seconds
* @param activePowerSetPoint in Watt
Expand All @@ -113,15 +117,15 @@ public GridConnSchedule(long startTimestamp, int duration, int activePowerSetPoi
}

public long getStartTimestamp() {
return startTimestamp;
return this.startTimestamp;
}

public int getDuration() {
return duration;
return this.duration;
}

public int getActivePowerSetPoint() {
return activePowerSetPoint;
return this.activePowerSetPoint;
}

public JsonObject toJson() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public Base64PayloadResponse(UUID id, byte[] payload) {
this.payload = Base64.getEncoder().encodeToString(payload);
}

public String getPayload() {
return this.payload;
}

@Override
public JsonObject getResult() {
return JsonUtils.buildJsonObject() //
Expand Down
Loading

0 comments on commit 2638e8f

Please sign in to comment.