Skip to content

Commit

Permalink
Merge branch 'release/2019.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Sep 12, 2019
2 parents 141cd4b + 2871440 commit f320676
Show file tree
Hide file tree
Showing 169 changed files with 7,857 additions and 2,578 deletions.
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ matrix:
- ./gradlew build -x test
- ./gradlew buildAggregatedJavadocs --continue
- ./gradlew buildAntoraDocs --continue
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
on:
branch: develop
repo: OpenEMS/openems.io
target-branch: master
local-dir: build/www

- language: node_js
node_js:
- 10
script:
- ./gradlew buildUiForEdge --continue

deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
on:
branch: develop
repo: OpenEMS/openems.io
target-branch: master
local-dir: build/www
10 changes: 5 additions & 5 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>com.fazecast</groupId>
<artifactId>jSerialComm</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>com.ghgande</groupId>
Expand Down Expand Up @@ -135,23 +135,23 @@
<dependency>
<groupId>org.msgpack</groupId>
<artifactId>msgpack-core</artifactId>
<version>0.8.17</version>
<version>0.8.18</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<version>1.11.0</version>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-service</artifactId>
<version>1.11.0</version>
<version>1.11.2</version>
</dependency>
<dependency>
<!-- Used by io.openems.backend.metadata.odoo -->
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.6</version>
<version>42.2.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) 2019 OpenEMS Association e.V.
Version 2019.10.0
Version 2019.11.0
:sectnums:
:sectnumlevels: 4
:toc:
Expand Down
8 changes: 4 additions & 4 deletions io.openems.backend.application/BackendApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
io.openems.backend.b2brest;version=snapshot,\
io.openems.wrapper.fastexcel;version=snapshot,\
io.openems.wrapper.opczip;version=snapshot,\
org.ops4j.pax.logging.pax-logging-api;version='[1.11.0,1.11.1)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.11.0,1.11.1)',\
org.postgresql.jdbc42;version='[42.2.6,42.2.7)',\
com.google.guava;version='[28.1.0,28.1.1)'
com.google.guava;version='[28.1.0,28.1.1)',\
org.postgresql.jdbc42;version='[42.2.7,42.2.8)',\
org.ops4j.pax.logging.pax-logging-api;version='[1.11.2,1.11.3)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.11.2,1.11.3)'
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,15 @@ private CompletableFuture<GenericJsonrpcResponseSuccess> handleSetGridConnSchedu

