-
Notifications
You must be signed in to change notification settings - Fork 5
/
QTMSettings.cs
1598 lines (1477 loc) · 47 KB
/
QTMSettings.cs
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
// Realtime SDK for Qualisys Track Manager. Copyright 2015-2018 Qualisys AB
//
using System;
using System.Reflection;
using System.Xml;
using System.Xml.Serialization;
using System.Collections.Generic;
using QTMRealTimeSDK.Data;
namespace QTMRealTimeSDK.Settings
{
static public class EnumHelper
{
// Find [XmlEnum] attribute tag on enum items
static public string GetXmlAttrNameFromEnumValue<T>(T enumValue)
{
var type = enumValue.GetType();
var info = type.GetField(Enum.GetName(typeof(T), enumValue));
var attributes = info.GetCustomAttributes(typeof(XmlEnumAttribute), false);
if (attributes.Length > 0)
return (attributes[0] as XmlEnumAttribute).Name;
return null;
}
/// Convert from [XmlEnum] string to a Enum object (return defaultValue if not found)
static public T XmlEnumStringToEnum<T>(string stringValue, T defaultValue)
{
foreach (T t in (T[])Enum.GetValues(typeof(T)))
{
if (GetXmlAttrNameFromEnumValue(t) == stringValue)
{
return t;
}
}
return defaultValue;
}
// Convert from Enum type to [XmlEnum] string (return defaultValue if not found)
static public string EnumToXmlEnumString<T>(T enumValue)
{
var name = GetXmlAttrNameFromEnumValue(enumValue);
if (name != null)
return name;
throw new ArgumentException("There is no XmlEnum attribute for this enum value");
}
}
public class SettingsBase
{
[XmlIgnore]
public string Xml;
}
/// <summary>General Settings from QTM</summary>
[XmlRoot("General")]
public class SettingsGeneral : SettingsBase
{
/// <summary>QTM Capture frequency </summary>
[XmlElement("Frequency")]
public int CaptureFrequency;
/// <summary>length of QTM Capture. Time expressed in seconds</summary>
[XmlElement("Capture_Time")]
public float CaptureTime;
/// <summary>Measurement start on any external trigger (qtm version 2.13 or less, or 2.14 running Oqus systems)</summary>
[XmlElement("Start_On_External_Trigger")]
public bool StartOnExternalTrigger;
/// <summary>Measurement start on MSU Trig NO/Oqus Trig in</summary>
[XmlElement("Start_On_Trigger_NO")]
public bool StartOnTrigNO;
/// <summary>Measurement start on MSU Trig NC</summary>
[XmlElement("Start_On_Trigger_NC")]
public bool StartOnTrigNC;
/// <summary>Measurement start on software trigger (app, keyboard etc)</summary>
[XmlElement("Start_On_Trigger_Software")]
public bool StartOnTrigSoftware;
[XmlElement("External_Time_Base")]
public SettingsExternalTimeBase ExternalTimebase;
[XmlElement("External_Timestamp")]
public SettingsExternalTimestamp ExternalTimestamp;
[XmlElement("Processing_Actions")]
public SettingProcessingActions ProcessingActions;
[XmlElement("RealTime_Processing_Actions")]
public SettingProcessingActions RealtimeProcessingActions;
[XmlElement("Reprocessing_Actions")]
public SettingProcessingActions ReprocessingActions;
[XmlElement("EulerAngles")]
public SettingsEulerAngles EulerAngles;
/// <summary>Camera Settings </summary>
[XmlElement("Camera")]
public List<SettingsGeneralCameraSystem> CameraSettings;
public SettingsGeneral()
{
}
}
/// <summary>3D Bone Settings from QTM</summary>
public class SettingsBone : SettingsBase
{
/// <summary>name of marker bone starts from </summary>
[XmlAttribute("From")]
public string From;
/// <summary>name of marker bone ends at</summary>
[XmlAttribute("To")]
public string To;
/// <summary>Color of marker bone</summary>
[XmlAttribute("Color")]
public int Color;
SettingsBone()
{
Color = 0xEEEEEE;
}
}
/// <summary>3D Settings from QTM</summary>
[XmlRoot("The_3D")]
public class Settings3D : SettingsBase
{
[XmlIgnore]
public Axis AxisUpwards;
[XmlElement("AxisUpwards")]
public string ModelAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(AxisUpwards);
}
set
{
AxisUpwards = EnumHelper.XmlEnumStringToEnum(value, Axis.Unknown);
}
}
[XmlElement("CalibrationTime")]
public string CalibrationTime;
[XmlElement("Labels")]
public int LabelCount;
[XmlElement("Label")]
public List<Settings3DLabel> Labels;
[XmlArray("Bones")]
[XmlArrayItem("Bone", typeof(SettingsBone))]
public SettingsBone[] Bones;
public Settings3D()
{
}
}
/// <summary>6D Settings from QTM</summary>
[XmlRoot("The_6D")]
public class Settings6D : SettingsBase
{
[XmlElement("Body")]
public List<Settings6DOF> Bodies;
}
/// <summary>Analog Settings from QTM</summary>
[XmlRoot("Analog")]
public class SettingsAnalog : SettingsBase
{
[XmlElement("Device")]
public List<AnalogDevice> Devices;
public SettingsAnalog()
{
}
}
/// <summary>Force Settings from QTM</summary>
[XmlRoot("Force")]
public class SettingsForce : SettingsBase
{
[XmlElement("Unit_Length")]
public string UnitLength;
[XmlElement("Unit_Force")]
public string UnitForce;
[XmlElement("Plate")]
public List<ForcePlateSettings> Plates;
public SettingsForce() { }
}
/// <summary>Image Settings from QTM</summary>
[XmlRoot("Image")]
public class SettingsImage : SettingsBase
{
[XmlElement("Camera")]
public List<ImageCamera> Cameras;
}
/// <summary>Gaze vector</summary>
public class SettingGazeVector
{
[XmlElement("Name")]
public string Name;
[XmlElement("Frequency")]
public float Frequency;
[XmlElement("Hardware_Sync")]
public bool HardwareSync;
[XmlElement("Filter")]
public bool Filter;
}
/// <summary>Gaze vector Settings from QTM</summary>
[XmlRoot("Gaze_Vector")]
public class SettingsGazeVectors : SettingsBase
{
[XmlElement("Vector")]
public List<SettingGazeVector> GazeVectors;
}
/// <summary>Eye tracker</summary>
public class SettingEyeTracker
{
[XmlElement("Name")]
public string Name;
[XmlElement("Frequency")]
public float Frequency;
[XmlElement("Hardware_Sync")]
public bool HardwareSync;
}
/// <summary>Eye tracker Settings from QTM</summary>
[XmlRoot("Eye_Tracker")]
public class SettingsEyeTrackers : SettingsBase
{
[XmlElement("Device")]
public List<SettingEyeTracker> EyeTrackers;
}
/// <summary>Position</summary>
public class Position
{
[XmlAttribute("X")]
public float X = float.NaN;
[XmlAttribute("Y")]
public float Y = float.NaN;
[XmlAttribute("Z")]
public float Z = float.NaN;
}
/// <summary>Rotation</summary>
public class Rotation
{
[XmlAttribute("X")]
public float X = float.NaN;
[XmlAttribute("Y")]
public float Y = float.NaN;
[XmlAttribute("Z")]
public float Z = float.NaN;
[XmlAttribute("W")]
public float W = float.NaN;
}
/// <summary>Transform</summary>
public class Transform
{
[XmlElement("Position")]
public Position Position;
[XmlElement("Rotation")]
public Rotation Rotation;
}
/// <summary>DefaultTransform</summary>
public class DefaultTransform
{
[XmlElement("Position")]
public Position Position;
[XmlElement("Rotation")]
public Rotation Rotation;
}
/// <summary>Constraint</summary>
public class Constraint
{
[XmlAttribute("LowerBound")]
public float LowerBound = float.NaN;
[XmlAttribute("UpperBound")]
public float UpperBound = float.NaN;
}
/// <summary>Coupling</summary>
public class Coupling
{
[XmlIgnore]
public DegreeOfFreedomType DegreeOfFreedom;
[XmlAttribute("Segment")]
public string Segment;
[XmlAttribute("DegreeOfFreedom")]
public string ModelAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(DegreeOfFreedom);
}
set
{
DegreeOfFreedom = EnumHelper.XmlEnumStringToEnum(value, DegreeOfFreedomType.Unknown);
}
}
[XmlAttribute("Coefficient")]
public float Coefficient = float.NaN;
}
/// <summary>Couplings</summary>
public class Couplings
{
[XmlElement("Coupling")]
public List<Coupling> CouplingList;
}
/// <summary>Goal</summary>
public class Goal
{
[XmlAttribute("Value")]
public float Value = float.NaN;
[XmlAttribute("Weight")]
public float Weight = float.NaN;
}
/// <summary>DegreeOfFreedom</summary>
public class DegreeOfFreedom
{
[XmlAttribute("LowerBound")]
public float LowerBound = float.NaN;
[XmlAttribute("UpperBound")]
public float UpperBound = float.NaN;
[XmlElement("Constraint")]
public Constraint Constraint;
[XmlElement("Couplings")]
public Couplings Couplings;
[XmlElement("Goal")]
public Goal Goal;
}
/// <summary>DegreesOfFreedom</summary>
public class DegreesOfFreedom
{
[XmlElement("RotationX")]
public DegreeOfFreedom RotationX;
[XmlElement("RotationY")]
public DegreeOfFreedom RotationY;
[XmlElement("RotationZ")]
public DegreeOfFreedom RotationZ;
[XmlElement("TranslationX")]
public DegreeOfFreedom TranslationX;
[XmlElement("TranslationY")]
public DegreeOfFreedom TranslationY;
[XmlElement("TranslationZ")]
public DegreeOfFreedom TranslationZ;
}
/// <summary>Marker</summary>
public class Marker
{
[XmlAttribute("Name")]
public string Name;
[XmlElement("Position")]
public Position Position;
[XmlElement("Weight")]
public float Weight = float.NaN;
}
/// <summary>Markers</summary>
public class Markers
{
[XmlElement("Marker")]
public List<Marker> MarkerList;
}
/// <summary>RigidBody</summary>
public class RigidBody
{
[XmlAttribute("Name")]
public string Name;
[XmlElement("Transform")]
public Transform Transform;
[XmlElement("Weight")]
public float Weight = float.NaN;
}
/// <summary>RigidBodies</summary>
public class RigidBodies
{
[XmlElement("RigidBody")]
public List<RigidBody> RigidBodyList;
}
/// <summary>Skeleton segment</summary>
public class SettingSkeletonSegmentHierarchical
{
[XmlAttribute("Name")]
public string Name;
[XmlAttribute("ID")]
public uint Id;
[XmlElement("Solver")]
public string Solver;
[XmlElement("Transform")]
public Transform Transform;
[XmlElement("DefaultTransform")]
public DefaultTransform DefaultTransform;
[XmlElement("DegreesOfFreedom")]
public DegreesOfFreedom DegreesOfFreedom;
[XmlElement("Endpoint")]
public Position Endpoint;
[XmlElement("Markers")]
public Markers Markers;
[XmlElement("RigidBodies")]
public RigidBodies RigidBodies;
[XmlElement("Segment")]
public List<SettingSkeletonSegmentHierarchical> Segments;
}
/// <summary>Skeleton segments</summary>
public class SegmentsHierarchical
{
[XmlElement("Segment")]
public List<SettingSkeletonSegmentHierarchical> Segments;
}
/// <summary>Skeleton</summary>
public class SettingSkeletonHierarchical
{
[XmlAttribute("Name")]
public string Name;
[XmlElement("Solver")]
public string Solver;
[XmlElement("Scale")]
public string Scale;
[XmlElement("Segments")]
public SegmentsHierarchical Segments;
}
/// <summary>
/// Skeleton Settings from QTM.
/// The skeleton is stored hierarchically.
/// </summary>
[XmlRoot("Skeletons")]
public class SettingsSkeletonsHierarchical : SettingsBase
{
[XmlElement("Skeleton")]
public List<SettingSkeletonHierarchical> Skeletons;
}
/// <summary>Skeleton segment</summary>
public class SettingSkeletonSegment
{
[XmlAttribute("Name")]
public string Name;
[XmlAttribute("ID")]
public uint Id;
[XmlAttribute("Parent_ID")]
public uint ParentId;
[XmlElement("Position")]
public Position Position;
[XmlElement("Rotation")]
public Rotation Rotation;
}
/// <summary>Skeleton</summary>
public class SettingSkeleton
{
[XmlAttribute("Name")]
public string Name;
[XmlElement("Segment")]
public List<SettingSkeletonSegment> Segments;
}
/// <summary>
/// Skeleton Settings from QTM.
/// The skeleton is stored in a vector.
/// </summary>
[XmlRoot("Skeletons")]
public class SettingsSkeletons : SettingsBase
{
[XmlElement("Skeleton")]
public List<SettingSkeleton> Skeletons;
}
/// <summary>General settings for Camera System</summary>
public struct SettingsGeneralCameraSystem
{
/// <summary>ID of camera</summary>
[XmlElement("ID")]
public int CameraId;
/// <summary>Model of camera</summary>
[XmlIgnore]
public CameraModel Model;
[XmlElement("Model")]
public string ModelAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(Model);
}
set
{
Model = EnumHelper.XmlEnumStringToEnum(value, CameraModel.Unknown);
}
}
/// <summary>If the camera is an underwater camera</summary>
[XmlElement("UnderWater")]
public bool UnderWater;
/// <summary>If the camera supports hardware sync (like Oqus and Miqus Sync Units)</summary>
[XmlElement("Supports_HW_Sync")]
public bool SupportsHardwareSync;
/// <summary>Serial number of the selected camera</summary>
[XmlElement("Serial")]
public int Serial;
/// <summary>Camera mode the camera is set to</summary>
[XmlIgnore]
public CameraMode Mode;
[XmlElement("Mode")]
public string ModeAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(Mode);
}
set
{
Mode = EnumHelper.XmlEnumStringToEnum(value, CameraMode.Unknown);
}
}
/// <summary>Values for camera video mode, current, min and max</summary>
[XmlElement("Video_Frequency")]
public int VideoFrequency;
/// <summary>Values for camera video exposure, current, min and max</summary>
[XmlElement("Video_Exposure")]
public CameraSetting VideoExposure;
/// <summary>Values for camera video flash time, current, min and max</summary>
[XmlElement("Video_Flash_Time")]
public CameraSetting VideoFlashTime;
/// <summary>Values for camera marker exposure, current, min and max</summary>
[XmlElement("Marker_Exposure")]
public CameraSetting MarkerExposure;
/// <summary>Values for camera marker threshold, current, min and max</summary>
[XmlElement("Marker_Threshold")]
public CameraSetting MarkerThreshold;
/// <summary>Position of camera</summary>
[XmlElement("Position")]
public CameraPosition Position;
/// <summary>Orientation of camera</summary>
[XmlElement("Orientation")]
public int Orientation;
/// <summary>Marker resolution of camera, width and height</summary>
[XmlElement("Marker_Res")]
public FieldOfViewSize MarkerFieldOfViewSize;
/// <summary>Video resolution of camera, width and height</summary>
[XmlElement("Video_Res")]
public FieldOfViewSize VideoFieldOfViewSize;
/// <summary>Marker Field Of View, left, top, right and bottom coordinates</summary>
[XmlElement("Marker_FOV")]
public FieldOfView MarkerFOV;
/// <summary>Video Field Of View, left, top, right and bottom coordinates</summary>
[XmlElement("Video_FOV")]
public FieldOfView VideoFOV;
/// <summary>Sync out settings for Oqus sync out or Sync Unit Out1</summary>
[XmlElement("Sync_Out")]
public SettingsSyncOut? SyncOut;
/// <summary>Sync out settings for Sync Unit Out2</summary>
[XmlElement("Sync_Out2")]
public SettingsSyncOut? SyncOut2;
/// <summary>Sync out settings for Sync Unit Measurement Time (MT)</summary>
[XmlElement("Sync_Out_MT")]
public SettingsSyncOut? SyncOutMT;
/// <summary>Lens Control settings for camera equipped with motorized lens</summary>
[XmlElement("LensControl")]
public SettingsLensControl LensControl;
/// <summary>Auto exposure settings for video camera</summary>
[XmlElement("AutoExposure")]
public SettingsAutoExposure AutoExposure;
/// <summary>Video resolution for non-marker cameras</summary>
[XmlIgnore]
public SettingsVideoResolution VideoResolution;
[XmlElement("Video_Resolution")]
public string VideoResolutionAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(VideoResolution);
}
set
{
VideoResolution = EnumHelper.XmlEnumStringToEnum(value, SettingsVideoResolution.Unknown);
}
}
/// <summary>Video aspect ratio for non-marker cameras</summary>
[XmlIgnore]
public SettingsVideoAspectRatio VideoAspectRatio;
[XmlElement("Video_Aspect_Ratio")]
public string VideoAspectRatioAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(VideoAspectRatio);
}
set
{
VideoAspectRatio = EnumHelper.XmlEnumStringToEnum(value, SettingsVideoAspectRatio.Unknown);
}
}
}
/// <summary>Settings regarding Lens Control for camera equipped with motorized lens</summary>
public struct SettingsLensControl
{
/// <summary>Camera focus lens control</summary>
[XmlElement("Focus")]
public SettingsLensControlValues Focus;
/// <summary>Camera aperture lens control</summary>
[XmlElement("Aperture")]
public SettingsLensControlValues Aperture;
}
/// <summary>Settings regarding camera auto exposure</summary>
public struct SettingsAutoExposure
{
[XmlAttribute("Enabled")]
public bool Enabled;
[XmlAttribute("Compensation")]
public float Compensation;
}
/// <summary>Settings for Lens Control Focus</summary>
public struct SettingsLensControlValues
{
[XmlAttribute("Value")]
public float Value;
[XmlAttribute("Min")]
public float Min;
[XmlAttribute("Max")]
public float Max;
}
/// <summary>Settings regarding sync for Camera</summary>
public struct SettingsSyncOut
{
/// <summary>Sync mode for camera</summary>
[XmlIgnore]
public SyncOutFrequencyMode SyncMode;
[XmlElement("Mode")]
public string SyncModeAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(SyncMode);
}
set
{
SyncMode = EnumHelper.XmlEnumStringToEnum(value, SyncOutFrequencyMode.Unknown);
}
}
/// <summary>Sync value, depending on mode</summary>
[XmlElement("Value")]
public int SyncValue;
/// <summary>Output duty cycle in percent</summary>
[XmlElement("Duty_Cycle")]
public float DutyCycle;
/// <summary>TTL signal polarity. no used in SRAM or 100Hz mode</summary>
[XmlIgnore]
public SignalPolarity SignalPolarity;
[XmlElement("Signal_Polarity")]
public string SignalPolarityAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(SignalPolarity);
}
set
{
SignalPolarity = EnumHelper.XmlEnumStringToEnum(value, SignalPolarity.Unknown);
}
}
}
/// <summary>Position for a camera</summary>
public struct CameraPosition
{
/// <summary>X position</summary>
[XmlElement("X")]
public float X;
/// <summary>Y position</summary>
[XmlElement("Y")]
public float Y;
/// <summary>Z position</summary>
[XmlElement("Z")]
public float Z;
/// <summary>Rotation matrix - [1,1] value</summary>
[XmlElement("Rot_1_1")]
public float Rot11;
/// <summary>Rotation matrix - [2,1] value</summary>
[XmlElement("Rot_2_1")]
public float Rot21;
/// <summary>Rotation matrix - [3,1] value</summary>
[XmlElement("Rot_3_1")]
public float Rot31;
/// <summary>Rotation matrix - [1,2] value</summary>
[XmlElement("Rot_1_2")]
public float Rot12;
/// <summary>Rotation matrix - [2,2] value</summary>
[XmlElement("Rot_2_2")]
public float Rot22;
/// <summary>Rotation matrix - [3,2] value</summary>
[XmlElement("Rot_3_2")]
public float Rot32;
/// <summary>Rotation matrix - [1,3] value</summary>
[XmlElement("Rot_1_3")]
public float Rot13;
/// <summary>Rotation matrix - [2,3] value</summary>
[XmlElement("Rot_2_3")]
public float Rot23;
/// <summary>Rotation matrix - [3,3] value</summary>
[XmlElement("Rot_3_3")]
public float Rot33;
}
/// <summary>Resolution (width/height)</summary>
public struct FieldOfViewSize
{
/// <summary>Width</summary>
[XmlElement("Width")]
public int Width;
/// <summary>Height</summary>
[XmlElement("Height")]
public int Height;
}
/// <summary>Field of View</summary>
public struct FieldOfView
{
/// <summary>Left</summary>
[XmlElement("Left")]
public int Left;
/// <summary>Top</summary>
[XmlElement("Top")]
public int Top;
/// <summary>Right</summary>
[XmlElement("Right")]
public int Right;
/// <summary>Bottom</summary>
[XmlElement("Bottom")]
public int Bottom;
}
/// <summary>Settings for Camera values (min,max and current)</summary>
public struct CameraSetting
{
/// <summary>Current value</summary>
[XmlElement("Current")]
public int Current;
/// <summary>Minimum value</summary>
[XmlElement("Min")]
public int Min;
/// <summary>Maximum value</summary>
[XmlElement("Max")]
public int Max;
}
/// <summary>Settings regarding post processing actions</summary>
public struct SettingProcessingActions
{
/// <summary>Preprocessing 2d data</summary>
[XmlElement("PreProcessing2D")]
public bool PreProcessing2D;
/// <summary>Tracking processing</summary>
[XmlIgnore]
public SettingsTrackingProcessingAction TrackingAction;
[XmlElement("Tracking")]
public string TrackingActionsAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(TrackingAction);
}
set
{
TrackingAction = EnumHelper.XmlEnumStringToEnum(value, SettingsTrackingProcessingAction.Unknown);
}
}
/// <summary>Twin system merge processing</summary>
[XmlElement("TwinSystemMerge")]
public bool TwinSystemMerge;
/// <summary>Gapfill processing</summary>
[XmlElement("SplineFill")]
public bool SplineFill;
/// <summary>AIM processing</summary>
[XmlElement("AIM")]
public bool Aim;
/// <summary>6DOF tracking processing</summary>
[XmlElement("Track6DOF")]
public bool Track6DOF;
/// <summary>Force data</summary>
[XmlElement("ForceData")]
public bool ForceData;
/// <summary>GazeVector</summary>
[XmlElement("GazeVector")]
public bool GazeVector;
/// <summary>Export to TSV</summary>
[XmlElement("ExportTSV")]
public bool ExportTSV;
/// <summary>Export to C3D</summary>
[XmlElement("ExportC3D")]
public bool ExportC3D;
/// <summary>Export to Matlab file</summary>
[XmlElement("ExportMatlabFile")]
public bool ExportMatlab;
/// <summary>Export to AVI</summary>
[XmlElement("ExportAviFile")]
public bool ExportAviFile;
/// <summary>Export to FBX</summary>
[XmlElement("ExportFbx")]
public bool ExportFbx;
/// <summary>Start Program</summary>
[XmlElement("StartProgram")]
public bool StartProgram;
/// <summary>Solve skeletons</summary>
[XmlElement("SkeletonSolve")]
public bool SkeletonSolve;
}
/// <summary>Settings regarding external Time Base</summary>
public struct SettingsExternalTimeBase
{
[XmlElement("Enabled")]
public bool Enabled;
[XmlIgnore]
public SignalSource SignalSource;
[XmlElement("Signal_Source")]
public string SignalSourceAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(SignalSource);
}
set
{
SignalSource = EnumHelper.XmlEnumStringToEnum(value, SignalSource.Unknown);
}
}
[XmlIgnore]
public SignalMode SignalMode;
[XmlElement("Signal_Mode")]
public string SignalModeAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(SignalMode);
}
set
{
SignalMode = EnumHelper.XmlEnumStringToEnum(value, SignalMode.Unknown);
}
}
[XmlElement("Frequency_Multiplier")]
public int FreqMultiplier;
[XmlElement("Frequency_Divisor")]
public int FreqDivisor;
[XmlElement("Frequency_Tolerance")]
public int FreqTolerance;
[XmlElement("Nominal_Frequency")]
public float NominalFrequency;
[XmlIgnore]
public SignalEdge SignalEdge;
[XmlElement("Signal_Edge")]
public string SignalEdgeAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(SignalEdge);
}
set
{
SignalEdge = EnumHelper.XmlEnumStringToEnum(value, SignalEdge.Unknown);
}
}
[XmlElement("Signal_Shutter_Delay")]
public int SignalShutterDelay;
[XmlElement("Non_Periodic_Timeout")]
public float NonPeriodicTimeout;
}
public struct SettingsEulerAngles
{
[XmlAttribute("First")]
public string First;
[XmlAttribute("Second")]
public string Second;
[XmlAttribute("Third")]
public string Third;
}
/// <summary>Settings regarding external time stamp</summary>
public struct SettingsExternalTimestamp
{
[XmlElement("Enabled")]
public bool Enabled;
[XmlIgnore]
public TimestampType Type;
[XmlElement("Type")]
public string TimestampTypeAsString
{
get
{
return EnumHelper.EnumToXmlEnumString(Type);
}
set
{
Type = EnumHelper.XmlEnumStringToEnum(value, TimestampType.Unknown);
}
}
[XmlElement("Frequency")]
public int Frequency;
}
/// <summary>Struct for 6dof filter</summary>
public struct Settings6DOFColor
{
internal Settings6DOFColor(int ColorRGB)
{
R = (ColorRGB & 0xff);
G = ((ColorRGB >> 8) & 0xff);
B = ((ColorRGB >> 16) & 0xff);
}
[XmlAttribute("R")]
public int R;
[XmlAttribute("G")]
public int G;
[XmlAttribute("B")]
public int B;
}
/// <summary>Struct for 6dof filter</summary>
public struct Settings6DOFFilter
{
[XmlAttribute("Preset")]
public string Preset;
}
/// <summary>Struct for 6dof mesh position</summary>
public struct Settings6DOFMeshPosition
{
[XmlAttribute("X")]
public float X;
[XmlAttribute("Y")]
public float Y;
[XmlAttribute("Z")]
public float Z;
}
/// <summary>Struct for 6dof mesh rotation</summary>
public struct Settings6DOFMeshRotation
{
[XmlAttribute("X")]
public float X;
[XmlAttribute("Y")]
public float Y;
[XmlAttribute("Z")]
public float Z;
}
/// <summary>Struct for 6dof mesh</summary>
public struct Settings6DOFMesh
{
[XmlElement("Name")]
public string Name;