Changeset 6033 for branches/HeuristicLab.Hive-3.4/sources
- Timestamp:
- 04/19/11 18:58:53 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 21 added
- 11 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/app_services.config
r6008 r6033 21 21 </service> 22 22 </services> 23 23 24 24 <client> 25 25 <endpoint name="SlaveCommunicationServiceEndpoint" address="net.pipe://localhost/HeuristicLabSlaveCom" binding="netNamedPipeBinding" contract="HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts.ISlaveCommunication"/> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs
r6004 r6033 56 56 57 57 public void Close() { 58 if (pipeFactory.State != CommunicationState.Closed ) {58 if (pipeFactory.State != CommunicationState.Closed && pipeFactory.State != CommunicationState.Closing) { 59 59 pipeProxy.Unsubscribe(); 60 60 pipeFactory.Close(); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/HeuristicLab.Clients.Hive.Slave.Views-3.4.csproj
r5852 r6033 71 71 </PropertyGroup> 72 72 <ItemGroup> 73 <Reference Include="HeuristicLab.Algorithms.GeneticAlgorithm-3.3">74 <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.dll</HintPath>75 </Reference>76 73 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 77 74 <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/HeuristicLabClientsHiveSlaveViewsPlugin.cs.frame
r5599 r6033 29 29 [Plugin("HeuristicLab.Clients.Hive.Slave.Views", "3.4.0.$WCREV$")] 30 30 [PluginFile("HeuristicLab.Clients.Hive.Slave.Views-3.4.dll", PluginFileType.Assembly)] 31 [PluginDependency("HeuristicLab.Clients.Hive.SlaveCore", "3.4")] 32 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 33 [PluginDependency("HeuristicLab.Common", "3.3")] 34 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 32 35 [PluginDependency("HeuristicLab.Core", "3.3")] 36 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 37 [PluginDependency("HeuristicLab.Data", "3.3")] 38 [PluginDependency("HeuristicLab.Data.Views", "3.3")] 39 [PluginDependency("HeuristicLab.MainForm", "3.3")] 40 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 41 [PluginDependency("HeuristicLab.Optimization", "3.3")] 42 [PluginDependency("HeuristicLab.Optimizer", "3.3")] 33 43 [PluginDependency("HeuristicLab.Persistence", "3.3")] 34 [PluginDependency("HeuristicLab.Clients.Hive.SlaveCore", "3.4")]35 44 public class HeuristicLabClientsHiveSlaveViewsPlugin : PluginBase { 36 45 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeuristicLabClientsHiveSlavePlugin.cs.frame
r5599 r6033 8 8 [Plugin("HeuristicLab.Clients.Hive.SlaveCore", "3.4.0.$WCREV$")] 9 9 [PluginFile("HeuristicLab.Clients.Hive.SlaveCore-3.4.dll", PluginFileType.Assembly)] 10 11 [PluginDependency("HeuristicLab.Clients.Common", "3.3")] 12 [PluginDependency("HeuristicLab.Clients.Hive", "3.4")] 10 13 [PluginDependency("HeuristicLab.Common", "3.3")] 11 14 [PluginDependency("HeuristicLab.Core", "3.3")] 15 [PluginDependency("HeuristicLab.Hive", "3.4")] 12 16 [PluginDependency("HeuristicLab.Persistence", "3.3")] 13 17 public class HeuristicLabClientsHiveSlavePlugin : PluginBase { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/StatusCommons.cs
r5599 r6033 48 48 [DataMember] 49 49 public List<JobStatus> Jobs { get; set; } 50 51 public override string ToString() { 52 return string.Format("Status: {0}, Fetched/Done/Aborted: {1},{2},{3}", Status, JobsFetched, JobsDone, JobsAborted); 53 } 50 54 } 51 55 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveExperimentListView.cs
r5955 r6033 20 20 #endregion 21 21 22 using System; 22 23 using System.Windows.Forms; 23 24 using HeuristicLab.Core; … … 27 28 namespace HeuristicLab.Clients.Hive.Views { 28 29 [View("HiveExperimentList View")] 29 [Content(typeof(ItemCollection< HiveExperiment>), false)]30 public partial class HiveExperimentListView : ItemCollectionView< HiveExperiment> {30 [Content(typeof(ItemCollection<RefreshableHiveExperiment>), false)] 31 public partial class HiveExperimentListView : ItemCollectionView<RefreshableHiveExperiment> { 31 32 32 33 public HiveExperimentListView() { … … 34 35 } 35 36 36 protected override HiveExperiment CreateItem() { 37 return new HiveExperiment(); 37 protected override RefreshableHiveExperiment CreateItem() { 38 return new RefreshableHiveExperiment(); 39 } 40 41 protected override void removeButton_Click(object sender, EventArgs e) { 42 DialogResult result = MessageBox.Show("This action will permanently delete this experiment (also on the hive server). Continue?", "Delete Experiment", MessageBoxButtons.OKCancel); 43 if (result == DialogResult.OK) { 44 base.removeButton_Click(sender, e); 45 } 38 46 } 39 47 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveExperimentManagerView.cs
r5955 r6033 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Windows.Forms; 25 using HeuristicLab.Collections; 24 26 using HeuristicLab.MainForm; 25 27 using HeuristicLab.MainForm.WindowsForms; … … 50 52 Content.Refreshing += new EventHandler(Content_Refreshing); 51 53 Content.Refreshed += new EventHandler(Content_Refreshed); 54 Content.HiveExperimentsChanged += new EventHandler(Content_HiveExperimentsChanged); 55 52 56 } 53 57 … … 55 59 Content.Refreshing -= new EventHandler(Content_Refreshing); 56 60 Content.Refreshed -= new EventHandler(Content_Refreshed); 61 Content.HiveExperimentsChanged -= new EventHandler(Content_HiveExperimentsChanged); 57 62 base.DeregisterContentEvents(); 58 63 } … … 101 106 protected override void OnClosing(FormClosingEventArgs e) { 102 107 base.OnClosing(e); 103 if (Content != null ) {104 foreach (var exp in Content.HiveExperiments ) {108 if (Content != null && Content.HiveExperiments != null) { 109 foreach (var exp in Content.HiveExperiments.OfType<RefreshableHiveExperiment>()) { 105 110 if (exp.RefreshAutomatically) { 106 111 exp.RefreshAutomatically = false; // stop result polling … … 109 114 } 110 115 } 116 117 private void HiveExperiments_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<RefreshableHiveExperiment> e) { 118 foreach (var item in e.Items) { 119 ExperimentManagerClient.Delete(item); 120 } 121 } 122 123 private void Content_HiveExperimentsChanged(object sender, EventArgs e) { 124 Content.HiveExperiments.ItemsRemoved += new CollectionItemsChangedEventHandler<RefreshableHiveExperiment>(HiveExperiments_ItemsRemoved); 125 } 111 126 } 112 127 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.cs
r5793 r6033 29 29 [View("HiveJob View")] 30 30 [Content(typeof(HiveJob), true)] 31 [Content(typeof(HiveJob<>), false)] 31 32 public partial class HiveJobView : ItemView { 32 33 public new HiveJob Content { … … 45 46 protected override void RegisterContentEvents() { 46 47 base.RegisterContentEvents(); 47 Content. OptimizerJobChanged += new EventHandler(Content_OptimizerJobChanged);48 Content.JobItemChanged += new EventHandler(Content_JobItemChanged); 48 49 Content.JobChanged += new EventHandler(Content_JobChanged); 49 50 Content.JobStateChanged += new EventHandler(Content_JobStateChanged); … … 51 52 52 53 protected override void DeregisterContentEvents() { 53 Content. OptimizerJobChanged -= new EventHandler(Content_OptimizerJobChanged);54 Content.JobItemChanged -= new EventHandler(Content_JobItemChanged); 54 55 Content.JobChanged -= new EventHandler(Content_JobChanged); 55 56 Content.JobStateChanged -= new EventHandler(Content_JobStateChanged); … … 60 61 base.OnContentChanged(); 61 62 if (Content != null && Content.Job != null) { 62 logView.Content = Content.OptimizerJob.Log; 63 computeInParallelCheckBox.Checked = Content.OptimizerJob.ComputeInParallel; 63 computeInParallelCheckBox.Checked = Content.JobItem.ComputeInParallel; 64 64 } else { 65 logView.Content = null;66 65 computeInParallelCheckBox.Checked = false; 67 66 } 68 Content_ OptimizerJobChanged(this, EventArgs.Empty);67 Content_JobItemChanged(this, EventArgs.Empty); 69 68 Content_JobChanged(this, EventArgs.Empty); 70 69 Content_JobStateChanged(this, EventArgs.Empty); 71 70 } 72 71 73 protected void Content_OptimizerJobChanged(object sender, EventArgs e) { 74 RegisterJobEvents(); 75 Job_OptimizerChanged(this, e); 76 } 77 78 protected void Job_OptimizerChanged(object sender, EventArgs e) { 79 if (Content != null && Content.Job != null && Content.OptimizerJob.Optimizer != null) { 80 optimizerNamedItemView.Content = Content.OptimizerJob.Optimizer; 81 runCollectionViewHost.Content = Content.OptimizerJob.Optimizer.Runs; 82 } else { 83 optimizerNamedItemView.Content = null; 84 runCollectionViewHost.Content = null; 72 protected virtual void RegisterJobEvents() { 73 if (Content != null && Content.Job != null) { 74 Content.JobItem.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged); 75 Content.JobItem.ItemChanged += new EventHandler(Job_ItemChanged); 85 76 } 86 77 } 87 78 88 pr ivate void RegisterJobEvents() {79 protected virtual void DeregisterJobEvents() { 89 80 if (Content != null && Content.Job != null) { 90 Content.OptimizerJob.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged); 91 Content.OptimizerJob.OptimizerChanged += new EventHandler(Job_OptimizerChanged); 92 } 93 } 94 95 private void DeregisterJobEvents() { 96 if (Content != null && Content.Job != null) { 97 Content.OptimizerJob.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged); 98 Content.OptimizerJob.OptimizerChanged -= new EventHandler(Job_OptimizerChanged); 81 Content.JobItem.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged); 82 Content.JobItem.ItemChanged -= new EventHandler(Job_ItemChanged); 99 83 } 100 84 } 101 85 102 86 #region Content Events 103 pr ivatevoid Content_JobChanged(object sender, EventArgs e) {87 protected virtual void Content_JobChanged(object sender, EventArgs e) { 104 88 if (InvokeRequired) { 105 89 Invoke(new EventHandler(Content_JobChanged), sender, e); … … 121 105 } 122 106 123 private void Content_JobStateChanged(object sender, EventArgs e) { 107 protected virtual void Content_JobItemChanged(object sender, EventArgs e) { 108 RegisterJobEvents(); 109 Job_ItemChanged(this, e); 110 } 111 112 protected virtual void Job_ItemChanged(object sender, EventArgs e) { 113 if (Content != null && Content.Job != null && Content.JobItem.Item != null) { 114 optimizerItemView.Content = Content.JobItem.Item; 115 } else { 116 optimizerItemView.Content = null; 117 } 118 } 119 120 protected virtual void Content_JobStateChanged(object sender, EventArgs e) { 124 121 if (InvokeRequired) { 125 122 Invoke(new EventHandler(Content_JobStateChanged), sender, e); … … 131 128 this.exceptionTextBox.Text = Content.Job.CurrentStateLog != null ? Content.Job.CurrentStateLog.Exception : string.Empty; 132 129 this.lastUpdatedTextBox.Text = Content.Job.LastJobDataUpdate.ToString(); 133 if (Content. OptimizerJob.ComputeInParallel) {130 if (Content.JobItem.ComputeInParallel) { 134 131 this.stateLogViewHost.Content = new StateLogListList( 135 132 this.Content.ChildHiveJobs.Select(child => new StateLogList(child.Job.StateLog) … … 165 162 this.coresNeededTextBox.ReadOnly = this.ReadOnly; 166 163 this.memoryNeededTextBox.ReadOnly = this.ReadOnly; 167 this.computeInParallelCheckBox.Enabled = !this.ReadOnly && this.Content != null && this.Content. OptimizerJob != null && this.Content.OptimizerJob.IsParallelizable;164 this.computeInParallelCheckBox.Enabled = !this.ReadOnly && this.Content != null && this.Content.JobItem != null && this.Content.JobItem.IsParallelizable; 168 165 169 this.restartButton.Enabled = Content != null && Content.Job.State == JobState.Paused; 170 this.pauseButton.Enabled = Content != null && Content.Job.State == JobState.Calculating; 171 this.stopButton.Enabled = Content != null && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused); 172 this.showOptimizerButton.Enabled = Content != null && Content.Job.State == JobState.Paused && Content.OptimizerJob != null && Content.OptimizerJob.Optimizer != null; 166 this.modifyItemButton.Enabled = (Content != null && Content.JobItem.Item != null && (Content.Job.State == JobState.Paused || Content.Job.State == JobState.Offline || Content.Job.State == JobState.Finished || Content.Job.State == JobState.Failed || Content.Job.State == JobState.Aborted)); 173 167 174 optimizer NamedItemView.ReadOnly = true;168 optimizerItemView.ReadOnly = true; 175 169 } 176 170 177 void OptimizerJob_ComputeInParallelChanged(object sender, EventArgs e) {171 protected virtual void OptimizerJob_ComputeInParallelChanged(object sender, EventArgs e) { 178 172 if (InvokeRequired) { 179 173 Invoke(new EventHandler(OptimizerJob_ComputeInParallelChanged), sender, e); 180 174 } else { 181 computeInParallelCheckBox.Checked = Content. OptimizerJob.ComputeInParallel;175 computeInParallelCheckBox.Checked = Content.JobItem.ComputeInParallel; 182 176 } 183 177 } 184 178 #endregion 185 179 186 private void computeInParallelCheckBox_CheckedChanged(object sender, EventArgs e) { 187 if (Content != null && Content.OptimizerJob != null) { 188 this.Content.OptimizerJob.ComputeInParallel = this.computeInParallelCheckBox.Checked; 180 #region Child Control Events 181 protected virtual void computeInParallelCheckBox_CheckedChanged(object sender, EventArgs e) { 182 if (Content != null && Content.JobItem != null) { 183 this.Content.JobItem.ComputeInParallel = this.computeInParallelCheckBox.Checked; 189 184 } 190 185 } 191 186 192 pr ivatevoid exceptionTextBox_DoubleClick(object sender, EventArgs e) {187 protected virtual void exceptionTextBox_DoubleClick(object sender, EventArgs e) { 193 188 using (TextDialog dialog = new TextDialog("Exception", exceptionTextBox.Text, ReadOnly || !Content.CanChangeDescription)) { 194 189 if (dialog.ShowDialog(this) == DialogResult.OK) … … 197 192 } 198 193 199 pr ivate void restartButton_Click(object sender, EventArgs e) {200 Content.Restart();194 protected virtual void modifyItemButton_Click(object sender, EventArgs e) { 195 MainFormManager.MainForm.ShowContent(Content.JobItem.Item); 201 196 } 202 203 private void pauseButton_Click(object sender, EventArgs e) { 204 Content.Pause(); 205 } 206 207 private void stopButton_Click(object sender, EventArgs e) { 208 Content.Stop(); 209 } 210 private void showOptimizerButton_Click(object sender, EventArgs e) { 211 MainFormManager.MainForm.ShowContent(Content.OptimizerJob.Optimizer); 212 } 197 #endregion 213 198 } 214 199 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.designer.cs
r5797 r6033 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HiveJobView));27 this.logTabPage = new System.Windows.Forms.TabPage();28 this.logView = new HeuristicLab.Core.Views.LogView();29 26 this.stateLogTabPage = new System.Windows.Forms.TabPage(); 30 27 this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 31 this.runsTabPage = new System.Windows.Forms.TabPage();32 this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();33 28 this.detailsTabPage = new System.Windows.Forms.TabPage(); 34 this.restartButton = new System.Windows.Forms.Button(); 35 this.pauseButton = new System.Windows.Forms.Button(); 36 this.stopButton = new System.Windows.Forms.Button(); 37 this.optimizerGroupBox = new System.Windows.Forms.GroupBox(); 38 this.showOptimizerButton = new System.Windows.Forms.Button(); 39 this.lastUpdatedTextBox = new System.Windows.Forms.TextBox(); 40 this.lastUpdatedLabel = new System.Windows.Forms.Label(); 41 this.optimizerNamedItemView = new HeuristicLab.Core.Views.NamedItemView(); 29 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 42 30 this.configurationGroupBox = new System.Windows.Forms.GroupBox(); 43 31 this.priorityTextBox = new System.Windows.Forms.TextBox(); … … 49 37 this.computeInParallelLabel = new System.Windows.Forms.Label(); 50 38 this.computeInParallelCheckBox = new System.Windows.Forms.CheckBox(); 51 this.jobIdLabel = new System.Windows.Forms.Label();52 this.jobIdTextBox = new System.Windows.Forms.TextBox();53 39 this.jobStatusGroupBox = new System.Windows.Forms.GroupBox(); 54 40 this.stateTextBox = new System.Windows.Forms.TextBox(); … … 64 50 this.dateFinishedLabel = new System.Windows.Forms.Label(); 65 51 this.exceptionTextBox = new System.Windows.Forms.TextBox(); 52 this.optimizerGroupBox = new System.Windows.Forms.GroupBox(); 53 this.modifyItemButton = new System.Windows.Forms.Button(); 54 this.lastUpdatedTextBox = new System.Windows.Forms.TextBox(); 55 this.lastUpdatedLabel = new System.Windows.Forms.Label(); 56 this.optimizerItemView = new HeuristicLab.Core.Views.ItemView(); 57 this.jobIdLabel = new System.Windows.Forms.Label(); 58 this.jobIdTextBox = new System.Windows.Forms.TextBox(); 66 59 this.tabControl = new System.Windows.Forms.TabControl(); 67 this.splitContainer1 = new System.Windows.Forms.SplitContainer();68 this.logTabPage.SuspendLayout();69 60 this.stateLogTabPage.SuspendLayout(); 70 this.runsTabPage.SuspendLayout();71 61 this.detailsTabPage.SuspendLayout(); 72 this.optimizerGroupBox.SuspendLayout();73 this.configurationGroupBox.SuspendLayout();74 this.jobStatusGroupBox.SuspendLayout();75 this.tabControl.SuspendLayout();76 62 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 77 63 this.splitContainer1.Panel1.SuspendLayout(); 78 64 this.splitContainer1.Panel2.SuspendLayout(); 79 65 this.splitContainer1.SuspendLayout(); 66 this.configurationGroupBox.SuspendLayout(); 67 this.jobStatusGroupBox.SuspendLayout(); 68 this.optimizerGroupBox.SuspendLayout(); 69 this.tabControl.SuspendLayout(); 80 70 this.SuspendLayout(); 81 //82 // logTabPage83 //84 this.logTabPage.Controls.Add(this.logView);85 this.logTabPage.Location = new System.Drawing.Point(4, 22);86 this.logTabPage.Name = "logTabPage";87 this.logTabPage.Padding = new System.Windows.Forms.Padding(3);88 this.logTabPage.Size = new System.Drawing.Size(611, 492);89 this.logTabPage.TabIndex = 1;90 this.logTabPage.Text = "Log";91 this.logTabPage.UseVisualStyleBackColor = true;92 //93 // logView94 //95 this.logView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)96 | System.Windows.Forms.AnchorStyles.Left)97 | System.Windows.Forms.AnchorStyles.Right)));98 this.logView.Caption = "Log View";99 this.logView.Content = null;100 this.logView.Location = new System.Drawing.Point(3, 3);101 this.logView.Name = "logView";102 this.logView.ReadOnly = false;103 this.logView.Size = new System.Drawing.Size(613, 486);104 this.logView.TabIndex = 0;105 71 // 106 72 // stateLogTabPage … … 109 75 this.stateLogTabPage.Location = new System.Drawing.Point(4, 22); 110 76 this.stateLogTabPage.Name = "stateLogTabPage"; 111 this.stateLogTabPage.Size = new System.Drawing.Size( 611, 492);77 this.stateLogTabPage.Size = new System.Drawing.Size(563, 375); 112 78 this.stateLogTabPage.TabIndex = 5; 113 79 this.stateLogTabPage.Text = "State"; … … 123 89 this.stateLogViewHost.Name = "stateLogViewHost"; 124 90 this.stateLogViewHost.ReadOnly = false; 125 this.stateLogViewHost.Size = new System.Drawing.Size( 611, 492);91 this.stateLogViewHost.Size = new System.Drawing.Size(563, 375); 126 92 this.stateLogViewHost.TabIndex = 0; 127 93 this.stateLogViewHost.ViewsLabelVisible = true; 128 94 this.stateLogViewHost.ViewType = null; 129 95 // 130 // runsTabPage131 //132 this.runsTabPage.Controls.Add(this.runCollectionViewHost);133 this.runsTabPage.Location = new System.Drawing.Point(4, 22);134 this.runsTabPage.Name = "runsTabPage";135 this.runsTabPage.Size = new System.Drawing.Size(611, 492);136 this.runsTabPage.TabIndex = 4;137 this.runsTabPage.Text = "Runs";138 this.runsTabPage.UseVisualStyleBackColor = true;139 //140 // runCollectionViewHost141 //142 this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)143 | System.Windows.Forms.AnchorStyles.Left)144 | System.Windows.Forms.AnchorStyles.Right)));145 this.runCollectionViewHost.Caption = "View";146 this.runCollectionViewHost.Content = null;147 this.runCollectionViewHost.Enabled = false;148 this.runCollectionViewHost.Location = new System.Drawing.Point(3, 3);149 this.runCollectionViewHost.Name = "runCollectionViewHost";150 this.runCollectionViewHost.ReadOnly = false;151 this.runCollectionViewHost.Size = new System.Drawing.Size(613, 486);152 this.runCollectionViewHost.TabIndex = 0;153 this.runCollectionViewHost.ViewsLabelVisible = true;154 this.runCollectionViewHost.ViewType = null;155 //156 96 // detailsTabPage 157 97 // 158 98 this.detailsTabPage.Controls.Add(this.splitContainer1); 159 this.detailsTabPage.Controls.Add(this.restartButton);160 this.detailsTabPage.Controls.Add(this.pauseButton);161 this.detailsTabPage.Controls.Add(this.stopButton);162 99 this.detailsTabPage.Controls.Add(this.optimizerGroupBox); 163 100 this.detailsTabPage.Controls.Add(this.jobIdLabel); … … 171 108 this.detailsTabPage.UseVisualStyleBackColor = true; 172 109 // 173 // restartButton 174 // 175 this.restartButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 176 this.restartButton.Image = ((System.Drawing.Image)(resources.GetObject("restartButton.Image"))); 177 this.restartButton.Location = new System.Drawing.Point(3, 348); 178 this.restartButton.Name = "restartButton"; 179 this.restartButton.Size = new System.Drawing.Size(24, 24); 180 this.restartButton.TabIndex = 30; 181 this.restartButton.UseVisualStyleBackColor = true; 182 this.restartButton.Click += new System.EventHandler(this.restartButton_Click); 183 // 184 // pauseButton 185 // 186 this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 187 this.pauseButton.Enabled = false; 188 this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image"))); 189 this.pauseButton.Location = new System.Drawing.Point(33, 348); 190 this.pauseButton.Name = "pauseButton"; 191 this.pauseButton.Size = new System.Drawing.Size(24, 24); 192 this.pauseButton.TabIndex = 31; 193 this.pauseButton.UseVisualStyleBackColor = true; 194 this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click); 195 // 196 // stopButton 197 // 198 this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 199 this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image"))); 200 this.stopButton.Location = new System.Drawing.Point(63, 348); 201 this.stopButton.Name = "stopButton"; 202 this.stopButton.Size = new System.Drawing.Size(24, 24); 203 this.stopButton.TabIndex = 32; 204 this.stopButton.UseVisualStyleBackColor = true; 205 this.stopButton.Click += new System.EventHandler(this.stopButton_Click); 206 // 207 // optimizerGroupBox 208 // 209 this.optimizerGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 210 | System.Windows.Forms.AnchorStyles.Right))); 211 this.optimizerGroupBox.Controls.Add(this.showOptimizerButton); 212 this.optimizerGroupBox.Controls.Add(this.lastUpdatedTextBox); 213 this.optimizerGroupBox.Controls.Add(this.lastUpdatedLabel); 214 this.optimizerGroupBox.Controls.Add(this.optimizerNamedItemView); 215 this.optimizerGroupBox.Location = new System.Drawing.Point(6, 29); 216 this.optimizerGroupBox.Name = "optimizerGroupBox"; 217 this.optimizerGroupBox.Size = new System.Drawing.Size(551, 129); 218 this.optimizerGroupBox.TabIndex = 28; 219 this.optimizerGroupBox.TabStop = false; 220 this.optimizerGroupBox.Text = "Optimizer"; 221 // 222 // showOptimizerButton 223 // 224 this.showOptimizerButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 225 | System.Windows.Forms.AnchorStyles.Right))); 226 this.showOptimizerButton.Location = new System.Drawing.Point(78, 99); 227 this.showOptimizerButton.Name = "showOptimizerButton"; 228 this.showOptimizerButton.Size = new System.Drawing.Size(467, 23); 229 this.showOptimizerButton.TabIndex = 3; 230 this.showOptimizerButton.Text = "Show Optimizer"; 231 this.showOptimizerButton.UseVisualStyleBackColor = true; 232 this.showOptimizerButton.Click += new System.EventHandler(this.showOptimizerButton_Click); 233 // 234 // lastUpdatedTextBox 235 // 236 this.lastUpdatedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 237 | System.Windows.Forms.AnchorStyles.Right))); 238 this.lastUpdatedTextBox.Location = new System.Drawing.Point(78, 73); 239 this.lastUpdatedTextBox.Name = "lastUpdatedTextBox"; 240 this.lastUpdatedTextBox.Size = new System.Drawing.Size(467, 20); 241 this.lastUpdatedTextBox.TabIndex = 2; 242 // 243 // lastUpdatedLabel 244 // 245 this.lastUpdatedLabel.AutoSize = true; 246 this.lastUpdatedLabel.Location = new System.Drawing.Point(9, 76); 247 this.lastUpdatedLabel.Name = "lastUpdatedLabel"; 248 this.lastUpdatedLabel.Size = new System.Drawing.Size(71, 13); 249 this.lastUpdatedLabel.TabIndex = 1; 250 this.lastUpdatedLabel.Text = "LastUpdated:"; 251 // 252 // optimizerNamedItemView 253 // 254 this.optimizerNamedItemView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 255 | System.Windows.Forms.AnchorStyles.Right))); 256 this.optimizerNamedItemView.Caption = "NamedItem View"; 257 this.optimizerNamedItemView.Content = null; 258 this.optimizerNamedItemView.Location = new System.Drawing.Point(6, 20); 259 this.optimizerNamedItemView.Name = "optimizerNamedItemView"; 260 this.optimizerNamedItemView.ReadOnly = false; 261 this.optimizerNamedItemView.Size = new System.Drawing.Size(539, 51); 262 this.optimizerNamedItemView.TabIndex = 0; 110 // splitContainer1 111 // 112 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 113 | System.Windows.Forms.AnchorStyles.Right))); 114 this.splitContainer1.Location = new System.Drawing.Point(6, 110); 115 this.splitContainer1.Name = "splitContainer1"; 116 // 117 // splitContainer1.Panel1 118 // 119 this.splitContainer1.Panel1.Controls.Add(this.configurationGroupBox); 120 // 121 // splitContainer1.Panel2 122 // 123 this.splitContainer1.Panel2.Controls.Add(this.jobStatusGroupBox); 124 this.splitContainer1.Size = new System.Drawing.Size(551, 155); 125 this.splitContainer1.SplitterDistance = 275; 126 this.splitContainer1.TabIndex = 33; 263 127 // 264 128 // configurationGroupBox … … 352 216 this.computeInParallelCheckBox.UseVisualStyleBackColor = true; 353 217 this.computeInParallelCheckBox.CheckedChanged += new System.EventHandler(this.computeInParallelCheckBox_CheckedChanged); 354 //355 // jobIdLabel356 //357 this.jobIdLabel.AutoSize = true;358 this.jobIdLabel.Location = new System.Drawing.Point(3, 6);359 this.jobIdLabel.Name = "jobIdLabel";360 this.jobIdLabel.Size = new System.Drawing.Size(36, 13);361 this.jobIdLabel.TabIndex = 25;362 this.jobIdLabel.Text = "JobId:";363 //364 // jobIdTextBox365 //366 this.jobIdTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)367 | System.Windows.Forms.AnchorStyles.Right)));368 this.jobIdTextBox.Location = new System.Drawing.Point(91, 6);369 this.jobIdTextBox.Name = "jobIdTextBox";370 this.jobIdTextBox.Size = new System.Drawing.Size(466, 20);371 this.jobIdTextBox.TabIndex = 26;372 218 // 373 219 // jobStatusGroupBox … … 502 348 this.exceptionTextBox.DoubleClick += new System.EventHandler(this.exceptionTextBox_DoubleClick); 503 349 // 350 // optimizerGroupBox 351 // 352 this.optimizerGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 353 | System.Windows.Forms.AnchorStyles.Right))); 354 this.optimizerGroupBox.Controls.Add(this.modifyItemButton); 355 this.optimizerGroupBox.Controls.Add(this.lastUpdatedTextBox); 356 this.optimizerGroupBox.Controls.Add(this.lastUpdatedLabel); 357 this.optimizerGroupBox.Controls.Add(this.optimizerItemView); 358 this.optimizerGroupBox.Location = new System.Drawing.Point(6, 29); 359 this.optimizerGroupBox.Name = "optimizerGroupBox"; 360 this.optimizerGroupBox.Size = new System.Drawing.Size(551, 75); 361 this.optimizerGroupBox.TabIndex = 28; 362 this.optimizerGroupBox.TabStop = false; 363 this.optimizerGroupBox.Text = "JobItem"; 364 // 365 // modifyItemButton 366 // 367 this.modifyItemButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 368 | System.Windows.Forms.AnchorStyles.Right))); 369 this.modifyItemButton.Location = new System.Drawing.Point(78, 45); 370 this.modifyItemButton.Name = "modifyItemButton"; 371 this.modifyItemButton.Size = new System.Drawing.Size(467, 23); 372 this.modifyItemButton.TabIndex = 3; 373 this.modifyItemButton.Text = "Modify Item"; 374 this.modifyItemButton.UseVisualStyleBackColor = true; 375 this.modifyItemButton.Click += new System.EventHandler(this.modifyItemButton_Click); 376 // 377 // lastUpdatedTextBox 378 // 379 this.lastUpdatedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 380 | System.Windows.Forms.AnchorStyles.Right))); 381 this.lastUpdatedTextBox.Location = new System.Drawing.Point(78, 19); 382 this.lastUpdatedTextBox.Name = "lastUpdatedTextBox"; 383 this.lastUpdatedTextBox.Size = new System.Drawing.Size(467, 20); 384 this.lastUpdatedTextBox.TabIndex = 2; 385 // 386 // lastUpdatedLabel 387 // 388 this.lastUpdatedLabel.AutoSize = true; 389 this.lastUpdatedLabel.Location = new System.Drawing.Point(3, 22); 390 this.lastUpdatedLabel.Name = "lastUpdatedLabel"; 391 this.lastUpdatedLabel.Size = new System.Drawing.Size(71, 13); 392 this.lastUpdatedLabel.TabIndex = 1; 393 this.lastUpdatedLabel.Text = "LastUpdated:"; 394 // 395 // optimizerItemView 396 // 397 this.optimizerItemView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 398 | System.Windows.Forms.AnchorStyles.Right))); 399 this.optimizerItemView.Caption = "NamedItem View"; 400 this.optimizerItemView.Content = null; 401 this.optimizerItemView.Location = new System.Drawing.Point(6, 20); 402 this.optimizerItemView.Name = "optimizerItemView"; 403 this.optimizerItemView.ReadOnly = false; 404 this.optimizerItemView.Size = new System.Drawing.Size(539, 51); 405 this.optimizerItemView.TabIndex = 0; 406 // 407 // jobIdLabel 408 // 409 this.jobIdLabel.AutoSize = true; 410 this.jobIdLabel.Location = new System.Drawing.Point(3, 6); 411 this.jobIdLabel.Name = "jobIdLabel"; 412 this.jobIdLabel.Size = new System.Drawing.Size(36, 13); 413 this.jobIdLabel.TabIndex = 25; 414 this.jobIdLabel.Text = "JobId:"; 415 // 416 // jobIdTextBox 417 // 418 this.jobIdTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 419 | System.Windows.Forms.AnchorStyles.Right))); 420 this.jobIdTextBox.Location = new System.Drawing.Point(91, 6); 421 this.jobIdTextBox.Name = "jobIdTextBox"; 422 this.jobIdTextBox.Size = new System.Drawing.Size(466, 20); 423 this.jobIdTextBox.TabIndex = 26; 424 // 504 425 // tabControl 505 426 // … … 509 430 this.tabControl.Controls.Add(this.detailsTabPage); 510 431 this.tabControl.Controls.Add(this.stateLogTabPage); 511 this.tabControl.Controls.Add(this.runsTabPage);512 this.tabControl.Controls.Add(this.logTabPage);513 432 this.tabControl.Location = new System.Drawing.Point(3, 3); 514 433 this.tabControl.Name = "tabControl"; … … 517 436 this.tabControl.TabIndex = 25; 518 437 // 519 // splitContainer1520 //521 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)522 | System.Windows.Forms.AnchorStyles.Right)));523 this.splitContainer1.Location = new System.Drawing.Point(6, 164);524 this.splitContainer1.Name = "splitContainer1";525 //526 // splitContainer1.Panel1527 //528 this.splitContainer1.Panel1.Controls.Add(this.configurationGroupBox);529 //530 // splitContainer1.Panel2531 //532 this.splitContainer1.Panel2.Controls.Add(this.jobStatusGroupBox);533 this.splitContainer1.Size = new System.Drawing.Size(551, 155);534 this.splitContainer1.SplitterDistance = 275;535 this.splitContainer1.TabIndex = 33;536 //537 438 // HiveJobView 538 439 // … … 542 443 this.Name = "HiveJobView"; 543 444 this.Size = new System.Drawing.Size(577, 407); 544 this.logTabPage.ResumeLayout(false);545 445 this.stateLogTabPage.ResumeLayout(false); 546 this.runsTabPage.ResumeLayout(false);547 446 this.detailsTabPage.ResumeLayout(false); 548 447 this.detailsTabPage.PerformLayout(); 549 this.optimizerGroupBox.ResumeLayout(false); 550 this.optimizerGroupBox.PerformLayout(); 448 this.splitContainer1.Panel1.ResumeLayout(false); 449 this.splitContainer1.Panel2.ResumeLayout(false); 450 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 451 this.splitContainer1.ResumeLayout(false); 551 452 this.configurationGroupBox.ResumeLayout(false); 552 453 this.configurationGroupBox.PerformLayout(); 553 454 this.jobStatusGroupBox.ResumeLayout(false); 554 455 this.jobStatusGroupBox.PerformLayout(); 456 this.optimizerGroupBox.ResumeLayout(false); 457 this.optimizerGroupBox.PerformLayout(); 555 458 this.tabControl.ResumeLayout(false); 556 this.splitContainer1.Panel1.ResumeLayout(false);557 this.splitContainer1.Panel2.ResumeLayout(false);558 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();559 this.splitContainer1.ResumeLayout(false);560 459 this.ResumeLayout(false); 561 460 … … 564 463 #endregion 565 464 566 private System.Windows.Forms.TabPage logTabPage; 567 private Core.Views.LogView logView; 568 private System.Windows.Forms.TabPage stateLogTabPage; 569 private MainForm.WindowsForms.ViewHost stateLogViewHost; 570 private System.Windows.Forms.TabPage runsTabPage; 571 private MainForm.WindowsForms.ViewHost runCollectionViewHost; 572 private System.Windows.Forms.TabPage detailsTabPage; 573 private System.Windows.Forms.GroupBox optimizerGroupBox; 574 private Core.Views.NamedItemView optimizerNamedItemView; 575 private System.Windows.Forms.GroupBox configurationGroupBox; 576 private System.Windows.Forms.TextBox priorityTextBox; 577 private System.Windows.Forms.Label priorityLabel; 578 private System.Windows.Forms.TextBox coresNeededTextBox; 579 private System.Windows.Forms.TextBox memoryNeededTextBox; 580 private System.Windows.Forms.Label memoryNeededLabel; 581 private System.Windows.Forms.Label coresNeededLabel; 582 private System.Windows.Forms.Label computeInParallelLabel; 583 private System.Windows.Forms.CheckBox computeInParallelCheckBox; 584 private System.Windows.Forms.Label jobIdLabel; 585 private System.Windows.Forms.TextBox jobIdTextBox; 586 private System.Windows.Forms.GroupBox jobStatusGroupBox; 587 private System.Windows.Forms.TextBox stateTextBox; 588 private System.Windows.Forms.Label stateLabel; 589 private System.Windows.Forms.TextBox dateFinishedTextBox; 590 private System.Windows.Forms.TextBox executionTimeTextBox; 591 private System.Windows.Forms.Label executionTimeLabel; 592 private System.Windows.Forms.Label exceptionLabel; 593 private System.Windows.Forms.Label dateFinishedLabel; 594 private System.Windows.Forms.TextBox exceptionTextBox; 595 private System.Windows.Forms.TabControl tabControl; 596 private System.Windows.Forms.Button restartButton; 597 private System.Windows.Forms.Button pauseButton; 598 private System.Windows.Forms.Button stopButton; 599 private System.Windows.Forms.Button showOptimizerButton; 600 private System.Windows.Forms.TextBox lastUpdatedTextBox; 601 private System.Windows.Forms.Label lastUpdatedLabel; 602 private System.Windows.Forms.Label dateCalculatedLabel; 603 private System.Windows.Forms.TextBox dateCalculatedText; 604 private System.Windows.Forms.TextBox dateCreatedTextBox; 605 private System.Windows.Forms.Label dateCreatedLabel; 606 private System.Windows.Forms.SplitContainer splitContainer1; 465 protected System.Windows.Forms.TabPage stateLogTabPage; 466 protected MainForm.WindowsForms.ViewHost stateLogViewHost; 467 protected System.Windows.Forms.TabPage detailsTabPage; 468 protected System.Windows.Forms.GroupBox optimizerGroupBox; 469 protected Core.Views.ItemView optimizerItemView; 470 protected System.Windows.Forms.GroupBox configurationGroupBox; 471 protected System.Windows.Forms.TextBox priorityTextBox; 472 protected System.Windows.Forms.Label priorityLabel; 473 protected System.Windows.Forms.TextBox coresNeededTextBox; 474 protected System.Windows.Forms.TextBox memoryNeededTextBox; 475 protected System.Windows.Forms.Label memoryNeededLabel; 476 protected System.Windows.Forms.Label coresNeededLabel; 477 protected System.Windows.Forms.Label computeInParallelLabel; 478 protected System.Windows.Forms.CheckBox computeInParallelCheckBox; 479 protected System.Windows.Forms.Label jobIdLabel; 480 protected System.Windows.Forms.TextBox jobIdTextBox; 481 protected System.Windows.Forms.GroupBox jobStatusGroupBox; 482 protected System.Windows.Forms.TextBox stateTextBox; 483 protected System.Windows.Forms.Label stateLabel; 484 protected System.Windows.Forms.TextBox dateFinishedTextBox; 485 protected System.Windows.Forms.TextBox executionTimeTextBox; 486 protected System.Windows.Forms.Label executionTimeLabel; 487 protected System.Windows.Forms.Label exceptionLabel; 488 protected System.Windows.Forms.Label dateFinishedLabel; 489 protected System.Windows.Forms.TextBox exceptionTextBox; 490 protected System.Windows.Forms.TabControl tabControl; 491 protected System.Windows.Forms.Button modifyItemButton; 492 protected System.Windows.Forms.TextBox lastUpdatedTextBox; 493 protected System.Windows.Forms.Label lastUpdatedLabel; 494 protected System.Windows.Forms.Label dateCalculatedLabel; 495 protected System.Windows.Forms.TextBox dateCalculatedText; 496 protected System.Windows.Forms.TextBox dateCreatedTextBox; 497 protected System.Windows.Forms.Label dateCreatedLabel; 498 protected System.Windows.Forms.SplitContainer splitContainer1; 607 499 608 500 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.resx
r5779 r6033 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />121 <data name="restartButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">122 <value>123 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/wAA125 Cv8BNGKaggAAALBJREFUOE9j+P//PwMlGKvmsv3ZbsQaitWAhBkR/4k1BKcBlmX6RBmC1YCoKUH/N9xa126 /J8YQ7AaEDzBG2Q7UYZgNcCnyxlsAAhHLQrA6xKsBjg2W/zP2BAL1mzbrP9fp1jhv0QaN4hWQ48drAaY127 1+ihaOZPYMGqGWQYVgP0SpXhNuPTjNMAlXwpsLMJacZpgHSGIFGacRogksyJ089EBSK20MaVNyjKiTi9128 QGxOBKkDACT9xOni1RbMAAAAAElFTkSuQmCC129 </value>130 </data>131 <data name="pauseButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">132 <value>133 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8134 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/wAA135 Cv8BNGKaggAAAL5JREFUOE9j+P//PwMlmCLNIIsHoQG9m//+79rw63/e1EefQE5E56OHF4YXQJqvPvzz136 Xzd0FVDtfwZ0PkED2tZ++3/r6e//qn6LwAag8wka0Lji8//LD3//l3ObBTYAnU/QgNrF7/+fuP77v5jd137 JLAB6HyCBlTMe/V/94Wf//nNusEGoPMJGlAy+/n/9Sd//uc0aAUbgM4naEDB9Mf/F+z5/J9VpxFsADqf138 oAGg+GfTbYIbgM4naACpGWvg8wIAkX3yJyVePz4AAAAASUVORK5CYII=139 </value>140 </data>141 <data name="stopButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">142 <value>143 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8144 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/wAA145 Cv8BNGKaggAAAWtJREFUOE/Nkz9IAmEYxl0KGqKtMVpaIiEoipYIgnByCSGhSQiCNBqCMiqwsr8clChF146 YmYSSikeWEbZH2qwEhKhwhAXjQwKEbw0zyue7nO7hgtyqOEbf7/ne5+XVwJAUsorCSbB/0xAeT+xSBcw147 685B52QwYU9jdOMFw+ZnDK0+YtCUyHzvSzACge/jH7hLcAg8FHB4w8IbZOEKsLD4s5AqdnheWLpAQJKj148 TxyCUa4IOi/yWPPlsOJlMGePoU6+JS4g376NczgKsdg+y8PIg3pnBmPWV6ipMGq61sUFZOarCAf3JZ98149 8I75XQKnoDEmoRg5RXW7QVxACvOHWdhO8lim36C1ptFvSEI5E4NsYA9VLUviAtK255qFcT+LSXsKahMP150 66OQa0Po7HOholEvLiCr2jxmMG2LQEOFoBw/55M96FA50NpjRlmDTlxA9tym8qGpl0Z9twO1Mktx7srm151 BZRLp34W/Oao/v4WvgBcI/R+TmAaZAAAAABJRU5ErkJggg==152 </value>153 </data>154 120 </root> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/StateLogView.cs
r5636 r6033 27 27 namespace HeuristicLab.Clients.Hive.Views { 28 28 [View("StateLog View")] 29 [Content(typeof(StateLog), IsDefaultView = false)]29 [Content(typeof(StateLog), IsDefaultView = true)] 30 30 public sealed partial class StateLogView : ItemView { 31 31 public new StateLog Content { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/HeuristicLab.Clients.Hive.Views-3.4.csproj
r6006 r6033 74 74 <HintPath>C:\Program Files\HeuristicLab 3.3\Calendar.DayView.dll</HintPath> 75 75 </Reference> 76 <Reference Include="HeuristicLab.Clients.Hive.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />77 76 <Reference Include="HeuristicLab.Collections-3.3"> 78 77 <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath> … … 158 157 <DependentUpon>UpdateControl.cs</DependentUpon> 159 158 </Compile> 160 <Compile Include="ExperimentManager\HiveExperimentView.cs"> 161 <SubType>UserControl</SubType> 162 </Compile> 163 <Compile Include="ExperimentManager\HiveExperimentView.Designer.cs"> 164 <DependentUpon>HiveExperimentView.cs</DependentUpon> 159 <Compile Include="ExperimentManager\OptimizerHiveJobView.cs"> 160 <SubType>UserControl</SubType> 161 </Compile> 162 <Compile Include="ExperimentManager\OptimizerHiveJobView.designer.cs"> 163 <DependentUpon>OptimizerHiveJobView.cs</DependentUpon> 164 </Compile> 165 <Compile Include="ExperimentManager\RefreshableHiveExperimentView.cs"> 166 <SubType>UserControl</SubType> 167 </Compile> 168 <Compile Include="ExperimentManager\RefreshableHiveExperimentView.Designer.cs"> 169 <DependentUpon>RefreshableHiveExperimentView.cs</DependentUpon> 165 170 </Compile> 166 171 <Compile Include="ExperimentManager\HiveItemView.cs"> … … 171 176 </Compile> 172 177 <Compile Include="ExperimentManager\StateLogListList.cs" /> 173 <Compile Include="ExperimentManager\ItemTreeView.cs"> 174 <SubType>UserControl</SubType> 175 </Compile> 176 <Compile Include="ExperimentManager\ItemTreeView.designer.cs"> 178 <Compile Include="ExperimentManager\TreeView\NewExperimentTreeNodeAction.cs" /> 179 <Compile Include="ExperimentManager\TreeView\DeleteJobTreeNodeAction.cs" /> 180 <Compile Include="ExperimentManager\TreeView\HiveJobItemTreeView.cs"> 181 <SubType>UserControl</SubType> 182 </Compile> 183 <Compile Include="ExperimentManager\TreeView\HiveJobItemTreeView.Designer.cs"> 184 <DependentUpon>HiveJobItemTreeView.cs</DependentUpon> 185 </Compile> 186 <Compile Include="ExperimentManager\TreeView\ItemTreeView.cs"> 187 <SubType>UserControl</SubType> 188 </Compile> 189 <Compile Include="ExperimentManager\TreeView\ItemTreeView.designer.cs"> 177 190 <DependentUpon>ItemTreeView.cs</DependentUpon> 178 191 </Compile> … … 283 296 <DependentUpon>UpdateControl.cs</DependentUpon> 284 297 </EmbeddedResource> 285 <EmbeddedResource Include="ExperimentManager\HiveExperimentView.resx"> 286 <DependentUpon>HiveExperimentView.cs</DependentUpon> 287 </EmbeddedResource> 288 <EmbeddedResource Include="ExperimentManager\ItemTreeView.resx"> 298 <EmbeddedResource Include="ExperimentManager\OptimizerHiveJobView.resx"> 299 <DependentUpon>OptimizerHiveJobView.cs</DependentUpon> 300 </EmbeddedResource> 301 <EmbeddedResource Include="ExperimentManager\RefreshableHiveExperimentView.resx"> 302 <DependentUpon>RefreshableHiveExperimentView.cs</DependentUpon> 303 </EmbeddedResource> 304 <EmbeddedResource Include="ExperimentManager\TreeView\ItemTreeView.resx"> 289 305 <DependentUpon>ItemTreeView.cs</DependentUpon> 290 306 </EmbeddedResource> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/HeuristicLabClientsHiveViewsPlugin.cs.frame
r5591 r6033 8 8 [Plugin("HeuristicLab.Clients.Hive.Views", "3.4.0.$WCREV$")] 9 9 [PluginFile("HeuristicLab.Clients.Hive.Views-3.4.dll", PluginFileType.Assembly)] 10 [PluginDependency("HeuristicLab.Clients.Hive", "3.4")] 11 [PluginDependency("HeuristicLab.Collections", "3.3")] 10 12 [PluginDependency("HeuristicLab.Common", "3.3")] 13 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 11 14 [PluginDependency("HeuristicLab.Core", "3.3")] 15 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 16 [PluginDependency("HeuristicLab.Data", "3.3")] 17 [PluginDependency("HeuristicLab.DayView", "1.0")] 18 [PluginDependency("HeuristicLab.Hive", "3.4")] 19 [PluginDependency("HeuristicLab.MainForm", "3.3")] 20 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 21 [PluginDependency("HeuristicLab.Optimization", "3.3")] 22 [PluginDependency("HeuristicLab.Optimizer", "3.3")] 12 23 [PluginDependency("HeuristicLab.Persistence", "3.3")] 13 [PluginDependency("HeuristicLab.DayView", "1.0")] 24 [PluginDependency("HeuristicLab.Services.Hive.Common", "3.4")] 25 [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")] 14 26 public class HeuristicLabClientsHiveViewsPlugin : PluginBase { 15 27 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/ExperimentManagerClient.cs
r6006 r6033 26 26 using System.Linq; 27 27 using System.Threading; 28 using HeuristicLab.Clients.Hive.ExperimentManager; 28 29 using HeuristicLab.Clients.Hive.Jobs; 29 30 using HeuristicLab.Common; … … 44 45 45 46 #region Properties 46 private ItemCollection< HiveExperiment> hiveExperiments;47 public ItemCollection< HiveExperiment> HiveExperiments {47 private ItemCollection<RefreshableHiveExperiment> hiveExperiments; 48 public ItemCollection<RefreshableHiveExperiment> HiveExperiments { 48 49 get { return hiveExperiments; } 49 set { hiveExperiments = value; } 50 } 51 50 set { 51 if (value != hiveExperiments) { 52 hiveExperiments = value; 53 OnHiveExperimentsChanged(); 54 } 55 } 56 } 57 52 58 private List<Plugin> onlinePlugins; 53 59 public List<Plugin> OnlinePlugins { … … 69 75 OnRefreshing(); 70 76 71 hiveExperiments = new HiveItemCollection<HiveExperiment>();72 73 77 try { 74 hiveExperiments.AddRange(ServiceLocator.Instance.CallHiveService<List<HiveExperiment>>(s => s.GetHiveExperiments()).OrderBy(x => x.Name)); 78 hiveExperiments = new HiveItemCollection<RefreshableHiveExperiment>(); 79 var he = ServiceLocator.Instance.CallHiveService<IEnumerable<HiveExperiment>>(s => s.GetHiveExperiments()); 80 hiveExperiments.AddRange(he.Select(x => new RefreshableHiveExperiment(x)).OrderBy(x => x.HiveExperiment.Name)); 81 } 82 catch { 83 hiveExperiments = null; 84 throw; 75 85 } 76 86 finally { … … 98 108 public static void Store(IHiveItem item) { 99 109 if (item.Id == Guid.Empty) { 100 if (item is HiveExperiment) {101 ExperimentManagerClient.Instance.UploadExperiment(( HiveExperiment)item);110 if (item is RefreshableHiveExperiment) { 111 ExperimentManagerClient.Instance.UploadExperiment((RefreshableHiveExperiment)item); 102 112 } 103 113 } else { 114 104 115 if (item is HiveExperiment) 105 116 ServiceLocator.Instance.CallHiveService(s => s.UpdateHiveExperiment((HiveExperiment)item)); … … 127 138 if (item is HiveExperiment) 128 139 ServiceLocator.Instance.CallHiveService(s => s.DeleteHiveExperiment(item.Id)); 140 if (item is RefreshableHiveExperiment) 141 ServiceLocator.Instance.CallHiveService(s => s.DeleteHiveExperiment(item.Id)); 129 142 item.Id = Guid.Empty; 130 143 } … … 142 155 if (handler != null) handler(this, EventArgs.Empty); 143 156 } 144 #endregion 145 146 public static void StartExperiment(Action<Exception> exceptionCallback, HiveExperiment hiveExperiment) { 157 public event EventHandler HiveExperimentsChanged; 158 private void OnHiveExperimentsChanged() { 159 var handler = HiveExperimentsChanged; 160 if (handler != null) handler(this, EventArgs.Empty); 161 } 162 #endregion 163 164 public static void StartExperiment(Action<Exception> exceptionCallback, RefreshableHiveExperiment refreshableHiveExperiment) { 147 165 ExperimentManagerClient.StoreAsync( 148 166 new Action<Exception>((Exception ex) => { 149 hiveExperiment.ExecutionState = ExecutionState.Prepared;167 refreshableHiveExperiment.HiveExperiment.ExecutionState = ExecutionState.Prepared; 150 168 exceptionCallback(ex); 151 }), hiveExperiment);152 hiveExperiment.ExecutionState = ExecutionState.Started;169 }), refreshableHiveExperiment); 170 refreshableHiveExperiment.HiveExperiment.ExecutionState = ExecutionState.Started; 153 171 } 154 172 … … 174 192 175 193 #region Upload Experiment 176 private void UploadExperiment( HiveExperiment hiveExperiment) {194 private void UploadExperiment(RefreshableHiveExperiment optimizerHiveExperiment) { 177 195 try { 178 hiveExperiment.Progress = new Progress("Connecting to server...");179 hiveExperiment.IsProgressing = true;196 optimizerHiveExperiment.HiveExperiment.Progress = new Progress("Connecting to server..."); 197 optimizerHiveExperiment.HiveExperiment.IsProgressing = true; 180 198 ServiceLocator.Instance.CallHiveService(service => { 181 IEnumerable<string> resourceNames = ToResourceNameList( hiveExperiment.ResourceNames);199 IEnumerable<string> resourceNames = ToResourceNameList(optimizerHiveExperiment.HiveExperiment.ResourceNames); 182 200 var resourceIds = new List<Guid>(); 183 201 foreach (var resourceName in resourceNames) { … … 189 207 } 190 208 191 foreach ( HiveJob hiveJob in hiveExperiment.HiveJobs) {209 foreach (OptimizerHiveJob hiveJob in optimizerHiveExperiment.HiveExperiment.HiveJobs.OfType<OptimizerHiveJob>()) { 192 210 hiveJob.SetIndexInParentOptimizerList(null); 193 211 } 194 212 195 213 // upload HiveExperiment 196 hiveExperiment.Progress.Status = "Uploading HiveExperiment...";197 hiveExperiment.Id = service.AddHiveExperiment(hiveExperiment);198 199 int totalJobCount = hiveExperiment.GetAllHiveJobs().Count();214 optimizerHiveExperiment.HiveExperiment.Progress.Status = "Uploading HiveExperiment..."; 215 optimizerHiveExperiment.HiveExperiment.Id = service.AddHiveExperiment(optimizerHiveExperiment.HiveExperiment); 216 217 int totalJobCount = optimizerHiveExperiment.HiveExperiment.GetAllHiveJobs().Count(); 200 218 int jobCount = 0; 201 219 202 220 // upload plugins 203 hiveExperiment.Progress.Status = "Uploading plugins...";221 optimizerHiveExperiment.HiveExperiment.Progress.Status = "Uploading plugins..."; 204 222 this.OnlinePlugins = service.GetPlugins(); 205 223 this.AlreadyUploadedPlugins = new List<Plugin>(); … … 208 226 209 227 // upload jobs 210 hiveExperiment.Progress.Status = "Uploading jobs...";211 212 foreach (HiveJob hiveJob in hiveExperiment.HiveJobs) {213 UploadJobWithChildren( hiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, hiveExperiment.UseLocalPlugins, hiveExperiment.Id);228 optimizerHiveExperiment.HiveExperiment.Progress.Status = "Uploading jobs..."; 229 230 foreach (HiveJob hiveJob in optimizerHiveExperiment.HiveExperiment.HiveJobs) { 231 UploadJobWithChildren(optimizerHiveExperiment.HiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, optimizerHiveExperiment.HiveExperiment.UseLocalPlugins, optimizerHiveExperiment.HiveExperiment.Id); 214 232 } 215 233 216 if ( hiveExperiment.RefreshAutomatically) hiveExperiment.StartResultPolling();234 if (optimizerHiveExperiment.RefreshAutomatically) optimizerHiveExperiment.StartResultPolling(); 217 235 }); 218 236 } 219 237 finally { 220 hiveExperiment.IsProgressing = false;238 optimizerHiveExperiment.HiveExperiment.IsProgressing = false; 221 239 } 222 240 } … … 256 274 List<IPluginDescription> plugins; 257 275 258 if (hiveJob. OptimizerJob.ComputeInParallel &&259 (hiveJob. OptimizerJob.Optimizer is Optimization.Experiment || hiveJob.OptimizerJob.Optimizeris Optimization.BatchRun)) {276 if (hiveJob.JobItem.ComputeInParallel && 277 (hiveJob.JobItem.Item is Optimization.Experiment || hiveJob.JobItem.Item is Optimization.BatchRun)) { 260 278 hiveJob.Job.IsParentJob = true; 261 279 hiveJob.Job.FinishWhenChildJobsFinished = true; 262 hiveJob. OptimizerJob.CollectChildJobs = false; // don't collect child-jobs on slaves280 hiveJob.JobItem.CollectChildJobs = false; // don't collect child-jobs on slaves 263 281 jobData = hiveJob.GetAsJobData(true, out plugins); 264 282 } else { … … 312 330 313 331 hiveExperiment.HiveJobs = new ItemCollection<HiveJob>(allHiveJobs.Values.Where(x => !x.Job.ParentJobId.HasValue)); 314 //hiveExperiment.HiveJobs = allHiveJobs[hiveExperiment.RootJobId];315 332 316 333 if (hiveExperiment.IsFinished()) { 317 //hiveExperiment.ExecutionTime = hiveExperiment.HiveJobs.Max(.Job.DateFinished.Value - hiveExperiment.HiveJobs.Job.DateCreated.Value;318 //hiveExperiment.lastUpdateTime = hiveExperiment.HiveJob.Job.DateFinished.Value;319 334 hiveExperiment.ExecutionState = Core.ExecutionState.Stopped; 320 //OnStopped(); // todo: stop timer321 335 } else { 322 //hiveExperiment.ExecutionTime = hiveExperiment.HiveJobs.Job.DateCreated.HasValue ? DateTime.Now - hiveExperiment.HiveJobs.Job.DateCreated.Value : TimeSpan.Zero;323 //hiveExperiment.lastUpdateTime = DateTime.Now;324 336 hiveExperiment.ExecutionState = Core.ExecutionState.Started; 325 //OnStarted(); // todo: start timer 326 } 327 hiveExperiment.UpdateTotalExecutionTime(); 337 } 328 338 329 339 // build child-job tree … … 331 341 BuildHiveJobTree(hiveJob, allJobs, allHiveJobs); 332 342 } 333 hiveExperiment.UpdateTotalExecutionTime(); 334 335 if (hiveExperiment.ExecutionState != ExecutionState.Stopped) { 336 hiveExperiment.RefreshAutomatically = true; 337 } 343 344 hiveExperiment.OnLoaded(); 338 345 } 339 346 finally { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJob.cs
r6006 r6033 24 24 using System.Drawing; 25 25 using System.Linq; 26 using HeuristicLab.Clients.Hive.Jobs;27 26 using HeuristicLab.Collections; 28 27 using HeuristicLab.Common; 29 28 using HeuristicLab.Core; 30 using HeuristicLab. Optimization;29 using HeuristicLab.Hive; 31 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; … … 36 35 [Item("Hive Job", "Represents a hive job.")] 37 36 [StorableClass] 38 public class HiveJob : NamedItem, IItemTree {39 pr ivatestatic object locker = new object();37 public class HiveJob : NamedItem, IItemTree<HiveJob> { 38 protected static object locker = new object(); 40 39 41 40 public override Image ItemImage { … … 56 55 } 57 56 58 pr ivateJob job;57 protected Job job; 59 58 public Job Job { 60 59 get { return job; } … … 70 69 71 70 [Storable] 72 pr ivate OptimizerJob optimizerJob;73 public OptimizerJob OptimizerJob{74 get { return optimizerJob; }71 protected ItemJob jobItem; 72 public ItemJob JobItem { 73 get { return jobItem; } 75 74 internal set { 76 if ( optimizerJob!= null && syncJobsWithOptimizers) {75 if (jobItem != null && syncJobsWithOptimizers) { 77 76 this.childHiveJobs.Clear(); 78 77 } 79 if ( optimizerJob!= value) {80 Dergister OptimizerEvents();81 optimizerJob= value;82 Register OptimizerEvents();83 On OptimizerJobChanged();78 if (jobItem != value) { 79 DergisterJobItemsEvents(); 80 jobItem = value; 81 RegisterJobItemEvents(); 82 OnJobItemChanged(); 84 83 } 85 84 } … … 87 86 88 87 [Storable] 89 pr ivateItemList<HiveJob> childHiveJobs;90 public ReadOnlyItemList<HiveJob> ChildHiveJobs {88 protected ItemList<HiveJob> childHiveJobs; 89 public virtual ReadOnlyItemList<HiveJob> ChildHiveJobs { 91 90 get { return childHiveJobs.AsReadOnly(); } 92 91 } 93 92 94 93 [Storable] 95 private bool syncJobsWithOptimizers = true; 96 94 protected bool syncJobsWithOptimizers = true; 95 96 #region Constructors and Cloning 97 97 public HiveJob() { 98 98 this.Job = new Job() { … … 106 106 } 107 107 108 public HiveJob( OptimizerJob optimizerJob, bool autoCreateChildHiveJobs)108 public HiveJob(ItemJob jobItem, bool autoCreateChildHiveJobs) 109 109 : this() { 110 110 this.syncJobsWithOptimizers = autoCreateChildHiveJobs; 111 this. OptimizerJob = optimizerJob;111 this.JobItem = jobItem; 112 112 this.syncJobsWithOptimizers = true; 113 }114 115 public HiveJob(IOptimizer optimizer)116 : this() {117 this.OptimizerJob = new OptimizerJob(optimizer);118 113 } 119 114 … … 122 117 this.Job = job; 123 118 try { 124 this. OptimizerJob = PersistenceUtil.Deserialize<OptimizerJob>(jobData.Data);119 this.JobItem = PersistenceUtil.Deserialize<ItemJob>(jobData.Data); 125 120 } 126 121 catch { 127 this. OptimizerJob= null;122 this.JobItem = null; 128 123 } 129 124 this.childHiveJobs = new ItemList<HiveJob>(); … … 135 130 : base(original, cloner) { 136 131 this.Job = cloner.Clone(original.job); 137 this.OptimizerJob = cloner.Clone(original.OptimizerJob); 132 this.JobItem = cloner.Clone(original.JobItem); 133 this.childHiveJobs = cloner.Clone(original.childHiveJobs); 134 this.syncJobsWithOptimizers = original.syncJobsWithOptimizers; 138 135 } 139 136 public override IDeepCloneable Clone(Cloner cloner) { 140 137 return new HiveJob(this, cloner); 141 138 } 142 143 /// <summary> 144 /// if this.Optimizer is an experiment 145 /// Uses the child-optimizers of this.HiveJob and creates HiveJob-childs 146 /// if this.Optimizer is a batchrun 147 /// Creates a number of child-jobs according to repetitions 148 /// </summary> 149 private void UpdateChildHiveJobs() { 150 if (Job != null && syncJobsWithOptimizers) { 151 if (!OptimizerJob.ComputeInParallel) { 152 this.childHiveJobs.Clear(); 153 } else { 154 if (OptimizerJob.Optimizer is Optimization.Experiment) { 155 Optimization.Experiment experiment = (Optimization.Experiment)OptimizerJob.Optimizer; 156 foreach (IOptimizer childOpt in experiment.Optimizers) { 157 this.childHiveJobs.Add(new HiveJob(childOpt)); 158 } 159 } else if (OptimizerJob.Optimizer is Optimization.BatchRun) { 160 Optimization.BatchRun batchRun = OptimizerJob.OptimizerAsBatchRun; 161 if (batchRun.Optimizer != null) { 162 while (this.childHiveJobs.Count < batchRun.Repetitions) { 163 this.childHiveJobs.Add(new HiveJob(batchRun.Optimizer)); 164 } 165 while (this.childHiveJobs.Count > batchRun.Repetitions) { 166 this.childHiveJobs.Remove(this.childHiveJobs.Last()); 167 } 168 } 169 } 170 } 171 } 172 } 173 174 private void RegisterOptimizerEvents() { 175 if (OptimizerJob != null) { 176 if (OptimizerJob.Optimizer is Optimization.Experiment) { 177 Optimization.Experiment experiment = OptimizerJob.OptimizerAsExperiment; 178 experiment.Optimizers.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsAdded); 179 experiment.Optimizers.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced); 180 experiment.Optimizers.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved); 181 experiment.Optimizers.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_CollectionReset); 182 } else if (OptimizerJob.Optimizer is Optimization.BatchRun) { 183 Optimization.BatchRun batchRun = OptimizerJob.OptimizerAsBatchRun; 184 batchRun.RepetitionsChanged += new EventHandler(batchRun_RepetitionsChanged); 185 batchRun.OptimizerChanged += new EventHandler(batchRun_OptimizerChanged); 186 } 187 OptimizerJob.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged); 188 OptimizerJob.ToStringChanged += new EventHandler(OptimizerJob_ToStringChanged); 189 } 190 } 191 private void DergisterOptimizerEvents() { 192 if (OptimizerJob != null) { 193 if (OptimizerJob.Optimizer is Optimization.Experiment) { 194 Optimization.Experiment experiment = OptimizerJob.OptimizerAsExperiment; 195 experiment.Optimizers.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsAdded); 196 experiment.Optimizers.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced); 197 experiment.Optimizers.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved); 198 experiment.Optimizers.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_CollectionReset); 199 } else if (OptimizerJob.Optimizer is Optimization.BatchRun) { 200 Optimization.BatchRun batchRun = OptimizerJob.OptimizerAsBatchRun; 201 batchRun.RepetitionsChanged -= new EventHandler(batchRun_RepetitionsChanged); 202 batchRun.OptimizerChanged -= new EventHandler(batchRun_OptimizerChanged); 203 } 204 OptimizerJob.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged); 205 OptimizerJob.ToStringChanged -= new EventHandler(OptimizerJob_ToStringChanged); 206 } 207 } 208 209 private void RegisterChildHiveJobEvents() { 139 #endregion 140 141 protected virtual void UpdateChildHiveJobs() { } 142 143 protected virtual void RegisterJobItemEvents() { 144 if (JobItem != null) { 145 JobItem.ComputeInParallelChanged += new EventHandler(JobItem_ComputeInParallelChanged); 146 JobItem.ToStringChanged += new EventHandler(JobItem_ToStringChanged); 147 } 148 } 149 protected virtual void DergisterJobItemsEvents() { 150 if (JobItem != null) { 151 JobItem.ComputeInParallelChanged -= new EventHandler(JobItem_ComputeInParallelChanged); 152 JobItem.ToStringChanged -= new EventHandler(JobItem_ToStringChanged); 153 } 154 } 155 156 protected virtual void RegisterChildHiveJobEvents() { 210 157 this.childHiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsAdded); 211 158 this.childHiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsRemoved); 212 159 this.childHiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnCollectionReset); 213 160 } 214 pr ivatevoid DeregisterChildHiveJobEvents() {161 protected virtual void DeregisterChildHiveJobEvents() { 215 162 this.childHiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsAdded); 216 163 this.childHiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsRemoved); … … 218 165 } 219 166 220 private void batchRun_OptimizerChanged(object sender, EventArgs e) { 221 if (syncJobsWithOptimizers) { 222 UpdateChildHiveJobs(); 223 } 224 } 225 226 private void batchRun_RepetitionsChanged(object sender, EventArgs e) { 227 if (syncJobsWithOptimizers) { 228 UpdateChildHiveJobs(); 229 } 230 } 231 232 private void OptimizerJob_ToStringChanged(object sender, EventArgs e) { 167 protected virtual void JobItem_ToStringChanged(object sender, EventArgs e) { 233 168 this.OnToStringChanged(); 234 169 } 235 236 private void Optimizers_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) { 237 if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) { 238 foreach (var item in e.Items) { 239 if (GetChildByOptimizer(item.Value) == null && item.Value.Name != "Placeholder") { 240 this.childHiveJobs.Add(new HiveJob(item.Value)); 241 } 242 } 243 } 244 } 245 private void Optimizers_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) { 246 if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) { 247 foreach (var item in e.OldItems) { 248 this.childHiveJobs.Remove(this.GetChildByOptimizer(item.Value)); 249 } 250 foreach (var item in e.Items) { 251 if (GetChildByOptimizer(item.Value) == null && item.Value.Name != "Placeholder") { 252 this.childHiveJobs.Add(new HiveJob(item.Value)); 253 } 254 } 255 } 256 } 257 private void Optimizers_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) { 258 if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) { 259 foreach (var item in e.Items) { 260 this.childHiveJobs.Remove(this.GetChildByOptimizer(item.Value)); 261 } 262 } 263 } 264 private void Optimizers_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) { 265 if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) { 266 foreach (var item in e.Items) { 267 this.childHiveJobs.Remove(this.GetChildByOptimizer(item.Value)); 268 } 269 } 270 } 271 272 private void OptimizerJob_ComputeInParallelChanged(object sender, EventArgs e) { 273 if (OptimizerJob != null && syncJobsWithOptimizers) { 170 171 protected virtual void JobItem_ComputeInParallelChanged(object sender, EventArgs e) { 172 if (JobItem != null && syncJobsWithOptimizers) { 274 173 this.UpdateChildHiveJobs(); 275 174 } 276 175 } 277 176 278 public v oid AddChildHiveJob(HiveJob hiveJob) {177 public virtual void AddChildHiveJob(HiveJob hiveJob) { 279 178 this.childHiveJobs.Add(hiveJob); 280 syncJobsWithOptimizers = false;281 if (this.OptimizerJob != null && hiveJob.OptimizerJob != null) {282 // if job is in state Paused, it has to preserve its ResultCollection, which is cleared when a optimizer is added to an experiment283 OptimizerJob optimizerJobClone = null;284 if (hiveJob.Job.State == JobState.Paused) {285 optimizerJobClone = (OptimizerJob)hiveJob.OptimizerJob.Clone();286 }287 288 if (this.OptimizerJob.Optimizer is Optimization.Experiment) {289 if (!this.OptimizerJob.OptimizerAsExperiment.Optimizers.Contains(hiveJob.OptimizerJob.Optimizer)) {290 UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, hiveJob.OptimizerJob);291 }292 } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) {293 UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, hiveJob.OptimizerJob);294 }295 296 if (hiveJob.Job.State == JobState.Paused) {297 hiveJob.OptimizerJob = optimizerJobClone;298 }299 }300 syncJobsWithOptimizers = true;301 }302 303 /// <summary>304 /// if this.Optimizer is Experiment305 /// replace the child-optimizer in the experiment306 /// if this.Optimizer is BatchRun307 /// add the runs from the optimizerJob to the batchrun and replace the Optimizer308 /// </summary>309 public void UpdateChildOptimizer(OptimizerJob optimizerJob, Guid childJobId) {310 syncJobsWithOptimizers = false; // don't sync with optimizers during this method311 bool childIsFinishedOptimizerDownloaded = false;312 313 if (this.OptimizerJob != null && this.OptimizerJob.Optimizer != null) {314 if (this.OptimizerJob.Optimizer is Optimization.Experiment) {315 UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, optimizerJob);316 childIsFinishedOptimizerDownloaded = true;317 } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) {318 UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, optimizerJob);319 if (this.OptimizerJob.OptimizerAsBatchRun.Repetitions == this.OptimizerJob.Optimizer.Runs.Count) {320 childIsFinishedOptimizerDownloaded = true;321 }322 } else {323 childIsFinishedOptimizerDownloaded = optimizerJob.Optimizer.ExecutionState == ExecutionState.Stopped;324 }325 }326 327 HiveJob child = this.ChildHiveJobs.Single(j => j.Job.Id == childJobId);328 if (!optimizerJob.ComputeInParallel) {329 child.syncJobsWithOptimizers = false;330 child.OptimizerJob = optimizerJob;331 child.syncJobsWithOptimizers = true;332 }333 if (childIsFinishedOptimizerDownloaded) {334 //child.IsFinishedOptimizerDownloaded = true; // todo: clean up with childIsFinishedOptimizerDownloaded335 }336 syncJobsWithOptimizers = true;337 }338 339 /// <summary>340 /// Adds the runs from the optimizerJob to the batchrun and replaces the Optimizer341 /// Sideeffect: the optimizerJob.Optimizer will be prepared (scopes are deleted and executionstate will be reset)342 /// </summary>343 private void UpdateOptimizerInBatchRun(BatchRun batchRun, OptimizerJob optimizerJob) {344 if (batchRun.Optimizer == null) {345 batchRun.Optimizer = (IOptimizer)optimizerJob.Optimizer; // only set the first optimizer as Optimizer. if every time the Optimizer would be set, the runs would be cleared each time346 }347 foreach (IRun run in optimizerJob.Optimizer.Runs) {348 if (!batchRun.Runs.Contains(run)) {349 run.Name = GetNewRunName(run, batchRun.Runs);350 batchRun.Runs.Add(run);351 }352 }353 }354 355 /// <summary>356 /// Parses the run numbers out of runs and renames the run to the next number357 /// </summary>358 private static string GetNewRunName(IRun run, RunCollection runs) {359 int idx = run.Name.IndexOf("Run ") + 4;360 361 if (idx == -1 || runs.Count == 0)362 return run.Name;363 364 int maxRunNumber = int.MinValue;365 foreach (IRun r in runs) {366 int number = GetRunNumber(r.Name);367 maxRunNumber = Math.Max(maxRunNumber, number);368 }369 370 return run.Name.Substring(0, idx) + (maxRunNumber + 1).ToString();371 }372 373 /// <summary>374 /// Parses the number of a Run out of its name. Example "Genetic Algorithm Run 3" -> 3375 /// </summary>376 private static int GetRunNumber(string runName) {377 int idx = runName.IndexOf("Run ") + 4;378 if (idx == -1) {379 return 0;380 } else {381 return int.Parse(runName.Substring(idx, runName.Length - idx));382 }383 }384 385 /// <summary>386 /// replace the child-optimizer in the experiment387 /// Sideeffect: the optimizerJob.Optimizer will be prepared (scopes are deleted and executionstate will be reset)388 /// </summary>389 private void UpdateOptimizerInExperiment(Optimization.Experiment experiment, OptimizerJob optimizerJob) {390 if (optimizerJob.IndexInParentOptimizerList < 0)391 throw new IndexOutOfRangeException("IndexInParentOptimizerList must be equal or greater than zero! The Job is invalid and the optimizer-tree cannot be reassembled.");392 393 while (experiment.Optimizers.Count < optimizerJob.IndexInParentOptimizerList) {394 experiment.Optimizers.Add(new UserDefinedAlgorithm("Placeholder")); // add dummy-entries to Optimizers so that its possible to insert the optimizerJob at the correct position395 }396 if (experiment.Optimizers.Count < optimizerJob.IndexInParentOptimizerList + 1) {397 experiment.Optimizers.Add(optimizerJob.Optimizer);398 } else {399 // if ComputeInParallel==true, don't replace the optimizer (except it is still a Placeholder)400 // this is because Jobs with ComputeInParallel get submitted to hive with their child-optimizers deleted401 if (!optimizerJob.ComputeInParallel || experiment.Optimizers[optimizerJob.IndexInParentOptimizerList].Name == "Placeholder") {402 experiment.Optimizers[optimizerJob.IndexInParentOptimizerList] = optimizerJob.Optimizer;403 }404 }405 }406 407 /// <summary>408 /// Sets the IndexInParentOptimizerList property of the OptimizerJob409 /// according to the position in the OptimizerList of the parentHiveJob.Job410 /// Recursively updates all the child-jobs as well411 /// </summary>412 internal void SetIndexInParentOptimizerList(HiveJob parentHiveJob) {413 if (parentHiveJob != null) {414 if (parentHiveJob.OptimizerJob.Optimizer is Optimization.Experiment) {415 this.OptimizerJob.IndexInParentOptimizerList = parentHiveJob.OptimizerJob.OptimizerAsExperiment.Optimizers.IndexOf(this.OptimizerJob.Optimizer);416 } else if (parentHiveJob.OptimizerJob.Optimizer is Optimization.BatchRun) {417 this.OptimizerJob.IndexInParentOptimizerList = 0;418 } else {419 throw new NotSupportedException("Only Experiment and BatchRuns are supported");420 }421 }422 foreach (HiveJob child in childHiveJobs) {423 child.SetIndexInParentOptimizerList(this);424 }425 179 } 426 180 427 181 public override string ToString() { 428 if ( optimizerJob!= null) {429 return optimizerJob.ToString();182 if (jobItem != null) { 183 return jobItem.ToString(); 430 184 } else { 431 185 return base.ToString(); … … 433 187 } 434 188 435 public v oid UpdateFromLightweightJob(LightweightJob lightweightJob) {189 public virtual void UpdateFromLightweightJob(LightweightJob lightweightJob) { 436 190 if (lightweightJob != null) { 437 191 job.Id = lightweightJob.Id; … … 455 209 /// if true the Child-Optimizers will not be serialized (if the job contains an Experiment) 456 210 /// </param> 457 public JobData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) { 458 plugins = new List<IPluginDescription>(); 459 if (this.optimizerJob == null || this.optimizerJob.Optimizer == null) 460 return null; 461 462 IEnumerable<Type> usedTypes; 463 byte[] jobByteArray; 464 if (withoutChildOptimizers && this.OptimizerJob.Optimizer is Optimization.Experiment) { 465 OptimizerJob clonedJob = (OptimizerJob)this.OptimizerJob.Clone(); // use a cloned job, so that the childHiveJob don't get confused 466 clonedJob.OptimizerAsExperiment.Optimizers.Clear(); 467 jobByteArray = PersistenceUtil.Serialize(clonedJob, out usedTypes); 468 } else if (withoutChildOptimizers && this.OptimizerJob.Optimizer is Optimization.BatchRun) { 469 OptimizerJob clonedJob = (OptimizerJob)this.OptimizerJob.Clone(); 470 clonedJob.OptimizerAsBatchRun.Optimizer = null; 471 jobByteArray = PersistenceUtil.Serialize(clonedJob, out usedTypes); 472 } else if (this.OptimizerJob.Optimizer is IAlgorithm) { 473 ((IAlgorithm)this.OptimizerJob.Optimizer).StoreAlgorithmInEachRun = false; // avoid storing the algorithm in runs to reduce size 474 jobByteArray = PersistenceUtil.Serialize(this.OptimizerJob, out usedTypes); 475 } else { 476 jobByteArray = PersistenceUtil.Serialize(this.OptimizerJob, out usedTypes); 477 } 478 479 JobData jobData = new JobData() { 480 JobId = job.Id, 481 Data = jobByteArray 482 }; 483 484 PluginUtil.CollectDeclaringPlugins(plugins, usedTypes); 485 486 return jobData; 487 } 488 211 public virtual JobData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) { 212 plugins = null; 213 return null; 214 } 489 215 490 216 #region Events 491 217 public event EventHandler JobChanged; 492 218 private void OnJobChanged() { 493 LogMessage("JobChanged");494 219 EventHandler handler = JobChanged; 495 220 if (handler != null) handler(this, EventArgs.Empty); … … 498 223 public event EventHandler JobStateChanged; 499 224 private void OnJobStateChanged() { 500 LogMessage("JobStateChanged (State: " + this.Job.State + ", ExecutionTime: " + this.Job.ExecutionTime.ToString() + ")");501 225 EventHandler handler = JobStateChanged; 502 226 if (handler != null) handler(this, EventArgs.Empty); 503 227 } 504 228 505 public event EventHandler OptimizerJobChanged;506 private void On OptimizerJobChanged() {507 OptimizerJob_ComputeInParallelChanged(this, EventArgs.Empty);508 var handler = OptimizerJobChanged;229 public event EventHandler JobItemChanged; 230 private void OnJobItemChanged() { 231 JobItem_ComputeInParallelChanged(this, EventArgs.Empty); 232 var handler = JobItemChanged; 509 233 if (handler != null) handler(this, EventArgs.Empty); 510 234 } … … 516 240 } 517 241 #endregion 518 519 public void LogMessage(string message) { 520 lock (locker) { 521 if (optimizerJob != null) { 522 optimizerJob.Log.LogMessage(message); 523 } 524 } 525 } 526 242 527 243 /// <summary> 528 244 /// Returns a list of HiveJobs including this and all its child-jobs recursively 529 245 /// </summary> 530 246 public IEnumerable<HiveJob> GetAllHiveJobs() { 531 List<HiveJob>jobs = new List<HiveJob>();247 var jobs = new List<HiveJob>(); 532 248 jobs.Add(this); 533 249 foreach (HiveJob child in this.ChildHiveJobs) { … … 544 260 if (result != null) 545 261 return result; 546 }547 return null;548 }549 550 551 public HiveJob GetChildByOptimizerJob(OptimizerJob optimizerJob) {552 foreach (var child in ChildHiveJobs) {553 if (child.OptimizerJob == optimizerJob)554 return child;555 }556 return null;557 }558 559 560 public HiveJob GetChildByOptimizer(IOptimizer optimizer) {561 foreach (var child in ChildHiveJobs) {562 if (child.OptimizerJob.Optimizer == optimizer)563 return child;564 262 } 565 263 return null; … … 582 280 } 583 281 584 585 282 public void RemoveByJobId(Guid jobId) { 586 283 IEnumerable<HiveJob> jobs = ChildHiveJobs.Where(j => j.Job.Id == jobId).ToList(); // if Guid.Empty needs to be removed, there could be more than one with this jobId … … 593 290 } 594 291 595 public IEnumerable<IItemTree > GetChildItems() {292 public IEnumerable<IItemTree<HiveJob>> GetChildItems() { 596 293 return this.childHiveJobs; 597 294 } … … 599 296 #region INotifyObservableCollectionItemsChanged<IItemTree> Members 600 297 601 public event CollectionItemsChangedEventHandler<IItemTree > CollectionReset;298 public event CollectionItemsChangedEventHandler<IItemTree<HiveJob>> CollectionReset; 602 299 private void OnCollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) { 603 300 var handler = CollectionReset; … … 605 302 } 606 303 607 public event CollectionItemsChangedEventHandler<IItemTree > ItemsAdded;304 public event CollectionItemsChangedEventHandler<IItemTree<HiveJob>> ItemsAdded; 608 305 private void OnItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) { 609 306 var handler = ItemsAdded; … … 611 308 } 612 309 613 public event CollectionItemsChangedEventHandler<IItemTree > ItemsRemoved;310 public event CollectionItemsChangedEventHandler<IItemTree<HiveJob>> ItemsRemoved; 614 311 private void OnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) { 615 312 var handler = ItemsRemoved; … … 617 314 } 618 315 619 private static CollectionItemsChangedEventArgs<IItemTree > ToCollectionItemsChangedEventArgs(CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {620 return new CollectionItemsChangedEventArgs<IItemTree >(e.Items.Select(x => x.Value), e.OldItems == null ? null : e.OldItems.Select(x => x.Value));316 private static CollectionItemsChangedEventArgs<IItemTree<HiveJob>> ToCollectionItemsChangedEventArgs(CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) { 317 return new CollectionItemsChangedEventArgs<IItemTree<HiveJob>>(e.Items.Select(x => x.Value), e.OldItems == null ? null : e.OldItems.Select(x => x.Value)); 621 318 } 622 319 #endregion … … 634 331 JobData jobData = new JobData(); 635 332 jobData.JobId = this.job.Id; 636 jobData.Data = PersistenceUtil.Serialize(this. optimizerJob);333 jobData.Data = PersistenceUtil.Serialize(this.jobItem); 637 334 service.UpdateJobData(this.Job, jobData); 638 335 service.RestartJob(this.job.Id); … … 641 338 }); 642 339 } 340 341 public ICollection<IItemTreeNodeAction<HiveJob>> Actions { 342 get { 343 return new List<IItemTreeNodeAction<HiveJob>>(); 344 } 345 } 346 } 347 348 [Item("Hive Job", "Represents a hive job.")] 349 [StorableClass] 350 public class HiveJob<T> : HiveJob where T : ItemJob { 351 352 public new T JobItem { 353 get { return (T)base.JobItem; } 354 internal set { base.JobItem = value; } 355 } 356 357 #region Constructors and Cloning 358 public HiveJob() : base() { } 359 protected HiveJob(HiveJob original, Cloner cloner) 360 : base(original, cloner) { 361 } 362 public override IDeepCloneable Clone(Cloner cloner) { 363 return new HiveJob<T>(this, cloner); 364 } 365 #endregion 643 366 } 644 367 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJobDownloader.cs
r5793 r6033 4 4 using System.Threading; 5 5 using System.Threading.Tasks; 6 using HeuristicLab.Clients.Hive.ExperimentManager; 7 using HeuristicLab.Clients.Hive.Jobs; 8 using HeuristicLab.Hive; 6 9 7 10 namespace HeuristicLab.Clients.Hive { … … 86 89 Job job = ServiceLocator.Instance.CallHiveService(s => s.GetJob(jobData.JobId)); 87 90 if (abort || job == null || jobData == null) return null; 88 HiveJob hiveJob = new HiveJob(job, jobData, false); 91 92 HiveJob hiveJob; 93 var itemJob = PersistenceUtil.Deserialize<ItemJob>(jobData.Data); 94 if (itemJob is OptimizerJob) { 95 hiveJob = new OptimizerHiveJob((OptimizerJob)itemJob); 96 } else { 97 hiveJob = new HiveJob(itemJob, true); 98 } 89 99 jobData.Data = null; // reduce memory consumption. 90 100 hiveJob.Job = job; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj
r6006 r6033 122 122 <Compile Include="ExperimentManager\ExperimentManagerClient.cs" /> 123 123 <Compile Include="ExperimentManager\HiveJobDownloader.cs" /> 124 <Compile Include="ExperimentManager\IItemTree.cs" /> 124 <Compile Include="ExperimentManager\TreeView\IItemTree.cs" /> 125 <Compile Include="ExperimentManager\TreeView\IItemTreeAction.cs" /> 126 <Compile Include="ExperimentManager\OptimizerHiveJob.cs"> 127 <SubType>Code</SubType> 128 </Compile> 125 129 <Compile Include="ExperimentManager\PluginClient.cs" /> 126 130 <Compile Include="Exceptions\ResourceNotFoundException.cs" /> … … 146 150 <Compile Include="ServiceClients\HiveItem.cs" /> 147 151 <Compile Include="ServiceClients\JobData.cs" /> 152 <Compile Include="ServiceClients\OperationJob.cs" /> 153 <Compile Include="ExperimentManager\RefreshableHiveExperiment.cs" /> 148 154 <Compile Include="ServiceClients\Plugin.cs" /> 149 155 <Compile Include="ServiceClients\PluginData.cs" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLabClientsHivePlugin.cs.frame
r5043 r6033 8 8 [Plugin("HeuristicLab.Clients.Hive", "3.4.0.$WCREV$")] 9 9 [PluginFile("HeuristicLab.Clients.Hive-3.4.dll", PluginFileType.Assembly)] 10 [PluginDependency("HeuristicLab.Clients.Common", "3.3")] 11 [PluginDependency("HeuristicLab.Collections", "3.3")] 10 12 [PluginDependency("HeuristicLab.Common", "3.3")] 13 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 11 14 [PluginDependency("HeuristicLab.Core", "3.3")] 15 [PluginDependency("HeuristicLab.Data", "3.3")] 16 [PluginDependency("HeuristicLab.Hive", "3.4")] 17 [PluginDependency("HeuristicLab.Optimization", "3.3")] 12 18 [PluginDependency("HeuristicLab.Persistence", "3.3")] 13 19 public class HeuristicLabClientsHivePlugin : PluginBase { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Jobs/OptimizerJob.cs
r5958 r6033 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing;25 24 using HeuristicLab.Common; 26 25 using HeuristicLab.Core; … … 32 31 [Item("Optimizer Job", "Represents Job which executes a IOptimizer object.")] 33 32 [StorableClass] 34 public class OptimizerJob : AbstractJob {33 public class OptimizerJob : ItemJob { 35 34 public override bool IsParallelizable { 36 get { return this. Optimizer is Optimization.Experiment || this.Optimizeris BatchRun; }35 get { return this.Item is Experiment || this.Item is BatchRun; } 37 36 } 38 37 39 [Storable] 40 protected IOptimizer optimizer; 41 public IOptimizer Optimizer { 42 get { return optimizer; } 43 set { 44 if (value != optimizer) { 45 if (optimizer != null) DeregisterOptimizerEvents(); 46 optimizer = value; 47 if (optimizer != null) RegisterOptimizerEvents(); 48 OnOptimizerChanged(); 49 } 50 } 38 public new IOptimizer Item { 39 get { return (IOptimizer)base.Item; } 40 set { base.Item = value; } 51 41 } 52 42 … … 58 48 } 59 49 60 public OptimizerJob() : base() { 61 62 } 50 public OptimizerJob() : base() { } 63 51 public OptimizerJob(IOptimizer optimizer) 64 52 : this() { 65 this.Optimizer= optimizer;53 this.Item = optimizer; 66 54 67 if (optimizer is Optimization.Experiment) {55 if (optimizer is Experiment) { 68 56 this.ComputeInParallel = true; 69 } else if (optimizer is Optimization.BatchRun) {57 } else if (optimizer is BatchRun) { 70 58 this.ComputeInParallel = false; 71 59 } else { … … 77 65 protected OptimizerJob(OptimizerJob original, Cloner cloner) 78 66 : base(original, cloner) { 79 this.Optimizer = cloner.Clone(original.Optimizer);80 67 this.IndexInParentOptimizerList = original.IndexInParentOptimizerList; 81 68 this.CollectChildJobs = original.CollectChildJobs; 82 this.RegisterOptimizerEvents();83 69 } 84 70 public override IDeepCloneable Clone(Cloner cloner) { … … 86 72 } 87 73 88 [StorableHook(HookType.AfterDeserialization)]89 protected virtual void AfterDeserialization() {90 RegisterOptimizerEvents();91 }92 93 74 /// <summary> 94 75 /// Casts the Optimizer to an Experiment. Returns null if cast was not successfull. 95 76 /// </summary> 96 public Optimization.Experiment OptimizerAsExperiment {97 get { return Optimizer as Optimization.Experiment; }77 public Experiment OptimizerAsExperiment { 78 get { return Item as Experiment; } 98 79 } 99 80 … … 101 82 /// Casts the Optimizer to an BatchRun. Returns null if cast was not successfull. 102 83 /// </summary> 103 public Optimization.BatchRun OptimizerAsBatchRun {104 get { return Optimizer as Optimization.BatchRun; }84 public BatchRun OptimizerAsBatchRun { 85 get { return Item as BatchRun; } 105 86 } 106 87 … … 108 89 109 90 public override ExecutionState ExecutionState { 110 get { return optimizer.ExecutionState; }91 get { return Item.ExecutionState; } 111 92 } 112 93 113 94 public override TimeSpan ExecutionTime { 114 get { return optimizer.ExecutionTime; }95 get { return Item.ExecutionTime; } 115 96 } 116 97 117 98 public override void Prepare() { 118 optimizer.Prepare();99 Item.Prepare(); 119 100 } 120 101 121 102 public override void Start() { 122 if (( optimizer is Optimization.Experiment && OptimizerAsExperiment.Optimizers.Count == 0) || // experiment would not fire OnStopped if it has 0 optimizers123 ( optimizer is Optimization.BatchRun && OptimizerAsBatchRun.Optimizer == null)) { // batchrun would not fire OnStopped if algorithm == null103 if ((Item is Experiment && OptimizerAsExperiment.Optimizers.Count == 0) || // experiment would not fire OnStopped if it has 0 optimizers 104 (Item is BatchRun && OptimizerAsBatchRun.Optimizer == null)) { // batchrun would not fire OnStopped if algorithm == null 124 105 OnJobStopped(); 125 106 } else { 126 optimizer.Start();107 Item.Start(); 127 108 } 128 109 } 129 110 130 111 public override void Pause() { 131 optimizer.Pause();112 Item.Pause(); 132 113 } 133 114 134 115 public override void Stop() { 135 optimizer.Stop();116 Item.Stop(); 136 117 } 137 118 … … 142 123 143 124 #region Optimizer Events 144 protected virtual void RegisterOptimizerEvents() { 145 optimizer.Stopped += new EventHandler(optimizer_Stopped); 146 optimizer.Paused += new EventHandler(optimizer_Paused); 147 optimizer.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred); 148 optimizer.DescriptionChanged += new EventHandler(optimizer_DescriptionChanged); 149 optimizer.ItemImageChanged += new EventHandler(optimizer_ItemImageChanged); 150 optimizer.NameChanged += new EventHandler(optimizer_NameChanged); 151 optimizer.NameChanging += new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging); 152 optimizer.ToStringChanged += new EventHandler(optimizer_ToStringChanged); 125 protected override void RegisterItemEvents() { 126 base.RegisterItemEvents(); 127 Item.Stopped += new EventHandler(optimizer_Stopped); 128 Item.Paused += new EventHandler(optimizer_Paused); 129 Item.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred); 130 Item.DescriptionChanged += new EventHandler(optimizer_DescriptionChanged); 131 Item.NameChanged += new EventHandler(optimizer_NameChanged); 132 Item.NameChanging += new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging); 153 133 } 154 134 155 135 protected virtual void DeregisterOptimizerEvents() { 156 optimizer.Stopped -= new EventHandler(optimizer_Stopped); 157 optimizer.Paused -= new EventHandler(optimizer_Paused); 158 optimizer.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred); 159 optimizer.DescriptionChanged -= new EventHandler(optimizer_DescriptionChanged); 160 optimizer.ItemImageChanged -= new EventHandler(optimizer_ItemImageChanged); 161 optimizer.NameChanged -= new EventHandler(optimizer_NameChanged); 162 optimizer.NameChanging -= new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging); 163 optimizer.ToStringChanged -= new EventHandler(optimizer_ToStringChanged); 164 } 165 166 protected void optimizer_ToStringChanged(object sender, EventArgs e) { 167 this.OnToStringChanged(); 136 Item.Stopped -= new EventHandler(optimizer_Stopped); 137 Item.Paused -= new EventHandler(optimizer_Paused); 138 Item.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred); 139 Item.DescriptionChanged -= new EventHandler(optimizer_DescriptionChanged); 140 Item.NameChanged -= new EventHandler(optimizer_NameChanged); 141 Item.NameChanging -= new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging); 142 base.DeregisterItemEvents(); 168 143 } 169 144 … … 174 149 protected void optimizer_NameChanged(object sender, EventArgs e) { 175 150 this.OnNameChanged(); 176 }177 178 protected void optimizer_ItemImageChanged(object sender, EventArgs e) {179 this.OnItemImageChanged();180 151 } 181 152 … … 198 169 199 170 #region INamedItem Members 200 201 171 public override bool CanChangeDescription { 202 get { return optimizer.CanChangeDescription; }172 get { return Item.CanChangeDescription; } 203 173 } 204 174 205 175 public override bool CanChangeName { 206 get { return optimizer.CanChangeName; }176 get { return Item.CanChangeName; } 207 177 } 208 178 209 179 public override string Description { 210 get { return optimizer.Description; }211 set { optimizer.Description = value; }180 get { return Item.Description; } 181 set { Item.Description = value; } 212 182 } 213 183 214 184 public override string Name { 215 get { return optimizer.Name; } 216 set { optimizer.Name = value; } 217 } 218 #endregion 219 220 #region IItem Members 221 222 public override string ItemDescription { 223 get { return optimizer.ItemDescription; } 224 } 225 226 public override Image ItemImage { 227 get { return optimizer.ItemImage; } 228 } 229 230 public override string ItemName { 231 get { return optimizer.ItemName; } 232 } 233 234 public override Version ItemVersion { 235 get { return optimizer.ItemVersion; } 185 get { return Item.Name; } 186 set { Item.Name = value; } 236 187 } 237 188 #endregion -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs
r6006 r6033 24 24 using System.ComponentModel; 25 25 using System.Linq; 26 using HeuristicLab.Clients.Hive.Jobs;27 26 using HeuristicLab.Common; 28 27 using HeuristicLab.Core; 29 using HeuristicLab.Optimization;30 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 29 … … 33 31 [StorableClass] 34 32 public partial class HiveExperiment : IDeepCloneable, IContent, IProgressReporter { 35 private JobResultPoller jobResultPoller;36 37 33 [Storable] 38 34 private bool useLocalPlugins; … … 71 67 get { return hiveJobs; } 72 68 set { 73 DeregisterHiveJobsEvents();74 69 if (hiveJobs != value) { 75 70 hiveJobs = value; 76 RegisterHiveJobsEvents();77 71 OnHiveJobsChanged(); 78 72 } … … 92 86 } 93 87 94 /** include jobs when refreshing **/95 [Storable]96 private bool includeJobs;97 public bool IncludeJobs {98 get { return includeJobs; }99 set { includeJobs = value; }100 }101 102 [Storable]103 private bool refreshAutomatically;104 public bool RefreshAutomatically {105 get { return refreshAutomatically; }106 set {107 if (refreshAutomatically != value) {108 refreshAutomatically = value;109 OnRefreshAutomaticallyChanged();110 if (RefreshAutomatically) {111 StartResultPolling();112 } else {113 StopResultPolling();114 }115 }116 }117 }118 119 88 [Storable] 120 89 private IProgress progress; … … 127 96 public HiveExperiment() { 128 97 this.ResourceNames = "HEAL"; 129 this.includeJobs = true; 130 this.refreshAutomatically = true; 98 this.HiveJobs = new ItemCollection<HiveJob>(); 131 99 } 132 100 … … 140 108 this.Description = original.Description; 141 109 this.Id = original.Id; 142 110 this.HiveJobs = cloner.Clone(original.HiveJobs); 143 111 this.UseLocalPlugins = original.UseLocalPlugins; 144 112 this.ExecutionTime = original.ExecutionTime; … … 148 116 } 149 117 #endregion 150 151 public override string ToString() {152 return Name;153 }154 118 155 119 #region Events … … 167 131 168 132 public event EventHandler HiveJobsChanged; 169 private void OnHiveJobsChanged() { 170 if (jobResultPoller != null && jobResultPoller.IsPolling) { 171 jobResultPoller.Stop(); 172 DeregisterResultPollingEvents(); 173 } 174 if (HiveJobs != null && HiveJobs.Count > 0 && GetAllHiveJobs().All(x => x.Job.Id != Guid.Empty)) { 175 if (this.RefreshAutomatically) 176 StartResultPolling(); 177 } 133 protected virtual void OnHiveJobsChanged() { 178 134 EventHandler handler = HiveJobsChanged; 179 135 if (handler != null) handler(this, EventArgs.Empty); … … 185 141 if (handler != null) handler(this, EventArgs.Empty); 186 142 } 187 188 public event EventHandler RefreshAutomaticallyChanged;189 private void OnRefreshAutomaticallyChanged() {190 EventHandler handler = RefreshAutomaticallyChanged;191 if (handler != null) handler(this, EventArgs.Empty);192 }193 143 #endregion 194 195 private void RegisterHiveJobsEvents() { 196 //if (HiveJobs != null) { 197 // HiveJobs.JobStateChanged += new EventHandler(HiveJob_JobStateChanged); 198 //} 199 } 200 201 private void DeregisterHiveJobsEvents() { 202 //if (HiveJobs != null) { 203 // HiveJobs.JobStateChanged -= new EventHandler(HiveJob_JobStateChanged); 204 //} 205 } 206 207 private void HiveJob_JobStateChanged(object sender, EventArgs e) { 208 //if (this.HiveJobs != null) { 209 // this.RootJobId = HiveJobs.Job.Id; 210 //} 211 } 212 213 public Experiment GetExperiment(int idx) { 214 if (this.HiveJobs != null) { 215 var hj = HiveJobs.ElementAtOrDefault(idx); 216 if (hj != null) 217 return hj.OptimizerJob.OptimizerAsExperiment; 218 } 219 return null; 220 } 221 222 public void AddExperiment(Experiment experiment) { 223 if (this.HiveJobs == null) 224 this.HiveJobs = new ItemCollection<HiveJob>(); 225 this.HiveJobs.Add(new HiveJob(experiment)); 226 } 227 228 public void SetExperiment(Experiment experiment) { 229 if (this.HiveJobs == null) 230 this.HiveJobs = new ItemCollection<HiveJob>(); 231 else 232 this.HiveJobs.Clear(); 233 this.HiveJobs.Add(new HiveJob(experiment)); 234 } 235 144 236 145 protected override void OnPropertyChanged(PropertyChangedEventArgs e) { 237 146 base.OnPropertyChanged(e); … … 240 149 } 241 150 } 242 243 #region JobResultPoller Events 244 245 public void StartResultPolling() { 246 if (jobResultPoller == null) { 247 jobResultPoller = new JobResultPoller(HiveJobs, /*ApplicationConstants.ResultPollingInterval*/new TimeSpan(0, 0, 5)); //TODO: find a better place for ApplicationConstants 248 RegisterResultPollingEvents(); 249 } 250 251 if (!jobResultPoller.IsPolling) { 252 jobResultPoller.Start(); 253 } 254 } 255 256 public void StopResultPolling() { 257 if (jobResultPoller != null && jobResultPoller.IsPolling) { 258 jobResultPoller.Stop(); 259 } 260 } 261 262 private void RegisterResultPollingEvents() { 263 jobResultPoller.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured); 264 jobResultPoller.JobResultsReceived += new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived); 265 jobResultPoller.IsPollingChanged += new EventHandler(jobResultPoller_IsPollingChanged); 266 } 267 private void DeregisterResultPollingEvents() { 268 jobResultPoller.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured); 269 jobResultPoller.JobResultsReceived -= new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived); 270 jobResultPoller.IsPollingChanged -= new EventHandler(jobResultPoller_IsPollingChanged); 271 } 272 private void jobResultPoller_IsPollingChanged(object sender, EventArgs e) { 273 this.refreshAutomatically = jobResultPoller.IsPolling; 274 OnRefreshAutomaticallyChanged(); 275 } 276 private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightJob>> e) { 277 foreach (LightweightJob lightweightJob in e.Value) { 278 HiveJob hj = GetHiveJobById(lightweightJob.Id); 279 if (hj != null) { 280 DateTime lastJobDataUpdate = hj.Job.LastJobDataUpdate; 281 hj.UpdateFromLightweightJob(lightweightJob); 282 283 // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated 284 if (lastJobDataUpdate != DateTime.MinValue && lastJobDataUpdate < hj.Job.LastJobDataUpdate) { 285 OptimizerJob optimizerJob = ExperimentManagerClient.LoadOptimizerJob(hj.Job.Id); 286 if (optimizerJob == null) { 287 // something bad happened to this job. bad job, BAAAD job! 288 } else { 289 // if the job is paused, download but don't integrate into parent optimizer (to avoid Prepare) 290 if (hj.Job.State == JobState.Paused) { 291 hj.OptimizerJob = optimizerJob; 292 } else { 293 if (lightweightJob.ParentJobId.HasValue) { 294 HiveJob parentHiveJob = GetHiveJobById(lightweightJob.ParentJobId.Value); 295 parentHiveJob.UpdateChildOptimizer(optimizerJob, hj.Job.Id); 296 } 297 } 298 } 299 } 300 } 301 } 302 GC.Collect(); // force GC, because .NET is too lazy here (deserialization takes a lot of memory) 303 if (AllJobsFinished()) { 304 this.ExecutionState = Core.ExecutionState.Stopped; 305 StopResultPolling(); 306 //OnStopped(); 307 } 308 UpdateTotalExecutionTime(); 309 UpdateStats(); 310 } 311 312 public HiveJob GetHiveJobById(Guid jobId) { 313 foreach (HiveJob job in HiveJobs) { 314 HiveJob hj = job.GetHiveJobByJobId(jobId); 315 if (hj != null) 316 return hj; 317 } 318 return null; 319 } 320 321 private void UpdateStats() { 322 var jobs = GetAllHiveJobs(); 323 this.JobCount = jobs.Count(); 324 this.CalculatingCount = jobs.Count(j => j.Job.State == JobState.Calculating); 325 this.FinishedCount = jobs.Count(j => j.Job.State == JobState.Finished); 326 } 327 328 public IEnumerable<HiveJob> GetAllHiveJobs() { 329 var jobs = new List<HiveJob>(); 330 foreach (HiveJob job in HiveJobs) { 331 jobs.AddRange(job.GetAllHiveJobs()); 332 } 333 return jobs; 334 } 335 336 public bool AllJobsFinished() { 337 return GetAllHiveJobs().All(j => j.Job.State == JobState.Finished 338 || j.Job.State == JobState.Aborted 339 || j.Job.State == JobState.Failed); 340 } 341 342 private void jobResultPoller_ExceptionOccured(object sender, EventArgs<Exception> e) { 343 //OnExceptionOccured(e.Value); 344 } 345 346 public void UpdateTotalExecutionTime() { 347 this.ExecutionTime = TimeSpan.FromMilliseconds(GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.HasValue ? x.Job.ExecutionTime.Value.TotalMilliseconds : 0)); 348 } 349 #endregion 350 151 351 152 protected override void RaisePropertyChanged(string propertyName) { 352 153 if (!(propertyName == "ExecutionTime") … … 362 163 && HiveJobs.All(x => x.Job.DateFinished.HasValue && x.Job.DateCreated.HasValue); 363 164 } 165 166 public IEnumerable<HiveJob> GetAllHiveJobs() { 167 var jobs = new List<HiveJob>(); 168 foreach (HiveJob job in HiveJobs) { 169 jobs.AddRange(job.GetAllHiveJobs()); 170 } 171 return jobs; 172 } 173 174 public override string ToString() { 175 return Name; 176 } 177 178 public virtual void OnLoaded() { } 364 179 } 365 180 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Hive/3.4/HeuristicLab.Hive-3.4.csproj
r5958 r6033 96 96 <Compile Include="HeuristicLabHivePlugin.cs" /> 97 97 <Compile Include="IJob.cs" /> 98 <Compile Include=" AbstractJob.cs" />98 <Compile Include="ItemJob.cs" /> 99 99 <Compile Include="Properties\AssemblyInfo.cs" /> 100 100 </ItemGroup> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Test/HeuristicLab.HiveEngine.Test.csproj
r6006 r6033 124 124 <Name>HeuristicLab.HiveEngine-3.4</Name> 125 125 </ProjectReference> 126 <ProjectReference Include="..\HeuristicLab.Hive\3.4\HeuristicLab.Hive-3.4.csproj"> 127 <Project>{F98A1740-9AC9-4D36-A582-6A2D0D06978D}</Project> 128 <Name>HeuristicLab.Hive-3.4</Name> 129 </ProjectReference> 126 130 </ItemGroup> 127 131 <ItemGroup> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Test/Program.cs
r6006 r6033 11 11 using HeuristicLab.PluginInfrastructure.Manager; 12 12 using HeuristicLab.Problems.TestFunctions; 13 using HeuristicLab.Clients.Hive.Jobs; 14 using HeuristicLab.Optimization; 13 15 14 16 namespace HeuristicLab.HiveEngine.Test { … … 30 32 public override void Run() { 31 33 ContentManager.Initialize(new PersistenceContentManager()); 34 35 36 OptimizerJob job = new OptimizerJob(new Experiment()); 37 job.IndexInParentOptimizerList = 15; 38 39 byte[] data = PersistenceUtil.Serialize(job); 40 41 var job2 = PersistenceUtil.Deserialize<OptimizerJob>(data); 42 43 32 44 33 45 #region Credentials -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Test/app.config
r6000 r6033 1 <?xml version="1.0" encoding="utf-8"?>1 <?xml version="1.0" encoding="utf-8"?> 2 2 <configuration> 3 3 <configSections> … … 73 73 </identity> 74 74 </endpoint> 75 <endpoint address="http:// services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService">75 <endpoint address="http://localhost/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService"> 76 76 <identity> 77 <certificate encodedValue="AwAAAAEAAAAUAAAA wK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ==" />77 <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac=" /> 78 78 </identity> 79 79 </endpoint> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/EngineJob.cs
r6000 r6033 9 9 namespace HeuristicLab.HiveEngine { 10 10 [StorableClass] 11 public class EngineJob : AbstractJob { 12 [Storable] 13 private IEngine engine; 14 11 public class EngineJob : ItemJob { 15 12 [Storable] 16 13 protected IOperation initialOperation; … … 20 17 } 21 18 19 public new IEngine Item { 20 get { return (IEngine)base.Item; } 21 set { base.Item = value; } 22 } 23 22 24 public override TimeSpan ExecutionTime { 23 get { return engine.ExecutionTime; }25 get { return Item.ExecutionTime; } 24 26 } 25 27 26 28 public override ExecutionState ExecutionState { 27 get { return engine.ExecutionState; }29 get { return Item.ExecutionState; } 28 30 } 29 31 … … 32 34 public EngineJob(IOperation initialOperation, IEngine engine) { 33 35 this.initialOperation = initialOperation; 34 this.engine = engine; 35 RegisterEngineEvents(); 36 this.Item = engine; 36 37 } 37 38 … … 40 41 protected EngineJob(EngineJob original, Cloner cloner) 41 42 : base(original, cloner) { 42 this.engine = cloner.Clone(original.engine);43 43 this.initialOperation = cloner.Clone(original.initialOperation); 44 RegisterEngineEvents();45 44 } 46 45 public override IDeepCloneable Clone(Cloner cloner) { 47 46 return new EngineJob(this, cloner); 48 }49 [StorableHook(HookType.AfterDeserialization)]50 private void AfterDeserialization() {51 RegisterEngineEvents();52 47 } 53 48 #endregion … … 60 55 61 56 public override void Start() { 62 engine.Prepare(initialOperation);63 engine.Start();57 Item.Prepare(initialOperation); 58 Item.Start(); 64 59 } 65 60 66 61 public override void Pause() { 67 engine.Pause();62 Item.Pause(); 68 63 } 69 64 70 65 public override void Stop() { 71 engine.Stop();66 Item.Stop(); 72 67 } 73 68 … … 76 71 } 77 72 78 private void RegisterEngineEvents() { 79 engine.Stopped += new EventHandler(engine_Stopped); 80 engine.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred); 73 protected override void RegisterItemEvents() { 74 Item.Stopped += new EventHandler(engine_Stopped); 75 Item.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred); 76 } 77 78 protected override void DeregisterItemEvents() { 79 Item.Stopped -= new EventHandler(engine_Stopped); 80 Item.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred); 81 81 } 82 82 … … 103 103 104 104 public override string Name { 105 get { return engine.ToString(); }105 get { return Item.ToString(); } 106 106 set { throw new NotSupportedException(); } 107 107 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HeuristicLabHiveEnginePlugin.cs.frame
r5958 r6033 26 26 [PluginFile("HeuristicLab.HiveEngine-3.4.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Clients.Common", "3.3")] 28 [PluginDependency("HeuristicLab.Clients.Hive", "3.4")] 29 [PluginDependency("HeuristicLab.Clients.Hive.Views", "3.4")] 28 30 [PluginDependency("HeuristicLab.Collections", "3.3")] 29 31 [PluginDependency("HeuristicLab.Common", "3.3")] 30 32 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 31 33 [PluginDependency("HeuristicLab.Core", "3.3")] 32 [PluginDependency("HeuristicLab.DataAccess", "3.3")] 33 [PluginDependency("HeuristicLab.Hive.Contracts", "3.3")] 34 [PluginDependency("HeuristicLab.Hive.ExperimentManager", "3.3")] 35 [PluginDependency("HeuristicLab.Hive.JobBase", "3.3")] 34 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 35 [PluginDependency("HeuristicLab.Hive", "3.4")] 36 [PluginDependency("HeuristicLab.MainForm", "3.3")] 37 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 38 [PluginDependency("HeuristicLab.Optimization.Views", "3.3")] 36 39 [PluginDependency("HeuristicLab.Persistence", "3.3")] 40 [PluginDependency("HeuristicLab.Random", "3.3")] 37 41 [PluginDependency("HeuristicLab.SequentialEngine", "3.3")] 38 42 public class HeuristicLabHiveEnginePlugin : PluginBase { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
r6006 r6033 54 54 55 55 [Storable] 56 private ItemCollection< HiveExperiment> hiveExperiments;57 public ItemCollection< HiveExperiment> HiveExperiments {56 private ItemCollection<RefreshableHiveExperiment> hiveExperiments; 57 public ItemCollection<RefreshableHiveExperiment> HiveExperiments { 58 58 get { return hiveExperiments; } 59 59 set { hiveExperiments = value; } … … 75 75 public HiveEngine() { 76 76 ResourceNames = "HEAL"; 77 HiveExperiments = new ItemCollection< HiveExperiment>();77 HiveExperiments = new ItemCollection<RefreshableHiveExperiment>(); 78 78 Priority = 0; 79 79 } … … 239 239 hiveExperiment.UseLocalPlugins = this.UseLocalPlugins; 240 240 hiveExperiment.ResourceNames = this.ResourceNames; 241 hiveExperiment.RefreshAutomatically = false;242 241 hiveExperiment.Id = ServiceLocator.Instance.CallHiveService(s => s.AddHiveExperiment(hiveExperiment)); 243 hiveExperiments.Add( hiveExperiment);242 hiveExperiments.Add(new RefreshableHiveExperiment(hiveExperiment)); 244 243 245 244 // create upload-tasks -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/Views/HiveEngineView.Designer.cs
r6006 r6033 222 222 private System.Windows.Forms.TextBox priorityTextBox; 223 223 private System.Windows.Forms.Label label1; 224 pr otectedSystem.Windows.Forms.TextBox executionTimeOnHiveTextBox;224 private System.Windows.Forms.TextBox executionTimeOnHiveTextBox; 225 225 private System.Windows.Forms.TabControl tabControl; 226 226 private System.Windows.Forms.TabPage jobsTabPage; 227 227 private System.Windows.Forms.TabPage logTabPage; 228 228 private System.Windows.Forms.Label executionTimeLabel; 229 pr otectedSystem.Windows.Forms.TextBox executionTimeTextBox;229 private System.Windows.Forms.TextBox executionTimeTextBox; 230 230 private System.Windows.Forms.CheckBox useLocalPluginsCheckBox; 231 231 private HeuristicLab.Core.Views.LogView logView; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLabServicesHiveDataAccessPlugin.cs.frame
r5043 r6033 8 8 [Plugin("HeuristicLab.Services.Hive.DataAccess", "3.4.0.$WCREV$")] 9 9 [PluginFile("HeuristicLab.Services.Hive.DataAccess-3.4.dll", PluginFileType.Assembly)] 10 [PluginDependency("HeuristicLab.Clients.Common", "3.3")] 10 11 [PluginDependency("HeuristicLab.Common", "3.3")] 11 12 [PluginDependency("HeuristicLab.Core", "3.3")] 12 13 [PluginDependency("HeuristicLab.Persistence", "3.3")] 14 [PluginDependency("HeuristicLab.Services.Hive.Common", "3.4")] 13 15 public class HeuristicLabServicesHiveDataAccessPlugin : PluginBase { 14 16 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql
r6006 r6033 55 55 GO 56 56 57 --ALTER TABLE [dbo].[Job] DROP CONSTRAINT [HiveExperiment_Job]58 --ALTER TABLE [dbo].[Job] WITH CHECK ADD CONSTRAINT [HiveExperiment_Job] FOREIGN KEY([HiveExperimentId])59 --REFERENCES [dbo].[HiveExperiment] ([HiveExperimentId])60 --ON UPDATE CASCADE61 --ON DELETE CASCADE62 --GO63 64 57 ALTER TABLE dbo.Plugin ALTER COLUMN PluginId ADD ROWGUIDCOL; 65 58 ALTER TABLE dbo.Plugin WITH NOCHECK ADD CONSTRAINT [DF_Plugin_PluginId] DEFAULT (newid()) FOR PluginId; … … 67 60 ALTER TABLE dbo.PluginData ALTER COLUMN PluginDataId ADD ROWGUIDCOL; 68 61 ALTER TABLE dbo.PluginData WITH NOCHECK ADD CONSTRAINT [DF_PluginData_PluginDataId] DEFAULT (newid()) FOR PluginDataId; 62 63 ALTER TABLE [dbo].[PluginData] DROP CONSTRAINT [Plugin_PluginData] 64 ALTER TABLE [dbo].[PluginData] WITH CHECK ADD CONSTRAINT [Plugin_PluginData] FOREIGN KEY([PluginId]) 65 REFERENCES [dbo].[Plugin] ([PluginId]) 66 ON UPDATE CASCADE 67 ON DELETE CASCADE 68 GO 69 69 70 70 ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId ADD ROWGUIDCOL; … … 108 108 109 109 /* triggers */ 110 USE [HeuristicLab.Hive-3.4] 111 GO 112 /****** Object: Trigger [dbo].[tr_HiveExperimentDeleteCascade] Script Date: 04/19/2011 16:31:53 ******/ 110 113 SET ANSI_NULLS ON 111 114 GO … … 114 117 -- ============================================= 115 118 -- Author: cneumuel 116 -- Create date: 1 1.04.2011119 -- Create date: 19.04.2011 117 120 -- Description: Deletes all associated jobs. This cannot be done with cascading delete, 118 121 -- because the job table defines a INSTEAD OF DELETE trigger itself, which 119 122 -- is not compatible with cascading deletes. 120 123 -- ============================================= 121 ALTERTRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] INSTEAD OF DELETE AS124 CREATE TRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] INSTEAD OF DELETE AS 122 125 BEGIN 123 DELETE Job FROM Job WHERE Job.HiveExperimentId = HiveExperimentId 126 DELETE Job FROM deleted, Job WHERE deleted.HiveExperimentId = Job.HiveExperimentId 127 DELETE HiveExperiment FROM deleted, HiveExperiment WHERE deleted.HiveExperimentId = HiveExperiment.HiveExperimentId 124 128 END 129 GO 125 130 126 SET ANSI_NULLS ON127 GO128 SET QUOTED_IDENTIFIER ON129 GO130 131 -- ============================================= 131 132 -- Author: cneumuel -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeuristicLabServicesHivePlugin.cs.frame
r5043 r6033 8 8 [Plugin("HeuristicLab.Services.Hive", "3.4.0.$WCREV$")] 9 9 [PluginFile("HeuristicLab.Services.Hive-3.4.dll", PluginFileType.Assembly)] 10 [PluginDependency("HeuristicLab.Clients.Common", "3.3")] 10 11 [PluginDependency("HeuristicLab.Common", "3.3")] 12 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 11 13 [PluginDependency("HeuristicLab.Core", "3.3")] 12 14 [PluginDependency("HeuristicLab.Persistence", "3.3")] 15 [PluginDependency("HeuristicLab.Services.Hive.Common", "3.4")] 16 [PluginDependency("HeuristicLab.Services.Hive.DataAccess", "3.4")] 13 17 public class HeuristicLabServicesHivePlugin : PluginBase { 14 18 }
Note: See TracChangeset
for help on using the changeset viewer.