// Wrap reply in GenericJsonrpcResponseSuccess
CompletableFuture<GenericJsonrpcResponseSuccess> result = new CompletableFuture<GenericJsonrpcResponseSuccess>();
resultFuture.thenAccept(r -> {
result.complete(new GenericJsonrpcResponseSuccess(messageId, r.toJsonObject()));
resultFuture.whenComplete((r, ex) -> {
if (ex != null) {
result.completeExceptionally(ex);
} else if (r != null) {
result.complete(new GenericJsonrpcResponseSuccess(messageId, r.toJsonObject()));
} else {
result.completeExceptionally(new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD,
SetGridConnScheduleRequest.METHOD));
}
});
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,15 @@ private CompletableFuture<GenericJsonrpcResponseSuccess> handleSetGridConnSchedu

// Wrap reply in GenericJsonrpcResponseSuccess
CompletableFuture<GenericJsonrpcResponseSuccess> result = new CompletableFuture<GenericJsonrpcResponseSuccess>();
resultFuture.thenAccept(r -> {
result.complete(new GenericJsonrpcResponseSuccess(messageId, r.toJsonObject()));
resultFuture.whenComplete((r, ex) -> {
if (ex != null) {
result.completeExceptionally(ex);
} else if (r != null) {
result.complete(new GenericJsonrpcResponseSuccess(messageId, r.toJsonObject()));
} else {
result.completeExceptionally(new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD,
SetGridConnScheduleRequest.METHOD));
}
});
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,20 @@ public CompletableFuture<JsonrpcResponseSuccess> send(String edgeId, User user,

// Unwrap Response
CompletableFuture<JsonrpcResponseSuccess> result = new CompletableFuture<JsonrpcResponseSuccess>();
responseFuture.thenAccept(r -> {
try {
AuthenticatedRpcResponse response = AuthenticatedRpcResponse.from(r);
result.complete(response.getPayload());
} catch (OpenemsNamedException e) {
this.logError(this.log, e.getMessage());
throw new RuntimeException(e.getMessage());
responseFuture.whenComplete((r, ex) -> {
if (ex != null) {
result.completeExceptionally(ex);
} else if (r != null) {
try {
AuthenticatedRpcResponse response = AuthenticatedRpcResponse.from(r);
result.complete(response.getPayload());
} catch (OpenemsNamedException e) {
this.logError(this.log, e.getMessage());
result.completeExceptionally(e);
}
} else {
result.completeExceptionally(
new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD, request.getMethod()));
}
});
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,15 @@ private CompletableFuture<EdgeRpcResponse> handleEdgeRpcRequest(WsData wsData, B

// Wrap reply in EdgeRpcResponse
CompletableFuture<EdgeRpcResponse> result = new CompletableFuture<EdgeRpcResponse>();
resultFuture.thenAccept(r -> {
result.complete(new EdgeRpcResponse(edgeRpcRequest.getId(), r));
resultFuture.whenComplete((r, ex) -> {
if (ex != null) {
result.completeExceptionally(ex);
} else if (r != null) {
result.complete(new EdgeRpcResponse(edgeRpcRequest.getId(), r));
} else {
result.completeExceptionally(
new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD, request.getMethod()));
}
});
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class OpenemsConstants {
*
* This is usually the number of the sprint within the year
*/
public final static short VERSION_MINOR = 10;
public final static short VERSION_MINOR = 11;

/**
* The patch version of OpenEMS.
Expand Down
21 changes: 8 additions & 13 deletions io.openems.edge.application/EdgeApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
bnd.identity;id='io.openems.edge.fenecon.dess',\
bnd.identity;id='io.openems.edge.fenecon.mini',\
bnd.identity;id='io.openems.edge.fenecon.pro',\
bnd.identity;id='io.openems.edge.goodwe.et',\
bnd.identity;id='io.openems.edge.io.kmtronic',\
bnd.identity;id='io.openems.edge.io.wago',\
bnd.identity;id='io.openems.edge.kostal.piko',\
Expand All @@ -83,20 +84,16 @@
bnd.identity;id='io.openems.edge.meter.microcare.sdm630',\
bnd.identity;id='io.openems.edge.meter.pqplus.umd97',\
bnd.identity;id='io.openems.edge.meter.socomec',\
bnd.identity;id='io.openems.edge.meter.sunspec',\
bnd.identity;id='io.openems.edge.meter.virtual',\
bnd.identity;id='io.openems.edge.meter.weidmueller',\
bnd.identity;id='io.openems.edge.predictor.persistencemodel',\
bnd.identity;id='io.openems.edge.pvinverter.kaco.blueplanet',\
bnd.identity;id='io.openems.edge.pvinverter.solarlog',\
bnd.identity;id='io.openems.edge.pvinverter.sunspec',\
bnd.identity;id='io.openems.edge.scheduler.allalphabetically',\
bnd.identity;id='io.openems.edge.scheduler.daily',\
bnd.identity;id='io.openems.edge.scheduler.fixedorder',\
bnd.identity;id='io.openems.edge.solaredge',\
bnd.identity;id='io.openems.edge.simulator',\
bnd.identity;id='io.openems.edge.tesla.powerwall2',\
bnd.identity;id='io.openems.edge.timedata.influxdb'
bnd.identity;id='io.openems.edge.timedata.influxdb',\
bnd.identity;id='io.openems.edge.tesla.powerwall2'

-runbundles: \
com.google.gson;version='[2.8.5,2.8.6)',\
Expand Down Expand Up @@ -151,6 +148,7 @@
io.openems.edge.fenecon.dess;version=snapshot,\
io.openems.edge.fenecon.mini;version=snapshot,\
io.openems.edge.fenecon.pro;version=snapshot,\
io.openems.edge.goodwe.et;version=snapshot,\
io.openems.edge.io.kmtronic;version=snapshot,\
io.openems.edge.io.wago;version=snapshot,\
io.openems.edge.kostal.piko;version=snapshot,\
Expand Down Expand Up @@ -191,7 +189,6 @@
io.openems.edge.meter.pqplus.umd97;version=snapshot,\
io.openems.edge.controller.pvinverter.fixpowerlimit;version=snapshot,\
io.openems.edge.controller.evcs.fixactivepower;version=snapshot,\
com.fazecast.jSerialComm;version='[2.5.1,2.5.2)',\
com.ghgande.j2mod;version='[2.5.5,2.5.6)',\
io.openems.edge.controller.ess.delaycharge;version=snapshot,\
io.openems.edge.meter.discovergy;version=snapshot,\
Expand All @@ -201,14 +198,12 @@
io.openems.edge.pvinverter.kaco.blueplanet;version=snapshot,\
io.openems.edge.controller.selltogridlimit;version=snapshot,\
com.sun.jna;version='[5.4.0,5.4.1)',\
org.ops4j.pax.logging.pax-logging-api;version='[1.11.0,1.11.1)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.11.0,1.11.1)',\
io.openems.edge.pvinverter.sunspec;version=snapshot,\
io.openems.edge.scheduler.daily;version=snapshot,\
io.openems.edge.meter.sunspec;version=snapshot,\
io.openems.edge.solaredge;version=snapshot,\
io.openems.edge.predictor.persistencemodel;version=snapshot,\
io.openems.edge.tesla.powerwall2;version=snapshot,\
io.openems.edge.evcs.cluster;version=snapshot,\
com.github.scribejava.core;version='[6.8.1,6.8.2)',\
com.google.guava;version='[28.1.0,28.1.1)'
com.google.guava;version='[28.1.0,28.1.1)',\
org.ops4j.pax.logging.pax-logging-api;version='[1.11.2,1.11.3)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.11.2,1.11.3)',\
com.fazecast.jSerialComm;version='[2.5.2,2.5.3)'
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface JsonApi {
* OpenemsError.JSONRPC_UNHANDLED_METHOD
* @throws OpenemsNamedException on error
*/
public CompletableFuture<JsonrpcResponseSuccess> handleJsonrpcRequest(User user, JsonrpcRequest request)
public CompletableFuture<? extends JsonrpcResponseSuccess> handleJsonrpcRequest(User user, JsonrpcRequest request)
throws OpenemsNamedException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,15 @@ private CompletableFuture<AuthenticatedRpcResponse> handleAuthenticatedRpcReques
}

CompletableFuture<AuthenticatedRpcResponse> result = new CompletableFuture<AuthenticatedRpcResponse>();
resultFuture.thenAccept(r -> {
result.complete(new AuthenticatedRpcResponse(authenticatedRpcRequest.getId(), r));
resultFuture.whenComplete((r, ex) -> {
if (ex != null) {
result.completeExceptionally(ex);
} else if (r != null) {
result.complete(new AuthenticatedRpcResponse(authenticatedRpcRequest.getId(), r));
} else {
result.completeExceptionally(
new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD, request.getMethod()));
}
});
return result;
}
Expand Down Expand Up @@ -217,7 +224,7 @@ private CompletableFuture<GenericJsonrpcResponseSuccess> handleComponentJsonApiR

// call JsonApi
JsonApi jsonApi = (JsonApi) component;
CompletableFuture<JsonrpcResponseSuccess> responseFuture = jsonApi.handleJsonrpcRequest(user,
CompletableFuture<? extends JsonrpcResponseSuccess> responseFuture = jsonApi.handleJsonrpcRequest(user,
request.getPayload());

// handle null response
Expand All @@ -227,8 +234,15 @@ private CompletableFuture<GenericJsonrpcResponseSuccess> handleComponentJsonApiR

// Wrap reply in EdgeRpcResponse
CompletableFuture<GenericJsonrpcResponseSuccess> edgeRpcResponse = new CompletableFuture<>();
responseFuture.thenAccept(response -> {
edgeRpcResponse.complete(new GenericJsonrpcResponseSuccess(request.getId(), response.getResult()));
responseFuture.whenComplete((r, ex) -> {
if (ex != null) {
edgeRpcResponse.completeExceptionally(ex);
} else if (r != null) {
edgeRpcResponse.complete(new GenericJsonrpcResponseSuccess(request.getId(), r.getResult()));
} else {
edgeRpcResponse.completeExceptionally(new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD,
request.getPayload().getMethod()));
}
});

return edgeRpcResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private CompletableFuture<JsonrpcResponseSuccess> handleComponentJsonApiRequest(

// call JsonApi
JsonApi jsonApi = (JsonApi) component;
CompletableFuture<JsonrpcResponseSuccess> responseFuture = jsonApi.handleJsonrpcRequest(user,
CompletableFuture<? extends JsonrpcResponseSuccess> responseFuture = jsonApi.handleJsonrpcRequest(user,
request.getPayload());

// handle null response
Expand All @@ -495,8 +495,15 @@ private CompletableFuture<JsonrpcResponseSuccess> handleComponentJsonApiRequest(

// Wrap reply in EdgeRpcResponse
CompletableFuture<JsonrpcResponseSuccess> edgeRpcResponse = new CompletableFuture<>();
responseFuture.thenAccept(response -> {
edgeRpcResponse.complete(new GenericJsonrpcResponseSuccess(request.getId(), response.getResult()));
responseFuture.whenComplete((r, ex) -> {
if (ex != null) {
edgeRpcResponse.completeExceptionally(ex);
} else if (r != null) {
edgeRpcResponse.complete(new GenericJsonrpcResponseSuccess(request.getId(), r.getResult()));
} else {
edgeRpcResponse.completeExceptionally(new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD,
request.getPayload().getMethod()));
}
});

return edgeRpcResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,15 @@ private CompletableFuture<EdgeRpcResponse> handleEdgeRpcRequest(WsData wsData, E

// Wrap reply in EdgeRpcResponse
CompletableFuture<EdgeRpcResponse> result = new CompletableFuture<EdgeRpcResponse>();
resultFuture.thenAccept(r -> {
result.complete(new EdgeRpcResponse(edgeRpcRequest.getId(), r));
resultFuture.whenComplete((r, ex) -> {
if (ex != null) {
result.completeExceptionally(ex);
} else if (r != null) {
result.complete(new EdgeRpcResponse(edgeRpcRequest.getId(), r));
} else {
result.completeExceptionally(
new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD, request.getMethod()));
}
});
return result;
}
Expand Down Expand Up @@ -357,7 +364,7 @@ private CompletableFuture<JsonrpcResponseSuccess> handleComponentJsonApiRequest(

// call JsonApi
JsonApi jsonApi = (JsonApi) component;
CompletableFuture<JsonrpcResponseSuccess> responseFuture = jsonApi.handleJsonrpcRequest(user,
CompletableFuture<? extends JsonrpcResponseSuccess> responseFuture = jsonApi.handleJsonrpcRequest(user,
request.getPayload());

// handle null response
Expand All @@ -367,8 +374,15 @@ private CompletableFuture<JsonrpcResponseSuccess> handleComponentJsonApiRequest(

// Wrap reply in new JsonrpcResponseSuccess
CompletableFuture<JsonrpcResponseSuccess> jsonrpcResponse = new CompletableFuture<>();
responseFuture.thenAccept(response -> {
jsonrpcResponse.complete(new GenericJsonrpcResponseSuccess(request.getId(), response.getResult()));
responseFuture.whenComplete((r, ex) -> {
if (ex != null) {
jsonrpcResponse.completeExceptionally(ex);
} else if (r != null) {
jsonrpcResponse.complete(new GenericJsonrpcResponseSuccess(request.getId(), r.getResult()));
} else {
jsonrpcResponse.completeExceptionally(new OpenemsNamedException(OpenemsError.JSONRPC_UNHANDLED_METHOD,
request.getPayload().getMethod()));
}
});

return jsonrpcResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import org.osgi.annotation.versioning.ProviderType;

import io.openems.common.channel.AccessMode;
import io.openems.common.channel.Level;
import io.openems.common.exceptions.OpenemsError.OpenemsNamedException;
import io.openems.edge.common.channel.Doc;
import io.openems.edge.common.channel.StateChannel;
import io.openems.edge.common.component.OpenemsComponent;
import io.openems.edge.common.modbusslave.ModbusSlaveNatureTable;
import io.openems.edge.common.modbusslave.ModbusType;

@ProviderType
public interface Controller extends OpenemsComponent {
Expand Down Expand Up @@ -42,4 +45,9 @@ public default StateChannel getRunFailed() {
return this.channel(ChannelId.RUN_FAILED);
}

public static ModbusSlaveNatureTable getModbusSlaveNatureTable(AccessMode accessMode) {
return ModbusSlaveNatureTable.of(OpenemsComponent.class, accessMode, 80) //
.channel(0, ChannelId.RUN_FAILED, ModbusType.UINT16) //
.build();
}
}
Loading

0 comments on commit f320676

Please sign in to comment.