You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/11/24 13:41:33 UTC
[plc4x] 02/02: - Added outputting the "meaning" of a group address.
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/knxnet-ip
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit cc82a1900611c1517dd25d57bc160cd5e11cef55
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Sun Nov 24 14:41:24 2019 +0100
- Added outputting the "meaning" of a group address.
---
.../streampipes/processors/processors/ets5/Ets5DataEnrichment.java | 4 ++++
.../processors/processors/ets5/Ets5DataEnrichmentController.java | 2 ++
2 files changed, 6 insertions(+)
diff --git a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichment.java b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichment.java
index 35e86f1..88cb3d2 100644
--- a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichment.java
+++ b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichment.java
@@ -81,11 +81,15 @@ public class Ets5DataEnrichment implements EventProcessor<Ets5DataEnrichmentPara
groupAddress.getFunction().getSpaceName());
event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_FUNCTION,
groupAddress.getFunction().getName());
+ event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_MEANING,
+ groupAddress.getName());
event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_DECODED_PROPERTY_VALUE,
jsonDatapoint);
//Event enrichedEvent = new Event()
spOutputCollector.collect(event);
+ } else {
+ System.out.println("Couldn't decode group address " + toGroupAddressString(destinationAddress));
}
} catch (ParseException e) {
// Driver Decoding
diff --git a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichmentController.java b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichmentController.java
index 2ca00d5..3c8a801 100644
--- a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichmentController.java
+++ b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/processors/ets5/Ets5DataEnrichmentController.java
@@ -47,6 +47,7 @@ public class Ets5DataEnrichmentController extends StandaloneEventProcessingDecla
public static final String MAPPING_FIELD_TYPE = "type";
public static final String MAPPING_FIELD_LOCATION = "location";
public static final String MAPPING_FIELD_FUNCTION = "function";
+ public static final String MAPPING_FIELD_MEANING = "meaning";
public static final String MAPPING_FIELD_DECODED_PROPERTY_VALUE = "decodedPropertyValue";
@Override
@@ -66,6 +67,7 @@ public class Ets5DataEnrichmentController extends StandaloneEventProcessingDecla
PrimitivePropertyBuilder.create(Datatypes.String, MAPPING_FIELD_TYPE).build(),
PrimitivePropertyBuilder.create(Datatypes.String, MAPPING_FIELD_LOCATION).build(),
PrimitivePropertyBuilder.create(Datatypes.String, MAPPING_FIELD_FUNCTION).build(),
+ PrimitivePropertyBuilder.create(Datatypes.String, MAPPING_FIELD_MEANING).build(),
PrimitivePropertyBuilder.create(Datatypes.String, MAPPING_FIELD_DECODED_PROPERTY_VALUE).build()
))
.requiredFile(Labels.from("File", "ETS5 Project File", "ETS5 Project File (.knxproj)"))