Exemplo n.º 1
0
        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            Robot_Control Robot_Control = new Robot_Control();

            Robot_Control.ShowDialog();
        }
Exemplo n.º 2
0
        private void bttnB_Click(object sender, EventArgs e)
        {
            this.Hide();
            Robot_Control Robot_Control = new Robot_Control();

            Robot_Control.ShowDialog();
        }
Exemplo n.º 3
0
        private void bttnConnnect_Click(object sender, EventArgs e)
        {
            string sCom = txtcom.Text;

            Connect.Globalvariable.sComPort = "COM" + sCom;

            try
            {
                // if brick is already connected then disconnect it
                if (brick != null && brick.Connection.IsConnected)
                {
                    MessageBox.Show("Robot is already connected", "Connect error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                this.Hide();
                Robot_Control Robot_Control = new Robot_Control();
                Robot_Control.ShowDialog();
            }
            catch
            {
                MessageBox.Show("Error connecting to robot on " + Connect.Globalvariable.sComPort, "Connect error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                // call disconnect in case robot has already connected when error occured
            }
        }