@@ -211,9 +211,6 @@ class PacketLossTrackerCytonSerialDaisy extends PacketLossTracker {
211211 }
212212}
213213
214- // with accel: sample index range 0-100, all sample indexes are duplicated except for zero.
215- // eg 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, ... , 99, 99, 100, 100, 0, 1, 1, 2, 2, 3, 3, ...
216- // without acceL: sample 0, then 101-200
217214class PacketLossTrackerGanglionBLE extends PacketLossTracker {
218215
219216 ArrayList<Integer > sampleIndexArrayAccel = new ArrayList<Integer > ();
@@ -225,32 +222,6 @@ class PacketLossTrackerGanglionBLE extends PacketLossTracker {
225222
226223 PacketLossTrackerGanglionBLE (int _sampleIndexChannel , int _timestampChannel , TTQTimeProvider _timeProvider ) {
227224 super (_sampleIndexChannel, _timestampChannel, _timeProvider);
228-
229- {
230- // add indices to array of indices
231- // With accel: 0-100, all sample indexes are duplicated except for zero
232- sampleIndexArrayAccel. add(0 );
233- int firstIndex = 1 ;
234- int lastIndex = 100 ;
235- for (int i = firstIndex; i <= lastIndex; i++ ) {
236- sampleIndexArrayAccel. add(i);
237- sampleIndexArrayAccel. add(i);
238- }
239- }
240-
241- {
242- // add indices to array of indices
243- // Without accel: 0, then 101 to 200, all sample indexes are duplicated except for zero
244- sampleIndexArrayNoAccel. add(0 );
245- int firstIndex = 101 ;
246- int lastIndex = 200 ;
247- for (int i = firstIndex; i <= lastIndex; i++ ) {
248- sampleIndexArrayNoAccel. add(i);
249- sampleIndexArrayNoAccel. add(i);
250- }
251- }
252-
253- setAccelerometerActive(true );
254225 }
255226
256227 public void setAccelerometerActive (boolean active ) {
@@ -264,4 +235,60 @@ class PacketLossTrackerGanglionBLE extends PacketLossTracker {
264235
265236 reset();
266237 }
238+ }
239+
240+ // With acceleration: sample index range 0-100, all sample indexes are duplicated except for zero.
241+ // E.g. 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, ... , 99, 99, 100, 100, 0, 1, 1, 2, 2, 3, 3, ...
242+ // Without acceleration: sample 0, then 101-200
243+ class PacketLossTrackerGanglionBLE2 extends PacketLossTrackerGanglionBLE {
244+ PacketLossTrackerGanglionBLE2 (int _sampleIndexChannel , int _timestampChannel ) {
245+ this (_sampleIndexChannel, _timestampChannel, new RealTimeProvider ());
246+ }
247+
248+ PacketLossTrackerGanglionBLE2 (int _sampleIndexChannel , int _timestampChannel , TTQTimeProvider _timeProvider ) {
249+ super (_sampleIndexChannel, _timestampChannel, _timeProvider);
250+
251+ // Add indices to array of indices
252+ // With acceleration: 0-100, all sample indexes are duplicated except for zero
253+ sampleIndexArrayAccel. add(0 );
254+ for (int i = 1 ; i <= 100 ; i++ ) {
255+ sampleIndexArrayAccel. add(i);
256+ sampleIndexArrayAccel. add(i);
257+ }
258+
259+ // Add indices to array of indices
260+ // Without acceleration: 0, then 101 to 200, all sample indexes are duplicated except for zero
261+ sampleIndexArrayNoAccel. add(0 );
262+ for (int i = 101 ; i <= 200 ; i++ ) {
263+ sampleIndexArrayNoAccel. add(i);
264+ sampleIndexArrayNoAccel. add(i);
265+ }
266+
267+ setAccelerometerActive(true );
268+ }
269+ }
270+
271+ // With acceleration: sample index range 0-100, all sample indexes are duplicated (including zero).
272+ // E.g. 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, ... , 99, 99, 100, 100, 0, 0, 1, 1, 2, 2, 3, 3, ...
273+ // Without acceleration: 101-200
274+ class PacketLossTrackerGanglionBLE3 extends PacketLossTrackerGanglionBLE {
275+ PacketLossTrackerGanglionBLE3 (int _sampleIndexChannel , int _timestampChannel ) {
276+ this (_sampleIndexChannel, _timestampChannel, new RealTimeProvider ());
277+ }
278+
279+ PacketLossTrackerGanglionBLE3 (int _sampleIndexChannel , int _timestampChannel , TTQTimeProvider _timeProvider ) {
280+ super (_sampleIndexChannel, _timestampChannel, _timeProvider);
281+
282+ for (int i = 0 ; i < 100 ; i++ ) {
283+ sampleIndexArrayAccel. add(i);
284+ sampleIndexArrayAccel. add(i);
285+ }
286+
287+ for (int i = 100 ; i < 200 ; i++ ) {
288+ sampleIndexArrayNoAccel. add(i);
289+ sampleIndexArrayNoAccel. add(i);
290+ }
291+
292+ setAccelerometerActive(true );
293+ }
267294}
0 commit comments