- Timestamp:
- 06/26/17 09:45:36 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GUIAutomationScriptSource.cs
r11789 r15065 1 using System; 2 using System.Linq; 3 using System.Threading; 1 using System.Linq; 4 2 using System.Windows.Forms; 5 3 6 4 using HeuristicLab.Algorithms.GeneticAlgorithm; 7 using HeuristicLab.Core;8 5 using HeuristicLab.MainForm; 9 6 using HeuristicLab.MainForm.WindowsForms; … … 13 10 14 11 public class GUIAutomationScript : HeuristicLab.Scripting.CSharpScriptBase { 15 readonly ManualResetEvent mutex = new ManualResetEvent(false);16 17 12 public override void Main() { 18 13 var ga = new GeneticAlgorithm { … … 27 22 ga.PopulationSize.Value *= 2; 28 23 } 29 30 experiment.ExecutionStateChanged += OnExecutionStateChanged;31 24 experiment.Start(); 32 mutex.WaitOne();33 25 34 26 vars.experiment = experiment; … … 39 31 bubbleChart.Controls.OfType<ComboBox>().Single(x => x.Name == "xAxisComboBox").SelectedItem = "PopulationSize"; 40 32 } 41 42 private void OnExecutionStateChanged(object sender, EventArgs e) {43 if (((IExecutable)sender).ExecutionState == ExecutionState.Stopped)44 mutex.Set();45 }46 33 }
Note: See TracChangeset
for help on using the changeset viewer.