示例#1
0
        const int GAIT_COUNT = 7;                            // 生成步态步数

        #endregion

        #region 界面初始化

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                motors.motors_Init();
                //cp.plotStart(motors, statusBar, statusInfoTextBlock);
            }
            catch (Exception)
            {
                MessageBox.Show("Drives initialization failed");
                statusBar.Background     = new SolidColorBrush(Color.FromArgb(255, 230, 20, 20));
                statusInfoTextBlock.Text = "Window initialization failed!";
            }

            // 显示参数和读表线程
            DispatcherTimer showParaTimer = new DispatcherTimer();

            showParaTimer.Tick    += new EventHandler(showParaTimer_Tick);
            showParaTimer.Interval = TimeSpan.FromMilliseconds(40);
            showParaTimer.Start();

            // 选择调用的步态
            //Thread select_thread = new Thread(Select);
            //select_thread.Start();
        }
示例#2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                motors.motors_Init();
                //cp.plotStart(motors, statusBar, statusInfoTextBlock);
            }
            catch (Exception)
            {
                MessageBox.Show("驱动器初始化失败");
                statusBar.Background     = new SolidColorBrush(Color.FromArgb(255, 230, 20, 20));
                statusInfoTextBlock.Text = "窗口初始化失败!";
            }

            Thread shoutdown = new Thread(Select);

            shoutdown.Start();
        }
示例#3
0
        private const int NORMAL_SPEED   = 13; // 正常循环步速度

        #endregion

        #region 界面初始化

        private void Window_Loaded(object sender, RoutedEventArgs e)//打开程序时执行
        {
            try
            {
                motors.motors_Init();
                //cp.plotStart(motors, statusBar, statusInfoTextBlock);
            }
            catch (Exception)
            {
                MessageBox.Show("驱动器初始化失败");
                statusBar.Background     = new SolidColorBrush(Color.FromArgb(255, 230, 20, 20));
                statusInfoTextBlock.Text = "窗口初始化失败!";
            }

            Thread logic = new Thread(eeg_emg_control);//逻辑控制线程logic

            logic.Start();
        }
示例#4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DispatcherTimer dateTimer = new DispatcherTimer();//显示当前时间线程

            dateTimer.Tick    += new EventHandler(dateTimer_Tick);
            dateTimer.Interval = new TimeSpan(0, 0, 0, 1, 0);
            dateTimer.Start();

            try
            {
                motors.motors_Init();
                //cp.plotStart(motors, statusBar, statusInfoTextBlock);
            }
            catch
            {
                statusBar.Background     = new SolidColorBrush(Color.FromArgb(255, 230, 20, 20));
                statusInfoTextBlock.Text = "窗口初始化失败!";
            }

            DispatcherTimer showParaTimer = new DispatcherTimer(); //显示参数线程

            showParaTimer.Tick    += new EventHandler(showParaTimer_Tick);
            showParaTimer.Interval = TimeSpan.FromMilliseconds(100);
            showParaTimer.Start();

            DispatcherTimer keystate = new DispatcherTimer(); //显示拐杖状态

            keystate.Tick    += new EventHandler(Keystate_Tick);
            keystate.Interval = TimeSpan.FromMilliseconds(50);
            keystate.Start();

            DispatcherTimer Executekey = new DispatcherTimer();

            Executekey.Tick    += new EventHandler(Execute_Tick);
            Executekey.Interval = TimeSpan.FromMilliseconds(100);
            Executekey.Start();
        }