Skip to content

Commit

Permalink
Merge branch 'release/2020.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Jan 17, 2020
2 parents 6f019ea + a73f406 commit 4197b9a
Show file tree
Hide file tree
Showing 27 changed files with 3,591 additions and 2,587 deletions.
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,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 4 additions & 4 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.14.4</version>
<version>3.14.6</version>
</dependency>
<dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.4</version>
<version>3.14.6</version>
</dependency>
<dependency>
<!-- Used by com.squareup.okhttp3: okhttp -->
Expand All @@ -67,12 +67,12 @@
<!-- Used by org.influxdb: influxdb-java -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-moshi</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.6.2</version>
<version>2.7.1</version>
</dependency>
<!-- info -->
<dependency>
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.1.0
Version 2020.2.0
:sectnums:
:sectnumlevels: 4
:toc:
Expand Down
29 changes: 12 additions & 17 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
4 changes: 2 additions & 2 deletions io.openems.backend.application/BackendApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

-runbundles: \
com.google.gson;version='[2.8.5,2.8.6)',\
com.google.guava;version='[28.2.0,28.2.1)',\
com.google.guava.failureaccess;version='[1.0.1,1.0.2)',\
io.openems.backend.application;version='[1.0.0,1.0.1)',\
io.openems.backend.b2brest;version='[1.0.0,1.0.1)',\
Expand Down Expand Up @@ -68,5 +69,4 @@
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)',\
org.osgi.service.metatype;version='[1.4.0,1.4.1)',\
org.postgresql.jdbc42;version='[42.2.9,42.2.10)',\
com.google.guava;version='[28.2.0,28.2.1)'
org.postgresql.jdbc42;version='[42.2.9,42.2.10)'
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 = 1;
public final static short VERSION_MINOR = 2;

/**
* The patch version of OpenEMS.
Expand All @@ -33,7 +33,6 @@ public class OpenemsConstants {
* The additional version string
*/
public final static String VERSION_STRING = "";
// public final static String VERSION_STRING = "SNAPSHOT";

