From 33ab9268550b1c552bab84b51cc97959ee423125 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 470bfad2..297ae364 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) {