コード例 #1
0
        public void Activate()
        {
            if (!MainV2.comPort.BaseStream.IsOpen)
            {
                CustomMessageBox.Show(Strings.ErrorNotConnected, Strings.ERROR);
                Wizard.instance.Close();
                return;
            }

            if (MainV2.comPort.MAV.param.ContainsKey("FRAME"))
            {
                ConfigFrameType.Frame frame = (ConfigFrameType.Frame) (int) (float) MainV2.comPort.MAV.param["FRAME"];

                switch (frame)
                {
                    case ConfigFrameType.Frame.X:
                        pictureBox_Click(pictureBoxMouseOverX, EventArgs.Empty);
                        break;
                    case ConfigFrameType.Frame.Plus:
                        pictureBox_Click(pictureBoxMouseOverplus, EventArgs.Empty);
                        break;
                    case ConfigFrameType.Frame.V:
                        pictureBox_Click(pictureBoxMouseOvertrap, EventArgs.Empty);
                        break;
                    case ConfigFrameType.Frame.H:
                        pictureBox_Click(pictureBoxMouseOverH, EventArgs.Empty);
                        break;
                    case ConfigFrameType.Frame.Y:
                        pictureBox_Click(pictureBoxMouseOverY, EventArgs.Empty);
                        break;
                }
            }
        }
コード例 #2
0
        public void Activate()
        {
            if (!MainV2.comPort.BaseStream.IsOpen)
            {
                CustomMessageBox.Show("You are no longer connected to the board\n the wizard will now exit", "Error");
                Wizard.instance.Close();
                return;
            }

            if (MainV2.comPort.MAV.param.ContainsKey("FRAME"))
            {
                ConfigFrameType.Frame frame = (ConfigFrameType.Frame)(int)(float) MainV2.comPort.MAV.param["FRAME"];

                switch (frame)
                {
                case ConfigFrameType.Frame.X:
                    pictureBox_Click(pictureBoxMouseOverX, new EventArgs());
                    break;

                case ConfigFrameType.Frame.Plus:
                    pictureBox_Click(pictureBoxMouseOverplus, new EventArgs());
                    break;

                case ConfigFrameType.Frame.V:
                    pictureBox_Click(pictureBoxMouseOvertrap, new EventArgs());
                    break;

                case ConfigFrameType.Frame.H:
                    pictureBox_Click(pictureBoxMouseOverH, new EventArgs());
                    break;

                case ConfigFrameType.Frame.Y:
                    pictureBox_Click(pictureBoxMouseOverY, new EventArgs());
                    break;
                }
            }
        }