예제 #1
0
        private DevAlarm CreateDevAlarm(UDPArchor item)
        {
            DevAlarm alarm = new DevAlarm();

            alarm.Level          = Abutment_DevAlarmLevel.低;
            alarm.Code           = "基站离线";
            alarm.Title          = "基站离线";
            alarm.Src            = Abutment_DevAlarmSrc.人员定位;//其实应该加上“基站扫描”的
            alarm.AlarmTime      = DateTime.Now;
            alarm.AlarmTimeStamp = TimeConvert.ToStamp(alarm.AlarmTime);
            var clientIP = item.GetClientIP();

            alarm.Msg = "基站离线:" + clientIP;

            var anchor = DbArchorList.Find(i => i.Ip == clientIP);

            if (anchor != null)
            {
                var devId = (int)anchor.DevId;
                var dev   = devDict[devId];
                alarm.DevInfo     = dev;
                alarm.DevInfoId   = devId;
                alarm.Device_desc = dev.Name;
                alarm.Title       = string.Format("基站离线[{0},{1}]", anchor.Code.Trim(), anchor.Ip.Trim());
                alarm.Msg         = string.Format("基站离线[{0},{1}]", anchor.Code, anchor.Ip);
                //alarm.AreaId
            }

            alarm.DictKey = alarm.Msg;

            return(alarm);
        }
예제 #2
0
        private void LoadList()
        {
            //3.加载清单代码
            var list = ArchorHelper.LoadArchoDevInfo();

            ArchorDevList list2 = new ArchorDevList();

            list2.ArchorList = new List <ArchorDev>();
            foreach (var item in list.ArchorList)
            {
                var a = DbArchorList.Find(i => i.Code == item.ArchorID);
                if (a != null)
                {
                    list2.ArchorList.Add(item);
                    item.Archor = a;
                }
            }
            archorManager.LoadList(list2);
        }