Пример #1
0
        /// <summary>
        /// 处理终端OFF的信息
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="equipment"></param>
        /// <param name="terminal"></param>
        private void Handle0xFF00(TX300 obj, TB_Equipment equipment, TB_Terminal terminal)
        {
            // 终端没电关机
            _0xFF00 xff00 = new _0xFF00();

            xff00.Content = obj.MsgContent;
            xff00.Unpackage();
            if (null != equipment)
            {
                EquipmentInstance.Update(f => f.id == equipment.id, act =>
                {
                    act.Voltage     = "G0000";
                    act.OnlineStyle = (byte)LinkType.OFF;
                    if (xff00.GPSInfo.Available)
                    {
                        act.Latitude   = xff00.GPSInfo.Latitude;
                        act.Longitude  = xff00.GPSInfo.Longitude;
                        act.GpsUpdated = false;
                    }
                });
            }
            if (xff00.GPSInfo.Available)
            {
                SaveGpsInfo(xff00.GPSInfo, equipment, obj.TerminalID, "0xFF00");
            }
        }
Пример #2
0
        /// <summary>
        /// 处理终端OFF的信息
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="equipment"></param>
        /// <param name="terminal"></param>
        private void Handle0xFF00(TX300 obj, TB_Equipment equipment, TB_Terminal terminal)
        {
            // 终端没电关机
            _0xFF00 xff00 = new _0xFF00();

            xff00.Content = obj.MsgContent;
            xff00.Unpackage();
            if (null != equipment)
            {
                using (var bll = new EquipmentBLL())
                {
                    bll.Update(f => f.id == equipment.id, act =>
                    {
                        act.Voltage     = "G0000";
                        act.OnlineStyle = (byte)LinkType.OFF;
                        if (xff00.GPSInfo.Available)
                        {
                            act.Latitude   = xff00.GPSInfo.Latitude;
                            act.Longitude  = xff00.GPSInfo.Longitude;
                            act.GpsUpdated = false;
                        }
                    });
                }
            }
            if (xff00.GPSInfo.Available)
            {
                SaveGpsInfo(xff00.GPSInfo, equipment, obj.TerminalID, "Battery OFF" + GetPackageType(obj.ProtocolType));
            }
        }