Skip to content

Commit

Permalink
Merge branch 'release/2019.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Aug 1, 2019
2 parents 5dff05a + 584cbec commit 582dec8
Show file tree
Hide file tree
Showing 111 changed files with 20,424 additions and 3,046 deletions.
23 changes: 17 additions & 6 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>com.github.scribejava</groupId>
<artifactId>scribejava-core</artifactId>
<version>6.6.3</version>
<version>6.7.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down Expand Up @@ -57,16 +57,19 @@
<version>3.13.1</version>
</dependency>
<dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp/3.13.1 -->
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.13.1</version>
</dependency>
<dependency>
<!-- Used by com.squareup.okhttp3: okhttp -->
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.17.2</version>
</dependency>
<dependency>
<!-- Used by org.influxdb: influxdb-java -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-moshi</artifactId>
<version>2.5.0</version>
Expand All @@ -82,11 +85,18 @@
<artifactId>SDNotify</artifactId>
<version>1.3</version>
</dependency>
<!-- javax -->
<dependency>
<groupId>javax.jmdns</groupId>
<artifactId>jmdns</artifactId>
<version>3.4.1</version>
</dependency>
<!-- net -->
<dependency>
<!-- Used by SDNotify -->
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.3.1</version>
<version>5.4.0</version>
</dependency>
<!-- org -->
<dependency>
Expand All @@ -107,9 +117,10 @@
<dependency>
<groupId>org.dhatim</groupId>
<artifactId>fastexcel</artifactId>
<version>0.10.8</version>
<version>0.10.9</version>
</dependency>
<dependency>
<!-- https://mvnrepository.com/artifact/org.influxdb/influxdb-java/2.15 -->
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
<version>2.15</version>
Expand All @@ -122,17 +133,17 @@
<dependency>
<groupId>org.msgpack</groupId>
<artifactId>msgpack-core</artifactId>
<version>0.8.16</version>
<version>0.8.17</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<version>1.10.2</version>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-service</artifactId>
<version>1.10.2</version>
<version>1.11.0</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.7.0-SNAPSHOT
Version 2019.8.0
:sectnums:
:sectnumlevels: 4
:toc:
Expand Down
6 changes: 3 additions & 3 deletions io.openems.backend.application/BackendApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
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.10.2,1.10.3)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.10.2,1.10.3)',\
com.google.guava;version='[28.0.0,28.0.1)'
com.google.guava;version='[28.0.0,28.0.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)'
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 = 7;
public final static short VERSION_MINOR = 8;

/**
* The patch version of OpenEMS.
Expand Down
8 changes: 7 additions & 1 deletion io.openems.common/src/io/openems/common/channel/Unit.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ public enum Unit {
/**
* Unit of Electric Charge
*/
MILLIAMPERE_HOURS("mAh"),
MILLIAMPERE_HOURS("mAh", AMPERE_HOURS, -3),

/**
* Unit of Electric Charge
*/
KILOAMPERE_HOURS("kAh", AMPERE_HOURS, 3),

