Beispiel #1
0
        public void SetValue(TBody gpsbody)
        {
            var tmpbytes = gpsbody.GetASCIIBytes(gpsbody.GetIssi());

            this.Issi = new Byte[33];
            for (var i = 0; i < 33; i++)
            {
                if (i < tmpbytes.Length)
                {
                    this.Issi[i] = tmpbytes[i];
                }
                else
                {
                    this.Issi[i] = 0;
                }
            }
            ///取小数点后5位
            this.Lon         = Convert.ToDouble(String.Format("{0:N5}", gpsbody.lon));
            this.Lat         = Convert.ToDouble(String.Format("{0:N5}", gpsbody.lat));
            this.Hight       = gpsbody.height;
            this.Speed       = gpsbody.speed;
            this.Dir         = gpsbody.dir;
            this.Year        = IPAddress.HostToNetworkOrder(Convert.ToInt16(DateTime.Now.Year));
            this.Month       = Convert.ToByte(DateTime.Now.Month);
            this.Day         = Convert.ToByte(DateTime.Now.Day);
            this.Hour        = Convert.ToByte(DateTime.Now.Hour);
            this.Minute      = Convert.ToByte(DateTime.Now.Minute);
            this.Second      = Convert.ToByte(DateTime.Now.Second);
            this.Cdatalength = IPAddress.HostToNetworkOrder(Convert.ToInt16(12));
            this.Cdata       = gpsbody.GetASCIIBytes("hello world!");
        }
Beispiel #2
0
 public void SetValue(TBody gps)
 {
     Gpsid   = gps.GetIssi().PadLeft(12, '0');
     X       = gps.lon;
     Y       = gps.lat;
     Dir     = Convert.ToInt32(gps.dir);
     State   = Convert.ToInt32(gps.state);
     GpsTime = DateTime.Now.ToString(CultureInfo.CurrentCulture);
 }
Beispiel #3
0
        public void SetValue(TBody body)
        {
            var issi = body.GetASCIIBytes(body.GetIssi());

            ID = Enumerable.Repeat <Byte>(0x00, 38).ToArray();
            Array.Copy(issi, ID, issi.Length);
            Lon   = body.lon;
            Lat   = body.lat;
            Heigh = body.height;
            Dir   = body.dir;
            Speed = body.speed;
        }
Beispiel #4
0
        public void SetValue(TBody body)
        {
            var dtime = DateTime.FromOADate(body.time);

            Issi = Enumerable.Repeat('\0', 20).ToArray();
            var sourcearray = body.GetIssi().ToArray();

            Array.Copy(sourcearray, Issi, sourcearray.Length);
            Lon       = body.lon;
            Lat       = body.lat;
            Speed     = (ushort)body.speed;
            Dir       = (ushort)body.dir;
            Height    = (ushort)body.height;
            Precision = 0;
            Year      = Convert.ToUInt16(dtime.Year);
            Month     = Convert.ToByte(dtime.Month);
            Day       = Convert.ToByte(dtime.Day);
            Hour      = Convert.ToByte(dtime.Hour);
            Minute    = Convert.ToByte(dtime.Minute);
            Second    = Convert.ToByte(dtime.Second);
        }
Beispiel #5
0
        public void SetValue(TBody body)
        {
            Issi = Enumerable.Repeat <Byte>(0x25, 20).ToArray();
            var bodyssi = body.GetASCIIBytes(body.GetIssi());

            Array.Copy(bodyssi, Issi, bodyssi.Length);
            //var bodyssi = body.GetASCIIBytes(body.GetIssi());
            //Issi = new Byte[20];
            //for (var i = 0; i < bodyssi.Length; i++)
            //{
            //    Issi[i] = bodyssi[i];
            //}
            //for (var i = bodyssi.Length; i <20 ; i++)
            //{
            //    Issi[i] = 0x25;
            //}
            CC    = 0x26;
            Time  = body.GetASCIIBytes(new DateTime(1899, 12, 30).AddDays(body.time).ToString("yyMMddHHmmss"));
            Lon   = body.lon;
            Lat   = body.lat;
            Speed = Convert.ToDouble(body.speed);
            Dir   = IPAddress.HostToNetworkOrder(body.dir);
        }
Beispiel #6
0
 public void SetValue(TBody body)
 {
     Issi       = Convert.ToInt32(body.GetIssi());
     Identitier = Convert.ToByte(36);
     Len        = Convert.ToInt16(96);
 }