/**
* The complete version as a SemanticVersion.
Expand Down
4 changes: 2 additions & 2 deletions io.openems.edge.application/EdgeApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
com.fazecast.jSerialComm;version='[2.5.1,2.5.2)',\
com.ghgande.j2mod;version='[2.5.5,2.5.6)',\
com.google.gson;version='[2.8.5,2.8.6)',\
com.google.guava;version='[28.2.0,28.2.1)',\
com.google.guava.failureaccess;version='[1.0.1,1.0.2)',\
com.sun.jna;version='[5.5.0,5.5.1)',\
io.openems.common;version='[1.0.0,1.0.1)',\
Expand Down Expand Up @@ -236,5 +237,4 @@
org.ops4j.pax.logging.pax-logging-service;version='[1.11.2,1.11.3)',\
org.osgi.service.event;version='[1.4.0,1.4.1)',\
org.osgi.service.metatype;version='[1.4.0,1.4.1)',\
rrd4j;version='[3.5.0,3.5.1)',\
com.google.guava;version='[28.2.0,28.2.1)'
rrd4j;version='[3.5.0,3.5.1)'
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public ModbusRecordChannel(int offset, ModbusType type, ChannelId channelId, Acc
case UINT16:
byteLength = ModbusRecordUint16.BYTE_LENGTH;
break;
case UINT32:
byteLength = ModbusRecordUint32.BYTE_LENGTH;
break;
}
this.writeValueBuffer = new Byte[byteLength];
}
Expand Down Expand Up @@ -144,6 +147,14 @@ public byte[] getValue(OpenemsComponent component) {
case WRITE_ONLY:
return ModbusRecordUint16Reserved.UNDEFINED_VALUE;
}
case UINT32:
switch (this.accessMode) {
case READ_ONLY:
case READ_WRITE:
return ModbusRecordUint32.toByteArray(value);
case WRITE_ONLY:
return ModbusRecordUint32Reserved.UNDEFINED_VALUE;
}
}
assert true;
return new byte[0];
Expand Down Expand Up @@ -201,6 +212,9 @@ public void writeValue(OpenemsComponent component, int index, byte byte1, byte b
case UINT16:
value = buff.getShort();
break;
case UINT32:
value = buff.getInt();
break;
}

// Forward Value to ApiWorker
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.openems.edge.common.modbusslave;

import java.nio.ByteBuffer;

import io.openems.common.types.OpenemsType;
import io.openems.edge.common.type.TypeUtils;

public class ModbusRecordUint32 extends ModbusRecordConstant {

public final static byte[] UNDEFINED_VALUE = new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF };

public final static int BYTE_LENGTH = 4;

protected final Integer value;

public ModbusRecordUint32(int offset, String name, Integer value) {
super(offset, name, ModbusType.UINT32, toByteArray(value));
this.value = value;
}

@Override
public String toString() {
return "ModbusRecordUInt32 [value=" + value + "/0x" + Integer.toHexString(value) + ", type=" + getType() + "]";
}

public static byte[] toByteArray(int value) {
return ByteBuffer.allocate(BYTE_LENGTH).putInt(value).array();
}

public static byte[] toByteArray(Object value) {
if (value == null || (value instanceof io.openems.common.types.OptionsEnum
&& ((io.openems.common.types.OptionsEnum) value).isUndefined())) {
return UNDEFINED_VALUE;
} else {
return toByteArray((int) TypeUtils.getAsType(OpenemsType.INTEGER, value));
}
}

@Override
public String getValueDescription() {
return this.value != null ? Integer.toString(this.value) : "";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.openems.edge.common.modbusslave;

public class ModbusRecordUint32Reserved extends ModbusRecordUint32 {

public ModbusRecordUint32Reserved(int offset) {
super(offset, "Reserved", null);
}

@Override
public String toString() {
return "ModbusRecordUint32Reserved [type=" + getType() + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public Builder channel(int offset, ChannelId channelId, ModbusType type) {
case UINT16:
this.uint16Reserved(offset);
break;
case UINT32:
this.uint32Reserved(offset);
break;
}
}
return this;
Expand All @@ -71,6 +74,11 @@ public Builder uint16Reserved(int offset) {
return this;
}

public Builder uint32Reserved(int offset) {
this.add(new ModbusRecordUint32Reserved(offset));
return this;
}

public Builder float32(int offset, String name, float value) {
this.add(new ModbusRecordFloat32(offset, name, value));
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public enum ModbusType {
UINT16(1, "uint16"), //
UINT32(2, "uint32"), //
FLOAT32(2, "float32"), //
FLOAT64(4, "float64"), //
STRING16(16, "string16");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import io.openems.edge.controller.api.modbus.jsonrpc.GetModbusProtocolExportXlsxResponse;
import io.openems.edge.controller.api.modbus.jsonrpc.GetModbusProtocolRequest;
import io.openems.edge.controller.api.modbus.jsonrpc.GetModbusProtocolResponse;
import io.openems.edge.timedata.api.Timedata;

@Designate(ocd = Config.class, factory = true)
@Component(//
Expand Down Expand Up @@ -88,9 +87,6 @@ protected void addComponent(ModbusSlave component) {
this._components.put(component.id(), component);
}

@Reference(policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY, cardinality = ReferenceCardinality.OPTIONAL)
protected volatile Timedata timedataService = null;

@Reference
protected ConfigurationAdmin cm;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
public class MyIllegalAddressException extends IllegalAddressException {

private static final long serialVersionUID = 1L;
private final Logger log = LoggerFactory.getLogger(ModbusTcpApi.class);

private final Logger log = LoggerFactory.getLogger(MyIllegalAddressException.class);

public MyIllegalAddressException(MyProcessImage parent, String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.openems.edge.common.modbusslave.ModbusRecordFloat64;
import io.openems.edge.common.modbusslave.ModbusRecordString16;
import io.openems.edge.common.modbusslave.ModbusRecordUint16;
import io.openems.edge.common.modbusslave.ModbusRecordUint32;
import io.openems.edge.common.modbusslave.ModbusType;

/**
Expand Down Expand Up @@ -159,11 +160,14 @@ private static void addUndefinedSheet(Workbook wb) {
case UINT16:
value = ModbusRecordUint16.UNDEFINED_VALUE;
break;
case UINT32:
value = ModbusRecordUint32.UNDEFINED_VALUE;
break;
}
nextRow++;
ws.value(nextRow, 0, modbusType.toString());
ws.value(nextRow, 1, byteArrayToString(value));
//Alternate Row shading
// Alternate Row shading
ws.range(1, 0, nextRow, 2).style().borderStyle("thin").shadeAlternateRows(Color.GRAY1).set();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.osgi.service.metatype.annotations.AttributeDefinition;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;

@ObjectClassDefinition( //
@ObjectClassDefinition(//
name = "Timedata RRD4J", //
description = "This component persists data to RRD4J files.")
@interface Config {
Expand Down
Loading

0 comments on commit 4197b9a

Please sign in to comment.