Esempio n. 1
0
        /// <summary>
        /// 从0x1001数据中取得定位信息记录
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="first"></param>
        /// <returns></returns>
        private TB_Data_Position GetGpsinfoFrom1001(_0x1001 obj, bool first)
        {
            TB_Data_Position info = PositionInstance.GetObject();

            info.Csq       = first ? obj.CSQ_1 : obj.CSQ_2;
            info.GpsTime   = first ? obj.GPSTime : obj.GPSTime.AddMinutes(30);
            info.Latitude  = first ? obj.Latitude_1 : obj.Latitude_2;
            info.Longitude = first ? obj.Longitude_1 : obj.Longitude_2;
            //info.SectorCode = obj.Sector;
            //info.StationCode = obj.Station;
            info.Type = "0x1001";
            return(info);
        }
Esempio n. 2
0
        /// <summary>
        /// 保存位置信息
        /// </summary>
        /// <param name="obj"></param>
        private void SaveGpsInfo(GPSInfo obj, TB_Equipment equipment, string terminal, string type)
        {
            TB_Data_Position pos = PositionInstance.GetObject();

            pos.Altitude    = obj.Altitude;
            pos.Direction   = obj.Direction;
            pos.Equipment   = null == equipment ? (int?)null : equipment.id;
            pos.EW          = obj.EW[0];
            pos.GpsTime     = obj.GPSTime;
            pos.Latitude    = obj.Latitude;
            pos.Longitude   = obj.Longitude;
            pos.NS          = obj.NS[0];
            pos.ReceiveTime = DateTime.Now;
            pos.Speed       = obj.Speed;
            pos.StoreTimes  = null == equipment ? 0 : equipment.StoreTimes;
            pos.Terminal    = terminal;
            pos.Type        = type;
            PositionInstance.Add(pos);
        }