private void Ludp2_DGramRecieved(object sender, BUDPGram dgram)
        {
            string msg = Encoding.UTF8.GetString(dgram.data);

            if (MessageReceived != null)
            {
                MessageReceived(msg);
            }
            //if (msg.Contains("002"))
            //{
            //    Log.Info("002");
            //}
            Position pos = new Position();

            if (pos.Parse(msg, LocationContext.OffsetX, LocationContext.OffsetY))
            {
                //if (PositionRecived != null)
                //{
                //    PositionRecived(pos);
                //}
                List <Position> posList = AddMockPosition(pos);
                if (PositionListRecived != null)
                {
                    PositionListRecived(posList);
                }
            }
        }
 private void Udp_DGramRecieved(object sender, BUDPGram dgram)
 {
     if (!Clients.Contains(dgram.iep))
     {
         Clients.Add(dgram.iep);
     }
 }
Esempio n. 3
0
        void ludp2_DGramRecieved(object sender, BUDPGram dgram)
        {
            string msg = dgram.iep.Address.ToString() + " " + dgram.iep.Port.ToString() + " " + Encoding.Default.GetString(dgram.data);

            msg      = GetLogText(msg);
            ShowInfo = ShowInfo + msg + System.Environment.NewLine;

            ReceiverTB.Text = ShowInfo;  //监听收到数据 可获得数据的来源和信息
        }
Esempio n. 4
0
        private void Udp_DGramRecieved(object sender, BUDPGram dgram)
        {
            string hex = ByteHelper.byteToHexStr(dgram.data);
            //string str = Encoding.UTF7.GetString(dgram.data);
            string txt = string.Format("[{0}]:{1}", dgram.iep, hex);

            AddLog(txt);

            AddArchor(dgram.iep, dgram.data);
        }
Esempio n. 5
0
        private void Udp_DGramRecieved(object sender, BUDPGram dgram)
        {
            var r = new UDPCommandResult();

            r.Parse(dgram.data);
            var    value = r.GetValue();
            string hex   = ByteHelper.byteToHexStr(dgram.data);
            //string str = Encoding.UTF7.GetString(dgram.data);
            string txt = string.Format("[{0}]:{1}\n", dgram.iep, hex);

            TbConsole.Text = txt + TbConsole.Text;
        }
        private void Udp_DGramRecieved1(object sender, BUDPGram dgram)
        {
            if (resultList == null)
            {
                resultList = new CommandResultManager();
            }
            var group = resultList.Add(dgram.iep, dgram.data);

            group.Archor.Value = ByteHelper.byteToHexStr(dgram.data);

            valueList.Add(dgram.iep, dgram.data);
            AddLog(string.Format("收到 :: {0}", group.ToString()));


            archorList = OnDataReceive(group);
        }
        private void Udp_DGramRecieved(object sender, BUDPGram dgram)
        {
            i++;
            string txt = string.Format("[{0}][{1}][{2}]{3}\t({4})",
                                       i,
                                       DateTime.Now.ToString("HH:mm:ss.fff"),
                                       dgram.iep,
                                       ByteHelper.byteToHexStr(dgram.data),
                                       ByteHelper.byteToStr(dgram.data, "\t")
                                       );

            log = txt + "\n" + log;
            if (log.Length > 2000)
            {
                log = log.Substring(0, 2000);
            }
            TbConsole.Text = log;

            valueList.Add(dgram.iep, dgram.data);
            DataGrid1.ItemsSource = null;
            DataGrid1.ItemsSource = valueList;
            LbCount.Content       = valueList.Count;
            LbStatistics.Content  = valueList.GetStatistics();
        }
Esempio n. 8
0
 private void Udp_DGramRecieved(object sender, BUDPGram dgram)
 {
 }