// ##########
// Energy
Expand Down Expand Up @@ -270,6 +275,7 @@ public String format(Object value, OpenemsType type) {
case SECONDS:
case AMPERE_HOURS:
case HOUR:
case KILOAMPERE_HOURS:
case KILOVOLT_AMPERE:
case KILOVOLT_AMPERE_REACTIVE:
case KILOVOLT_AMPERE_REACTIVE_HOURS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public enum OpenemsError {
JSON_NO_FLOAT_MEMBER(5017, "JSON [%s:%s] is not a Float"), //
JSON_NO_ENUM_MEMBER(5018, "JSON [%s:%s] is not an Enum"), //
JSON_NO_INET4ADDRESS(5020, "JSON [%s] is not an IPv4 address"), //
/*
* XML Errors. 6000-6999
*/
XML_HAS_NO_MEMBER(6000, "XML [%s] has no member [%s]"), //
XML_NO_STRING_MEMBER(6010, "XML [%s:%s] is not a String"), //
;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ public OpenemsException(String message, Throwable cause) {
super(OpenemsError.GENERIC, message + ": " + cause.getMessage());
}

public OpenemsException(Throwable cause) {
this(cause.getClass().getSimpleName() + ": " + cause.getMessage());
}

}
103 changes: 103 additions & 0 deletions io.openems.common/src/io/openems/common/utils/XmlUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package io.openems.common.utils;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.DOMException;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

import io.openems.common.exceptions.OpenemsError;
import io.openems.common.exceptions.OpenemsError.OpenemsNamedException;
import io.openems.common.exceptions.OpenemsException;

public class XmlUtils {

public static String namedNodeMapToString(NamedNodeMap attrs) {
List<Node> list = new ArrayList<>();
for (int i = 0; i < attrs.getLength(); i++) {
list.add(attrs.item(i));
}
return list.toString();
}

public static Node getSubNode(NamedNodeMap attrs, String name) throws OpenemsNamedException {
Node subNode = attrs.getNamedItem(name);
if (subNode == null) {
throw OpenemsError.XML_HAS_NO_MEMBER.exception(namedNodeMapToString(attrs).replaceAll("%", "%%"), name);
} else {
return subNode;
}
}

public static String getAsString(NamedNodeMap attrs, String name) throws OpenemsNamedException {
try {
return getSubNode(attrs, name).getNodeValue();
} catch (DOMException | NullPointerException e) {
throw OpenemsError.XML_NO_STRING_MEMBER.exception(namedNodeMapToString(attrs).replaceAll("%", "%%"), name);
}
}

public static String getAsStringOrElse(NamedNodeMap attrs, String name, String def) {
try {
return getAsString(attrs, name);
} catch (OpenemsNamedException e) {
return def;
}
}

public static int getAsInt(NamedNodeMap attrs, String name) throws OpenemsNamedException {
try {
return Integer.parseInt(getAsString(attrs, name));
} catch (NumberFormatException e) {
throw new OpenemsException(e);
}
}

public static int getAsIntOrElse(NamedNodeMap attrs, String name, int def) {
try {
return getAsInt(attrs, name);
} catch (OpenemsNamedException e) {
return def;
}
}

public static <E extends Enum<E>> E getAsEnum(Class<E> enumType, NamedNodeMap attrs, String name)
throws OpenemsNamedException {
String element = getAsString(attrs, name);
try {
return (E) Enum.valueOf(enumType, element.toUpperCase());
} catch (IllegalArgumentException e) {
throw new OpenemsException(e);
}
}

public static <E extends Enum<E>> E getAsEnumOrElse(Class<E> enumType, NamedNodeMap attrs, String name, E def) {
try {
return getAsEnum(enumType, attrs, name);
} catch (OpenemsNamedException e) {
return def;
}
}

public static boolean getAsBoolean(NamedNodeMap attrs, String name) throws OpenemsNamedException {
String element = getAsString(attrs, name);
return Boolean.parseBoolean(element);
}

public static boolean getAsBooleanOrElse(NamedNodeMap attrs, String name, boolean def) {
try {
return getAsBoolean(attrs, name);
} catch (OpenemsNamedException e) {
return def;
}
}

public static String getContentAsString(Node node) {
return node.getTextContent();
}

public static int getContentAsInt(Node node) {
return Integer.valueOf(node.getTextContent());
}
}
16 changes: 9 additions & 7 deletions io.openems.edge.application/EdgeApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@
bnd.identity;id='io.openems.edge.meter.weidmueller',\
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.dailyscheduler',\
bnd.identity;id='io.openems.edge.scheduler.daily',\
bnd.identity;id='io.openems.edge.scheduler.fixedorder',\
bnd.identity;id='io.openems.edge.simulator',\
bnd.identity;id='io.openems.edge.timedata.influxdb'
Expand Down Expand Up @@ -158,7 +159,6 @@
io.openems.edge.meter.weidmueller;version=snapshot,\
io.openems.edge.pvinverter.solarlog;version=snapshot,\
io.openems.edge.scheduler.allalphabetically;version=snapshot,\
io.openems.edge.scheduler.dailyscheduler;version=snapshot,\
io.openems.edge.scheduler.fixedorder;version=snapshot,\
io.openems.edge.simulator;version=snapshot,\
io.openems.edge.timedata.influxdb;version=snapshot,\
Expand All @@ -184,9 +184,6 @@
org.osgi.service.event;version='[1.3.1,1.3.2)',\
org.osgi.service.metatype;version='[1.3.0,1.3.1)',\
io.openems.edge.meter.pqplus.umd97;version=snapshot,\
org.ops4j.pax.logging.pax-logging-api;version='[1.10.2,1.10.3)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.10.2,1.10.3)',\
com.sun.jna;version='[5.3.1,5.3.2)',\
io.openems.edge.controller.pvinverter.fixpowerlimit;version=snapshot,\
io.openems.edge.controller.evcs.fixactivepower;version=snapshot,\
com.google.guava;version='[28.0.0,28.0.1)',\
Expand All @@ -197,6 +194,11 @@
com.fasterxml.jackson.core.jackson-annotations;version='[2.9.0,2.9.1)',\
com.fasterxml.jackson.core.jackson-core;version='[2.9.9,2.9.10)',\
com.fasterxml.jackson.core.jackson-databind;version='[2.9.9,2.9.10)',\
com.github.scribejava.core;version='[6.6.3,6.6.4)',\
io.openems.edge.pvinverter.kaco.blueplanet;version=snapshot,\
io.openems.edge.controller.selltogridlimit;version=snapshot
io.openems.edge.controller.selltogridlimit;version=snapshot,\
com.github.scribejava.core;version='[6.7.0,6.7.1)',\
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
1 change: 1 addition & 0 deletions io.openems.edge.bridge.modbus/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Export-Package: \
io.openems.edge.bridge.modbus.api.task,\
io.openems.edge.bridge.modbus.api.element,\
io.openems.edge.bridge.modbus.api.facade,\
io.openems.edge.bridge.modbus.sunspec,\
io.openems.edge.bridge.modbus

-includeresource: {readme.adoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private List<WriteTask> getAllWriteTasks() {
* result. The idea is to not execute tasks that are known to fail.
*
* @param <T> the Task type
* @param tasks Tasks by Componen-ID
* @param tasks Tasks by Component-ID
* @return a list of filtered tasks
*/
private <T extends Task> List<T> filterDefectiveComponents(Multimap<String, T> tasks) {
Expand Down
Loading

0 comments on commit 582dec8

Please sign in to comment.