Skip to content

Commit

Permalink
Merge branch 'release/2021.16.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Sep 23, 2021
2 parents bc282db + 5445213 commit 7966617
Show file tree
Hide file tree
Showing 17 changed files with 2,103 additions and 1,393 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-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<!-- Changelog: https://github.com/apache/felix-dev/blob/master/scr/changelog.txt -->
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr</artifactId>
<version>2.1.20</version>
<version>2.1.30</version>
</dependency>
<dependency>
<!-- Apache Felix Web Management Console -->
Expand All @@ -206,7 +206,7 @@
<dependency>
<groupId>org.dhatim</groupId>
<artifactId>fastexcel</artifactId>
<version>0.12.11</version>
<version>0.12.12</version>
</dependency>
<dependency>
<!-- Eclipse Paho MQTTv5 Client -->
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 2021.15.0
Version 2021.16.0
:sectnums:
:sectnumlevels: 4
:toc:
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
Expand Down
2 changes: 1 addition & 1 deletion io.openems.backend.application/BackendApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
org.apache.felix.inventory;version='[1.1.0,1.1.1)',\
org.apache.felix.metatype;version='[1.2.4,1.2.5)',\
org.apache.felix.scr;version='[2.1.20,2.1.21)',\
org.apache.felix.scr;version='[2.1.30,2.1.31)',\
org.apache.felix.webconsole;version='[4.7.0,4.7.1)',\
org.apache.felix.webconsole.plugins.ds;version='[2.1.0,2.1.1)',\
org.apache.servicemix.bundles.ws-commons-util;version='[1.0.2,1.0.3)',\
Expand Down
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 = 15;
public final static short VERSION_MINOR = 16;

