Skip to content

Commit

Permalink
Add ShimmerDataFrame constructor that allows full initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
nightscape committed Mar 7, 2019
1 parent ee7a13d commit 04eac98
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 04eac98

Please sign in to comment.