コード例 #1
0
ファイル: rock.cs プロジェクト: ThomasGaff/Year-3-Uni-Work
        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            Robot_Control Robot_Control = new Robot_Control();

            Robot_Control.ShowDialog();
        }
コード例 #2
0
        private void bttnB_Click(object sender, EventArgs e)
        {
            this.Hide();
            Robot_Control Robot_Control = new Robot_Control();

            Robot_Control.ShowDialog();
        }
コード例 #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
            }
        }