Esempio n. 1
0
 private void SaveGpsData(Feng.IRepository rep, WayPoint entity)
 {
     if (rep == null)
     {
         s_wayPointDao.Save(entity);
     }
     else
     {
         s_wayPointDao.Save(rep, entity);
     }
 }
Esempio n. 2
0
        //internal static string ProcessVehicleName(string vehicleName)
        //{
        //    if (vehicleName.StartsWith("ZJ"))
        //    {
        //        vehicleName = vehicleName.Remove(0, 2).Insert(0, "浙");
        //    }
        //    return vehicleName;
        //}
        private WayPoint ConvertToGpsData2(string gpsId, string gpsData)
        {
            string[] ss = gpsData.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            WayPoint entity = new WayPoint
            {
                VehicleName = gpsId,
                GpsTime = Convert.ToDateTime(ss[0]),
                Latitude = Convert.ToDouble(ss[1]),
                Longitude = Convert.ToDouble(ss[2]),
                Accuracy = Convert.ToDouble(ss[3]),
                Altitude = Convert.ToDouble(ss[4]),
                Heading = Convert.ToDouble(ss[5]),
                Speed = Convert.ToDouble(ss[6]),
                MessageTime = System.DateTime.Now,
                IsActive = true,
                Action = ss[7]
            };
            return entity;
        }