Skip to content

Commit

Permalink
Sp 1592 (apache#1647)
Browse files Browse the repository at this point in the history
* [hotfix] Remove set adapters from extensions

* [hotfix] Remove old resource files

* [apache#1289] Remove data set model

* [apache#1289] Remove data set model from ui

* [apache#1289] Remove `adapterType` and fix tests

* [apache#1289] Remove class `SpDataSet`

* [apache#1289] Remove legacy code in class `AdapterDescription`

* [apache#1289] Remove class `AdapterStreamDescription`

* [apache#1289] Remove class `ProtocolStreamDescription`

* [hotfix] Remove class `AdapterDescription`

* [apache#1289] Very first version for new adapter interface

* [apache#1289] Started to migrate the API

* [apache#1289] Deactivate old protocol API

* [apache#1289] Remove old models from the ui

* [apache#1289] Remove old models from the ui

* [apache#1289] Fix icons for adapters

* [apache#1289] Fix minor bug

* [apache#1289] Fix maven build

* [apache#1289] WIP refactor `AdapterConfigurationBuilder`

* [apache#1289] Fix AdapterConfigurationBuilder

* [apache#1289] Fix AdapterConfigurationBuilder

* [apache#1289] Guess schema works now for NewMachineDataSimulatorAdapter

* [apache#1289] Add start adapter

* [apache#1289] First version of new machine data simulator works

* [apache#1289] Working on the first new parser

* [apache#1289] First version of declare parser description

* [WIP] Add adapter configuration test

* [apache#1289] First generic adapter works now

* [apache#1289] Add parser exception to json parser

* [apache#1289] Add csv parser

* [apache#1289] Change implementation for json parser

* [apache#1289] Add json array parsers

* Add runtime context to adapters (apache#1290)

* Extract interface of  (apache#1290)

* Refactor OPC-UA adapter to new model (apache#1290)

* Refactor S7 adapter (apache#1290)

* Refactor Modbus adapter (apache#1290)

* Refactor Ros adapter (apache#1290)

* [apache#1289] Add geo json parser

* [apache#1289] Add xml parser

* [apache#1289] Add image parser

* Refactor Kafka adapter (apache#1290)

* Refactor MQTT adapter (apache#1290)

* Refactor Nats adapter (apache#1290)

* Refactor Pulsar adapter (apache#1290)

* Refactor RocketMQ adapter (apache#1290)

* Refactor TubeMQ adapter (apache#1290)

* Refactor HTTP server adapter (apache#1290)

* Refactor HTTP Stream adapter (apache#1290)

* [WIP] Refactor Parser API

* [WIP] Refactor Parser API

* [apache#1289] Fix file stream e2e test

* [apache#1289] Fix tests and csv parser for timestamps

* [apache#1289] Fix e2e connect tests

* [hotfix] Fix build

* [hotfix] Deactivate Mqtt integration test

* [apache#1289] Remove old format implementation from backend

* [apache#1289] Remove old format implementation from backend

* [apache#1289] Remove old format implementation from ui

* [apache#1289] Fix kafka e2e test

* Add migration script for specific adapters (apache#1289)

* Add initial version to migrate generic adapters (apache#1289)

* Modify format migrators (apache#1289)

* [apache#1289] Migrate influxdb to new interface

* [apache#1289] Fix ROS bridge adapter

* [apache#1289] Rename specific-adapter-configuration.component

* [apache#1289] Remove old data model

* [apache#1289] Fix mqtt integration test

* [apache#1289] Update Pulsar integration test

* [apache#1289] Remove DebugAdapterSink which is no longer needed for integration tests

* [apache#1289] Fix kafka adapter on restart

* [apache#1289] Fix migrations for all parser

* [hotfix] Fix image parser for adapters

* [hotfix] Change StreamPipes version to fix build problem

* [apache#1289] Move adapters

* [hotfix] Remove duplicate licence headers

* [hotfix] Fix conversion of pipeline element templates

* Move PullAdapter to extensions-management and api modules (apache#1289)

* Refactor structure of extensions-api, add supplier to adapter interface (apache#1581)

* Rename AdapterInterface to StreamPipesAdapter (apache#1590)

* [hotfix] Fix checkstyle issues

* [hotfix] Fix checkstyle issue

* [hotfix] Fix checkstyle issue

* [hotfix] Fix checkstyle

* Migrate ISS adapter and Flic adapter (apache#1289)

* Migrate connect adapters to new model (apache#1289)

* Properly apply configs to influx adapter (apache#1289)

* [hotfix] Fix checkstyle

* fix: minor adaptions

* fix: remove data set artifacts

* fix: minor fixes

* [hotfix] Regenerate typescript model

* [apache#1592] Add first version for an io link adapter

* Refactor data processor and sink API (apache#1632) (apache#1633)

* chore: mark streampipes-wrapper-python as deprecated (apache#1623)

* Bump types-requests in /streampipes-client-python (apache#1588)

Bumps [types-requests](https://github.com/python/typeshed) from 2.30.0.0 to 2.31.0.0.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-requests
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mkdocstrings[python] in /streampipes-client-python (apache#1631)

* chore: add missing support of NATS as messaging protocol (apache#1628)

* Bump spring-boot.version from 3.0.6 to 3.1.0 (apache#1595)

Bumps `spring-boot.version` from 3.0.6 to 3.1.0.

Updates `spring-boot-properties-migrator` from 3.0.6 to 3.1.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.0.6...v3.1.0)

Updates `spring-boot-starter-jersey` from 3.0.6 to 3.1.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.0.6...v3.1.0)

Updates `spring-boot-starter-jetty` from 3.0.6 to 3.1.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.0.6...v3.1.0)

Updates `spring-boot-starter-oauth2-client` from 3.0.6 to 3.1.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.0.6...v3.1.0)

Updates `spring-boot-starter-undertow` from 3.0.6 to 3.1.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.0.6...v3.1.0)

Updates `spring-boot-starter-web` from 3.0.6 to 3.1.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.0.6...v3.1.0)

Updates `spring-boot-maven-plugin` from 3.0.6 to 3.1.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.0.6...v3.1.0)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-properties-migrator
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.springframework.boot:spring-boot-starter-jersey
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.springframework.boot:spring-boot-starter-jetty
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.springframework.boot:spring-boot-starter-oauth2-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.springframework.boot:spring-boot-starter-undertow
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.springframework.boot:spring-boot-starter-web
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.springframework.boot:spring-boot-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Refactor data processor and sink API (apache#1632)

* Cleanup pom file (apache#1632)

* Migrate processors to API (apache#1632)

* [hotfix] Add runtime provider, update pom

* Fix bug in standalone wrapper (apache#1632)

* Fix instance provision in compatibility layer (apache#1632)

* [hotfix] Disable Maven cache in workflow file

* [hotfix] Fix failing build by reverting Flink version

* [hotfix] Add proper time selection to another cypress test (apache#1641)

* Fix bug in aggregation flink module

* Properly return output source and schema info

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Tim <50115603+bossenti@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: remove Plc4xPassiveAdapter

* Add implementation for schema guessing from the example file in the HTTP

resolves apache#1637
fixes apache#1518 for streampipes-extensions

* [apache#1592] Add io link master id to event

* [apache#1592] Provide documentation for io link adapter

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dominik Riemer <dominik.riemer@gmail.com>
Co-authored-by: Stefan Obermeier <st.obermeier@seeburger.de>
Co-authored-by: bossenti <bossenti@posteo.de>
Co-authored-by: Tim <50115603+bossenti@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored and jjbiggins committed Jul 5, 2023
1 parent b91376d commit 181794c
Show file tree
Hide file tree
Showing 8 changed files with 565 additions and 0 deletions.
Expand Up @@ -18,6 +18,7 @@

package org.apache.streampipes.connect.iiot;

import org.apache.streampipes.connect.iiot.adapters.iolink.IfmAlMqttAdapter;
import org.apache.streampipes.connect.iiot.adapters.opcua.OpcUaAdapter;
import org.apache.streampipes.connect.iiot.adapters.plc4x.modbus.Plc4xModbusAdapter;
import org.apache.streampipes.connect.iiot.adapters.plc4x.s7.Plc4xS7Adapter;
Expand Down Expand Up @@ -49,6 +50,7 @@ public SpServiceDefinition provideServiceDefinition() {
8001)
.registerAdapter(new MachineDataSimulatorAdapter())
.registerAdapter(new FileReplayAdapter())
.registerAdapter(new IfmAlMqttAdapter())
.registerAdapter(new RosBridgeAdapter())
.registerAdapter(new OpcUaAdapter())
.registerAdapter(new Plc4xS7Adapter())
Expand Down
@@ -0,0 +1,186 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.streampipes.connect.iiot.adapters.iolink;

import org.apache.streampipes.commons.exceptions.connect.AdapterException;
import org.apache.streampipes.commons.exceptions.connect.ParseException;
import org.apache.streampipes.connect.iiot.adapters.iolink.sensor.SensorVVB001;
import org.apache.streampipes.extensions.api.connect.IAdapterConfiguration;
import org.apache.streampipes.extensions.api.connect.IEventCollector;
import org.apache.streampipes.extensions.api.connect.IParser;
import org.apache.streampipes.extensions.api.connect.StreamPipesAdapter;
import org.apache.streampipes.extensions.api.connect.context.IAdapterGuessSchemaContext;
import org.apache.streampipes.extensions.api.connect.context.IAdapterRuntimeContext;
import org.apache.streampipes.extensions.api.extractor.IAdapterParameterExtractor;
import org.apache.streampipes.extensions.api.extractor.IStaticPropertyExtractor;
import org.apache.streampipes.extensions.management.connect.adapter.parser.JsonParsers;
import org.apache.streampipes.extensions.management.connect.adapter.parser.json.JsonObjectParser;
import org.apache.streampipes.model.AdapterType;
import org.apache.streampipes.model.StreamPipesErrorMessage;
import org.apache.streampipes.model.connect.guess.GuessSchema;
import org.apache.streampipes.model.monitoring.SpLogEntry;
import org.apache.streampipes.pe.shared.config.mqtt.MqttConfig;
import org.apache.streampipes.pe.shared.config.mqtt.MqttConnectUtils;
import org.apache.streampipes.pe.shared.config.mqtt.MqttConsumer;
import org.apache.streampipes.sdk.builder.adapter.AdapterConfigurationBuilder;
import org.apache.streampipes.sdk.helpers.Labels;
import org.apache.streampipes.sdk.helpers.Locales;
import org.apache.streampipes.sdk.helpers.Options;
import org.apache.streampipes.sdk.utils.Assets;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

public class IfmAlMqttAdapter implements StreamPipesAdapter {

public static final String ID = "org.apache.streampipes.connect.iiot.adapters.iolink";

private static final Logger LOG = LoggerFactory.getLogger(IfmAlMqttAdapter.class);

private static final String PORTS = "ports";
private static final String SENSOR_TYPE = "sensor_type";

private MqttConsumer mqttConsumer;
private MqttConfig mqttConfig;

private final IParser parser;

private List<String> ports;

public IfmAlMqttAdapter() {
parser = new JsonParsers(new JsonObjectParser());
}

@Override
public IAdapterConfiguration declareConfig() {
return AdapterConfigurationBuilder
.create(ID, IfmAlMqttAdapter::new)
.withLocales(Locales.EN)
.withAssets(Assets.DOCUMENTATION, Assets.ICON)
.withCategory(AdapterType.Generic, AdapterType.Manufacturing)
.requiredTextParameter(MqttConnectUtils.getBrokerUrlLabel())
.requiredAlternatives(MqttConnectUtils.getAccessModeLabel(), MqttConnectUtils.getAlternativesOne(),
MqttConnectUtils.getAlternativesTwo())
.requiredMultiValueSelection(Labels.withId(PORTS),
Options.from("Port 1", "Port 2", "Port 3", "Port 4"))
.requiredSingleValueSelection(Labels.withId(SENSOR_TYPE),
Options.from("VVB001"))
.requiredTextParameter(MqttConnectUtils.getTopicLabel())
.buildConfiguration();
}

@Override
public void onAdapterStarted(IAdapterParameterExtractor extractor,
IEventCollector collector,
IAdapterRuntimeContext adapterRuntimeContext) throws AdapterException {
var sensor = new SensorVVB001();

this.applyConfiguration(extractor.getStaticPropertyExtractor());
this.mqttConsumer = new MqttConsumer(
this.mqttConfig,
(mqttEvent) -> {
try {
InputStream in = convertByte(mqttEvent);
parser.parse(in, (event) -> {

var data = getMap(event, "data");
var payload = getMap(data, "payload");

var deviceInfo = getMap(payload, "/deviceinfo/serialnumber");
var serialnumber = deviceInfo.get("data");

for (int i = 0; i < ports.size(); i++) {

var portResult = getMap(payload,
"/iolinkmaster/port[%s]/iolinkdevice/pdin".formatted(ports.get(i)));
var eventData = (String) portResult.get("data");

var parsedEvent = sensor.parseEvent(eventData);
parsedEvent.put("timestamp", System.currentTimeMillis() + i);
parsedEvent.put("port", "port" + ports.get(i));
parsedEvent.put(SensorVVB001.IO_LINK_MASTER_SN, serialnumber);

collector.collect(parsedEvent);
}
});
} catch (Exception e) {
adapterRuntimeContext
.getLogger()
.addErrorMessage(
extractor.getAdapterDescription().getElementId(),
SpLogEntry.from(System.currentTimeMillis(), StreamPipesErrorMessage.from(e)));
LOG.error("Could not parse event", e);
}
});

Thread thread = new Thread(this.mqttConsumer);
thread.start();
}

@Override
public void onAdapterStopped(IAdapterParameterExtractor extractor,
IAdapterRuntimeContext adapterRuntimeContext) throws AdapterException {
this.mqttConsumer.close();
}

@Override
public GuessSchema onSchemaRequested(IAdapterParameterExtractor extractor,
IAdapterGuessSchemaContext adapterGuessSchemaContext) throws AdapterException {
this.applyConfiguration(extractor.getStaticPropertyExtractor());

return new SensorVVB001().getEventSchema();
}


private void applyConfiguration(IStaticPropertyExtractor extractor) {
mqttConfig = MqttConnectUtils.getMqttConfig(extractor);
String sensorType = extractor.selectedSingleValue(SENSOR_TYPE, String.class);
var selectedPorts = extractor.selectedMultiValues(PORTS, String.class);
ports = selectedPorts.stream()
.map(port -> port.substring(5))
.toList();
}

private Map<String, Object> getMap(Map<String, Object> event, String key) {
if (event.containsKey(key)) {
var payload = event.get(key);
if (payload instanceof Map) {
return (Map<String, Object>) event.get(key);
} else {
throw new ParseException(getErrorMessage(key));
}
} else {
throw new ParseException(getErrorMessage(key));
}
}

private String getErrorMessage(String key) {
return "The event does not contain key: %s. Please reconfigure the IOLink master to include this key".formatted(
key);
}

private InputStream convertByte(byte[] event) {
return IOUtils.toInputStream(new String(event), "UTF-8");
}
}
@@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.streampipes.connect.iiot.adapters.iolink.sensor;

import org.apache.streampipes.model.connect.guess.GuessSchema;

import java.util.Map;

public interface IoLinkSensor {
GuessSchema getEventSchema();

Map<String, Object> parseEvent(String encodedEvent);
}
@@ -0,0 +1,162 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.streampipes.connect.iiot.adapters.iolink.sensor;

import org.apache.streampipes.model.connect.guess.GuessSchema;
import org.apache.streampipes.model.schema.PropertyScope;
import org.apache.streampipes.sdk.builder.PrimitivePropertyBuilder;
import org.apache.streampipes.sdk.builder.adapter.GuessSchemaBuilder;
import org.apache.streampipes.sdk.utils.Datatypes;

import java.util.HashMap;
import java.util.Map;

import static org.apache.streampipes.sdk.helpers.EpProperties.timestampProperty;

public class SensorVVB001 implements IoLinkSensor {

public static final String V_RMS_NAME = "vRms";
public static final String A_PEAK_NAME = "aPeak";
public static final String A_RMS_NAME = "aRms";
public static final String TEMPERATURE_NAME = "temperature";
public static final String CREST_NAME = "crest";
public static final String STATUS_NAME = "status";
public static final String OUT_1_NAME = "out1";
public static final String OUT_2_NAME = "out2";
public static final String PORT_NAME = "port";

public static final String IO_LINK_MASTER_SN = "ioLinkMasterSN";


@Override
public GuessSchema getEventSchema() {

return GuessSchemaBuilder.create()
.property(timestampProperty("timestamp"))
.sample("timestamp", 1685525380729L)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Float, V_RMS_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Speed RMS value")
.build()
)
.sample(V_RMS_NAME, 0.0023)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Float, A_PEAK_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Acceleration peak value")
.build()
)
.sample(A_PEAK_NAME, 6.6)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Float, A_RMS_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Acceleration RMS value")
.build()
)
.sample(A_RMS_NAME, 1.8)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Float, TEMPERATURE_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Current temperature")
.build()
)
.sample(TEMPERATURE_NAME, 22.0)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Float, CREST_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Acceleration crest factor")
.build()
)
.sample(CREST_NAME, 3.7)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Integer, STATUS_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Device status (0: OK, 1: Maintenance required, "
+ "2: Out of specification, 3: Function Test, 4: Error)")
.build()
)
.sample(STATUS_NAME, 0)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Boolean, OUT_1_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Current state of the digital signal")
.build()
)
.sample(OUT_1_NAME, true)
.property(
PrimitivePropertyBuilder
.create(Datatypes.Boolean, OUT_2_NAME)
.scope(PropertyScope.MEASUREMENT_PROPERTY)
.description("Current state of the digital signal")
.build()
)
.sample(OUT_2_NAME, true)
.property(
PrimitivePropertyBuilder
.create(Datatypes.String, PORT_NAME)
.scope(PropertyScope.DIMENSION_PROPERTY)
.description("Port the sensor is connected to at IOLink master")
.build()
)
.sample(PORT_NAME, "port1")
.property(
PrimitivePropertyBuilder
.create(Datatypes.String, IO_LINK_MASTER_SN)
.scope(PropertyScope.DIMENSION_PROPERTY)
.description("This is the serial number of the IO-Link Master")
.build()
)
.sample(PORT_NAME, "XXXXXXXXXXXX")
.build();
}

@Override
public Map<String, Object> parseEvent(String encodedEvent) {
var event = new HashMap<String, Object>();
event.put(V_RMS_NAME, getValue(0, 4, 0.0001, encodedEvent));
event.put(A_PEAK_NAME, getValue(8, 12, 0.1, encodedEvent));
event.put(A_RMS_NAME, getValue(16, 20, 0.1, encodedEvent));
event.put(TEMPERATURE_NAME, getValue(24, 28, 0.1, encodedEvent));
event.put(CREST_NAME, getValue(32, 36, 0.1, encodedEvent));
event.put(STATUS_NAME, (int) getValue(38, 39, 1.0, encodedEvent));

// The last two bits represent the status
var outValues = (int) getValue(39, 40, 1.0, encodedEvent);
event.put(OUT_1_NAME, (outValues & 1) != 0);
event.put(OUT_2_NAME, (outValues & 2) != 0);

return event;
}

private double getValue(int start, int end, double scaleFactor, String encodedEvent) {
var word = encodedEvent.substring(start, end);

var rawValue = (double) (Integer.parseInt(word, 16));

return rawValue * scaleFactor;
}
}

0 comments on commit 181794c

Please sign in to comment.