From b3ec9c224c2edda09806bad46a09fbf879aca7fd Mon Sep 17 00:00:00 2001 From: Martin Mauch Date: Mon, 4 Feb 2019 11:13:36 +0100 Subject: [PATCH] Add ShimmerDataFrame constructor that allows full initialization --- .../de/fau/sensorlib/sensors/ShimmerSensor.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SensorLib/sls-shimmer/src/main/java/de/fau/sensorlib/sensors/ShimmerSensor.java b/SensorLib/sls-shimmer/src/main/java/de/fau/sensorlib/sensors/ShimmerSensor.java index 5272a1b1..9e2424b5 100644 --- a/SensorLib/sls-shimmer/src/main/java/de/fau/sensorlib/sensors/ShimmerSensor.java +++ b/SensorLib/sls-shimmer/src/main/java/de/fau/sensorlib/sensors/ShimmerSensor.java @@ -60,6 +60,21 @@ public ShimmerDataFrame(AbstractSensor fromSensor, double timestamp) { super(fromSensor, timestamp); } + public ShimmerDataFrame(AbstractSensor fromSensor, double timestamp, double emg, double[] accel, double [] gyro, double[] ecg) { + super(fromSensor, timestamp); + this.ecg = ecg[0]; + this.emg = emg; + this.ax = accel[0]; + this.ay = accel[1]; + this.az = accel[2]; + this.gx = gyro[0]; + this.gy = gyro[1]; + this.gz = gyro[2]; + this.ecgRA = ecg[0]; + this.ecgLA = ecg[1]; + this.isTwoChannelEcg = ecg.length == 2; + } + @Override public double getEcgSample() { if (isTwoChannelEcg) {