コード例 #1
0
ファイル: ConnectViewModel.cs プロジェクト: xiaodelea/CutIT
 private void DoConnectCommand()
 {
     if (_tcpGrblClient.IsConnected)
     {
         _tcpGrblClient.Stop();
     }
     else
     {
         int port = 0;
         if (int.TryParse(_port, out port))
         {
             _tcpGrblClient.Start(_address, port);
         }
     }
     RaiseAllProperties();
 }
コード例 #2
0
 public Program()
 {
     gc = new TcpGrblClient();
     gs = new GrblSettings();
     if (gc.Start("192.168.1.15", 8887))
     {
         running = true;
         new Thread(new ThreadStart(ReadMain)).Start();
         while (gc.IsRunning)
         {
             if (gc.IsPaused)
             {
                 Console.WriteLine("PAUSED");
             }
             if (gc.Responses.Count > 0)
             {
                 GrblResponse r = gc.Responses.Pop();
                 gs.Parse(r);
                 Console.WriteLine(r.Content);
             }
             Thread.Sleep(10);
         }
     }
 }