コード例 #1
0
ファイル: Form1.cs プロジェクト: ufjl0683/rtaVideoStreamer
        void reader_OnEtagArriveEvent(EtagInfo info)
        {
            using (System.IO.StreamWriter wr = System.IO.File.AppendText(AppDomain.CurrentDomain.BaseDirectory + "ETAG.log"))
            {
                wr.WriteLine(info.antenna + "," + info.tag_id);
                wr.Close();
            }

            if (info.tag_id == "0x00BFDE232520FF63991F027A" )
            {

                if(info.antenna==1)
                             _Server.Pause();
                if (info.antenna == 7)
                             _Server.Resume();

                //Task.Run(() =>
                //    {
                //        System.Threading.Thread.Sleep(10 * 1000);
                //        _Server.Resume();
                //    }
                //);

            }

              //  throw new NotImplementedException();
        }
コード例 #2
0
        void reader_OnEtagArriveEvent(EtagInfo info)
        {
            using (System.IO.StreamWriter wr = System.IO.File.AppendText(AppDomain.CurrentDomain.BaseDirectory + "ETAG.log"))
            {
                wr.WriteLine(info.antenna + "," + info.tag_id);
                wr.Close();
            }


            if (info.tag_id == "0x00BFDE232520FF63991F027A")
            {
                if (info.antenna == 1)
                {
                    _Server.Pause();
                }
                if (info.antenna == 7)
                {
                    _Server.Resume();
                }

                //Task.Run(() =>
                //    {
                //        System.Threading.Thread.Sleep(10 * 1000);
                //        _Server.Resume();
                //    }
                //);
            }



            //  throw new NotImplementedException();
        }
コード例 #3
0
        void reader_OnEtagArriveEvent(EtagInfo info)
        {
            //using (System.IO.StreamWriter wr = System.IO.File.AppendText(AppDomain.CurrentDomain.BaseDirectory + "ETAG.log"))
            //{
            //    wr.WriteLine(info.antenna + "," + info.tag_id);
            //    wr.Close();
            //}

            Console.WriteLine(info.antenna + "," + info.tag_id);
             //   if (info.tag_id == "0x00BFDE232520FF63991F027A" )

            if (ExecuteMode == ConstExecuteMode.Stop)
            {
                Resume();
                return;
            }

            if (dictWhiteListLookUp.ContainsKey(   info.tag_id.ToUpper()))
            {

                if(info.antenna==EnterChno)
                             Pause();
                if (info.antenna == LeaveChno)
                             Resume();

                //Task.Run(() =>
                //    {
                //        System.Threading.Thread.Sleep(10 * 1000);
                //        _Server.Resume();
                //    }
                //);

            }

              //  throw new NotImplementedException();
        }
コード例 #4
0
 EtagInfo ToEtagInfo(string str)
 {
     string[] pairs = str.Split(new char[] { ' ' });    //[1].Trim().Split(new char[]{',',' '});
     EtagInfo info=new EtagInfo();
       foreach (string s in pairs)
       {
       string value, key;
       if (!s.Contains('='))
           continue;
       string temp = s.Trim().TrimEnd(new char[] { ',' });
        string[] res =temp.Split(new char[] {'=' });
       key = res[0];
       value = res[1];
       if (key == "tag_id")
           info.tag_id = value;
       else if (key == "rssi")
           info.rssi = System.Convert.ToInt32(value);
       else if(key=="antenna")
           info.antenna = System.Convert.ToInt32(value);
       }
       return info;
 }