Ejemplo n.º 1
0
        /// <summary>
        /// 处理命令回复的定位信息
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="equipment"></param>
        /// <param name="terminal"></param>
        private void Handle0x1000(TX300 obj, TB_Equipment equipment, TB_Terminal terminal)
        {
            _0x1000 x1000 = new _0x1000();

            x1000.Content = obj.MsgContent;
            x1000.Unpackage();
            if (null != equipment)
            {
                if (x1000.GPSInfo.Available)
                {
                    using (var bll = new EquipmentBLL())
                    {
                        bll.Update(f => f.id == equipment.id, act =>
                        {
                            act.Latitude   = x1000.GPSInfo.Latitude;
                            act.Longitude  = x1000.GPSInfo.Longitude;
                            act.GpsUpdated = false;
                        });
                    }
                }
            }
            if (x1000.GPSInfo.Available)
            {
                SaveGpsInfo(x1000.GPSInfo, equipment, obj.TerminalID, "Position command" + GetPackageType(obj.ProtocolType));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 处理0x1000命令
        /// </summary>
        /// <param name="obj"></param>
        private void Handle0x1000(TX300 obj, TB_Equipment equipment)
        {
            _0x1000 x1000 = new _0x1000();

            x1000.Content = obj.MsgContent;
            x1000.Unpackage();
            if (null != equipment)
            {
                if (x1000.GPSInfo.Available)
                {
                    EquipmentInstance.Update(f => f.id == equipment.id && f.Deleted == false, act =>
                    {
                        act.Latitude   = x1000.GPSInfo.Latitude;
                        act.Longitude  = x1000.GPSInfo.Longitude;
                        act.GpsUpdated = false;
                    });
                }
            }
            if (x1000.GPSInfo.Available)
            {
                SaveGpsInfo(x1000.GPSInfo, equipment, obj.TerminalID, "0x1000");
            }
        }