Ejemplo n.º 1
0
        public static void CorvusManagerTest()
        {
            CorvusManager cm = new CorvusManager("COM6", 57600);

            cm.rmove(-6, -5, -2);
            Thread.Sleep(5000);
            cm.rmove(6, 5, 2);
        }
Ejemplo n.º 2
0
        // relative move section ------------------------------------------------
        private void RelativeMove_Click(object sender, EventArgs ea)
        {
            // check whether port is open
            if (!IsCMSet)
            {
                MessageBox.Show(
                    "Not Connected to Corvus Platform through serial port",
                    "No port connection error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                return;
            }

            // get differential coordinates from user input
            float  x = 0, y = 0, z = 0;
            String txt = ((System.Windows.Forms.Button)sender).Text;

            switch (txt)
            {
            // x+ and x- buttons
            case "x+":
                x = (float)this.RMoveX.Value;
                break;

            case "x-":
                x = -(float)this.RMoveX.Value;
                break;

            // y+ and y- buttons
            case "y+":
                y = (float)this.RMoveY.Value;
                break;

            case "y-":
                y = -(float)this.RMoveY.Value;
                break;

            // z+ and z- buttons
            case "z+":
                z = (float)this.RMoveZ.Value;
                break;

            case "z-":
                z = -(float)this.RMoveZ.Value;
                break;

            // Move all axes button
            default:
                x = (float)this.RMoveX.Value;
                y = (float)this.RMoveY.Value;
                z = (float)this.RMoveZ.Value;
                break;
            }

            // send command to platform
            CM.rmove(x, y, z);
            this.updateCorvusConnectionStatus();
        }