Last change
on this file since 2119 was
2119,
checked in by gkronber, 15 years ago
|
Changed dispatcher to configure algorithms to use only the allowed input variables and changed dispatching to dispatch deterministic algorithms again when the input variable set is different.
#676 (Cockpit for the CEDMA Server to control algorithm settings)
|
File size:
1.6 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.ComponentModel;
|
---|
4 | using System.Drawing;
|
---|
5 | using System.Data;
|
---|
6 | using System.Linq;
|
---|
7 | using System.Text;
|
---|
8 | using System.Windows.Forms;
|
---|
9 | using HeuristicLab.Core;
|
---|
10 |
|
---|
11 | namespace HeuristicLab.CEDMA.Server {
|
---|
12 | public partial class DispatcherView : ViewBase {
|
---|
13 | private DispatcherBase dispatcher;
|
---|
14 | public DispatcherView(DispatcherBase dispatcher) : base() {
|
---|
15 | this.dispatcher = dispatcher;
|
---|
16 | InitializeComponent();
|
---|
17 | UpdateControls();
|
---|
18 | dispatcher.Changed += (sender, args) => UpdateControls();
|
---|
19 | }
|
---|
20 |
|
---|
21 | protected override void UpdateControls() {
|
---|
22 | base.UpdateControls();
|
---|
23 |
|
---|
24 | foreach (string targetVar in dispatcher.TargetVariables) {
|
---|
25 | targetVariableList.Items.Add(targetVar);
|
---|
26 | }
|
---|
27 |
|
---|
28 | foreach (string inputVar in dispatcher.InputVariables) {
|
---|
29 | inputVariableList.Items.Add(inputVar);
|
---|
30 | }
|
---|
31 | }
|
---|
32 |
|
---|
33 | private void targetVariableList_ItemCheck(object sender, ItemCheckEventArgs e) {
|
---|
34 | if (e.NewValue == CheckState.Checked) {
|
---|
35 | dispatcher.EnableTargetVariable((string)targetVariableList.Items[e.Index]);
|
---|
36 | } else if (e.NewValue == CheckState.Unchecked) {
|
---|
37 | dispatcher.DisableTargetVariable((string)targetVariableList.Items[e.Index]);
|
---|
38 | }
|
---|
39 | }
|
---|
40 |
|
---|
41 | private void inputVariableList_ItemCheck(object sender, ItemCheckEventArgs e) {
|
---|
42 | if (e.NewValue == CheckState.Checked) {
|
---|
43 | dispatcher.EnableInputVariable((string)inputVariableList.Items[e.Index]);
|
---|
44 | } else if (e.NewValue == CheckState.Unchecked) {
|
---|
45 | dispatcher.DisableInputVariable((string)inputVariableList.Items[e.Index]);
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.