Beispiel #1
0
        //futtatás
        private async void RunClick(object sender, RoutedEventArgs e)
        {
            runButton.IsEnabled = false;
            menu.Save(rtbhelper.GetString(commandLine));
            turtle.Clean();
            turtle.PenDown();
            RoboPreter rp = new RoboPreter();

            try
            {
                List <Robopreter.Command> com = rp.Run(menu.GetFullSource());
                for (int i = 0; i < com.Count; i++)
                {
                    Draw(com[i]);
                    int time = GetTime(com[i]);
                    await Task.Factory.StartNew(() => Wait(time));
                }
            }
            catch (RPExeption rpe)
            {
                MessageBox.Show(rpe.NewMessage);
            }
            catch
            {
                MessageBox.Show(App.Current.TryFindResource("error").ToString());
            }
            runButton.IsEnabled = true;
        }
Beispiel #2
0
        private async void runbtButton_Click(object sender, RoutedEventArgs e)
        {
            runbtButton.IsEnabled = false;
            menu.Save(rtbhelper.GetString(commandLine));
            RoboPreter rp = new RoboPreter();

            try
            {
                List <Robopreter.Command> com = rp.Run(menu.GetFullSource());
                await Task.Factory.StartNew(() => BTRun(com));

                runbtButton.IsEnabled = true;
            }
            catch (RPExeption rpe)
            {
                MessageBox.Show(rpe.NewMessage);
            }
            catch
            {
                MessageBox.Show(App.Current.TryFindResource("error").ToString());
                BTUpdate();
            }
        }
Beispiel #3
0
 private async void runbtButton_Click(object sender, RoutedEventArgs e)
 {
     runbtButton.IsEnabled = false;
     menu.Save(rtbhelper.GetString(commandLine));
     RoboPreter rp = new RoboPreter();
     try
     {
         List<Robopreter.Command> com = rp.Run(menu.GetFullSource());
         await Task.Factory.StartNew(() => BTRun(com));
         runbtButton.IsEnabled = true;
     }
     catch (RPExeption rpe)
     {
         MessageBox.Show(rpe.NewMessage);
     }
     catch
     {
         MessageBox.Show(App.Current.TryFindResource("error").ToString());
         BTUpdate();
     }
 }
Beispiel #4
0
        //futtatás
        private async void RunClick(object sender, RoutedEventArgs e)
        {
            runButton.IsEnabled = false;
            menu.Save(rtbhelper.GetString(commandLine));
            turtle.Clean();
            turtle.PenDown();
            RoboPreter rp = new RoboPreter();
            try
            {

                List<Robopreter.Command> com = rp.Run(menu.GetFullSource());
                for (int i = 0; i < com.Count; i++)
                {
                    Draw(com[i]);
                    int time = GetTime(com[i]);
                    await Task.Factory.StartNew(() => Wait(time));
                }
            }
            catch (RPExeption rpe)
            {
                MessageBox.Show(rpe.NewMessage);
            }
            catch
            {
                MessageBox.Show(App.Current.TryFindResource("error").ToString());
            }
            runButton.IsEnabled = true;

        }