Пример #1
0
        private void Display(string s)
        {
            try
            {
                if (txtReceive.InvokeRequired)
                {
                    DlDisplay sd = new DlDisplay(Display);
                    txtReceive.Invoke(sd, new object[] { s });
                }
                else
                {
                    //  txtReceive.Text = s;

                    txtReceive.Text = s;
                }
            }
            catch (Exception) { }
        }
Пример #2
0
 private void Display(string s)
 {
     if (Txt_Data.InvokeRequired)
     {
         DlDisplay sd = new DlDisplay(Display);
         Txt_Data.Invoke(sd, new object[] { s });
     }
     else
     {
         try
         {
             //txtPid.Text += s;
             //[] X_pos = s.Split(sstring stringSeparators tringSeparators, StringSplitOptions.None);
             if (s.Contains("X.stop:"))
             {
                 string[] temp = s.Split(new char[] { ':' });
                 X_pos = Convert.ToDouble(temp[1]);
             }
             else if (s.Contains("Y.stop:"))
             {
                 string[] temp = s.Split(new char[] { ':' });
                 Y_pos = Convert.ToDouble(temp[1]);
             }
             else if (s.Contains("Z.stop:"))
             {
                 string[] temp = s.Split(new char[] { ':' });
                 Z_pos = Convert.ToDouble(temp[1]);
             }
             Txt_Data.Text = X_pos.ToString() + "/n" + Y_pos.ToString() + "/n";
         }
         catch (IndexOutOfRangeException)
         {
             return;
         }
     }
 }