Esempio n. 1
0
 private void RunButton_Click(object sender, RoutedEventArgs e)
 {
     if (Settings.RunFunction == Settings.RunFunctionMap["Run"])
     {
         if (CanRun())
         {
             RunProgram();
             return;
         }
     }
     if (Settings.RunFunction == Settings.RunFunctionMap["Step"])
     {
         if (Settings.Running && Settings.IterationType == "Once")
         {
             Interpret.IterateOnce();
             return;
         }
     }
     if (Settings.RunFunction == Settings.RunFunctionMap["Stop"])
     {
         AttemptStop();
         return;
     }
     if (Settings.RunFunction == Settings.RunFunctionMap["Reset"])
     {
         ResetProgram();
         return;
     }
 }
Esempio n. 2
0
 private void RunFullDone(object sender, RunWorkerCompletedEventArgs e)
 {
     Settings.Running   = false;
     ErrorTextBox.Text  = Interpret.Output.RunFullErrorOutput;
     OutputTextBox.Text = Interpret.Output.RunFullOutput;
     OutputTextBox.ScrollToEnd();
     Interpret.UpdateRegisterUI();
     SetRunToReset();
     SetOptionsToOptions();
 }
Esempio n. 3
0
 private void RunFullUpdateDone(object sender, RunWorkerCompletedEventArgs e)
 {
     if (Settings.Running)
     {
         ErrorTextBox.Text  = Interpret.Output.RunFullErrorOutput;
         OutputTextBox.Text = Interpret.Output.RunFullOutput;
         OutputTextBox.ScrollToEnd();
         Interpret.UpdateRegisterUI();
         RunFullUpdate.RunWorkerAsync();
     }
 }
Esempio n. 4
0
        public void ResetProgram()
        {
            int test = new int();

            AttemptStop();
            ErrorTextBox.Clear();
            OutputTextBox.Clear();
            Interpret.Reset();
            Settings.CanReset = false;
            SetRunToRun();
            SetOptionsToOptions();
            EnableEdit();
            PixelGridUI.NewGrid();
        }
Esempio n. 5
0
 private void IteratorDone(object sender, RunWorkerCompletedEventArgs e)
 {
     if (Settings.IterationType == "Delay")
     {
         if (Settings.Running)
         {
             Interpret.IterateOnce();
             Iterator.RunWorkerAsync();
         }
         else
         {
             SetRunToReset();
             SetOptionsToOptions();
         }
     }
 }
Esempio n. 6
0
 public void RunProgram()
 {
     if (!Settings.Running)
     {
         Interpret.ProgramInput(EditorTextBox.Text);
         DisableEdit();
     }
     if (Settings.IterationType == "Delay")
     {
         Settings.CanReset = true;
         Settings.Running  = true;
         SetRunToStop();
         Iterator.RunWorkerAsync();
     }
     if (Settings.IterationType == "Once")
     {
         Settings.CanReset = true;
         Settings.Running  = true;
         SetRunToStep();
         SetOptionsToReset();
         Settings.RunFunction = Settings.RunFunctionMap["Step"];
         Interpret.IterateOnce();
     }
     if (Settings.IterationType == "End")
     {
         Settings.CanReset = true;
         Settings.Running  = true;
         SetRunToStop();
         RunFull.RunWorkerAsync();
         RunFullUpdate.RunWorkerAsync();
         RunButton.Background = new SolidColorBrush();
     }
     if (Settings.IterationType == "Label")
     {
         Interpret.Break.BreakLabel   = Settings.BreakLabel;
         Interpret.Break.BreakOnLabel = true;
         Settings.CanReset            = true;
         Settings.Running             = true;
         SetRunToStop();
         RunFull.RunWorkerAsync();
         RunFullUpdate.RunWorkerAsync();
         RunButton.Background = new SolidColorBrush();
     }
 }
Esempio n. 7
0
 private void RunFullWait(object sender, DoWorkEventArgs e)
 {
     Interpret.FullRun();
 }