コード例 #1
0
 public void Unpack(JsonDict dict)
 {
     // All numeric entities will be doubles
     // Round and cast them
     this._Time          = (uint)Math.Round((double)dict["Time"]);
     this._VelodyneModel = (VelodyneModel)(int)Math.Round((double)dict["VelodyneModel"]);
     this._ReturnType    = (ReturnType)(int)Math.Round((double)dict["ReturnType"]);
     this._Blocks        = Array.ConvertAll(dict["Blocks"] as object[], item => new VerticalBlockPair(item as JsonDict));
 }
コード例 #2
0
            public JsonDict Pack()
            {
                var of_the_jedi = new JsonDict();

                of_the_jedi["Azimuth"]        = this._Azimuth;
                of_the_jedi["Length"]         = this._ChannelData.Length;
                of_the_jedi["Distances"]      = Array.ConvertAll(this._ChannelData, item => (object)item._DistanceMeters);
                of_the_jedi["Reflectivities"] = Array.ConvertAll(this._ChannelData, item => (object)item._Reflectivity);
                return(of_the_jedi);
            }
コード例 #3
0
            public JsonDict Pack()
            {
                var of_the_jedi = new JsonDict();

                of_the_jedi["Time"]          = this._Time;
                of_the_jedi["VelodyneModel"] = (int)this._VelodyneModel;
                of_the_jedi["ReturnType"]    = (int)this._ReturnType;
                of_the_jedi["Blocks"]        = Array.ConvertAll(this._Blocks, item => (object)item.Pack());

                return(of_the_jedi);
            }
コード例 #4
0
            public void Unpack(JsonDict dict)
            {
                this._Azimuth = dict.asFloat("Azimuth");
                int lens           = dict.asInt("Length");
                var distances      = dict["Distances"] as object[];
                var reflectivities = dict["Reflectivities"] as object[];

                this._ChannelData = new SinglePoint[lens];
                this._ChannelData.Fill(i => new SinglePoint(
                                           (float)(double)distances[i],
                                           (byte)Math.Round((double)reflectivities[i])));
            }
コード例 #5
0
            public void Unpack(JsonDict dict)
            {
                this._Azimuth = (float)(double)dict["Azimuth"];

                int lens = (int)(double)dict["Length"];

                this._ChannelData = new SinglePoint[lens];

                var distances      = dict["Distances"] as object[];
                var reflectivities = dict["Reflectivities"] as object[];

                for (int i = 0; i < lens; i++)
                {
                    this._ChannelData[i] = new SinglePoint(
                        (float)(double)distances[i],
                        (byte)Math.Round((double)reflectivities[i])
                        );
                }
            }
コード例 #6
0
 internal VerticalBlockPair(JsonDict dict)
 {
     this._Azimuth     = 0;
     this._ChannelData = null;
     this.Unpack(dict);
 }
コード例 #7
0
 public Packet(JsonDict d)
 {
     this.Unpack(d);
 }