| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System.Collections.Generic;
- using Newtonsoft.Json.Linq;
- using o0.IMU;
- using o0.Geometry;
- using o0;
- public class AttitudeJson : JCUnityLib.CustomJson
- {
- public AttitudeJson() : 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[]>())
- );
- }
- }
|