Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2205_OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.Views/3.3/OrchestratorNodeView.cs @ 16147

Last change on this file since 16147 was 14610, checked in by jkarder, 8 years ago

#2205: worked on optimization networks

  • added abstract base classes for ttp networks/orchestrators
  • removed ttp networks/orchestrators from HeuristicLab.Networks.IntegratedOptimization
  • runs can now be cleared when preparing OrchestratedAlgorithmNodes
File size: 1.9 KB
Line 
1using HeuristicLab.Core.Networks.Views;
2using HeuristicLab.MainForm;
3
4namespace HeuristicLab.Networks.IntegratedOptimization.Views {
5  [View("OrchestratorNode View")]
6  [Content(typeof(OrchestratorNode), true)]
7  [Content(typeof(IOrchestratorNode), false)]
8  public partial class OrchestratorNodeView : NetworkItemView {
9    public new IOrchestratorNode Content {
10      get { return (IOrchestratorNode)base.Content; }
11    }
12
13    protected override void OnContentChanged() {
14      base.OnContentChanged();
15      if (Content == null) {
16        parameterCollectionView.Content = null;
17        portCollectionView.Content = null;
18        resultCollectionView.Content = null;
19      } else {
20        parameterCollectionView.Content = Content.Parameters;
21        portCollectionView.Content = Content.Ports;
22        resultCollectionView.Content = Content.Results;
23      }
24    }
25
26    public OrchestratorNodeView() {
27      InitializeComponent();
28      startButton.Text = string.Empty;
29      startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;
30      pauseButton.Text = string.Empty;
31      pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;
32      stopButton.Text = string.Empty;
33      stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop;
34      prepareButton.Text = string.Empty;
35      prepareButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;
36    }
37
38    private void startButton_Click(object sender, System.EventArgs e) {
39      Content.StartAsync();
40    }
41
42    private void pauseButton_Click(object sender, System.EventArgs e) {
43      Content.PauseAsync();
44    }
45
46    private void stopButton_Click(object sender, System.EventArgs e) {
47      Content.StopAsync();
48    }
49
50    private void prepareButton_Click(object sender, System.EventArgs e) {
51      Content.PrepareAsync(false);
52    }
53  }
54}
Note: See TracBrowser for help on using the repository browser.