-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,967 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- OpenEMS - Open Source Energy Management System Copyright (c) 2016 FENECON | ||
GmbH and contributors This program is free software: you can redistribute | ||
it and/or modify it under the terms of the GNU General Public License as | ||
published by the Free Software Foundation, either version 3 of the License, | ||
or (at your option) any later version. This program is distributed in the | ||
hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. You should have received a copy | ||
of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
Contributors: FENECON GmbH - initial API and implementation and initial documentation --> | ||
|
||
<configuration> | ||
<statusListener class="ch.qos.logback.core.status.NopStatusListener" /> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>[%-8.8thread] [%-5level] [%-20.20logger{36}:%-3line]%msg%ex{10}%n</pattern> | ||
</encoder> | ||
</appender> | ||
<appender name="WEBSOCKET" | ||
class="io.openems.core.utilities.websocket.WebsocketLogAppender"> | ||
</appender> | ||
<appender name="roll-by-size" | ||
class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>/var/log/openems.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | ||
<fileNamePattern>/var/log/openems.%i.log.zip | ||
</fileNamePattern> | ||
<minIndex>1</minIndex> | ||
<maxIndex>3</maxIndex> | ||
<totalSizeCap>10MB</totalSizeCap> | ||
</rollingPolicy> | ||
<triggeringPolicy | ||
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | ||
<maxFileSize>1MB</maxFileSize> | ||
</triggeringPolicy> | ||
<encoder> | ||
<pattern>%d{"yyyy/MM/dd HH:mm:ss"} : [%-8.8thread] [%-5level] [%-20.20logger{36}:%-3line]%msg%ex{10}%n</pattern> | ||
</encoder> | ||
</appender> | ||
<root level="INFO"> | ||
<appender-ref ref="STDOUT" /> | ||
<appender-ref ref="WEBSOCKET" /> | ||
<appender-ref ref="roll-by-size" /> | ||
</root> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
edge/src/io/openems/api/device/nature/pyra/PyranometerNature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package io.openems.api.device.nature.pyra; | ||
|
||
import io.openems.api.channel.ReadChannel; | ||
import io.openems.api.channel.WriteChannel; | ||
import io.openems.api.device.nature.DeviceNature; | ||
import io.openems.api.doc.ThingInfo; | ||
|
||
@ThingInfo(title = "Pyranometer") | ||
public interface PyranometerNature extends DeviceNature { | ||
|
||
public ReadChannel<Long> getDevType(); | ||
public ReadChannel<Long> getDataSet(); | ||
public ReadChannel<Long> getDevMode(); | ||
public ReadChannel<Long> getStatusFlags(); | ||
public ReadChannel<Long> getScaleFactor(); | ||
public ReadChannel<Long> getSensor1(); | ||
public ReadChannel<Long> getrRawData1(); | ||
public ReadChannel<Long> getStDev1(); | ||
public ReadChannel<Long> getBodyTemp(); | ||
public ReadChannel<Long> getVSupply(); | ||
public ReadChannel<Long> getVDAC(); | ||
public ReadChannel<Long> getDacInp(); | ||
public ReadChannel<Long> getInputVSensor(); | ||
public ReadChannel<Long> getInputVBodyTemp(); | ||
public ReadChannel<Long> getErrorCode(); | ||
public ReadChannel<Long> getProtocolError(); | ||
public ReadChannel<Long> getErrorCountPrio1(); | ||
public ReadChannel<Long> getErrorCountPrio2(); | ||
public ReadChannel<Long> getRestartCount(); | ||
public ReadChannel<Long> getFalseStartCount(); | ||
public ReadChannel<Long> getSensorOnTimeM(); | ||
public ReadChannel<Long> getSensorOnTimeL(); | ||
public ReadChannel<Long> getBatchNumber(); | ||
public ReadChannel<Long> getSerialNumber(); | ||
public ReadChannel<Long> getSoftwareVersion(); | ||
public ReadChannel<Long> getHardwareVersion(); | ||
public ReadChannel<Long> getNodeID(); | ||
public WriteChannel<Long> getStatusFlag(); | ||
public WriteChannel<Long> setWorkState(); | ||
|
||
public ReadChannel<Boolean> getIoVoidDataFlag(); | ||
public ReadChannel<Boolean> getIoOverFlowError(); | ||
public ReadChannel<Boolean> getIoUnderFlowError(); | ||
public ReadChannel<Boolean> getIoErrorFlag(); | ||
public ReadChannel<Boolean> getIoADCError(); | ||
public ReadChannel<Boolean> getIoDACError(); | ||
public ReadChannel<Boolean> getIoCalibrationError(); | ||
public ReadChannel<Boolean> getIoUpdateFailed(); | ||
public WriteChannel<Boolean> setClearError(); | ||
public WriteChannel<Boolean> setRestartModbus(); | ||
public WriteChannel<Boolean> setRoundOFF(); | ||
public WriteChannel<Boolean> setAutoRange(); | ||
public WriteChannel<Boolean> setFastResponse(); | ||
public WriteChannel<Boolean> setTrackingFilter(); | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,5 +95,4 @@ public Ess(EssNature ess) { | |
b.append("]"); | ||
return b.toString(); | ||
} | ||
|
||
} |
91 changes: 91 additions & 0 deletions
91
edge/src/io/openems/impl/controller/debuglogforkaco/DebugLogController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/******************************************************************************* | ||
* OpenEMS - Open Source Energy Management System | ||
* Copyright (c) 2016, 2017 FENECON GmbH and contributors | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* FENECON GmbH - initial API and implementation and initial documentation | ||
*******************************************************************************/ | ||
package io.openems.impl.controller.debuglogforkaco; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.openems.api.channel.Channel; | ||
import io.openems.api.channel.ConfigChannel; | ||
import io.openems.api.channel.ReadChannel; | ||
import io.openems.api.channel.thingstate.ThingStateChannels; | ||
import io.openems.api.controller.Controller; | ||
import io.openems.api.doc.ChannelInfo; | ||
import io.openems.api.doc.ThingInfo; | ||
import io.openems.api.exception.InvalidValueException; | ||
import io.openems.core.ThingRepository; | ||
import io.openems.impl.device.blueplanet50tl3.FeneconBlueplanet50TL3Ess; | ||
|
||
@ThingInfo(title = "Output debugging information on systemlog") | ||
public class DebugLogController extends Controller { | ||
|
||
private final Logger log = LoggerFactory.getLogger(DebugLogController.class); | ||
|
||
private ThingStateChannels thingState = new ThingStateChannels(this); | ||
|
||
/* | ||
* Constructors | ||
*/ | ||
public DebugLogController() { | ||
super(); | ||
} | ||
|
||
public DebugLogController(String thingId) { | ||
super(thingId); | ||
} | ||
|
||
/* | ||
* Config | ||
*/ | ||
@ChannelInfo(title = "Ess", description = "Sets the Ess device.", type = Ess.class, isOptional = true) | ||
public final ConfigChannel<Ess> ess = new ConfigChannel<Ess>("ess", this); | ||
|
||
/* | ||
* Methods | ||
*/ | ||
@Override | ||
public void run() { | ||
FeneconBlueplanet50TL3Ess ess = this.ess.getValue().ess; | ||
log.info(ess.id() + ": " + ess.getClass()); | ||
for(Channel channel : ThingRepository.getInstance().getChannels(ess)) { | ||
if(channel instanceof ReadChannel<?>) { | ||
ReadChannel<?> c = (ReadChannel<?>) channel; | ||
try { | ||
log.info(c.id() + ": " + c.value()); | ||
} catch (InvalidValueException e) { | ||
} | ||
} | ||
} | ||
System.out.println("-"); | ||
System.out.println("-"); | ||
System.out.println("-"); | ||
System.out.println("-"); | ||
System.out.println("-"); | ||
System.out.println("-"); | ||
|
||
} | ||
|
||
@Override | ||
public ThingStateChannels getStateChannel() { | ||
return this.thingState; | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
edge/src/io/openems/impl/controller/debuglogforkaco/Ess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/******************************************************************************* | ||
* OpenEMS - Open Source Energy Management System | ||
* Copyright (c) 2016, 2017 FENECON GmbH and contributors | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* FENECON GmbH - initial API and implementation and initial documentation | ||
*******************************************************************************/ | ||
package io.openems.impl.controller.debuglogforkaco; | ||
|
||
import io.openems.api.controller.IsThingMap; | ||
import io.openems.api.controller.ThingMap; | ||
import io.openems.impl.device.blueplanet50tl3.FeneconBlueplanet50TL3Ess; | ||
|
||
@IsThingMap(type = FeneconBlueplanet50TL3Ess.class) | ||
public class Ess extends ThingMap { | ||
|
||
public final FeneconBlueplanet50TL3Ess ess; | ||
|
||
public Ess(FeneconBlueplanet50TL3Ess ess) { | ||
super(ess); | ||
this.ess = ess; | ||
} | ||
|
||
} |
81 changes: 81 additions & 0 deletions
81
edge/src/io/openems/impl/controller/kippzonenpyranometer/KippZonenPyranometerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/******************************************************************************* | ||
* OpenEMS - Open Source Energy Management System | ||
* Copyright (c) 2016, 2017 FENECON GmbH and contributors | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* FENECON GmbH - initial API and implementation and initial documentation | ||
*******************************************************************************/ | ||
package io.openems.impl.controller.kippzonenpyranometer; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.openems.api.channel.ConfigChannel; | ||
import io.openems.api.channel.thingstate.ThingStateChannels; | ||
import io.openems.api.controller.Controller; | ||
import io.openems.api.device.nature.pyra.PyranometerNature; | ||
import io.openems.api.doc.ChannelInfo; | ||
import io.openems.api.doc.ThingInfo; | ||
import io.openems.api.exception.InvalidValueException; | ||
import io.openems.api.exception.WriteChannelException; | ||
|
||
@ThingInfo(title = "Output debugging information on systemlog") | ||
public class KippZonenPyranometerController extends Controller { | ||
|
||
private final Logger log = LoggerFactory.getLogger(KippZonenPyranometerController.class); | ||
|
||
private ThingStateChannels thingState = new ThingStateChannels(this); | ||
|
||
/* | ||
* Constructors | ||
*/ | ||
public KippZonenPyranometerController() { | ||
super(); | ||
} | ||
|
||
public KippZonenPyranometerController(String thingId) { | ||
super(thingId); | ||
} | ||
|
||
/* | ||
* Config | ||
*/ | ||
@ChannelInfo(title = "PyranometerNature", description = "Sets the Pyra device.", type = Pyra.class, isOptional = true) | ||
public final ConfigChannel<Pyra> pyra = new ConfigChannel<Pyra>("pyra", this); | ||
|
||
/* | ||
* Methods | ||
*/ | ||
@Override | ||
public void run() { | ||
try { | ||
PyranometerNature pyra = this.pyra.getValue().pyra; | ||
long statusFlags = pyra.getStatusFlags().value(); | ||
long devMode = pyra.getDevMode().value(); | ||
if (devMode != 1 || statusFlags != 0) { | ||
pyra.setClearError().pushWrite(true); | ||
} | ||
} catch (InvalidValueException | WriteChannelException e) { | ||
log.error("Unable to clear error: " + e.getMessage()); | ||
} | ||
} | ||
|
||
@Override | ||
public ThingStateChannels getStateChannel() { | ||
return this.thingState; | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
edge/src/io/openems/impl/controller/kippzonenpyranometer/Pyra.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/******************************************************************************* | ||
* OpenEMS - Open Source Energy Management System | ||
* Copyright (c) 2016, 2017 FENECON GmbH and contributors | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* FENECON GmbH - initial API and implementation and initial documentation | ||
*******************************************************************************/ | ||
package io.openems.impl.controller.kippzonenpyranometer; | ||
|
||
import io.openems.api.controller.IsThingMap; | ||
import io.openems.api.controller.ThingMap; | ||
import io.openems.api.device.nature.pyra.PyranometerNature; | ||
|
||
@IsThingMap(type = PyranometerNature.class) | ||
public class Pyra extends ThingMap { | ||
|
||
public final PyranometerNature pyra; | ||
public Pyra(PyranometerNature pyra) { | ||
super(pyra); | ||
this.pyra = pyra; | ||
} | ||
} |
Oops, something went wrong.