Beispiel #1
0
        public void GoHomeWorks()
        {
            GCoderSender myGCodeSender = new GCoderSender();

            myGCodeSender.Start();
            myGCodeSender.SendHome();
            myGCodeSender.Disconnect();
        }
Beispiel #2
0
        public void TestGCodeSending()
        {
            double       ChessBoardWidth = 152;
            double       halfBoard       = ChessBoardWidth / 2;
            double       rodHeight       = 43;
            double       abovePieces     = 120;
            GCoderSender myGCodeSender   = new GCoderSender();

            myGCodeSender.Start();
            myGCodeSender.SendHome();
            int sleepLength = 3000;

            //Move Rook from h8 to a8
            myGCodeSender.GoTo(-halfBoard, halfBoard, rodHeight);
            myGCodeSender.Pick();
            System.Threading.Thread.Sleep(sleepLength);
            myGCodeSender.GoTo(-halfBoard, halfBoard, abovePieces);
            myGCodeSender.GoTo(halfBoard, halfBoard, abovePieces);
            myGCodeSender.GoTo(halfBoard, halfBoard, rodHeight);
            System.Threading.Thread.Sleep(sleepLength);
            myGCodeSender.Play();
            System.Threading.Thread.Sleep(2000);

            myGCodeSender.GoTo(halfBoard, halfBoard, abovePieces);
            myGCodeSender.GoTo(halfBoard, halfBoard, rodHeight);
            myGCodeSender.Pick();
            System.Threading.Thread.Sleep(sleepLength);

            myGCodeSender.GoTo(halfBoard, -halfBoard, abovePieces);
            //Move Knight from a1 to a8
            myGCodeSender.GoTo(halfBoard, -halfBoard, rodHeight);
            myGCodeSender.Pick();
            System.Threading.Thread.Sleep(sleepLength);
            myGCodeSender.GoTo(halfBoard, -halfBoard, abovePieces);
            myGCodeSender.GoTo(-halfBoard, -halfBoard, abovePieces);
            myGCodeSender.GoTo(-halfBoard, -halfBoard, rodHeight);
            System.Threading.Thread.Sleep(sleepLength);
            myGCodeSender.Play();
            myGCodeSender.Play();
            myGCodeSender.SendHome();
            myGCodeSender.Disconnect();
        }