1 | using HeuristicLab.Core.Networks.Views;
|
---|
2 | using HeuristicLab.MainForm;
|
---|
3 |
|
---|
4 | namespace 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 | }
|
---|