| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System.Collections.Generic;
- using Newtonsoft.Json.Linq;
- using o0.IMU;
- using o0.Geometry;
- using o0;
- namespace SmartBowSDK
- {
- public class AttitudeJson_SDK : CustomJson_SDK
- {
- public AttitudeJson_SDK() : base()
- {
- InitJsonClass<_9AxisPreProcessor>(() => new _9AxisPreProcessor(),
- "AccByteIndex",
- "GyrByteIndex",
- "MagByteIndex",
- "ByteToAcc",
- "ByteToGyr",
- "ByteToMag",
- "GyrCalibrater",
- "MagCalibrater",
- "ByteReverseMS"
- );
- InitJsonClass<MagnetometerAutoCalibrater>(() => new MagnetometerAutoCalibrater(),
- "CountPerLength",
- "EllipsoidFitting",
- "FitCountLeft",
- "FitThreshold",
- "LastTimestamp",
- "Lock",
- "MaxCount",
- "NewBlock",
- "NewBlockAccumulation",
- "Variance",
- "VectorByBlock"
- );
- InitJsonClass<ByteToShorts>(() => new ByteToShorts(3),
- "ByteToShort"
- );
- InitJsonClass<ByteToShort>(() => new ByteToShort(null),
- "MinCount",
- "Reverse",
- "Short"
- );
- InitJsonClass<MeanMaintainer<Vector<double>>>(() => new MeanMaintainer<Vector<double>>(),
- "Count",
- "Mean"
- );
- InitJsonClass<ByteToShortByVariance>(() => new ByteToShortByVariance(),
- "Count",
- "Reverse",
- "Short",
- "ThresholdRate"
- );
- InitJsonClass<EllipsoidFitting>(() => new EllipsoidFitting(default, null, default),
- "Center",
- "CorrectMatrixArray",
- "Radius"
- );
- InitJsonClass<Dictionary<Vector<int>, Vector<double>>>(
- o => JToken.FromObject(o),
- jt =>
- {
- var o = new Dictionary<Vector<int>, Vector<double>>();
- foreach (JProperty item in jt)
- o[ParseByExporter<Vector<int>>(JArray.Parse(item.Name))]
- = ParseByExporter<Vector<double>>(item.Value);
- return o;
- }
- );
- InitJsonClass<Vector<int>>(
- o => JToken.FromObject(o),
- jt => new Vector<int>(jt.ToObject<int[]>())
- );
- InitJsonClass<Vector<double>>(
- o => JToken.FromObject(o),
- jt => new Vector<double>(jt.ToObject<double[]>())
- );
- }
- }
- }
|