Наследование: System.Windows.Forms.MyUserControl, IWizard
Пример #1
0
        public Wizard()
        {
            instance = this;

            InitializeComponent();

            Utilities.ThemeManager.ApplyThemeTo(this);

            config.Clear();

            wiz_main = new MainSwitcher(this.panel1);

            AccelCalib = new _5AccelCalib();
            finish = new Finish();
            
            wiz_main.AddScreen(new MainSwitcher.Screen("Intro", new _1Intro(), true));
            wiz_main.AddScreen(new MainSwitcher.Screen("Connect", new _3ConnectAP(), true));
            wiz_main.AddScreen(new MainSwitcher.Screen("AccelCalib", AccelCalib, true)); // сделано чтобы иметь доступ к методам
            wiz_main.AddScreen(new MainSwitcher.Screen("CompassCalib", new _6CompassCalib(), true));
            wiz_main.AddScreen(new MainSwitcher.Screen("OptionalAP", new _8OptionalItemsAP(), true));
            wiz_main.AddScreen(new MainSwitcher.Screen("StabilCheckJoystic", new DS_Check(), true));
            wiz_main.AddScreen(new MainSwitcher.Screen("StabilCheckAutomatic", new DS_Check_Automatic(), true));
            wiz_main.AddScreen(new MainSwitcher.Screen("Finish", finish, true));


            wiz_main.ShowScreen("Intro");
            history.Add(wiz_main.current.Name);

            progressStep1.Maximum = wiz_main.screens.Count;
            progressStep1.Step = 0;
        }
Пример #2
0
        static void readmessage(object item)
        {
            _5AccelCalib local = (_5AccelCalib)item;

            // clean up history
            MainV2.comPort.MAV.cs.messages.Clear();

            while (!(MainV2.comPort.MAV.cs.message.ToLower().Contains("calibration successful") || MainV2.comPort.MAV.cs.message.ToLower().Contains("calibration failed")))
            {
                try
                {
                    System.Threading.Thread.Sleep(10);
                    // read the message
                    MainV2.comPort.readPacket();
                    // update cs with the message
                    MainV2.comPort.MAV.cs.UpdateCurrentSettings(null);
                    // update user display
                    local.UpdateUserMessage();
                }
                catch { break; }
            }

            MainV2.comPort.giveComport = false;

            try
            {
                local.Invoke((MethodInvoker) delegate()
                {
                    //local.imageLabel1.Text = "Done";
                    local.BUT_continue.Enabled = false;
                });
            }
            catch { }
        }