Exemplo n.º 1
0
 internal void SetArchorInfo(UDPArchor archor, string key)
 {
     if (key == "id")
     {
     }
     ScanArchors(UDPCommands.GetAll().ToArray(), new string[] { archor.GetClientIP() });
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        private void SendCmd(string cmd, UDPArchor archor)
        {
            var archorIp = archor.GetClientIP();
            var localIp  = GetLocalIp(archorIp);

            if (localIp == null)
            {
                return;
            }
            var        udp        = GetLightUDP(localIp);
            IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse(archorIp), archorPort);

            udp.SendHex(cmd, ipEndPoint);
            AddLog(string.Format("发送 :: [{0}]:{1}", ipEndPoint, cmd));
        }
Exemplo n.º 4
0
        private void MenuLocalArchor_Click(object sender, RoutedEventArgs e)
        {
            List <string> codes = new List <string>();

            foreach (var item in DataGrid3.SelectedItems)
            {
                UDPArchor archor = item as UDPArchor;
                if (archor == null)
                {
                    continue;
                }
                codes.Add(archor.GetClientIP());
            }
            StaticEvents.OnLocateArchorByIp(codes);
        }
Exemplo n.º 5
0
 internal void GetArchorInfo(UDPArchor archor, string key)
 {
     //key = key.ToLower();
     if (key == "Id")
     {
         ScanArchor(UDPCommands.GetId, archor.GetClientIP());
     }
     else if (key == "Ip")
     {
         ScanArchor(UDPCommands.GetIp, archor.GetClientIP());
     }
     else if (key == "Type")
     {
         ScanArchor(UDPCommands.GetType, archor.GetClientIP());
     }
     else if (key == "ServerIp")
     {
         ScanArchor(UDPCommands.GetServerIp, archor.GetClientIP());
     }
     else if (key == "ServerPort")
     {
         ScanArchor(UDPCommands.GetServerPort, archor.GetClientIP());
     }
     else if (key == "Mask")
     {
         ScanArchor(UDPCommands.GetMask, archor.GetClientIP());
     }
     else if (key == "Gateway")
     {
         ScanArchor(UDPCommands.GetGateway, archor.GetClientIP());
     }
     else if (key == "DHCP")
     {
         ScanArchor(UDPCommands.GetDHCP, archor.GetClientIP());
     }
     else if (key == "SoftVersion")
     {
         ScanArchor(UDPCommands.GetSoftVersion, archor.GetClientIP());
     }
     else if (key == "HardVersion")
     {
         ScanArchor(UDPCommands.GetHardVersion, archor.GetClientIP());
     }
     else if (key == "Power")
     {
         ScanArchor(UDPCommands.GetPower, archor.GetClientIP());
     }
     else if (key == "MAC")
     {
         ScanArchor(UDPCommands.GetMAC, archor.GetClientIP());
     }
 }