-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathConfiguration.java
More file actions
2721 lines (2372 loc) · 163 KB
/
Copy pathConfiguration.java
File metadata and controls
2721 lines (2372 loc) · 163 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*Rev 2.6
*
*
* Copyright (c) 2010, Shimmer Research, Ltd.
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Shimmer Research, Ltd. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @author Jong Chern Lim, Ruaidhri Molloy, Mark Nolan
* @date May, 2014
*
* The purpose of this code is to maintain the configurations of BTSTREAM
*
*
* Changes since 2.5 (RM first revision)
* - Addition of Strain Gauge for Shimmer3
*
* Changes since 2.2
* - Changed list of compatible sensors to public
*
*/
package com.shimmerresearch.driver;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import com.shimmerresearch.algorithms.orientation.OrientationModule6DOF;
import com.shimmerresearch.algorithms.orientation.OrientationModule9DOF;
import com.shimmerresearch.driverUtilities.ChannelDetails;
import com.shimmerresearch.driverUtilities.ConfigOptionDetailsSensor;
import com.shimmerresearch.driverUtilities.SensorDetailsRef;
import com.shimmerresearch.driverUtilities.SensorGroupingDetails;
import com.shimmerresearch.driverUtilities.ShimmerVerDetails;
import com.shimmerresearch.driverUtilities.ShimmerVerObject;
import com.shimmerresearch.driverUtilities.ChannelDetails.CHANNEL_TYPE;
import com.shimmerresearch.driverUtilities.ShimmerVerDetails.FW_ID;
import com.shimmerresearch.driverUtilities.ShimmerVerDetails.HW_ID;
import com.shimmerresearch.driverUtilities.ShimmerVerDetails.HW_ID_SR_CODES;
import com.shimmerresearch.sensors.AbstractSensor;
import com.shimmerresearch.sensors.SensorADC;
import com.shimmerresearch.sensors.SensorBattVoltage;
import com.shimmerresearch.sensors.SensorBridgeAmp;
import com.shimmerresearch.sensors.SensorECGToHRFw;
import com.shimmerresearch.sensors.SensorEXG;
import com.shimmerresearch.sensors.SensorGSR;
import com.shimmerresearch.sensors.SensorPPG;
import com.shimmerresearch.sensors.SensorSTC3100;
import com.shimmerresearch.sensors.SensorSystemTimeStamp;
import com.shimmerresearch.sensors.SensorShimmerClock;
import com.shimmerresearch.sensors.ShimmerStreamingProperties;
import com.shimmerresearch.sensors.bmpX80.SensorBMP180;
import com.shimmerresearch.sensors.bmpX80.SensorBMP280;
import com.shimmerresearch.sensors.bmpX80.SensorBMP390;
import com.shimmerresearch.sensors.kionix.SensorKionixAccel;
import com.shimmerresearch.sensors.kionix.SensorKionixKXRB52042;
import com.shimmerresearch.sensors.lisxmdl.SensorLIS3MDL;
import com.shimmerresearch.sensors.lisxmdl.SensorLIS2MDL;
import com.shimmerresearch.sensors.lsm303.SensorLSM303;
import com.shimmerresearch.sensors.lsm303.SensorLSM303DLHC;
import com.shimmerresearch.sensors.mpu9x50.SensorMPU9150;
import com.shimmerresearch.sensors.mpu9x50.SensorMPU9X50;
import com.shimmerresearch.sensors.adxl371.SensorADXL371;
import com.shimmerresearch.sensors.lsm6dsv.SensorLSM6DSV;
import com.shimmerresearch.sensors.lis2dw12.SensorLIS2DW12;
import com.shimmerresearch.verisense.sensors.SensorLSM6DS3;
//import com.shimmerresearch.verisense.sensors.SensorLIS2DW12;
import com.shimmerresearch.verisense.sensors.SensorBattVoltageVerisense;
import com.shimmerresearch.verisense.sensors.SensorGSRVerisense;
import com.shimmerresearch.verisense.sensors.SensorMAX86916;
/**
* The purpose of this code is to maintain the configurations constants for a
* Shimmer Device
*
* @author Jong Chern Lim,
* @author Ruaidhri Molloy
* @author Mark Nolan
* @author Alex Saez
*
*/
public class Configuration {
public static final double ACCELERATION_DUE_TO_GRAVITY = 9.81;
public static class CHANNEL_UNITS{
//Sensors units
public static final String NO_UNITS = "no_units";
public static final String MILLISECONDS = "ms";
public static final String SECONDS = "s";
public static final String MINUTES = "min";
public static final String MICROSECONDS = "us";
public static final String CLOCK_UNIT = "Ticks";
public static final String FREQUENCY = "Hz";
//TODO: should be .SSS rather then .000? .000 might be required for viewing files in Microsoft Office
public static final String DATE_FORMAT = "yyyy/mm/dd hh:mm:ss.000";
public static final String METER = "m";
public static final String METER_PER_SECOND = "m/s";
public static final String METER_PER_SECOND_SQUARE = "m/(s^2)";
public static final String METER_SQUARE = "m^2";
public static final String MILLIMETER = "mm";
public static final String MILLIMETER_PER_SECOND = "mm/s";
public static final String MILLIMETER_PER_SECOND_SQUARE = "mm/(s^2)";
public static final String MILLIMETER_SQUARE = "mm^2";
public static final String MILLIMETER_SQUARE_PER_SECOND = "mm^2/s";
public static final String DEGREES_PER_SECOND = "deg/s";
public static final String LOCAL_FLUX = "local_flux";
public static final String KOHMS = "kOhms";
public static final String KOHMS_PER_SECOND = "kOhms/s";
public static final String KOHMS_SECONDS = "kOhm.s";
public static final String MILLIVOLTS = "mV";
public static final String MILLIAMPS= "mA";
public static final String NANOAMPS= "nA";
public static final String MILLIAMP_HOUR = "mAh";
public static final String BEATS_PER_MINUTE = "BPM";
public static final String KPASCAL = "kPa";
public static final String DEGREES_CELSIUS_SHORT = "\u00B0C";
public static final String DEGREES_CELSIUS = "Degrees Celsius";
public static final String DEGREES = "Degrees";
public static final String U_TESLA = "uT";
public static final String U_SIEMENS = "uS";
public static final String GRAVITY = "g";
public static final String RPM = "rpm";
public static final String POWER = "dB";
public static final String SCORE = "Score";
public static final String ACCEL_CAL_UNIT = METER_PER_SECOND_SQUARE;
public static final String GYRO_CAL_UNIT = DEGREES_PER_SECOND;
public static final String MAG_CAL_UNIT = LOCAL_FLUX;
// public static final String ACCEL_DEFAULT_CAL_UNIT = METER_PER_SECOND_SQUARE+"*";
// public static final String GYRO_DEFAULT_CAL_UNIT = DEGREES_PER_SECOND+"*";
// public static final String MAG_DEFAULT_CAL_UNIT = LOCAL_FLUX+"*";
public static final String LOCAL = "local"; //used for axis-angle and madgewick quaternions //XXX-RS-LSM-SensorClass?
public static final String PERCENT = "%";
public static final String PIXEL = "px";
public static final String ASCII_CODE = "ASCII";
}
public enum COMMUNICATION_TYPE{
ALL,
DOCK,
BLUETOOTH,
IEEE802154,
SD, // Bin file
HID,
USB,
CLASS, //this is to read the value of the class for clones etc. e.g. if you do a getsettings(accelRange,CLASS) and getsettings(accelRange,Bluetooth), the results are different. One returns the value in the object while the other should generate a read command to be sent to the shimmer device
}
public enum COMMUNICATION_ACTION{
READ,
WRITE
}
public static class Shimmer2{
public class Channel{
public static final int XAccel = 0x00;
public static final int YAccel = 0x01;
public static final int ZAccel = 0x02;
public static final int XGyro = 0x03;
public static final int YGyro = 0x04;
public static final int ZGyro = 0x05;
public static final int XMag = 0x06;
public static final int YMag = 0x07;
public static final int ZMag = 0x08;
public static final int EcgRaLl = 0x09;
public static final int EcgLaLl = 0x0A;
public static final int GsrRaw = 0x0B;
public static final int GsrRes = 0x0C;
public static final int Emg = 0x0D;
public static final int AnExA0 = 0x0E;
public static final int AnExA7 = 0x0F;
public static final int BridgeAmpHigh = 0x10;
public static final int BridgeAmpLow = 0x11;
public static final int HeartRate = 0x12;
}
public class SensorBitmap{
public static final int SENSOR_ACCEL = 0x80;
public static final int SENSOR_GYRO = 0x40;
public static final int SENSOR_MAG = 0x20;
public static final int SENSOR_ECG = 0x10;
public static final int SENSOR_EMG = 0x08;
public static final int SENSOR_GSR = 0x04;
public static final int SENSOR_EXP_BOARD_A7 = 0x02;
public static final int SENSOR_EXP_BOARD_A0 = 0x01;
public static final int SENSOR_BRIDGE_AMP = 0x8000;
public static final int SENSOR_HEART = 0x4000;
}
//DATABASE NAMES
//GUI AND EXPORT CHANNELS
public static class ObjectClusterSensorName{
public static String TIMESTAMP = "Timestamp";
public static String REAL_TIME_CLOCK = "RealTime";
public static String ACCEL_X = "Accel_X";
public static String ACCEL_Y = "Accel_Y";
public static String ACCEL_Z = "Accel_Z";
public static String BATTERY = "Battery";
public static String REG = "Reg";
public static String EXT_EXP_A7 = "Ext_Exp_A7";
public static String EXT_EXP_A6 = "Ext_Exp_A6";
public static String EXT_EXP_A15 = "Ext_Exp_A15";
public static String INT_EXP_A12 = "Int_Exp_A12";
public static String INT_EXP_A13 = "Int_Exp_A13";
public static String INT_EXP_A14 = "Int_Exp_A14";
public static String BRIDGE_AMP_HIGH = "Bridge_Amp_High";
public static String BRIDGE_AMP_LOW = "Bridge_Amp_Low";
public static String GSR = "GSR";
//public static String GSR_RAW = "GSR Raw";
public static String GSR_RES = "GSR Res";
public static String INT_EXP_A1 = "Int_Exp_A1";
public static String EXP_BOARD_A0 = "Exp_Board_A0";
public static String EXP_BOARD_A7 = "Exp_Board_A7";
public static String GYRO_X = "Gyro_X";
public static String GYRO_Y = "Gyro_Y";
public static String GYRO_Z = "Gyro_Z";
public static String MAG_X = "Mag_X";
public static String MAG_Y = "Mag_Y";
public static String MAG_Z = "Mag_Z";
public static String EMG = "EMG";
public static String ECG_RA_LL = "ECG_RA-LL";
public static String ECG_LA_LL = "ECG_LA-LL";
public static String ECG_TO_HR = "ECGtoHR";
public static String QUAT_MADGE_6DOF_W = "Quat_Madge_6DOF_W";
public static String QUAT_MADGE_6DOF_X = "Quat_Madge_6DOF_X";
public static String QUAT_MADGE_6DOF_Y = "Quat_Madge_6DOF_Y";
public static String QUAT_MADGE_6DOF_Z = "Quat_Madge_6DOF_Z";
public static String QUAT_MADGE_9DOF_W = "Quat_Madge_9DOF_W";
public static String QUAT_MADGE_9DOF_X = "Quat_Madge_9DOF_X";
public static String QUAT_MADGE_9DOF_Y = "Quat_Madge_9DOF_Y";
public static String QUAT_MADGE_9DOF_Z = "Quat_Madge_9DOF_Z";
public static String EULER_6DOF_YAW = "Euler_6DOF_Yaw";
public static String EULER_6DOF_PITCH = "Euler_6DOF_PITCH";
public static String EULER_6DOF_ROLL = "Euler_6DOF_Roll";
public static String EULER_9DOF_YAW = "Euler_9DOF_YAW";
public static String EULER_9DOF_PITCH = "Euler_9DOF_PITCH";
public static String EULER_9DOF_ROLL = "Euler_9DOF_Roll";
public static String HEART_RATE = "Heart_Rate"; //for the heart rate strap now no longer sold
public static String AXIS_ANGLE_6DOF_A = "Axis_Angle_A";
public static String AXIS_ANGLE_6DOF_X = "Axis_Angle_X";
public static String AXIS_ANGLE_6DOF_Y = "Axis_Angle_Y";
public static String AXIS_ANGLE_6DOF_Z = "Axis_Angle_Z";
public static String AXIS_ANGLE_9DOF_A = "Axis_Angle_A";
public static String AXIS_ANGLE_9DOF_X = "Axis_Angle_X";
public static String AXIS_ANGLE_9DOF_Y = "Axis_Angle_Y";
public static String AXIS_ANGLE_9DOF_Z = "Axis_Angle_Z";
public static String VOLT_REG = "VSenseReg";
}
public static final String[] ListofCompatibleSensors={"Accelerometer","Gyroscope","Magnetometer","Battery Voltage","ECG","EMG","GSR","Exp Board","Bridge Amplifier","Heart Rate"};
public static final String[] ListofAccelRange={"+/- 1.5g","+/- 6g"};
public static final String[] ListofMagRange={"+/- 0.8Ga","+/- 1.3Ga","+/- 1.9Ga","+/- 2.5Ga","+/- 4.0Ga","+/- 4.7Ga","+/- 5.6Ga","+/- 8.1Ga"};
public static final String[] ListofGSRRange={"10kOhm to 56kOhm","56kOhm to 220kOhm","220kOhm to 680kOhm","680kOhm to 4.7MOhm","Auto Range"};
public class SENSOR_ID{
public static final int ACCEL = 0;
public static final int GYRO = 1;
public static final int MAG = 2;
public static final int EMG = 3;
public static final int ECG = 4;
public static final int GSR = 5;
public static final int EXP_BOARD_A7 = 6;
public static final int EXP_BOARD_A0 = 7;
public static final int EXP_BOARD = 8;
public static final int BRIDGE_AMP = 9;
public static final int HEART = 10;
public static final int BATT = 11;
public static final int EXT_ADC_A15 = 12;
public static final int INT_ADC_A1 = 13;
public static final int INT_ADC_A12 = 14;
public static final int INT_ADC_A13 = 15;
public static final int INT_ADC_A14 = 16;
}
public static final Map<Integer, SensorDetailsRef> mSensorMapRef;
static {
Map<Integer, SensorDetailsRef> aMap = new LinkedHashMap<Integer,SensorDetailsRef>();
aMap.put(Configuration.Shimmer2.SENSOR_ID.ACCEL, new SensorDetailsRef(0x80, 0, "Accelerometer"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.GYRO, new SensorDetailsRef(0x40, 0, "Gyroscope"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.MAG, new SensorDetailsRef(0x20, 0, "Magnetometer"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.EMG, new SensorDetailsRef(0x08, 0, "EMG"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.ECG, new SensorDetailsRef(0x10, 0, "ECG"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.GSR, new SensorDetailsRef(0x04, 0, "GSR"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A7, new SensorDetailsRef(0x02, 0, "Exp Board A7"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A0, new SensorDetailsRef(0x01, 0, "Exp Board A0"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.EXP_BOARD, new SensorDetailsRef(0x02|0x01, 0, "Exp Board"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.BRIDGE_AMP, new SensorDetailsRef(0x8000, 0, "Bridge Amplifier"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.HEART, new SensorDetailsRef(0x4000, 0, "Heart Rate"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.BATT, new SensorDetailsRef(0x2000, 0, "Battery Voltage"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.EXT_ADC_A15, new SensorDetailsRef(0x0800, 0, "External ADC A15"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.INT_ADC_A1, new SensorDetailsRef(0x0400, 0, "Internal ADC A1"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.INT_ADC_A12, new SensorDetailsRef(0x0200, 0, "Internal ADC A12"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.INT_ADC_A13, new SensorDetailsRef(0x0100, 0, "Internal ADC A13"));
aMap.put(Configuration.Shimmer2.SENSOR_ID.INT_ADC_A14, new SensorDetailsRef(0x800000, 0, "Internal ADC A14"));
// Conflicting Channels
aMap.get(Configuration.Shimmer2.SENSOR_ID.GYRO).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.ECG,
Configuration.Shimmer2.SENSOR_ID.EMG,
Configuration.Shimmer2.SENSOR_ID.GSR,
Configuration.Shimmer2.SENSOR_ID.BRIDGE_AMP);
aMap.get(Configuration.Shimmer2.SENSOR_ID.MAG).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.ECG,
Configuration.Shimmer2.SENSOR_ID.EMG,
Configuration.Shimmer2.SENSOR_ID.GSR,
Configuration.Shimmer2.SENSOR_ID.BRIDGE_AMP);
aMap.get(Configuration.Shimmer2.SENSOR_ID.EMG).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.GSR,
Configuration.Shimmer2.SENSOR_ID.ECG,
Configuration.Shimmer2.SENSOR_ID.BRIDGE_AMP,
Configuration.Shimmer2.SENSOR_ID.GYRO,
Configuration.Shimmer2.SENSOR_ID.MAG);
aMap.get(Configuration.Shimmer2.SENSOR_ID.ECG).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.GSR,
Configuration.Shimmer2.SENSOR_ID.EMG,
Configuration.Shimmer2.SENSOR_ID.BRIDGE_AMP,
Configuration.Shimmer2.SENSOR_ID.GYRO,
Configuration.Shimmer2.SENSOR_ID.MAG);
aMap.get(Configuration.Shimmer2.SENSOR_ID.GSR).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.ECG,
Configuration.Shimmer2.SENSOR_ID.EMG,
Configuration.Shimmer2.SENSOR_ID.BRIDGE_AMP,
Configuration.Shimmer2.SENSOR_ID.GYRO,
Configuration.Shimmer2.SENSOR_ID.MAG);
aMap.get(Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A7).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.HEART,
Configuration.Shimmer2.SENSOR_ID.BATT);
aMap.get(Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A0).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.HEART,
Configuration.Shimmer2.SENSOR_ID.BATT);
aMap.get(Configuration.Shimmer2.SENSOR_ID.BRIDGE_AMP).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.ECG,
Configuration.Shimmer2.SENSOR_ID.EMG,
Configuration.Shimmer2.SENSOR_ID.GSR,
Configuration.Shimmer2.SENSOR_ID.GYRO,
Configuration.Shimmer2.SENSOR_ID.MAG);
aMap.get(Configuration.Shimmer2.SENSOR_ID.HEART).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A0,
Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A7);
aMap.get(Configuration.Shimmer2.SENSOR_ID.BATT).mListOfSensorIdsConflicting = Arrays.asList(
Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A0,
Configuration.Shimmer2.SENSOR_ID.EXP_BOARD_A7);
mSensorMapRef = Collections.unmodifiableMap(aMap);
}
}
@Deprecated
public static void setTooLegacyObjectClusterSensorNames(){
Shimmer3.ObjectClusterSensorName.TIMESTAMP = "Timestamp";
Shimmer3.ObjectClusterSensorName.REAL_TIME_CLOCK = "RealTime";
Shimmer3.ObjectClusterSensorName.ACCEL_LN_X = "Low Noise Accelerometer X";
Shimmer3.ObjectClusterSensorName.ACCEL_LN_Y = "Low Noise Accelerometer Y";
Shimmer3.ObjectClusterSensorName.ACCEL_LN_Z = "Low Noise Accelerometer Z";
Shimmer3.ObjectClusterSensorName.BATTERY = "VSenseBatt";
Shimmer3.ObjectClusterSensorName.EXT_EXP_ADC_A7 = "ExpBoard A7";
Shimmer3.ObjectClusterSensorName.EXT_EXP_ADC_A6 = "ExpBoard A6";
Shimmer3.ObjectClusterSensorName.EXT_EXP_ADC_A15 = "External ADC A15";
Shimmer3.ObjectClusterSensorName.INT_EXP_ADC_A12 = "Internal ADC A12";
Shimmer3.ObjectClusterSensorName.INT_EXP_ADC_A13 = "Internal ADC A13";
Shimmer3.ObjectClusterSensorName.INT_EXP_ADC_A14 = "Internal ADC A14";
Shimmer3.ObjectClusterSensorName.BRIDGE_AMP_HIGH = "Bridge Amplifier High";
Shimmer3.ObjectClusterSensorName.BRIDGE_AMP_LOW = "Bridge Amplifier Low";
Shimmer3.ObjectClusterSensorName.GSR_RESISTANCE = "GSR";
Shimmer3.ObjectClusterSensorName.INT_EXP_ADC_A1 = "Internal ADC A1";
Shimmer3.ObjectClusterSensorName.RESISTANCE_AMP = "Resistance Amp";
Shimmer3.ObjectClusterSensorName.GYRO_X = "Gyroscope X";
Shimmer3.ObjectClusterSensorName.GYRO_Y = "Gyroscope Y";
Shimmer3.ObjectClusterSensorName.GYRO_Z = "Gyroscope Z";
Shimmer3.ObjectClusterSensorName.ACCEL_WR_X = "Wide Range Accelerometer X";
Shimmer3.ObjectClusterSensorName.ACCEL_WR_Y = "Wide Range Accelerometer Y";
Shimmer3.ObjectClusterSensorName.ACCEL_WR_Z= "Wide Range Accelerometer Z";
Shimmer3.ObjectClusterSensorName.MAG_X = "Magnetometer X";
Shimmer3.ObjectClusterSensorName.MAG_Y = "Magnetometer Y";
Shimmer3.ObjectClusterSensorName.MAG_Z = "Magnetometer Z";
Shimmer3.ObjectClusterSensorName.ACCEL_MPU_X = "Accel_MPU_X";
Shimmer3.ObjectClusterSensorName.ACCEL_MPU_Y = "Accel_MPU_Y";
Shimmer3.ObjectClusterSensorName.ACCEL_MPU_Z = "Accel_MPU_Z";
Shimmer3.ObjectClusterSensorName.MAG_MPU_X = "Mag_MPU_X";
Shimmer3.ObjectClusterSensorName.MAG_MPU_Y = "Mag_MPU_Y";
Shimmer3.ObjectClusterSensorName.MAG_MPU_Z = "Mag_MPU_Z";
Shimmer3.ObjectClusterSensorName.TEMPERATURE_BMP180 = "Temperature";
Shimmer3.ObjectClusterSensorName.PRESSURE_BMP180 = "Pressure";
Shimmer3.ObjectClusterSensorName.EMG_CH1_24BIT = "EMG CH1";
Shimmer3.ObjectClusterSensorName.EMG_CH2_24BIT = "EMG CH2";
Shimmer3.ObjectClusterSensorName.EMG_CH1_16BIT = "EMG CH1";
Shimmer3.ObjectClusterSensorName.EMG_CH2_16BIT = "EMG CH2";
Shimmer3.ObjectClusterSensorName.ECG_LL_RA_24BIT = "ECG LL-RA";
Shimmer3.ObjectClusterSensorName.ECG_LA_RA_24BIT = "ECG LA-RA";
Shimmer3.ObjectClusterSensorName.ECG_LL_LA_24BIT = "ECG LL-LA";
Shimmer3.ObjectClusterSensorName.ECG_LL_LA_16BIT = "ECG LL-LA";
Shimmer3.ObjectClusterSensorName.ECG_LL_RA_16BIT = "ECG LL-RA";
Shimmer3.ObjectClusterSensorName.ECG_LA_RA_16BIT = "ECG LA-RA";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP1_CH1_24BIT = "EXG1 CH1";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP2_CH1_24BIT = "EXG1 CH1";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP1_CH2_24BIT = "EXG1 CH2";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP2_CH2_24BIT = "EXG1 CH2";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP1_CH1_16BIT = "EXG1 CH1 16BIT";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP2_CH1_16BIT = "EXG1 CH1 16BIT";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP1_CH2_16BIT = "EXG1 CH2 16BIT";
Shimmer3.ObjectClusterSensorName.EXG_TEST_CHIP2_CH2_16BIT = "EXG1 CH2 16BIT";
Shimmer3.ObjectClusterSensorName.EXG1_STATUS = "EXG1 Status";
Shimmer3.ObjectClusterSensorName.ECG_RESP_24BIT = "ECG RESP";
Shimmer3.ObjectClusterSensorName.ECG_VX_RL_24BIT = "ECG Vx-RL";
Shimmer3.ObjectClusterSensorName.ECG_RESP_16BIT = "ECG RESP";
Shimmer3.ObjectClusterSensorName.ECG_VX_RL_16BIT = "ECG Vx-RL";
Shimmer3.ObjectClusterSensorName.EXG1_CH1_24BIT = "ExG1 CH1";
Shimmer3.ObjectClusterSensorName.EXG1_CH2_24BIT = "ExG1 CH2";
Shimmer3.ObjectClusterSensorName.EXG1_CH1_16BIT = "ExG1 CH1 16Bit";
Shimmer3.ObjectClusterSensorName.EXG1_CH2_16BIT = "ExG1 CH2 16Bit";
Shimmer3.ObjectClusterSensorName.EXG2_CH1_24BIT = "ExG2 CH1";
Shimmer3.ObjectClusterSensorName.EXG2_CH2_24BIT = "ExG2 CH2";
Shimmer3.ObjectClusterSensorName.EXG2_CH1_16BIT = "ExG2 CH1 16Bit";
Shimmer3.ObjectClusterSensorName.EXG2_CH2_16BIT = "ExG2 CH2 16Bit";
Shimmer3.ObjectClusterSensorName.EXG2_STATUS = "EXG2 Status";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_6DOF_W = "Quat_MPL_6DOF_W";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_6DOF_X = "Quat_MPL_6DOF_X";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_6DOF_Y = "Quat_MPL_6DOF_Y";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_6DOF_Z = "Quat_MPL_6DOF_Z";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_9DOF_W = "Quat_MPL_9DOF_W";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_9DOF_X = "Quat_MPL_9DOF_X";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_9DOF_Y = "Quat_MPL_9DOF_Y";
Shimmer3.ObjectClusterSensorName.QUAT_MPL_9DOF_Z = "Quat_MPL_9DOF_Z";
Shimmer3.ObjectClusterSensorName.EULER_MPL_6DOF_X = "Euler_MPL_6DOF_X";
Shimmer3.ObjectClusterSensorName.EULER_MPL_6DOF_Y = "Euler_MPL_6DOF_Y";
Shimmer3.ObjectClusterSensorName.EULER_MPL_6DOF_Z = "Euler_MPL_6DOF_Z";
Shimmer3.ObjectClusterSensorName.EULER_MPL_9DOF_X = "Euler_MPL_9DOF_X";
Shimmer3.ObjectClusterSensorName.EULER_MPL_9DOF_Y = "Euler_MPL_9DOF_Y";
Shimmer3.ObjectClusterSensorName.EULER_MPL_9DOF_Z = "Euler_MPL_9DOF_Z";
Shimmer3.ObjectClusterSensorName.MPL_HEADING = "MPL_heading";
Shimmer3.ObjectClusterSensorName.MPL_TEMPERATURE = "MPL_Temperature";
Shimmer3.ObjectClusterSensorName.MPL_PEDOM_CNT = "MPL_Pedom_cnt";
Shimmer3.ObjectClusterSensorName.MPL_PEDOM_TIME = "MPL_Pedom_Time";
Shimmer3.ObjectClusterSensorName.TAPDIRANDTAPCNT = "TapDirAndTapCnt";
Shimmer3.ObjectClusterSensorName.MOTIONANDORIENT = "MotionAndOrient";
Shimmer3.ObjectClusterSensorName.GYRO_MPU_MPL_X = "Gyro_MPU_MPL_X";
Shimmer3.ObjectClusterSensorName.GYRO_MPU_MPL_Y = "Gyro_MPU_MPL_Y";
Shimmer3.ObjectClusterSensorName.GYRO_MPU_MPL_Z = "Gyro_MPU_MPL_Z";
Shimmer3.ObjectClusterSensorName.ACCEL_MPU_MPL_X = "Accel_MPU_MPL_X";
Shimmer3.ObjectClusterSensorName.ACCEL_MPU_MPL_Y = "Accel_MPU_MPL_Y";
Shimmer3.ObjectClusterSensorName.ACCEL_MPU_MPL_Z = "Accel_MPU_MPL_Z";
Shimmer3.ObjectClusterSensorName.MAG_MPU_MPL_X = "Mag_MPU_MPL_X";
Shimmer3.ObjectClusterSensorName.MAG_MPU_MPL_Y = "Mag_MPU_MPL_Y";
Shimmer3.ObjectClusterSensorName.MAG_MPU_MPL_Z = "Mag_MPU_MPL_Z";
Shimmer3.ObjectClusterSensorName.QUAT_DMP_6DOF_W = "Quat_DMP_6DOF_W";
Shimmer3.ObjectClusterSensorName.QUAT_DMP_6DOF_X = "Quat_DMP_6DOF_X";
Shimmer3.ObjectClusterSensorName.QUAT_DMP_6DOF_Y = "Quat_DMP_6DOF_Y";
Shimmer3.ObjectClusterSensorName.QUAT_DMP_6DOF_Z = "Quat_DMP_6DOF_Z";
Shimmer3.ObjectClusterSensorName.ECG_TO_HR_FW = "ECGtoHR";
Shimmer3.ObjectClusterSensorName.PPG_TO_HR = "PPGtoHR";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_6DOF_W = "Quaternion 0";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_6DOF_X = "Quaternion 1";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_6DOF_Y = "Quaternion 2";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_6DOF_Z = "Quaternion 3";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_9DOF_W = "Quaternion 0";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_9DOF_X = "Quaternion 1";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_9DOF_Y = "Quaternion 2";
Shimmer3.ObjectClusterSensorName.QUAT_MADGE_9DOF_Z = "Quaternion 3";
Shimmer3.ObjectClusterSensorName.EULER_6DOF_YAW = "Euler_6DOF_Yaw";
Shimmer3.ObjectClusterSensorName.EULER_6DOF_PITCH = "Euler_6DOF_Pitch";
Shimmer3.ObjectClusterSensorName.EULER_6DOF_ROLL = "Euler_6DOF_Roll";
Shimmer3.ObjectClusterSensorName.EULER_9DOF_YAW = "Euler_9DOF_Yaw";
Shimmer3.ObjectClusterSensorName.EULER_9DOF_PITCH = "Euler_9DOF_Pitch";
Shimmer3.ObjectClusterSensorName.EULER_9DOF_ROLL = "Euler_9DOF_Roll";
Shimmer3.ObjectClusterSensorName.AXIS_ANGLE_9DOF_A = "Axis Angle A";
Shimmer3.ObjectClusterSensorName.AXIS_ANGLE_9DOF_X = "Axis Angle X";
Shimmer3.ObjectClusterSensorName.AXIS_ANGLE_9DOF_Y = "Axis Angle Y";
Shimmer3.ObjectClusterSensorName.AXIS_ANGLE_9DOF_Z = "Axis Angle Z";
SensorPPG.ObjectClusterSensorName.PPG_A12 = "PPG_A12";
SensorPPG.ObjectClusterSensorName.PPG_A13 = "PPG_A13";
SensorPPG.ObjectClusterSensorName.PPG1_A12 = "PPG1_A12";
SensorPPG.ObjectClusterSensorName.PPG1_A13 = "PPG1_A13";
SensorPPG.ObjectClusterSensorName.PPG2_A1 = "PPG2_A1";
SensorPPG.ObjectClusterSensorName.PPG2_A14 = "PPG2_A14";
// Shimmer3.ObjectClusterSensorName.REAL_TIME_CLOCK_SYNC = "RealTime_Sync";
// Shimmer3.ObjectClusterSensorName.TIMESTAMP_SYNC = "Timestamp_Sync";
Shimmer2.ObjectClusterSensorName.TIMESTAMP = "Timestamp";
Shimmer2.ObjectClusterSensorName.REAL_TIME_CLOCK = "RealTime";
Shimmer2.ObjectClusterSensorName.ACCEL_X = "Accelerometer X";
Shimmer2.ObjectClusterSensorName.ACCEL_Y = "Accelerometer Y";
Shimmer2.ObjectClusterSensorName.ACCEL_Z = "Accelerometer Z";
Shimmer2.ObjectClusterSensorName.BATTERY = "VSenseBatt";
Shimmer2.ObjectClusterSensorName.VOLT_REG = "VSenseReg";
Shimmer2.ObjectClusterSensorName.BRIDGE_AMP_HIGH = "Bridge Amplifier High";
Shimmer2.ObjectClusterSensorName.BRIDGE_AMP_LOW = "Bridge Amplifier Low";
Shimmer2.ObjectClusterSensorName.GSR = "GSR";
//Shimmer2.ObjectClusterSensorName.GSR_RAW = "GSR Raw";
Shimmer2.ObjectClusterSensorName.GSR_RES = "GSR Res";
Shimmer2.ObjectClusterSensorName.EXP_BOARD_A0 = "ExpBoard A0";
Shimmer2.ObjectClusterSensorName.EXP_BOARD_A7 = "ExpBoard A7";
Shimmer2.ObjectClusterSensorName.GYRO_X = "Gyroscope X";
Shimmer2.ObjectClusterSensorName.GYRO_Y = "Gyroscope Y";
Shimmer2.ObjectClusterSensorName.GYRO_Z = "Gyroscope Z";
Shimmer2.ObjectClusterSensorName.MAG_X = "Magnetometer X";
Shimmer2.ObjectClusterSensorName.MAG_Y = "Magnetometer Y";
Shimmer2.ObjectClusterSensorName.MAG_Z = "Magnetometer Z";
Shimmer2.ObjectClusterSensorName.EMG = "EMG";
Shimmer2.ObjectClusterSensorName.ECG_RA_LL = "ECG RA-LL";
Shimmer2.ObjectClusterSensorName.ECG_LA_LL = "ECG LA-LL";
Shimmer2.ObjectClusterSensorName.ECG_TO_HR = "ECGtoHR";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_6DOF_W = "Quaternion 0";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_6DOF_X = "Quaternion 1";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_6DOF_Y = "Quaternion 2";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_6DOF_Z = "Quaternion 3";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_9DOF_W = "Quaternion 0";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_9DOF_X = "Quaternion 1";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_9DOF_Y = "Quaternion 2";
Shimmer2.ObjectClusterSensorName.QUAT_MADGE_9DOF_Z = "Quaternion 3";
Shimmer2.ObjectClusterSensorName.EULER_6DOF_YAW = "Euler_6DOF_YAW";
Shimmer2.ObjectClusterSensorName.EULER_6DOF_PITCH = "Euler_6DOF_PITCH";
Shimmer2.ObjectClusterSensorName.EULER_6DOF_ROLL = "Euler_6DOF_Roll";
Shimmer2.ObjectClusterSensorName.EULER_9DOF_YAW = "Euler_9DOF_YAW";
Shimmer2.ObjectClusterSensorName.EULER_9DOF_PITCH = "Euler_9DOF_PITCH";
Shimmer2.ObjectClusterSensorName.EULER_9DOF_ROLL = "Euler_9DOF_Roll";
Shimmer2.ObjectClusterSensorName.HEART_RATE = "Heart_Rate"; //for the heart rate strap now no longer sold
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_6DOF_A = "Axis Angle A 6DOF";
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_6DOF_X = "Axis Angle X 6DOF";
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_6DOF_Y = "Axis Angle Y 6DOF";
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_6DOF_Z = "Axis Angle Z 6DOF";
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_9DOF_A = "Axis Angle A 9DOF";
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_9DOF_X = "Axis Angle X 9DOF";
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_9DOF_Y = "Axis Angle Y 9DOF";
Shimmer2.ObjectClusterSensorName.AXIS_ANGLE_9DOF_Z = "Axis Angle Z 9DOF";
;
}
public static class Shimmer3{
public class Channel{
public static final int XAAccel = 0x00;//XXX-RS-AA-SensorClass?
public static final int YAAccel = 0x01;//XXX-RS-AA-SensorClass?
public static final int ZAAccel = 0x02;//XXX-RS-AA-SensorClass?
public static final int VBatt = 0x03;
public static final int XDAccel = 0x04;//XXX-RS-LSM-SensorClass?
public static final int YDAccel = 0x05;//XXX-RS-LSM-SensorClass?
public static final int ZDAccel = 0x06;//XXX-RS-LSM-SensorClass?
public static final int XMag = 0x07;//XXX-RS-LSM-SensorClass?
public static final int YMag = 0x08;//XXX-RS-LSM-SensorClass?
public static final int ZMag = 0x09;//XXX-RS-LSM-SensorClass?
public static final int XGyro = 0x0A;
public static final int YGyro = 0x0B;
public static final int ZGyro = 0x0C;
public static final int ExtAdc7 = 0x0D;
public static final int ExtAdc6 = 0x0E;
public static final int ExtAdc15 = 0x0F;
public static final int IntAdc1 = 0x10;
public static final int IntAdc12 = 0x11;
public static final int IntAdc13 = 0x12;
public static final int IntAdc14 = 0x13;
public static final int ExtAdc9 = 0x0D;
public static final int ExtAdc11 = 0x0E;
public static final int ExtAdc12 = 0x0F;
public static final int IntAdc17 = 0x10;
public static final int IntAdc10 = 0x11;
public static final int IntAdc15 = 0x12;
public static final int IntAdc16 = 0x13;
public static final int XAlterAccel = 0x14; //Alternative Accelerometer
public static final int YAlterAccel = 0x15;
public static final int ZAlterAccel = 0x16;
public static final int XAlterMag = 0x17; //Alternative Magnetometer
public static final int YAlterMag = 0x18;
public static final int ZAlterMag = 0x19;
public static final int Temperature = 0x1A;
public static final int Pressure = 0x1B;
public static final int GsrRaw = 0x1C;
public static final int EXG_ADS1292R_1_STATUS = 0x1D;
public static final int EXG_ADS1292R_1_CH1_24BIT = 0x1E;
public static final int EXG_ADS1292R_1_CH2_24BIT = 0x1F;
public static final int EXG_ADS1292R_2_STATUS = 0x20;
public static final int EXG_ADS1292R_2_CH1_24BIT = 0x21;
public static final int EXG_ADS1292R_2_CH2_24BIT = 0x22;
public static final int EXG_ADS1292R_1_CH1_16BIT = 0x23;
public static final int EXG_ADS1292R_1_CH2_16BIT = 0x24;
public static final int EXG_ADS1292R_2_CH1_16BIT = 0x25;
public static final int EXG_ADS1292R_2_CH2_16BIT = 0x26;
public static final int BridgeAmpHigh = 0x27;
public static final int BridgeAmpLow = 0x28;
}
public class SensorBitmap{
//Sensor Bitmap for Shimmer 3
public static final int SENSOR_A_ACCEL = 0x80;//XXX-RS-AA-SensorClass?
public static final int SENSOR_GYRO = 0x40;
public static final int SENSOR_MAG = 0x20; //XXX-RS-LSM-SensorClass?
public static final int SENSOR_EXG1_24BIT = 0x10;
public static final int SENSOR_EXG2_24BIT = 0x08;
public static final int SENSOR_GSR = 0x04;
public static final int SENSOR_EXT_A7 = 0x02;
public static final int SENSOR_EXT_A6 = 0x01;
public static final int SENSOR_VBATT = 0x2000;
public static final int SENSOR_D_ACCEL = 0x1000; //XXX-RS-LSM-SensorClass?
public static final int SENSOR_EXT_A15 = 0x0800;
public static final int SENSOR_INT_A1 = 0x0400;
public static final int SENSOR_INT_A12 = 0x0200;
public static final int SENSOR_INT_A13 = 0x0100;
public static final int SENSOR_INT_A14 = 0x800000;
public static final int SENSOR_BMP180 = 0x40000;
public static final int SENSOR_EXG1_16BIT = 0x100000;
public static final int SENSOR_EXG2_16BIT = 0x080000;
public static final int SENSOR_BRIDGE_AMP = 0x8000;
public static final int SENSOR_ALT_ACCEL = 0x400000;
public static final int SENSOR_ALT_MAG = 0X200000;
}
public static final String[] ListofBluetoothBaudRates = {"115200","1200","2400","4800","9600","19200","38400","57600","230400","460800","921600"};
public static final Integer[] ListofBluetoothBaudRatesConfigValues = {0,1,2,3,4,5,6,7,8,9,10};
//TODO Remove the need for this, standalone strings are too hardcoded and should be based on sensor/channel maps etc.
@Deprecated
public static final String[] ListofCompatibleSensors = {
"Low Noise Accelerometer",
"Wide Range Accelerometer",
"Gyroscope",
"Magnetometer",
"Battery Voltage",
"External ADC A7",
"External ADC A6",
"External ADC A15",
"Internal ADC A1",
"Internal ADC A12",
"Internal ADC A13",
"Internal ADC A14",
"Pressure",
"GSR",
"EXG1",
"EXG2",
"EXG1 16Bit",
"EXG2 16Bit",
"Bridge Amplifier"};
/**
* Some of these sensors are listed in order of how they appear in the
* data packets. The firmware also uses the IMU IDs as Sensor IDs in the
* IMU/BMP calibration bytes.
*/
public class SENSOR_ID{
public static final int RESERVED_ANY_SENSOR = -1;
public static final int HOST_SHIMMER_STREAMING_PROPERTIES = -100;
//TODO below should be merged with HOST_REAL_TIME_CLOCK?
public static final int HOST_SYSTEM_TIMESTAMP = -101;
//Sensors channels originating from the Shimmer
//Analog channels begin
public static final int SHIMMER_TIMESTAMP = -200;//1;
/** Shimmer3 Low-noise analog accelerometer */
public static final int SHIMMER_ANALOG_ACCEL = 2;
public static final int SHIMMER_VBATT = 3;
public static final int SHIMMER_EXT_EXP_ADC_A7 = 4;
public static final int SHIMMER_EXT_EXP_ADC_A6 = 5;
public static final int SHIMMER_EXT_EXP_ADC_A15 = 6;
public static final int SHIMMER_INT_EXP_ADC_A12 = 7;
public static final int HOST_PPG_A12 = 8; //GSR Board
public static final int HOST_PPG1_A12 = 9; //Proto3 Deluxe Board
public static final int SHIMMER_INT_EXP_ADC_A13 = 10;
public static final int HOST_PPG_A13 = 11; //GSR Board
public static final int HOST_PPG1_A13 = 12; //Proto3 Deluxe Board
public static final int SHIMMER_INT_EXP_ADC_A14 = 13;
public static final int HOST_PPG2_A14 = 14; //Proto3 Deluxe Board
//TODO which ADCs should these be beside?
public static final int SHIMMER_BRIDGE_AMP = 15;
public static final int SHIMMER_RESISTANCE_AMP = 16;
public static final int SHIMMER_INT_EXP_ADC_A1 = 17;
public static final int HOST_PPG2_A1 = 18; //Proto3 Deluxe Board
public static final int SHIMMER_GSR = 19;// Based on ADC1
//Digital channels begin
public static final int SHIMMER_MPU9X50_GYRO = 30;
/** Shimmer3 Wide-range digital accelerometer */
public static final int SHIMMER_LSM303_ACCEL = 31;
public static final int SHIMMER_LSM303_MAG = 32;
/** Shimmer3 Alternative accelerometer */
public static final int SHIMMER_MPU9X50_ACCEL = 33;
/** Shimmer3 Alternative magnetometer */
public static final int SHIMMER_MPU9X50_MAG = 34;
public static final int SHIMMER_MPU9X50_TEMP = 35;
public static final int SHIMMER_BMPX80_PRESSURE = 36; //BMP180 and BMP280
/** Shimmer3r Wide-Range Accelerometer **/
public static final int SHIMMER_LSM6DSV_ACCEL_LN = 37;
public static final int SHIMMER_LSM6DSV_GYRO = 38;
public static final int SHIMMER_LIS2DW12_ACCEL_WR = 39;
public static final int SHIMMER_ADXL371_ACCEL_HIGHG = 40;
public static final int SHIMMER_LIS2MDL_MAG = 42;
public static final int SHIMMER_LIS3MDL_MAG_ALT = 41;
public static final int SHIMMER_BMP390_PRESSURE = 43;
// public static final int SHIMMER_EXG1_24BIT = 3;
// public static final int SHIMMER_EXG2_24BIT = 4;
//public static final int SHIMMER_HR = 9;
// public static final int SHIMMER_EXG1_16BIT = 19;
// public static final int SHIMMER_EXG2_16BIT = 21;
//public static final int SHIMMER_BMP180_TEMPERATURE = 23; // not yet implemented
//public static final int SHIMMER_MSP430_TEMPERATURE = 24; // not yet implemented
//public static final int SHIMMER_LSM303DLHC_TEMPERATURE = 26; // not yet implemented
//public static final int SHIMMER_MPU9150_MPL_TEMPERATURE = 1<<17; // same as SENSOR_SHIMMER3_MPU9150_TEMP
public static final int SHIMMER_MPU9X50_MPL_QUAT_6DOF = 50;
public static final int SHIMMER_MPU9X50_MPL_QUAT_9DOF = 51;
public static final int SHIMMER_MPU9X50_MPL_EULER_6DOF = 52;
public static final int SHIMMER_MPU9X50_MPL_EULER_9DOF = 53;
public static final int SHIMMER_MPU9X50_MPL_HEADING = 54;
public static final int SHIMMER_MPU9X50_MPL_PEDOMETER = 55;
public static final int SHIMMER_MPU9X50_MPL_TAP = 56;
public static final int SHIMMER_MPU9X50_MPL_MOTION_ORIENT = 57;
public static final int SHIMMER_MPU9X50_MPL_GYRO = 58;
public static final int SHIMMER_MPU9X50_MPL_ACCEL = 59;
public static final int SHIMMER_MPU9X50_MPL_MAG = 60;
public static final int SHIMMER_MPU9X50_MPL_QUAT_6DOF_RAW = 61;
// STC3100 Channels
public static final int SHIMMER_STC3100 = 62;
// public static final int SHIMMER_STC3100_VOLTAGE = 62;
// public static final int SHIMMER_STC3100_CURRENT = 63;
// public static final int SHIMMER_STC3100_TEMP = 64;
// public static final int SHIMMER_STC3100_CHARGE = 65;
// public static final int SHIMMER_STC3100_BATTERY_PERCENTAGE = 66;
// public static final int SHIMMER_STC3100_TIME_REMAINING = 67;
//Sensors channels modified or created on the host side
// Combination Channels
public static final int HOST_ECG = 100;
public static final int HOST_EMG = 101;
public static final int HOST_EXG_TEST = 102;
public static final int HOST_EXG_CUSTOM = 116;
public static final int HOST_EXG_THREE_UNIPOLAR = 106;
// Derived Channels
public static final int HOST_EXG_RESPIRATION = 103;
public static final int HOST_SKIN_TEMPERATURE_PROBE = 104;
public static final int HOST_PPG_DUMMY = 105;
public static final int HOST_PPG1_DUMMY = 110;
public static final int HOST_PPG2_DUMMY = 113;
public static final int HOST_TIMESTAMP_SYNC = 151;
public static final int HOST_REAL_TIME_CLOCK = 152;
public static final int HOST_REAL_TIME_CLOCK_SYNC = 153;
public static final int SHIMMER_ECG_TO_HR_FW = 150;
// Third party devices @ 1000+
public static final int THIRD_PARTY_NONIN = 1000;
public static final int HOST_KEYBOARD_LISTENER = 1001;
public static final int HOST_MOUSE_LISTENER = 1002;
public static final int HOST_WEBCAM = 1003;
public static final int HOST_CPU_USAGE = 1004;
}
/**
* The bit mask must not change for each algorithm as this is what is
* stored in the Shimmer's infomem and the SD file configuration header.
*
* 3 bytes for derived channels were introduced in LogAndStream v0.3.15 and SDLog v0.8.69.
* 5 bytes in GQ firmware.
* 8 bytes in LogAndStream v0.7.1 and SDLog v0.13.1 onwards
*/
public class DerivedSensorsBitMask {
// -------------- Derived Channels Byte 0 -------------------
public final static int RES_AMP = 1 << 0; // (0*8 + 0);
public final static int SKIN_TEMP = 1 << 1; // (0*8 + 1);
// TODO: Now implemented in SensorPPG -> decide where best these
// bits belong, Configuration.Shimmer3 or sensor/algorithm classes
public final static int PPG_12_13 = 1 << 2; // (0*8 + 2);
public final static int PPG1_12_13 = 1 << 3; // (0*8 + 3);
public final static int PPG2_1_14 = 1 << 4; // (0*8 + 4);
public final static int PPG_TO_HR_12_13 = 1 << 5; // (0*8 + 5);
public final static int PPG_TO_HR1_12_13 = 1 << 6; // (0*8 + 6);
public final static int PPG_TO_HR2_1_14 = 1 << 7; // (0*8 + 7);
public final static int PPG_10_15 = 1 << 2; // (0*8 + 2);
public final static int PPG1_10_15 = 1 << 3; // (0*8 + 3);
public final static int PPG2_17_16 = 1 << 4; // (0*8 + 4);
// -------------- Derived Channels Byte 1 -------------------
public final static int ACTIVITY_MODULE = 1 << 8; // (1*8 + 0);
public final static int GSR_METRICS_GENERAL = 1 << 9; // (1*8 + 1);
public final static int ECG2HR_HRV_FREQ_DOMAIN = 1 << 10; // (1*8 + 2);
public final static int ECG2HR_HRV_TIME_DOMAIN = 1 << 11; // (1*8 + 3);
public final static int ECG2HR_CHIP2_CH2 = 1 << 12; // (1*8 + 4);
public final static int ECG2HR_CHIP2_CH1 = 1 << 13; // (1*8 + 5);
public final static int ECG2HR_CHIP1_CH2 = 1 << 14; // (1*8 + 6);
public final static int ECG2HR_CHIP1_CH1 = 1 << 15; // (1*8 + 7);
// -------------- Derived Channels Byte 2 -------------------
public final static int ORIENTATION_9DOF_WR_QUAT = 1 << 16; // (2*8 + 0);
public final static int ORIENTATION_9DOF_WR_EULER = 1 << 17; // (2*8 + 1);
public final static int ORIENTATION_6DOF_WR_QUAT = 1 << 18; // (2*8 + 2);
public final static int ORIENTATION_6DOF_WR_EULER = 1 << 19; // (2*8 + 3);
public final static int ORIENTATION_9DOF_LN_QUAT = 1 << 20; // (2*8 + 4);
public final static int ORIENTATION_9DOF_LN_EULER = 1 << 21; // (2*8 + 5);
public final static int ORIENTATION_6DOF_LN_QUAT = 1 << 22; // (2*8 + 6);
public final static int ORIENTATION_6DOF_LN_EULER = 1 << 23; // (2*8 + 7);
// -------------- Derived Channels Byte 3 -------------------
public final static int EMG_PROCESSING_CHAN2 = 1 << 24; // (3*8 + 0);
public final static int EMG_PROCESSING_CHAN1 = 1 << 25; // (3*8 + 1);
public final static int GSR_BASELINE = 1 << 26; // (3*8 + 2);
public final static int GSR_METRICS_TREND_PEAK = 1 << 27; // (3*8 + 3);
public final static int GAIT_MODULE = 1 << 28; // (3*8 + 4);
public final static int GYRO_ON_THE_FLY_CAL = 1 << 29; // (3*8 + 5);
// public final static int UNUSED = 1 << 30; // (3*8 + 6);
// public final static int UNUSED = 1 << 31; // (3*8 + 7);
// -------------- Derived Channels Byte 4 -------------------
// Currently Unused
// -------------- Derived Channels Byte 5 -------------------
// Currently Unused
// -------------- Derived Channels Byte 6 -------------------
// Currently Unused
// -------------- Derived Channels Byte 7 -------------------
// Currently Unused
}
// Config Options Map
public class GuiLabelConfig{
public static final String SHIMMER_USER_ASSIGNED_NAME = "Shimmer Name";
public static final String TRIAL_NAME = "Trial Name";
/** Algorithm models and sensor classes also rely on this*/
public static final String SHIMMER_SAMPLING_RATE = "Sampling Rate";
public static final String SHIMMER_AND_SENSORS_SAMPLING_RATE = "Shimmer and Sensors Sampling Rate";
public static final String BUFFER_SIZE = "Buffer Size";
public static final String CONFIG_TIME = "Config Time";
public static final String EXPERIMENT_NUMBER_OF_SHIMMERS = "Number Of Shimmers";
public static final String SHIMMER_MAC_FROM_INFOMEM = "InfoMem MAC";
public static final String EXPERIMENT_ID = "Experiment ID";
public static final String EXPERIMENT_DURATION_ESTIMATED = "Estimated Duration";
public static final String EXPERIMENT_DURATION_MAXIMUM = "Maximum Duration";
public static final String BROADCAST_INTERVAL = "Broadcast Interval";
public static final String BLUETOOTH_BAUD_RATE = "Bluetooth Baud Rate";
public static final String ENABLED_SENSORS = "Enabled Sensors Int";
public static final String ENABLED_SENSORS_IDS = "Enabled SensorsIds";
public static final String SD_BT_STREAM_WHEN_RECORDING = "<html>SD Log and/or<br> Bluetooth Stream</html>";
public static final String SD_STREAM_WHEN_RECORDING = "<html>SD Log Recording<br>Only</html>";
public static final String SD_SYNC_STREAM_WHEN_RECORDING = "<html>SD Log with<br> Inter-device Sync</html>";
public static final String USER_BUTTON_START = "User Button";
public static final String UNDOCK_START = "Undock/Dock";
public static final String SINGLE_TOUCH_START = "Single Touch Start";
public static final String EXPERIMENT_MASTER_SHIMMER = "Master Shimmer";
public static final String EXPERIMENT_SYNC_WHEN_LOGGING = "Sync When Logging";
public static final String TCXO = "TCX0";
public static final String INT_EXP_BRD_POWER_BOOLEAN = "Internal Expansion Board Power";
public static final String INT_EXP_BRD_POWER_INTEGER = "Int Exp Power";
public static final String ENABLE_ERROR_LEDS_RTC = "RTC Error LEDs";
public static final String ENABLE_ERROR_LEDS_SD = "SD Error LEDs";
public static final String LOW_POWER_AUTOSTOP = "Low-power Autostop";
public static final String KINEMATIC_LPM = "Kinematic Sensors Low-Power Mode";//XXX-RS-LSM-SensorClass? What about HighResolutionMode?!
public static final String CALIBRATION_ALL = AbstractSensor.GuiLabelConfigCommon.CALIBRATION_ALL;
public static final String CALIBRATION_PER_SENSOR = AbstractSensor.GuiLabelConfigCommon.CALIBRATION_PER_SENSOR;
}
/** GUI Sensor Tiles
* Order of Enum is the order in which they will be generated in the GUI
*/
public enum LABEL_SENSOR_TILE{
STREAMING_PROPERTIES(SensorShimmerClock.LABEL_SENSOR_TILE.STREAMING_PROPERTIES),
LOW_NOISE_ACCEL(SensorKionixAccel.LABEL_SENSOR_TILE.LOW_NOISE_ACCEL),
LOW_NOISE_ACCEL_3R(SensorLSM6DSV.LABEL_SENSOR_TILE.LOW_NOISE_ACCEL),
WIDE_RANGE_ACCEL(SensorLSM303.LABEL_SENSOR_TILE.WIDE_RANGE_ACCEL),
HIGH_G_ACCEL(SensorADXL371.LABEL_SENSOR_TILE.HIGH_G_ACCEL),
WIDE_RANGE_ACCEL_3R(SensorLIS2DW12.LABEL_SENSOR_TILE.WIDE_RANGE_ACCEL),
GYRO(SensorMPU9X50.LABEL_SENSOR_TILE.GYRO),
GYRO_3R(SensorLSM6DSV.LABEL_SENSOR_TILE.GYRO),
MAG(SensorLSM303.LABEL_SENSOR_TILE.MAG),
MAG_3R(SensorLIS2MDL.LABEL_SENSOR_TILE.MAG),
ALT_MAG_3R(SensorLIS3MDL.LABEL_SENSOR_TILE.ALT_MAG),
PRESSURE_TEMPERATURE_BMP180(SensorBMP180.LABEL_SENSOR_TILE.PRESSURE_TEMPERATURE),
PRESSURE_TEMPERATURE_BMP280(SensorBMP280.LABEL_SENSOR_TILE.PRESSURE_TEMPERATURE),
PRESSURE_TEMPERATURE_BMP390(SensorBMP390.LABEL_SENSOR_TILE.PRESSURE_TEMPERATURE),
BATTERY_MONITORING(SensorBattVoltage.LABEL_SENSOR_TILE.BATTERY_MONITORING),
EXTERNAL_EXPANSION_ADC(SensorADC.LABEL_SENSOR_TILE.EXTERNAL_EXPANSION_ADC),
INTERNAL_EXPANSION_ADC(SensorADC.LABEL_SENSOR_TILE.INTERNAL_EXPANSION_ADC),
GSR(SensorGSR.LABEL_SENSOR_TILE.GSR),
EXG("ECG/EMG"),
PROTO3_MINI("Proto Mini"),
PROTO3_DELUXE("Proto Deluxe"),
PROTO3_DELUXE_SUPP(SensorPPG.LABEL_SENSOR_TILE.PROTO3_DELUXE_SUPP),
BRIDGE_AMPLIFIER(SensorBridgeAmp.LABEL_SENSOR_TILE.BRIDGE_AMPLIFIER),
BRIDGE_AMPLIFIER_SUPP(SensorBridgeAmp.LABEL_SENSOR_TILE.BRIDGE_AMPLIFIER_SUPP),
ADXL377_ACCEL_200G(Configuration.Shimmer3.GuiLabelSensors.ADXL377_ACCEL_200G),
MPU_ACCEL_GYRO_MAG(SensorMPU9X50.LABEL_SENSOR_TILE.MPU_ACCEL_GYRO_MAG),
MPU(SensorMPU9X50.LABEL_SENSOR_TILE.MPU),
MPU_OTHER(SensorMPU9X50.LABEL_SENSOR_TILE.MPU_OTHER),
GPS("GPS"),
STC3100_MONITORING (SensorSTC3100.LABEL_SENSOR_TILE.STC3100_MONITORING),
SWEATCH_ADC ("Sweatch ADC");
private String tileText = "";
LABEL_SENSOR_TILE(String text){
this.tileText = text;
}
public String getTileText(){
return tileText;
}
}
//GUI SENSORS
//TODO Change over to sensor classes
public class GuiLabelSensors{
// public static final String ACCEL_LN = SensorKionixKXRB52042.GuiLabelSensors.ACCEL_LN;
// public static final String ACCEL_LN = SensorLSM6DSV.GuiLabelSensors.ACCEL_LN;
// public static final String BATTERY = SensorBattVoltage.GuiLabelSensors.BATTERY;
// public static final String EXT_EXP_A7 = SensorADC.GuiLabelSensors.EXT_EXP_A7;
// public static final String EXT_EXP_A6 = SensorADC.GuiLabelSensors.EXT_EXP_A6;
// public static final String EXT_EXP_A15 = SensorADC.GuiLabelSensors.EXT_EXP_A15;
// public static final String INT_EXP_A12 = SensorADC.GuiLabelSensors.INT_EXP_A12;
// public static final String INT_EXP_A13 = SensorADC.GuiLabelSensors.INT_EXP_A13;
// public static final String INT_EXP_A14 = SensorADC.GuiLabelSensors.INT_EXP_A14;
// public static final String INT_EXP_A1 = SensorADC.GuiLabelSensors.INT_EXP_A1;
//
public static final String BRIDGE_AMPLIFIER = SensorBridgeAmp.GuiLabelSensors.BRIDGE_AMPLIFIER;
public static final String RESISTANCE_AMP = SensorBridgeAmp.GuiLabelSensors.RESISTANCE_AMP;
public static final String SKIN_TEMP_PROBE = SensorBridgeAmp.GuiLabelSensors.SKIN_TEMP_PROBE;
public static final String BRAMP_HIGHGAIN = SensorBridgeAmp.GuiLabelSensors.BRAMP_HIGHGAIN;
public static final String BRAMP_LOWGAIN = SensorBridgeAmp.GuiLabelSensors.BRAMP_LOWGAIN;
// public static final String GSR = SensorGSR.GuiLabelSensors.GSR;
// public static final String ACCEL_WR = SensorLSM303.GuiLabelSensors.ACCEL_WR;
public static final String MAG = SensorLSM303DLHC.GuiLabelSensors.MAG;
public static final String ALT_MAG_3R = SensorLIS3MDL.GuiLabelSensors.MAG_ALT;
// public static final String PRESS_TEMP_BMP180 = SensorBMP180.GuiLabelSensors.PRESS_TEMP_BMP180;
// public static final String GYRO = SensorMPU9X50.GuiLabelSensors.GYRO;
// public static final String ACCEL_MPU = SensorMPU9X50.GuiLabelSensors.ACCEL_MPU;
// public static final String MAG_MPU = SensorMPU9X50.GuiLabelSensors.MAG_MPU;
public static final String GYRO_MPU_MPL = SensorMPU9X50.GuiLabelSensors.GYRO_MPU_MPL;
public static final String ACCEL_MPU_MPL = SensorMPU9X50.GuiLabelSensors.ACCEL_MPU_MPL;
public static final String MAG_MPU_MPL = SensorMPU9X50.GuiLabelSensors.MAG_MPU_MPL;
public static final String QUAT_MPL_6DOF = SensorMPU9X50.GuiLabelSensors.QUAT_MPL_6DOF;
public static final String QUAT_MPL_9DOF = SensorMPU9X50.GuiLabelSensors.QUAT_MPL_9DOF;
public static final String EULER_MPL_6DOF = SensorMPU9X50.GuiLabelSensors.EULER_MPL_6DOF;
public static final String EULER_MPL_9DOF = SensorMPU9X50.GuiLabelSensors.EULER_MPL_9DOF;