/**
* The patch version of OpenEMS.
Expand Down
2 changes: 1 addition & 1 deletion io.openems.edge.application/EdgeApp.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
org.apache.felix.inventory;version='[1.1.0,1.1.1)',\
org.apache.felix.metatype;version='[1.2.4,1.2.5)',\
org.apache.felix.scr;version='[2.1.20,2.1.21)',\
org.apache.felix.scr;version='[2.1.30,2.1.31)',\
org.apache.felix.webconsole;version='[4.7.0,4.7.1)',\
org.apache.felix.webconsole.plugins.ds;version='[2.1.0,2.1.1)',\
org.eclipse.paho.mqttv5.client;version='[1.2.5,1.2.6)',\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@ public class DummyController extends AbstractOpenemsComponent implements Control

private Runnable runCallback = null;

protected DummyController(String id, io.openems.edge.common.channel.ChannelId[] firstInitialChannelIds,
protected DummyController(String id, String alias,
io.openems.edge.common.channel.ChannelId[] firstInitialChannelIds,
io.openems.edge.common.channel.ChannelId[]... furtherInitialChannelIds) {
super(firstInitialChannelIds, furtherInitialChannelIds);
for (Channel<?> channel : this.channels()) {
channel.nextProcessImage();
}
super.activate(null, id, "", true);
super.activate(null, id, alias, true);
}

public DummyController(String id) {
this(id, //
this(id, "");
}

public DummyController(String id, String alias) {
this(id, alias, //
OpenemsComponent.ChannelId.values(), //
Controller.ChannelId.values() //
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
@AttributeDefinition(name = "Is enabled?", description = "Is this Component enabled?")
boolean enabled() default true;

@AttributeDefinition(name = "Show Alias", description = "Print the Alias for each Component")
boolean showAlias() default false;

@AttributeDefinition(name = "Condensed output", description = "Print all logs in one joint line")
boolean condensedOutput() default true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Modified;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
Expand All @@ -22,6 +23,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Objects;
import com.google.common.collect.TreeMultimap;

import io.openems.common.exceptions.OpenemsError.OpenemsNamedException;
Expand Down Expand Up @@ -63,9 +65,19 @@ public DebugLogImpl() {
}

@Activate
void activate(ComponentContext context, Config config) throws OpenemsNamedException {
this.config = config;
private void activate(ComponentContext context, Config config) throws OpenemsNamedException {
this.applyConfig(config);
super.activate(context, config.id(), config.alias(), config.enabled());
}

@Modified
private void modified(ComponentContext context, Config config) throws OpenemsNamedException {
this.applyConfig(config);
super.modified(context, config.id(), config.alias(), config.enabled());
}

private void applyConfig(Config config) throws OpenemsNamedException {
this.config = config;

// Parse Additional Channels
for (String channel : config.additionalChannels()) {
Expand Down Expand Up @@ -149,7 +161,14 @@ protected String getLogMessage() {

// Any logs? Add them to the output
if (!logs.isEmpty()) {
result.add(component.id() + "[" + String.join("|", logs) + "]");
StringBuilder b = new StringBuilder();
b.append(component.id()).append("[");
if (this.config.showAlias() && !Objects.equal(component.id(), component.alias())) {
b.append(component.alias()).append("|");
}
b.append(String.join("|", logs));
b.append("]");
result.add(b.toString());
}
});
if (this.config.condensedOutput()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ public class DebugLogImplTest {

private static final String DUMMY0_ID = "dummy0";
private static final String DUMMY1_ID = "dummy1";
private static final String DUMMY1_ALIAS = "This is Dummy1";
private static final String DUMMY2_ID = "dummy2";
private static final String DUMMY2_ALIAS = DUMMY2_ID;
private static final String DUMMY10_ID = "dummy10";

private static final String ANY_DUMMY = "dummy*";

private final static ChannelAddress SUM_ESS_SOC = new ChannelAddress("_sum", "EssSoc");
private static final ChannelAddress SUM_ESS_SOC = new ChannelAddress("_sum", "EssSoc");

@Test
public void test() throws Exception {
Expand All @@ -42,13 +44,13 @@ public String debugLog() {
return "abc:xyz";
}
});
components.add(new DummyController(DUMMY1_ID) {
components.add(new DummyController(DUMMY1_ID, DUMMY1_ALIAS) {
@Override
public String debugLog() {
return "def:uvw";
}
});
components.add(new DummyController(DUMMY2_ID) {
components.add(new DummyController(DUMMY2_ID, DUMMY2_ALIAS) {
@Override
public String debugLog() {
return "ghi:rst";
Expand All @@ -66,6 +68,7 @@ public String debugLog() {
.addReference("components", components) //
.activate(MyConfig.create() //
.setId(CTRL_ID) //
.setShowAlias(true) //
.setCondensedOutput(true) //
.setAdditionalChannels(new String[] { //
SUM_ESS_SOC.toString() //
Expand All @@ -77,7 +80,9 @@ public String debugLog() {
.next(new TestCase() //
.input(SUM_ESS_SOC, 50));

assertEquals("_sum[foo:bar|EssSoc:50 %] dummy1[def:uvw] dummy2[ghi:rst] dummy10[jkl:opq]", sut.getLogMessage());
assertEquals(
"_sum[Core.Sum|foo:bar|EssSoc:50 %] dummy1[This is Dummy1|def:uvw] dummy2[ghi:rst] dummy10[jkl:opq]",
sut.getLogMessage());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class MyConfig extends AbstractComponentConfig implements Config {
protected static class Builder {
private String id = "ctrlJsonLogic0";
private String rule = null;
public boolean showAlias;
public String[] additionalChannels;
public String[] ignoreComponents;
public boolean condensedOutput;
Expand All @@ -21,6 +22,11 @@ public Builder setId(String id) {
return this;
}

public Builder setShowAlias(boolean showAlias) {
this.showAlias = showAlias;
return this;
}

public Builder setAdditionalChannels(String[] additionalChannels) {
this.additionalChannels = additionalChannels;
return this;
Expand Down Expand Up @@ -52,6 +58,11 @@ private MyConfig(Builder builder) {
this.builder = builder;
}

@Override
public boolean showAlias() {
return this.builder.showAlias;
}

@Override
public String[] additionalChannels() {
return this.builder.additionalChannels;
Expand Down
4 changes: 2 additions & 2 deletions io.openems.wrapper/fastexcel.bnd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Bundle-Name: fastexcel
Bundle-DocURL: https://github.com/dhatim/fastexcel
Bundle-License: https://opensource.org/licenses/Apache-2.0
Bundle-Version: 0.12.11
Bundle-Version: 0.12.12

Include-Resource: @fastexcel-0.12.11.jar
Include-Resource: @fastexcel-0.12.12.jar

-dsannotations: *

Expand Down
Loading

0 comments on commit 7966617

Please sign in to comment.