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(() => new MagnetometerAutoCalibrater(), "CountPerLength", "EllipsoidFitting", "FitCountLeft", "FitThreshold", "LastTimestamp", "Lock", "MaxCount", "NewBlock", "NewBlockAccumulation", "Variance", "VectorByBlock" ); InitJsonClass(() => new ByteToShorts(3), "ByteToShort" ); InitJsonClass(() => new ByteToShort(null), "MinCount", "Reverse", "Short" ); InitJsonClass>>(() => new MeanMaintainer>(), "Count", "Mean" ); InitJsonClass(() => new ByteToShortByVariance(), "Count", "Reverse", "Short", "ThresholdRate" ); InitJsonClass(() => new EllipsoidFitting(default, null, default), "Center", "CorrectMatrixArray", "Radius" ); InitJsonClass, Vector>>( o => JToken.FromObject(o), jt => { var o = new Dictionary, Vector>(); foreach (JProperty item in jt) o[ParseByExporter>(JArray.Parse(item.Name))] = ParseByExporter>(item.Value); return o; } ); InitJsonClass>( o => JToken.FromObject(o), jt => new Vector(jt.ToObject()) ); InitJsonClass>( o => JToken.FromObject(o), jt => new Vector(jt.ToObject()) ); } } }