Changeset 2094
- Timestamp:
- 06/25/09 12:46:44 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.CEDMA.Server/3.3
- Files:
-
- 9 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherBase.cs
r2088 r2094 41 41 private IStore store; 42 42 private DataSet dataset; 43 43 internal event EventHandler Changed; 44 44 public IEnumerable<string> AllowedTargetVariables { 45 45 get { … … 68 68 if (datasetEntities.Count() == 0) return null; 69 69 dataset = new DataSet(store, datasetEntities.ElementAt(0)); 70 OnChanged(); 70 71 } 71 72 int targetVariable = SelectTargetVariable(dataset.Problem.AllowedTargetVariables.ToArray()); … … 108 109 } 109 110 111 private void OnChanged() { 112 if (Changed != null) Changed(this, new EventArgs()); 113 } 114 110 115 #region IViewable Members 111 116 -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs
r2088 r2094 12 12 public partial class DispatcherView : ViewBase { 13 13 private DispatcherBase dispatcher; 14 public DispatcherView(DispatcherBase dispatcher) {14 public DispatcherView(DispatcherBase dispatcher) : base() { 15 15 this.dispatcher = dispatcher; 16 16 InitializeComponent(); 17 18 17 UpdateControls(); 18 dispatcher.Changed += (sender, args) => UpdateControls(); 19 19 } 20 20 -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterBase.cs
r2088 r2094 42 42 namespace HeuristicLab.CEDMA.Server { 43 43 public abstract class ExecuterBase : IExecuter { 44 internal event EventHandler Changed; 45 44 46 private IDispatcher dispatcher; 45 47 protected IDispatcher Dispatcher { … … 54 56 if (value < 0) throw new ArgumentException("Only positive values are allowed for MaxActiveJobs"); 55 57 maxActiveJobs = value; 58 OnChanged(); 56 59 } 57 60 } … … 130 133 public abstract string[] GetJobs(); 131 134 135 protected internal void OnChanged() { 136 if (Changed != null) Changed(this, new EventArgs()); 137 } 132 138 133 139 #region IViewable Members -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterView.Designer.cs
r2088 r2094 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container();27 this.refreshTimer = new System.Windows.Forms.Timer(this.components);28 26 this.jobsList = new System.Windows.Forms.ListBox(); 29 27 this.maxJobsLabel = new System.Windows.Forms.Label(); … … 31 29 ((System.ComponentModel.ISupportInitialize)(this.maxActiveJobs)).BeginInit(); 32 30 this.SuspendLayout(); 33 //34 // refreshTimer35 //36 this.refreshTimer.Interval = 1000;37 this.refreshTimer.Tick += new System.EventHandler(this.refreshTimer_Tick);38 31 // 39 32 // jobsList … … 86 79 #endregion 87 80 88 private System.Windows.Forms.Timer refreshTimer;89 81 private System.Windows.Forms.ListBox jobsList; 90 82 private System.Windows.Forms.Label maxJobsLabel; -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterView.cs
r2088 r2094 12 12 public partial class ExecuterView : ViewBase { 13 13 private ExecuterBase executer; 14 public ExecuterView(ExecuterBase executer) { 14 public ExecuterView(ExecuterBase executer) 15 : base() { 15 16 this.executer = executer; 16 17 InitializeComponent(); 17 refreshTimer.Enabled = true; 18 maxActiveJobs.Value = executer.MaxActiveJobs; 19 executer.Changed += (sender, args) => UpdateControls(); 18 20 } 19 21 20 private void refreshTimer_Tick(object sender, EventArgs e) { 21 jobsList.DataSource = executer.GetJobs(); 22 protected override void UpdateControls() { 23 if (InvokeRequired) Invoke((Action)UpdateControls); 24 else { 25 base.UpdateControls(); 26 maxActiveJobs.Value = executer.MaxActiveJobs; 27 jobsList.DataSource = executer.GetJobs(); 28 jobsList.Refresh(); 29 } 22 30 } 23 31 24 private void maxActiveJobs UpDown_ValueChanged(object sender, EventArgs e) {32 private void maxActiveJobs_ValueChanged(object sender, EventArgs e) { 25 33 executer.MaxActiveJobs = Convert.ToInt32(maxActiveJobs.Value); 26 34 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterView.resx
r2088 r2094 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="refreshTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">121 <value>17, 17</value>122 </metadata>123 120 </root> -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs
r2073 r2094 61 61 62 62 protected override void StartJobs() { 63 Dictionary<WaitHandle, AsyncGridResult> asyncResults = new Dictionary<WaitHandle, AsyncGridResult>();63 Dictionary<WaitHandle, AsyncGridResult> asyncResults = new Dictionary<WaitHandle, AsyncGridResult>(); 64 64 while (true) { 65 65 try { … … 80 80 activeAlgorithms.Add(asyncResult, algorithm); 81 81 } 82 OnChanged(); 82 83 } 83 84 } … … 95 96 asyncResults.Remove(readyHandle); 96 97 } 98 OnChanged(); 97 99 try { 98 100 IEngine finishedEngine = jobManager.EndExecuteEngine(finishedResult); -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/HeuristicLab.CEDMA.Server-3.3.csproj
r2088 r2094 112 112 <Compile Include="HeuristicLabCedmaServerPlugin.cs" /> 113 113 <Compile Include="Properties\AssemblyInfo.cs" /> 114 <Compile Include="Server Form.cs">114 <Compile Include="ServerView.cs"> 115 115 <SubType>UserControl</SubType> 116 116 </Compile> 117 <Compile Include="Server Form.designer.cs">118 <DependentUpon>Server Form.cs</DependentUpon>117 <Compile Include="ServerView.designer.cs"> 118 <DependentUpon>ServerView.cs</DependentUpon> 119 119 </Compile> 120 120 <Compile Include="SimpleDispatcher.cs" /> … … 177 177 <DependentUpon>ExecuterView.cs</DependentUpon> 178 178 </EmbeddedResource> 179 <EmbeddedResource Include="ServerForm.resx"> 180 <DependentUpon>ServerForm.cs</DependentUpon> 181 <SubType>Designer</SubType> 179 <EmbeddedResource Include="ServerView.resx"> 180 <DependentUpon>ServerView.cs</DependentUpon> 182 181 </EmbeddedResource> 183 182 </ItemGroup> -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs
r2088 r2094 108 108 109 109 public IView CreateView() { 110 return new Server Form(this);110 return new ServerView(this); 111 111 } 112 112 -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerView.cs
r2089 r2094 41 41 42 42 namespace HeuristicLab.CEDMA.Server { 43 public partial class Server Form: ViewBase {43 public partial class ServerView : ViewBase { 44 44 private Server server; 45 45 46 public Server Form(Server server) {46 public ServerView(Server server) : base() { 47 47 this.server = server; 48 48 InitializeComponent(); -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerView.designer.cs
r2089 r2094 21 21 22 22 namespace HeuristicLab.CEDMA.Server { 23 partial class Server Form{23 partial class ServerView { 24 24 /// <summary> 25 25 /// Required designer variable.
Note: See TracChangeset
for help on using the changeset viewer.