Changeset 6479 for branches/HeuristicLab.Hive-3.4
- Timestamp:
- 06/27/11 15:20:23 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/MenuItems/AdministrationMenuItem.cs
r6373 r6479 27 27 public class AdministrationMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider { 28 28 public override string Name { 29 get { return "&Administration (dev)"; }29 get { return "&Administration"; } 30 30 } 31 31 public override IEnumerable<string> Structure { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/MenuItems/ExperimentManagerMenuItem.cs
r6373 r6479 27 27 public class ExperimentManagerMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider { 28 28 public override string Name { 29 get { return "&Experiment Manager (dev)"; }29 get { return "&Experiment Manager"; } 30 30 } 31 31 public override IEnumerable<string> Structure { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/HiveExperimentPermissionView.Designer.cs
r6463 r6479 61 61 this.usernameTextBox.TabIndex = 3; 62 62 this.usernameTextBox.Validated += new System.EventHandler(this.usernameTextBox_Validated); 63 this.usernameTextBox.Validating += new System.ComponentModel.CancelEventHandler(usernameTextBox_Validating); 63 64 // 64 65 // permissionComboBox … … 73 74 this.permissionComboBox.TabIndex = 4; 74 75 this.permissionComboBox.Validated += new System.EventHandler(this.permissionComboBox_Validated); 76 this.permissionComboBox.Validating += new System.ComponentModel.CancelEventHandler(permissionComboBox_Validating); 75 77 // 76 78 // HiveExperimentPermissionView … … 92 94 93 95 } 94 95 96 #endregion 96 97 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/HiveExperimentPermissionView.cs
r6465 r6479 20 20 #endregion 21 21 22 using System.ComponentModel; 22 23 using HeuristicLab.Clients.Hive.Views; 23 24 using HeuristicLab.MainForm; … … 62 63 63 64 #region Child Control Events 64 private void usernameTextBox_Validated(object sender, System.EventArgs e) { 65 66 private void usernameTextBox_Validating(object sender, CancelEventArgs e) { 65 67 Content.GrantedUserName = usernameTextBox.Text; 66 68 } 69 private void usernameTextBox_Validated(object sender, System.EventArgs e) { 70 71 } 67 72 73 private void permissionComboBox_Validating(object sender, CancelEventArgs e) { 74 Content.Permission = (Permission)permissionComboBox.SelectedItem; 75 } 68 76 private void permissionComboBox_Validated(object sender, System.EventArgs e) { 69 Content.Permission = (Permission)permissionComboBox.SelectedItem;77 70 78 } 71 79 #endregion -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentListView.cs
r6465 r6479 39 39 this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable; 40 40 this.itemsListView.FullRowSelect = true; 41 this.itemsListView.Sorting = SortOrder.Ascending; 42 this.itemsListView.Sort(); 41 43 } 42 44 43 45 protected override RefreshableHiveExperiment CreateItem() { 44 return new RefreshableHiveExperiment() ;46 return new RefreshableHiveExperiment() { IsAllowedPrivileged = HiveClient.Instance.IsAllowedPrivileged }; 45 47 } 46 48 … … 52 54 } 53 55 56 protected override void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<RefreshableHiveExperiment> e) { 57 base.Content_ItemsAdded(sender, e); 58 59 } 60 54 61 protected override ListViewItem CreateListViewItem(RefreshableHiveExperiment item) { 55 62 ListViewItem listViewItem = base.CreateListViewItem(item); … … 59 66 listViewItem.Group = GetListViewGroup(item.HiveExperiment.OwnerUsername); 60 67 return listViewItem; 68 } 69 70 protected override void UpdateListViewItemText(ListViewItem listViewItem) { 71 if (listViewItem == null) throw new ArgumentNullException(); 72 var item = listViewItem.Tag as RefreshableHiveExperiment; 73 listViewItem.SubItems[0].Text = item == null ? "null" : item.HiveExperiment.DateCreated.ToString("dd.MM.yyyy HH:mm"); 74 listViewItem.SubItems[1].Text = item == null ? "null" : item.HiveExperiment.Name; 75 listViewItem.Group = GetListViewGroup(item.HiveExperiment.OwnerUsername); 76 listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription; 61 77 } 62 78 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.Designer.cs
r6463 r6479 55 55 this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 56 56 this.sharingTabPage = new System.Windows.Forms.TabPage(); 57 this.refreshPermissionsButton = new System.Windows.Forms.Button(); 57 58 this.hiveExperimentPermissionListView = new HeuristicLab.Clients.Hive.ExperimentManager.Views.HiveExperimentPermissionListView(); 58 59 this.logTabPage = new System.Windows.Forms.TabPage(); … … 79 80 this.calculatingLabel = new System.Windows.Forms.Label(); 80 81 this.jobsLabel = new System.Windows.Forms.Label(); 81 this.refreshPermissionsButton = new System.Windows.Forms.Button();82 82 this.tabControl.SuspendLayout(); 83 83 this.jobsTabPage.SuspendLayout(); … … 102 102 this.tabControl.Size = new System.Drawing.Size(717, 452); 103 103 this.tabControl.TabIndex = 4; 104 this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); 104 105 // 105 106 // jobsTabPage … … 165 166 this.sharingTabPage.UseVisualStyleBackColor = true; 166 167 // 168 // refreshPermissionsButton 169 // 170 this.refreshPermissionsButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshPermissionsButton.Image"))); 171 this.refreshPermissionsButton.Location = new System.Drawing.Point(3, 3); 172 this.refreshPermissionsButton.Name = "refreshPermissionsButton"; 173 this.refreshPermissionsButton.Size = new System.Drawing.Size(24, 24); 174 this.refreshPermissionsButton.TabIndex = 23; 175 this.toolTip.SetToolTip(this.refreshPermissionsButton, "Refresh Data"); 176 this.refreshPermissionsButton.UseVisualStyleBackColor = true; 177 this.refreshPermissionsButton.Click += new System.EventHandler(this.refreshPermissionsButton_Click); 178 // 167 179 // hiveExperimentPermissionListView 168 180 // … … 172 184 this.hiveExperimentPermissionListView.Caption = "HiveExperimentPermissionList View"; 173 185 this.hiveExperimentPermissionListView.Content = null; 186 this.hiveExperimentPermissionListView.HiveExperimentId = new System.Guid("00000000-0000-0000-0000-000000000000"); 174 187 this.hiveExperimentPermissionListView.Location = new System.Drawing.Point(3, 33); 175 188 this.hiveExperimentPermissionListView.Name = "hiveExperimentPermissionListView"; … … 410 423 this.jobsLabel.TabIndex = 0; 411 424 this.jobsLabel.Text = "Jobs:"; 412 //413 // refreshPermissionsButton414 //415 this.refreshPermissionsButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshPermissionsButton.Image")));416 this.refreshPermissionsButton.Location = new System.Drawing.Point(3, 3);417 this.refreshPermissionsButton.Name = "refreshPermissionsButton";418 this.refreshPermissionsButton.Size = new System.Drawing.Size(24, 24);419 this.refreshPermissionsButton.TabIndex = 23;420 this.toolTip.SetToolTip(this.refreshPermissionsButton, "Refresh Data");421 this.refreshPermissionsButton.UseVisualStyleBackColor = true;422 this.refreshPermissionsButton.Click += new System.EventHandler(this.refreshPermissionsButton_Click);423 425 // 424 426 // RefreshableHiveExperimentView -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.cs
r6463 r6479 63 63 Content.ExceptionOccured += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured); 64 64 Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged); 65 Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged); 66 Content.HiveJobsChanged += new EventHandler(Content_HiveJobChanged); 67 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); 68 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 69 Content.IsAllowedPrivilegedChanged += new EventHandler(Content_IsAllowedPrivilegedChanged); 65 70 } 66 71 … … 72 77 Content.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured); 73 78 Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged); 79 Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged); 80 Content.HiveJobsChanged -= new EventHandler(Content_HiveJobChanged); 81 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); 82 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 74 83 base.DeregisterContentEvents(); 75 84 } 76 85 77 86 private void RegisterHiveExperimentEvents() { 78 Content.HiveExperiment.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);79 Content.HiveExperiment.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);80 Content.HiveExperiment.HiveJobsChanged += new EventHandler(Content_HiveJobChanged);81 Content.HiveExperiment.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged);82 87 Content.HiveExperiment.PropertyChanged += new PropertyChangedEventHandler(HiveExperiment_PropertyChanged); 83 88 } 84 89 85 90 private void DeregisterHiveExperimentEvents() { 86 Content.HiveExperiment.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);87 Content.HiveExperiment.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);88 Content.HiveExperiment.HiveJobsChanged -= new EventHandler(Content_HiveJobChanged);89 Content.HiveExperiment.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged);90 91 Content.HiveExperiment.PropertyChanged -= new PropertyChangedEventHandler(HiveExperiment_PropertyChanged); 91 92 } 92 93 93 94 private void RegisterHiveJobEvents() { 94 Content.Hive Experiment.HiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);95 Content.Hive Experiment.HiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);96 Content.Hive Experiment.HiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);95 Content.HiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset); 96 Content.HiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset); 97 Content.HiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset); 97 98 } 98 99 private void DeregisterHiveJobEvents() { 99 Content.Hive Experiment.HiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);100 Content.Hive Experiment.HiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);101 Content.Hive Experiment.HiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);100 Content.HiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset); 101 Content.HiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset); 102 Content.HiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset); 102 103 } 103 104 … … 114 115 } else { 115 116 nameTextBox.Text = Content.HiveExperiment.Name; 116 executionTimeTextBox.Text = Content. HiveExperiment.ExecutionTime.ToString();117 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 117 118 resourceNamesTextBox.Text = Content.HiveExperiment.ResourceNames; 118 119 isPrivilegedCheckBox.Checked = Content.HiveExperiment.IsPrivileged; … … 139 140 if (Content != null) { 140 141 bool alreadyUploaded = Content.Id != Guid.Empty; 141 bool jobsLoaded = Content.HiveExperiment.HiveJobs != null && Content.HiveExperiment.HiveJobs.All(x => x.Job.Id != Guid.Empty); 142 143 this.nameTextBox.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded; 144 this.resourceNamesTextBox.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded; 145 this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded; 146 147 this.isPrivilegedCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this 148 this.refreshAutomaticallyCheckBox.Enabled = Content.IsControllable && alreadyUploaded && jobsLoaded && Content.HiveExperiment.ExecutionState == ExecutionState.Started; 149 this.refreshButton.Enabled = Content.IsControllable && alreadyUploaded; 150 this.Locked = !Content.IsControllable || Content.HiveExperiment.ExecutionState == ExecutionState.Started; 151 142 bool jobsLoaded = Content.HiveJobs != null && Content.HiveJobs.All(x => x.Job.Id != Guid.Empty); 143 144 this.nameTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded; 145 this.resourceNamesTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded; 146 this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded; 147 148 this.isPrivilegedCheckBox.Enabled = Content.IsAllowedPrivileged && Content.IsControllable && !(Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this 149 this.refreshAutomaticallyCheckBox.Enabled = Content.IsControllable && alreadyUploaded && jobsLoaded && Content.ExecutionState == ExecutionState.Started; 150 this.refreshButton.Enabled = Content.IsDownloadable && alreadyUploaded; 151 this.Locked = !Content.IsControllable || Content.ExecutionState == ExecutionState.Started; 152 152 } 153 153 SetEnabledStateOfExecutableButtons(); 154 tabControl_SelectedIndexChanged(this, EventArgs.Empty); // ensure sharing tabpage is disabled 154 155 } 155 156 … … 214 215 Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e); 215 216 else 216 executionTimeTextBox.Text = Content. HiveExperiment.ExecutionTime.ToString();217 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 217 218 } 218 219 private void Content_RefreshAutomaticallyChanged(object sender, EventArgs e) { … … 228 229 Invoke(new EventHandler(Content_HiveJobChanged), sender, e); 229 230 else { 230 if (Content != null && Content.Hive Experiment.HiveJobs != null) {231 jobsTreeView.Content = Content.Hive Experiment.HiveJobs;231 if (Content != null && Content.HiveJobs != null) { 232 jobsTreeView.Content = Content.HiveJobs; 232 233 RegisterHiveJobEvents(); 233 234 } else { … … 263 264 } 264 265 private void Content_ExceptionOccured(object sender, EventArgs<Exception> e) { 265 if (Content.IsControllable) { 266 // show error dialog only if Controllable (otherwise it should continue trying without an error dialog (e.g. HiveEngine)) 267 ErrorHandling.ShowErrorDialog(this, e.Value); 268 } 266 // don't show exception, it is logged anyway 269 267 } 270 268 private void Content_StateLogListChanged(object sender, EventArgs e) { … … 275 273 } 276 274 } 275 private void Content_IsAllowedPrivilegedChanged(object sender, EventArgs e) { 276 if (InvokeRequired) 277 Invoke(new EventHandler(Content_IsAllowedPrivilegedChanged), sender, e); 278 else { 279 SetEnabledStateOfControls(); 280 } 281 } 282 277 283 278 284 private void UpdateStateLogList() { 279 285 if (Content != null && this.Content.HiveExperiment != null) { 280 stateLogViewHost.Content = this.Content. HiveExperiment.StateLogList;286 stateLogViewHost.Content = this.Content.StateLogList; 281 287 } else { 282 288 stateLogViewHost.Content = null; … … 294 300 } 295 301 private void pauseButton_Click(object sender, EventArgs e) { 296 HiveClient.PauseExperiment(Content .HiveExperiment);302 HiveClient.PauseExperiment(Content); 297 303 } 298 304 private void stopButton_Click(object sender, EventArgs e) { 299 HiveClient.StopExperiment(Content .HiveExperiment);305 HiveClient.StopExperiment(Content); 300 306 } 301 307 private void resetButton_Click(object sender, EventArgs e) { } … … 320 326 321 327 private void refreshButton_Click(object sender, EventArgs e) { 322 var invoker = new Action< HiveExperiment>(HiveClient.LoadExperiment);323 invoker.BeginInvoke(Content .HiveExperiment, (ar) => {328 var invoker = new Action<RefreshableHiveExperiment>(HiveClient.LoadExperiment); 329 invoker.BeginInvoke(Content, (ar) => { 324 330 try { 325 331 invoker.EndInvoke(ar); … … 343 349 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false; 344 350 } else { 345 startButton.Enabled = Content.IsControllable && Content.Hive Experiment.HiveJobs != null && Content.HiveExperiment.HiveJobs.Count > 0 && Content.HiveExperiment.ExecutionState == ExecutionState.Prepared;346 pauseButton.Enabled = Content.IsControllable && Content. HiveExperiment.ExecutionState == ExecutionState.Started;347 stopButton.Enabled = Content.IsControllable && Content. HiveExperiment.ExecutionState == ExecutionState.Started;351 startButton.Enabled = Content.IsControllable && Content.HiveJobs != null && Content.HiveJobs.Count > 0 && Content.ExecutionState == ExecutionState.Prepared; 352 pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started; 353 stopButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started; 348 354 resetButton.Enabled = false; 349 355 } … … 356 362 Invoke(new EventHandler(Content_IsProgressingChanged), sender, e); 357 363 } else { 358 if (Content != null && Content. HiveExperiment.IsProgressing) {364 if (Content != null && Content.IsProgressing) { 359 365 SetProgressView(); 360 366 } else { … … 366 372 private void SetProgressView() { 367 373 if (progressView == null) { 368 progressView = new ProgressView(this, Content. HiveExperiment.Progress);369 } 370 progressView.Progress = Content. HiveExperiment.Progress;374 progressView = new ProgressView(this, Content.Progress); 375 } 376 progressView.Progress = Content.Progress; 371 377 } 372 378 … … 389 395 var obj = e.Data.GetData(Constants.DragDropDataFormat); 390 396 if (obj is IOptimizer) { 391 e.Effect = DragDropEffects.Copy; 397 if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key 398 else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy; 392 399 } 393 400 } … … 399 406 var optimizer = obj as IOptimizer; 400 407 if (optimizer != null) { 401 Content.Hive Experiment.HiveJobs.Add(new OptimizerHiveJob(optimizer));408 Content.HiveJobs.Add(new OptimizerHiveJob(e.Effect.HasFlag(DragDropEffects.Copy) ? (IOptimizer)optimizer.Clone() : optimizer)); 402 409 } 403 410 } 404 411 } 405 412 #endregion 413 414 private void tabControl_SelectedIndexChanged(object sender, EventArgs e) { 415 if (tabControl.SelectedTab == sharingTabPage) { 416 if (!Content.IsSharable) { 417 MessageBox.Show("Unable to load tab. You have insufficient access privileges."); 418 tabControl.SelectedTab = jobsTabPage; 419 } 420 } 421 } 406 422 } 407 423 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient/app.config
r6359 r6479 24 24 </service> 25 25 </services> 26 26 27 27 <client> 28 28 <endpoint name="SlaveCommunicationServiceEndpoint" address="net.pipe://localhost/HeuristicLabSlaveCom" binding="netNamedPipeBinding" contract="HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts.ISlaveCommunication"/> 29 <endpoint address="http:// services.heuristiclab.com/Hive-3.4/HiveService.svc"29 <endpoint address="http://localhost/Hive-3.4/HiveService.svc" 30 30 binding="wsHttpBinding" 31 31 bindingConfiguration="wsHttpBinding_Hive" 32 32 contract="HeuristicLab.Clients.Hive.IHiveService" 33 33 name="wsHttpBinding_IHiveService"> 34 <identity> 35 <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ==" /> 36 </identity> 34 <identity> 35 <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac=" /> 36 </identity> 37 37 38 </endpoint> 38 39 </client> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/ExperimentManagerTests.cs
r6452 r6479 45 45 var rhc = new RefreshableHiveExperiment(); 46 46 var optimizer = CreateOptimizer(); 47 rhc.Hive Experiment.HiveJobs.Add(new OptimizerHiveJob(optimizer));47 rhc.HiveJobs.Add(new OptimizerHiveJob(optimizer)); 48 48 49 49 HiveClient.StartExperiment((Exception ex) => TestContext.WriteLine(ex.ToString()), rhc, new CancellationToken()); 50 50 51 while (rhc. HiveExperiment.ExecutionState != Core.ExecutionState.Stopped) {51 while (rhc.ExecutionState != Core.ExecutionState.Stopped) { 52 52 Thread.Sleep(500); 53 53 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/HiveJobs/OptimizerHiveJobView.cs
r6381 r6479 49 49 } 50 50 #region Content Events 51 protected override void RegisterContentEvents() { 52 base.RegisterContentEvents(); 53 Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged); 54 } 55 56 protected override void DeregisterContentEvents() { 57 Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged); 58 base.DeregisterContentEvents(); 59 } 60 61 protected virtual void Content_IsControllableChanged(object sender, EventArgs e) { 62 SetEnabledStateOfControls(); 63 } 64 51 65 #endregion 52 66 … … 68 82 base.SetEnabledStateOfControls(); 69 83 70 this.restartButton.Enabled = Content != null && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Paused || Content.Job.State == JobState.Failed || Content.Job.State == JobState.Aborted);71 this.pauseButton.Enabled = Content != null && !Content.Job.Command.HasValue && Content.Job.State == JobState.Calculating;72 this.stopButton.Enabled = Content != null && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused);84 this.restartButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Paused || Content.Job.State == JobState.Failed || Content.Job.State == JobState.Aborted); 85 this.pauseButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && Content.Job.State == JobState.Calculating; 86 this.stopButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused); 73 87 } 74 88 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/TreeView/HiveJobItemTreeView.cs
r6382 r6479 24 24 using System.Windows.Forms; 25 25 using HeuristicLab.Clients.Hive.Jobs; 26 using HeuristicLab.Clients.Hive.Views.ExperimentManager.TreeView;27 26 using HeuristicLab.Core; 28 27 using HeuristicLab.MainForm; … … 98 97 experiment.Optimizers.Remove(((OptimizerJob)selectedItem.ItemJob).Item); 99 98 } 100 } 99 } 101 100 } 102 101 } … … 104 103 105 104 protected override ICollection<IItemTreeNodeAction<HiveJob>> GetTreeNodeItemActions(HiveJob selectedItem) { 106 var actions = base.GetTreeNodeItemActions(selectedItem); 107 if (selectedItem != null) { 108 if (selectedItem.ItemJob.Item is Experiment) { 109 110 } 111 actions.Add(new DeleteJobTreeNodeAction(Content)); 112 } 113 114 return actions; 105 return base.GetTreeNodeItemActions(selectedItem); 115 106 } 116 107 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs
r6463 r6479 66 66 set { alreadyUploadedPlugins = value; } 67 67 } 68 69 private bool isAllowedPrivileged; 70 public bool IsAllowedPrivileged { 71 get { return isAllowedPrivileged; } 72 set { isAllowedPrivileged = value; } 73 } 68 74 #endregion 69 75 … … 75 81 76 82 try { 83 this.IsAllowedPrivileged = ServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged()); 84 85 var oldExperiments = hiveExperiments ?? new ItemCollection<RefreshableHiveExperiment>(); 77 86 hiveExperiments = new HiveItemCollection<RefreshableHiveExperiment>(); 78 var he = ServiceLocator.Instance.CallHiveService<IEnumerable<HiveExperiment>>(s => s.GetHiveExperiments()); 79 hiveExperiments.AddRange(he.Select(x => new RefreshableHiveExperiment(x)).OrderBy(x => x.HiveExperiment.Name)); 87 var experimentsLoaded = ServiceLocator.Instance.CallHiveService<IEnumerable<HiveExperiment>>(s => s.GetHiveExperiments()); 88 89 foreach (var he in experimentsLoaded) { 90 var hiveExperiment = oldExperiments.SingleOrDefault(x => x.Id == he.Id); 91 if (hiveExperiment == null) { 92 // new 93 hiveExperiments.Add(new RefreshableHiveExperiment(he) { IsAllowedPrivileged = this.isAllowedPrivileged }); 94 } else { 95 // update 96 hiveExperiment.HiveExperiment = he; 97 hiveExperiment.IsAllowedPrivileged = this.isAllowedPrivileged; 98 hiveExperiments.Add(hiveExperiment); 99 } 100 } 101 // remove those which were not in the list of loaded hiveexperiments 102 foreach (var experiment in oldExperiments) { 103 if (experiment.Id == Guid.Empty) { 104 // experiment not uploaded... keep 105 hiveExperiments.Add(experiment); 106 } else { 107 experiment.RefreshAutomatically = false; // stop results polling 108 } 109 } 80 110 } 81 111 catch { … … 175 205 HiveClient.StoreAsync( 176 206 new Action<Exception>((Exception ex) => { 177 refreshableHiveExperiment. HiveExperiment.ExecutionState = ExecutionState.Prepared;207 refreshableHiveExperiment.ExecutionState = ExecutionState.Prepared; 178 208 exceptionCallback(ex); 179 209 }), refreshableHiveExperiment, cancellationToken); 180 refreshableHiveExperiment. HiveExperiment.ExecutionState = ExecutionState.Started;181 } 182 183 public static void PauseExperiment( HiveExperiment hiveExperiment) {210 refreshableHiveExperiment.ExecutionState = ExecutionState.Started; 211 } 212 213 public static void PauseExperiment(RefreshableHiveExperiment refreshableHiveExperiment) { 184 214 ServiceLocator.Instance.CallHiveService(service => { 185 foreach (HiveJob job in hiveExperiment.GetAllHiveJobs()) {215 foreach (HiveJob job in refreshableHiveExperiment.GetAllHiveJobs()) { 186 216 if (job.Job.State != JobState.Finished && job.Job.State != JobState.Aborted && job.Job.State != JobState.Failed) 187 217 service.PauseJob(job.Job.Id); 188 218 } 189 219 }); 190 hiveExperiment.ExecutionState = ExecutionState.Paused;191 } 192 193 public static void StopExperiment( HiveExperiment hiveExperiment) {220 refreshableHiveExperiment.ExecutionState = ExecutionState.Paused; 221 } 222 223 public static void StopExperiment(RefreshableHiveExperiment refreshableHiveExperiment) { 194 224 ServiceLocator.Instance.CallHiveService(service => { 195 foreach (HiveJob job in hiveExperiment.GetAllHiveJobs()) {225 foreach (HiveJob job in refreshableHiveExperiment.GetAllHiveJobs()) { 196 226 if (job.Job.State != JobState.Finished && job.Job.State != JobState.Aborted && job.Job.State != JobState.Failed) 197 227 service.StopJob(job.Job.Id); … … 207 237 private void UploadExperiment(RefreshableHiveExperiment refreshableHiveExperiment, CancellationToken cancellationToken) { 208 238 try { 209 refreshableHiveExperiment. HiveExperiment.Progress = new Progress("Connecting to server...");210 refreshableHiveExperiment. HiveExperiment.IsProgressing = true;239 refreshableHiveExperiment.Progress = new Progress("Connecting to server..."); 240 refreshableHiveExperiment.IsProgressing = true; 211 241 212 242 IEnumerable<string> resourceNames = ToResourceNameList(refreshableHiveExperiment.HiveExperiment.ResourceNames); … … 220 250 } 221 251 222 foreach (OptimizerHiveJob hiveJob in refreshableHiveExperiment.Hive Experiment.HiveJobs.OfType<OptimizerHiveJob>()) {252 foreach (OptimizerHiveJob hiveJob in refreshableHiveExperiment.HiveJobs.OfType<OptimizerHiveJob>()) { 223 253 hiveJob.SetIndexInParentOptimizerList(null); 224 254 } 225 255 226 256 // upload HiveExperiment 227 refreshableHiveExperiment. HiveExperiment.Progress.Status = "Uploading HiveExperiment...";257 refreshableHiveExperiment.Progress.Status = "Uploading HiveExperiment..."; 228 258 refreshableHiveExperiment.HiveExperiment.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddHiveExperiment(refreshableHiveExperiment.HiveExperiment)); 229 cancellationToken.ThrowIfCancellationRequested(); 230 231 int totalJobCount = refreshableHiveExperiment.HiveExperiment.GetAllHiveJobs().Count(); 259 refreshableHiveExperiment.HiveExperiment = ServiceLocator.Instance.CallHiveService((s) => s.GetHiveExperiment(refreshableHiveExperiment.HiveExperiment.Id)); // update owner and permissions 260 cancellationToken.ThrowIfCancellationRequested(); 261 262 int totalJobCount = refreshableHiveExperiment.GetAllHiveJobs().Count(); 232 263 int[] jobCount = new int[1]; // use a reference type (int-array) instead of value type (int) in order to pass the value via a delegate to task-parallel-library 233 264 cancellationToken.ThrowIfCancellationRequested(); 234 265 235 266 // upload plugins 236 refreshableHiveExperiment. HiveExperiment.Progress.Status = "Uploading plugins...";267 refreshableHiveExperiment.Progress.Status = "Uploading plugins..."; 237 268 this.OnlinePlugins = ServiceLocator.Instance.CallHiveService((s) => s.GetPlugins()); 238 269 this.AlreadyUploadedPlugins = new List<Plugin>(); … … 244 275 245 276 // upload jobs 246 refreshableHiveExperiment. HiveExperiment.Progress.Status = "Uploading jobs...";277 refreshableHiveExperiment.Progress.Status = "Uploading jobs..."; 247 278 248 279 var tasks = new List<Task>(); 249 foreach (HiveJob hiveJob in refreshableHiveExperiment.Hive Experiment.HiveJobs) {280 foreach (HiveJob hiveJob in refreshableHiveExperiment.HiveJobs) { 250 281 tasks.Add(Task.Factory.StartNew((hj) => { 251 UploadJobWithChildren(refreshableHiveExperiment. HiveExperiment.Progress, (HiveJob)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged, cancellationToken);282 UploadJobWithChildren(refreshableHiveExperiment.Progress, (HiveJob)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged, cancellationToken); 252 283 }, hiveJob) 253 284 .ContinueWith((x) => refreshableHiveExperiment.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted)); … … 259 290 if (!ae.InnerExceptions.All(e => e is TaskCanceledException)) throw ae; // for some reason the WaitAll throws a AggregateException containg a TaskCanceledException. i don't know where it comes from, however the tasks all finish properly, so for now just ignore it 260 291 } 292 refreshableHiveExperiment.HiveExperiment.Modified = false; 261 293 } 262 294 finally { 263 refreshableHiveExperiment. HiveExperiment.IsProgressing = false;295 refreshableHiveExperiment.IsProgressing = false; 264 296 } 265 297 } … … 364 396 } 365 397 finally { 366 if (!semaphoreReleased) jobUploadSemaphore.Release();398 if (!semaphoreReleased) jobUploadSemaphore.Release(); 367 399 } 368 400 } … … 370 402 371 403 #region Download Experiment 372 public static void LoadExperiment(HiveExperiment hiveExperiment) { 373 hiveExperiment.Progress = new Progress(); 404 public static void LoadExperiment(RefreshableHiveExperiment refreshableHiveExperiment) { 405 var hiveExperiment = refreshableHiveExperiment.HiveExperiment; 406 refreshableHiveExperiment.Progress = new Progress(); 407 374 408 try { 375 hiveExperiment.IsProgressing = true;409 refreshableHiveExperiment.IsProgressing = true; 376 410 int totalJobCount = 0; 377 411 IEnumerable<LightweightJob> allJobs; 378 412 379 hiveExperiment.Progress.Status = "Connecting to Server...";413 refreshableHiveExperiment.Progress.Status = "Connecting to Server..."; 380 414 // fetch all Job objects to create the full tree of tree of HiveJob objects 381 hiveExperiment.Progress.Status = "Downloading list of jobs...";415 refreshableHiveExperiment.Progress.Status = "Downloading list of jobs..."; 382 416 allJobs = ServiceLocator.Instance.CallHiveService(s => s.GetLightweightExperimentJobs(hiveExperiment.Id)); 383 417 totalJobCount = allJobs.Count(); … … 387 421 388 422 while (!downloader.IsFinished) { 389 hiveExperiment.Progress.ProgressValue = downloader.FinishedCount / (double)totalJobCount;390 hiveExperiment.Progress.Status = string.Format("Downloading/deserializing jobs... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount);423 refreshableHiveExperiment.Progress.ProgressValue = downloader.FinishedCount / (double)totalJobCount; 424 refreshableHiveExperiment.Progress.Status = string.Format("Downloading/deserializing jobs... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount); 391 425 Thread.Sleep(500); 392 426 … … 397 431 IDictionary<Guid, HiveJob> allHiveJobs = downloader.Results; 398 432 399 hiveExperiment.HiveJobs = new ItemCollection<HiveJob>(allHiveJobs.Values.Where(x => !x.Job.ParentJobId.HasValue));400 401 if ( hiveExperiment.IsFinished()) {402 hiveExperiment.ExecutionState = Core.ExecutionState.Stopped;433 refreshableHiveExperiment.HiveJobs = new ItemCollection<HiveJob>(allHiveJobs.Values.Where(x => !x.Job.ParentJobId.HasValue)); 434 435 if (refreshableHiveExperiment.IsFinished()) { 436 refreshableHiveExperiment.ExecutionState = Core.ExecutionState.Stopped; 403 437 } else { 404 hiveExperiment.ExecutionState = Core.ExecutionState.Started;438 refreshableHiveExperiment.ExecutionState = Core.ExecutionState.Started; 405 439 } 406 440 407 441 // build child-job tree 408 foreach (HiveJob hiveJob in hiveExperiment.HiveJobs) {442 foreach (HiveJob hiveJob in refreshableHiveExperiment.HiveJobs) { 409 443 BuildHiveJobTree(hiveJob, allJobs, allHiveJobs); 410 444 } 411 445 412 hiveExperiment.OnLoaded();446 refreshableHiveExperiment.OnLoaded(); 413 447 } 414 448 finally { 415 hiveExperiment.IsProgressing = false;449 refreshableHiveExperiment.IsProgressing = false; 416 450 } 417 451 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveJobs/HiveJob.cs
r6419 r6479 108 108 public bool IsDownloading { get; set; } 109 109 110 // if true, all control buttons should be enabled. otherwise disabled 111 private bool isControllable = true; 112 public bool IsControllable { 113 get { return isControllable; } 114 set { 115 if (value != isControllable) { 116 isControllable = value; 117 OnIsControllableChanged(); 118 childHiveJobsLock.EnterReadLock(); 119 try { 120 foreach (var hiveJob in childHiveJobs) { 121 hiveJob.IsControllable = value; 122 } 123 } 124 finally { 125 childHiveJobsLock.ExitReadLock(); 126 } 127 } 128 } 129 } 130 110 131 [Storable] 111 132 protected ItemList<HiveJob> childHiveJobs; … … 296 317 } 297 318 319 public event EventHandler IsControllableChanged; 320 private void OnIsControllableChanged() { 321 var handler = IsControllableChanged; 322 if (handler != null) handler(this, EventArgs.Empty); 323 } 324 298 325 private void RegisterJobEvents() { 299 326 if (job != null) … … 303 330 private void DeregisterJobEvents() { 304 331 if (job != null) 305 job.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(job_PropertyChanged);332 job.PropertyChanged += new PropertyChangedEventHandler(job_PropertyChanged); 306 333 } 307 334 … … 397 424 foreach (var item in e.Items) { 398 425 item.Value.StateLogChanged += new EventHandler(ChildHiveJob_StateLogChanged); 426 item.Value.IsControllable = this.IsControllable; 399 427 } 400 428 var handler = ItemsAdded; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/RefreshableHiveExperiment.cs
r6478 r6479 25 25 using System.Drawing; 26 26 using System.Linq; 27 using HeuristicLab.Collections; 27 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Core; 29 30 30 31 namespace HeuristicLab.Clients.Hive { 31 public class RefreshableHiveExperiment : IHiveItem, IDeepCloneable, IContent, IProgressReporter {32 public class RefreshableHiveExperiment : IHiveItem, IDeepCloneable, IContent, IProgressReporter, IComparable<RefreshableHiveExperiment> { 32 33 private JobResultPoller jobResultPoller; 33 34 private ConcurrentJobDownloader<ItemJob> jobDownloader; … … 44 45 if (hiveExperiment != null) DergisterHiveExperimentEvents(); 45 46 hiveExperiment = value; 46 if (hiveExperiment != null) RegisterHiveExperimentEvents(); 47 if (hiveExperiment != null) { 48 RegisterHiveExperimentEvents(); 49 hiveExperiment_PropertyChanged(hiveExperiment, new PropertyChangedEventArgs("Id")); 50 } 47 51 OnHiveExperimentChanged(); 52 OnToStringChanged(this, EventArgs.Empty); 53 } 54 } 55 } 56 57 private ItemCollection<HiveJob> hiveJobs; 58 public ItemCollection<HiveJob> HiveJobs { 59 get { return hiveJobs; } 60 set { 61 if (hiveJobs != value) { 62 if (hiveJobs != null) DeregisterHiveJobsEvents(); 63 hiveJobs = value; 64 if (hiveJobs != null) RegisterHiveJobsEvents(); 65 OnHiveJobsChanged(); 66 } 67 } 68 } 69 70 private ExecutionState executionState; 71 public ExecutionState ExecutionState { 72 get { return executionState; } 73 internal set { 74 if (executionState != value) { 75 executionState = value; 76 OnExecutionStateChanged(); 77 } 78 } 79 } 80 81 private TimeSpan executionTime; 82 public TimeSpan ExecutionTime { 83 get { return executionTime; } 84 internal set { 85 if (executionTime != value) { 86 executionTime = value; 87 OnExecutionTimeChanged(); 48 88 } 49 89 } … … 60 100 } 61 101 if (RefreshAutomatically) { 62 if ( hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) {102 if (this.HiveJobs != null && this.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) { 63 103 StartResultPolling(); 64 104 } … … 70 110 } 71 111 72 // if true, all control buttons should be enabled. otherwise disabled (used for HiveEngine) 112 // indicates if download button is enabled 113 private bool isDownloadable = true; 114 public bool IsDownloadable { 115 get { return isDownloadable; } 116 set { 117 if (value != isDownloadable) { 118 isDownloadable = value; 119 OnIsDownloadableChanged(); 120 } 121 } 122 } 123 124 // if true, all control buttons should be enabled. otherwise disabled 73 125 private bool isControllable = true; 74 126 public bool IsControllable { 75 127 get { return isControllable; } 76 set {128 private set { 77 129 if (value != isControllable) { 78 130 isControllable = value; 79 131 OnIsControllableChanged(); 80 } 81 } 132 if (this.hiveJobs != null) { 133 foreach (var hiveJob in this.hiveJobs) { 134 hiveJob.IsControllable = value; 135 } 136 } 137 } 138 } 139 } 140 141 // indicates if a user is allowed to share this experiment 142 private bool isSharable = true; 143 public bool IsSharable { 144 get { return isSharable; } 145 private set { 146 if (value != isSharable) { 147 isSharable = value; 148 OnIsSharableChanged(); 149 } 150 } 151 } 152 153 // may execute jobs with privileged permissions on slaves 154 private bool isAllowedPrivileged = true; 155 public bool IsAllowedPrivileged { 156 get { return isAllowedPrivileged; } 157 set { 158 if (value != isAllowedPrivileged) { 159 isAllowedPrivileged = value; 160 OnIsAllowedPrivilegedChanged(); 161 } 162 } 163 } 164 165 private bool isProgressing; 166 public bool IsProgressing { 167 get { return isProgressing; } 168 set { 169 if (isProgressing != value) { 170 isProgressing = value; 171 OnIsProgressingChanged(); 172 } 173 } 174 } 175 176 private IProgress progress; 177 public IProgress Progress { 178 get { return progress; } 179 set { this.progress = value; } 82 180 } 83 181 … … 85 183 public ILog Log { 86 184 get { return log; } 185 } 186 187 public StateLogListList StateLogList { 188 get { return new StateLogListList(this.GetAllHiveJobs().Select(x => x.StateLog)); } 87 189 } 88 190 … … 94 196 this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2); 95 197 this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured); 198 this.HiveJobs = new ItemCollection<HiveJob>(); 96 199 } 97 200 public RefreshableHiveExperiment(HiveExperiment hiveExperiment) { … … 101 204 this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2); 102 205 this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured); 206 this.HiveJobs = new ItemCollection<HiveJob>(); 103 207 } 104 208 protected RefreshableHiveExperiment(RefreshableHiveExperiment original, Cloner cloner) { … … 110 214 this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2); 111 215 this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured); 216 this.HiveJobs = cloner.Clone(original.HiveJobs); 217 this.ExecutionTime = original.ExecutionTime; 218 this.ExecutionState = original.ExecutionState; 112 219 } 113 220 public IDeepCloneable Clone(Cloner cloner) { … … 118 225 } 119 226 #endregion 120 121 private void hiveExperiment_HiveJobsChanged(object sender, EventArgs e) { 122 if (jobResultPoller != null && jobResultPoller.IsPolling) { 123 jobResultPoller.Stop(); 124 DeregisterResultPollingEvents(); 125 } 126 if (hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && hiveExperiment.GetAllHiveJobs().All(x => x.Job.Id != Guid.Empty)) { 127 if (this.RefreshAutomatically) 128 StartResultPolling(); 129 } 130 } 131 227 132 228 #region JobResultPoller Events 133 229 … … 212 308 GC.Collect(); // force GC, because .NET is too lazy here (deserialization takes a lot of memory) 213 309 if (AllJobsFinished()) { 214 hiveExperiment.ExecutionState = Core.ExecutionState.Stopped;310 this.ExecutionState = Core.ExecutionState.Stopped; 215 311 StopResultPolling(); 216 312 } … … 221 317 222 318 public HiveJob GetHiveJobById(Guid jobId) { 223 foreach (HiveJob job in hiveExperiment.HiveJobs) {319 foreach (HiveJob job in this.HiveJobs) { 224 320 var hj = job.GetHiveJobByJobId(jobId); 225 321 if (hj != null) … … 229 325 } 230 326 private void UpdateStatistics() { 231 var jobs = hiveExperiment.GetAllHiveJobs();327 var jobs = this.GetAllHiveJobs(); 232 328 hiveExperiment.JobCount = jobs.Count(); 233 329 hiveExperiment.CalculatingCount = jobs.Count(j => j.Job.State == JobState.Calculating); … … 237 333 238 334 public bool AllJobsFinished() { 239 return hiveExperiment.GetAllHiveJobs().All(j => (j.Job.State == JobState.Finished335 return this.GetAllHiveJobs().All(j => (j.Job.State == JobState.Finished 240 336 || j.Job.State == JobState.Aborted 241 337 || j.Job.State == JobState.Failed) … … 250 346 } 251 347 public void UpdateTotalExecutionTime() { 252 hiveExperiment.ExecutionTime = TimeSpan.FromMilliseconds(hiveExperiment.GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.TotalMilliseconds));348 this.ExecutionTime = TimeSpan.FromMilliseconds(this.GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.TotalMilliseconds)); 253 349 } 254 350 #endregion … … 256 352 #region HiveExperiment Events 257 353 private void RegisterHiveExperimentEvents() { 258 hiveExperiment.HiveJobsChanged += new EventHandler(hiveExperiment_HiveJobsChanged); 259 hiveExperiment.ToStringChanged += new EventHandler(hiveExperiment_ToStringChanged); 354 hiveExperiment.ToStringChanged += new EventHandler(OnToStringChanged); 260 355 hiveExperiment.PropertyChanged += new PropertyChangedEventHandler(hiveExperiment_PropertyChanged); 261 356 hiveExperiment.ItemImageChanged += new EventHandler(hiveExperiment_ItemImageChanged); 262 357 hiveExperiment.ModifiedChanged += new EventHandler(hiveExperiment_ModifiedChanged); 263 hiveExperiment.IsProgressingChanged += new EventHandler(hiveExperiment_IsProgressingChanged);264 hiveExperiment.Loaded += new EventHandler(hiveExperiment_Loaded);265 358 } 266 359 267 360 private void DergisterHiveExperimentEvents() { 268 hiveExperiment.HiveJobsChanged -= new EventHandler(hiveExperiment_HiveJobsChanged); 269 hiveExperiment.ToStringChanged -= new EventHandler(hiveExperiment_ToStringChanged); 361 hiveExperiment.ToStringChanged -= new EventHandler(OnToStringChanged); 270 362 hiveExperiment.PropertyChanged -= new PropertyChangedEventHandler(hiveExperiment_PropertyChanged); 271 363 hiveExperiment.ItemImageChanged -= new EventHandler(hiveExperiment_ItemImageChanged); 272 364 hiveExperiment.ModifiedChanged -= new EventHandler(hiveExperiment_ModifiedChanged); 273 hiveExperiment.IsProgressingChanged -= new EventHandler(hiveExperiment_IsProgressingChanged);274 hiveExperiment.Loaded -= new EventHandler(hiveExperiment_Loaded);275 }276 277 private void hiveExperiment_Loaded(object sender, EventArgs e) {278 this.UpdateTotalExecutionTime();279 280 if (hiveExperiment.ExecutionState != ExecutionState.Stopped) {281 this.RefreshAutomatically = true;282 }283 365 } 284 366 #endregion … … 311 393 public event PropertyChangedEventHandler PropertyChanged; 312 394 private void hiveExperiment_PropertyChanged(object sender, PropertyChangedEventArgs e) { 395 this.IsSharable = hiveExperiment.Permission == Permission.Full; 396 this.IsControllable = hiveExperiment.Permission == Permission.Full; 397 313 398 var handler = PropertyChanged; 314 399 if (handler != null) handler(sender, e); … … 316 401 317 402 public event EventHandler ToStringChanged; 318 private void hiveExperiment_ToStringChanged(object sender, EventArgs e) {403 private void OnToStringChanged(object sender, EventArgs e) { 319 404 var handler = ToStringChanged; 320 405 if (handler != null) handler(this, e); … … 322 407 323 408 public event EventHandler IsProgressingChanged; 324 pr ivate void hiveExperiment_IsProgressingChanged(object sender, EventArgs e) {409 protected virtual void OnIsProgressingChanged() { 325 410 var handler = IsProgressingChanged; 326 if (handler != null) handler(sender, e); 411 if (handler != null) handler(this, EventArgs.Empty); 412 } 413 414 public event EventHandler IsDownloadableChanged; 415 private void OnIsDownloadableChanged() { 416 var handler = IsDownloadableChanged; 417 if (handler != null) handler(this, EventArgs.Empty); 327 418 } 328 419 … … 330 421 private void OnIsControllableChanged() { 331 422 var handler = IsControllableChanged; 423 if (handler != null) handler(this, EventArgs.Empty); 424 } 425 426 public event EventHandler IsSharableChanged; 427 private void OnIsSharableChanged() { 428 var handler = IsSharableChanged; 429 if (handler != null) handler(this, EventArgs.Empty); 430 } 431 432 public event EventHandler IsAllowedPrivilegedChanged; 433 private void OnIsAllowedPrivilegedChanged() { 434 var handler = IsAllowedPrivilegedChanged; 332 435 if (handler != null) handler(this, EventArgs.Empty); 333 436 } … … 351 454 if (handler != null) handler(this, EventArgs.Empty); 352 455 } 456 457 public event EventHandler ExecutionTimeChanged; 458 protected virtual void OnExecutionTimeChanged() { 459 var handler = ExecutionTimeChanged; 460 if (handler != null) handler(this, EventArgs.Empty); 461 } 462 463 public event EventHandler ExecutionStateChanged; 464 protected virtual void OnExecutionStateChanged() { 465 var handler = ExecutionStateChanged; 466 if (handler != null) handler(this, EventArgs.Empty); 467 } 353 468 #endregion 469 470 #region HiveJobs Events 471 private void RegisterHiveJobsEvents() { 472 this.hiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded); 473 this.hiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved); 474 this.hiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset); 475 } 476 477 private void DeregisterHiveJobsEvents() { 478 this.hiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded); 479 this.hiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved); 480 this.hiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset); 481 } 482 483 private void hiveJobs_CollectionReset(object sender, CollectionItemsChangedEventArgs<HiveJob> e) { 484 foreach (var item in e.Items) { 485 item.StateLogChanged -= new EventHandler(item_StateLogChanged); 486 } 487 OnHiveJobsReset(e); 488 } 489 490 private void hiveJobs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<HiveJob> e) { 491 foreach (var item in e.Items) { 492 item.StateLogChanged -= new EventHandler(item_StateLogChanged); 493 } 494 OnHiveJobsRemoved(e); 495 } 496 497 private void hiveJobs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<HiveJob> e) { 498 foreach (var item in e.Items) { 499 item.StateLogChanged += new EventHandler(item_StateLogChanged); 500 item.IsControllable = this.IsControllable; 501 } 502 OnHiveJobsAdded(e); 503 } 504 505 private void item_StateLogChanged(object sender, EventArgs e) { 506 OnStateLogListChanged(); 507 } 508 #endregion 509 510 public event EventHandler HiveJobsChanged; 511 protected virtual void OnHiveJobsChanged() { 512 if (jobResultPoller != null && jobResultPoller.IsPolling) { 513 jobResultPoller.Stop(); 514 DeregisterResultPollingEvents(); 515 } 516 if (this.HiveJobs != null && this.HiveJobs.Count > 0 && this.GetAllHiveJobs().All(x => x.Job.Id != Guid.Empty)) { 517 if (this.RefreshAutomatically) 518 StartResultPolling(); 519 } 520 521 var handler = HiveJobsChanged; 522 if (handler != null) handler(this, EventArgs.Empty); 523 } 524 525 public event EventHandler Loaded; 526 public virtual void OnLoaded() { 527 this.UpdateTotalExecutionTime(); 528 529 if (this.ExecutionState != ExecutionState.Stopped) { 530 this.RefreshAutomatically = true; 531 } 532 533 var handler = Loaded; 534 if (handler != null) handler(this, EventArgs.Empty); 535 } 536 537 public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsAdded; 538 private void OnHiveJobsAdded(CollectionItemsChangedEventArgs<HiveJob> e) { 539 var handler = HiveJobsAdded; 540 if (handler != null) handler(this, e); 541 } 542 543 public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsRemoved; 544 private void OnHiveJobsRemoved(CollectionItemsChangedEventArgs<HiveJob> e) { 545 var handler = HiveJobsRemoved; 546 if (handler != null) handler(this, e); 547 } 548 549 public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsReset; 550 private void OnHiveJobsReset(CollectionItemsChangedEventArgs<HiveJob> e) { 551 var handler = HiveJobsReset; 552 if (handler != null) handler(this, e); 553 } 354 554 355 555 public Guid Id { … … 375 575 get { return hiveExperiment.ItemVersion; } 376 576 } 377 378 #region IProgressReporter Members379 public IProgress Progress {380 get { return HiveExperiment.Progress; }381 }382 383 public bool IsProgressing {384 get { return HiveExperiment.IsProgressing; }385 }386 #endregion387 577 388 578 public override string ToString() { 389 579 return string.Format("{0} {1}", HiveExperiment.DateCreated.ToString("MM.dd.yyyy HH:mm"), HiveExperiment.ToString()); 390 580 } 581 582 public bool IsFinished() { 583 return HiveJobs != null 584 && HiveJobs.All(x => x.Job.DateFinished.HasValue && x.Job.DateCreated.HasValue); 585 } 586 587 public IEnumerable<HiveJob> GetAllHiveJobs() { 588 if (hiveJobs == null) return Enumerable.Empty<HiveJob>(); 589 590 var jobs = new List<HiveJob>(); 591 foreach (HiveJob job in HiveJobs) { 592 jobs.AddRange(job.GetAllHiveJobs()); 593 } 594 return jobs; 595 } 596 597 public int CompareTo(RefreshableHiveExperiment other) { 598 return this.ToString().CompareTo(other.ToString()); 599 } 391 600 } 392 601 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs
r6426 r6479 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.ComponentModel; 25 using System.Linq;26 using HeuristicLab.Collections;27 24 using HeuristicLab.Common; 28 using HeuristicLab.Core;29 25 30 26 namespace HeuristicLab.Clients.Hive { 31 public partial class HiveExperiment : IDeepCloneable, IContent , IProgressReporter{27 public partial class HiveExperiment : IDeepCloneable, IContent { 32 28 33 29 private bool isPrivileged; … … 37 33 } 38 34 39 private ExecutionState executionState;40 public ExecutionState ExecutionState {41 get { return executionState; }42 internal set {43 if (executionState != value) {44 executionState = value;45 OnExecutionStateChanged();46 }47 }48 }49 50 private TimeSpan executionTime;51 public TimeSpan ExecutionTime {52 get { return executionTime; }53 internal set {54 if (executionTime != value) {55 executionTime = value;56 OnExecutionTimeChanged();57 }58 }59 }60 61 private ItemCollection<HiveJob> hiveJobs;62 public ItemCollection<HiveJob> HiveJobs {63 get { return hiveJobs; }64 set {65 if (hiveJobs != value) {66 if (hiveJobs != null) DeregisterHiveJobsEvents();67 hiveJobs = value;68 if (hiveJobs != null) RegisterHiveJobsEvents();69 OnHiveJobsChanged();70 }71 }72 }73 74 private bool isProgressing;75 public bool IsProgressing {76 get { return isProgressing; }77 set {78 if (isProgressing != value) {79 isProgressing = value;80 OnIsProgressingChanged();81 }82 }83 }84 85 private IProgress progress;86 public IProgress Progress {87 get { return progress; }88 set { this.progress = value; }89 }90 91 public StateLogListList StateLogList {92 get { return new StateLogListList(this.GetAllHiveJobs().Select(x => x.StateLog)); }93 }94 95 35 #region Constructors and Cloning 96 36 public HiveExperiment() { 97 37 this.ResourceNames = "HEAL"; 98 this.HiveJobs = new ItemCollection<HiveJob>();99 38 this.DateCreated = DateTime.Now; 39 this.Permission = Permission.Full; 100 40 } 101 41 … … 109 49 this.Description = original.Description; 110 50 this.Id = original.Id; 111 this.HiveJobs = cloner.Clone(original.HiveJobs);112 this.ExecutionTime = original.ExecutionTime;113 51 this.IsPrivileged = original.IsPrivileged; 52 this.Permission = original.Permission; 114 53 } 115 54 public override IDeepCloneable Clone(Cloner cloner) { … … 119 58 120 59 #region Events 121 public event EventHandler ExecutionTimeChanged;122 protected virtual void OnExecutionTimeChanged() {123 var handler = ExecutionTimeChanged;124 if (handler != null) handler(this, EventArgs.Empty);125 }126 127 public event EventHandler ExecutionStateChanged;128 protected virtual void OnExecutionStateChanged() {129 var handler = ExecutionStateChanged;130 if (handler != null) handler(this, EventArgs.Empty);131 }132 133 public event EventHandler HiveJobsChanged;134 protected virtual void OnHiveJobsChanged() {135 var handler = HiveJobsChanged;136 if (handler != null) handler(this, EventArgs.Empty);137 }138 139 public event EventHandler IsProgressingChanged;140 protected virtual void OnIsProgressingChanged() {141 var handler = IsProgressingChanged;142 if (handler != null) handler(this, EventArgs.Empty);143 }144 145 public event EventHandler Loaded;146 public virtual void OnLoaded() {147 var handler = Loaded;148 if (handler != null) handler(this, EventArgs.Empty);149 }150 151 public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsAdded;152 private void OnHiveJobsAdded(CollectionItemsChangedEventArgs<HiveJob> e) {153 var handler = HiveJobsAdded;154 if (handler != null) handler(this, e);155 }156 157 public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsRemoved;158 private void OnHiveJobsRemoved(CollectionItemsChangedEventArgs<HiveJob> e) {159 var handler = HiveJobsRemoved;160 if (handler != null) handler(this, e);161 }162 163 public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsReset;164 private void OnHiveJobsReset(CollectionItemsChangedEventArgs<HiveJob> e) {165 var handler = HiveJobsReset;166 if (handler != null) handler(this, e);167 }168 169 60 public event EventHandler StateLogListChanged; 170 61 private void OnStateLogListChanged() { 171 62 var handler = StateLogListChanged; 172 63 if (handler != null) handler(this, EventArgs.Empty); 173 }174 #endregion175 176 #region HiveJobs Events177 private void RegisterHiveJobsEvents() {178 this.hiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded);179 this.hiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved);180 this.hiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset);181 }182 183 private void DeregisterHiveJobsEvents() {184 this.hiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded);185 this.hiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved);186 this.hiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset);187 }188 189 private void hiveJobs_CollectionReset(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {190 foreach (var item in e.Items) {191 item.StateLogChanged -= new EventHandler(item_StateLogChanged);192 }193 OnHiveJobsReset(e);194 }195 196 private void hiveJobs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {197 foreach (var item in e.Items) {198 item.StateLogChanged -= new EventHandler(item_StateLogChanged);199 }200 OnHiveJobsRemoved(e);201 }202 203 private void hiveJobs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {204 foreach (var item in e.Items) {205 item.StateLogChanged += new EventHandler(item_StateLogChanged);206 }207 OnHiveJobsAdded(e);208 }209 210 private void item_StateLogChanged(object sender, EventArgs e) {211 OnStateLogListChanged();212 64 } 213 65 #endregion … … 229 81 } 230 82 231 public bool IsFinished() {232 return HiveJobs != null233 && HiveJobs.All(x => x.Job.DateFinished.HasValue && x.Job.DateCreated.HasValue);234 }235 236 public IEnumerable<HiveJob> GetAllHiveJobs() {237 if (hiveJobs == null) return Enumerable.Empty<HiveJob>();238 239 var jobs = new List<HiveJob>();240 foreach (HiveJob job in HiveJobs) {241 jobs.AddRange(job.GetAllHiveJobs());242 }243 return jobs;244 }245 246 83 public override string ToString() { 247 84 return Name; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperimentPermission.cs
r6465 r6479 28 28 private string grantedUserName; 29 29 public string GrantedUserName { 30 get { return this.grantedUserName; } 31 set { 32 this.grantedUserName = value; 33 this.OnPropertyChanged(new PropertyChangedEventArgs("GrantedUserName")); 30 get { return grantedUserName; } 31 set { 32 if (value != grantedUserName) { 33 grantedUserName = value; 34 RaisePropertyChanged("GrantedUserName"); 35 } 34 36 } 35 37 } … … 37 39 #region Constructors and Cloning 38 40 public HiveExperimentPermission() { 39 this.Permission = Hive.Permission.Read;41 this.Permission = Permission.Read; 40 42 this.PropertyChanged += new PropertyChangedEventHandler(HiveExperimentPermission_PropertyChanged); 41 43 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveItem.cs
r6444 r6479 50 50 public bool Modified { 51 51 get { return modified; } 52 privateset {52 internal set { 53 53 if (value != modified) { 54 54 modified = value; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs
r6465 r6479 14 14 [System.Diagnostics.DebuggerStepThroughAttribute()] 15 15 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 16 [System.Runtime.Serialization.DataContractAttribute(Name="Job", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +17 "nsfer")]18 [System.SerializableAttribute()]19 public partial class Job : HeuristicLab.Clients.Hive.LightweightJob20 {21 22 [System.Runtime.Serialization.OptionalFieldAttribute()]23 private int CoresNeededField;24 25 [System.Runtime.Serialization.OptionalFieldAttribute()]26 private bool FinishWhenChildJobsFinishedField;27 28 [System.Runtime.Serialization.OptionalFieldAttribute()]29 private System.Guid HiveExperimentIdField;30 31 [System.Runtime.Serialization.OptionalFieldAttribute()]32 private bool IsParentJobField;33 34 [System.Runtime.Serialization.OptionalFieldAttribute()]35 private bool IsPrivilegedField;36 37 [System.Runtime.Serialization.OptionalFieldAttribute()]38 private System.Nullable<System.DateTime> LastHeartbeatField;39 40 [System.Runtime.Serialization.OptionalFieldAttribute()]41 private int MemoryNeededField;42 43 [System.Runtime.Serialization.OptionalFieldAttribute()]44 private System.Collections.Generic.List<System.Guid> PluginsNeededIdsField;45 46 [System.Runtime.Serialization.OptionalFieldAttribute()]47 private int PriorityField;48 49 [System.Runtime.Serialization.DataMemberAttribute()]50 public int CoresNeeded51 {52 get53 {54 return this.CoresNeededField;55 }56 set57 {58 if ((this.CoresNeededField.Equals(value) != true))59 {60 this.CoresNeededField = value;61 this.RaisePropertyChanged("CoresNeeded");62 }63 }64 }65 66 [System.Runtime.Serialization.DataMemberAttribute()]67 public bool FinishWhenChildJobsFinished68 {69 get70 {71 return this.FinishWhenChildJobsFinishedField;72 }73 set74 {75 if ((this.FinishWhenChildJobsFinishedField.Equals(value) != true))76 {77 this.FinishWhenChildJobsFinishedField = value;78 this.RaisePropertyChanged("FinishWhenChildJobsFinished");79 }80 }81 }82 83 [System.Runtime.Serialization.DataMemberAttribute()]84 public System.Guid HiveExperimentId85 {86 get87 {88 return this.HiveExperimentIdField;89 }90 set91 {92 if ((this.HiveExperimentIdField.Equals(value) != true))93 {94 this.HiveExperimentIdField = value;95 this.RaisePropertyChanged("HiveExperimentId");96 }97 }98 }99 100 [System.Runtime.Serialization.DataMemberAttribute()]101 public bool IsParentJob102 {103 get104 {105 return this.IsParentJobField;106 }107 set108 {109 if ((this.IsParentJobField.Equals(value) != true))110 {111 this.IsParentJobField = value;112 this.RaisePropertyChanged("IsParentJob");113 }114 }115 }116 117 [System.Runtime.Serialization.DataMemberAttribute()]118 public bool IsPrivileged119 {120 get121 {122 return this.IsPrivilegedField;123 }124 set125 {126 if ((this.IsPrivilegedField.Equals(value) != true))127 {128 this.IsPrivilegedField = value;129 this.RaisePropertyChanged("IsPrivileged");130 }131 }132 }133 134 [System.Runtime.Serialization.DataMemberAttribute()]135 public System.Nullable<System.DateTime> LastHeartbeat136 {137 get138 {139 return this.LastHeartbeatField;140 }141 set142 {143 if ((this.LastHeartbeatField.Equals(value) != true))144 {145 this.LastHeartbeatField = value;146 this.RaisePropertyChanged("LastHeartbeat");147 }148 }149 }150 151 [System.Runtime.Serialization.DataMemberAttribute()]152 public int MemoryNeeded153 {154 get155 {156 return this.MemoryNeededField;157 }158 set159 {160 if ((this.MemoryNeededField.Equals(value) != true))161 {162 this.MemoryNeededField = value;163 this.RaisePropertyChanged("MemoryNeeded");164 }165 }166 }167 168 [System.Runtime.Serialization.DataMemberAttribute()]169 public System.Collections.Generic.List<System.Guid> PluginsNeededIds170 {171 get172 {173 return this.PluginsNeededIdsField;174 }175 set176 {177 if ((object.ReferenceEquals(this.PluginsNeededIdsField, value) != true))178 {179 this.PluginsNeededIdsField = value;180 this.RaisePropertyChanged("PluginsNeededIds");181 }182 }183 }184 185 [System.Runtime.Serialization.DataMemberAttribute()]186 public int Priority187 {188 get189 {190 return this.PriorityField;191 }192 set193 {194 if ((this.PriorityField.Equals(value) != true))195 {196 this.PriorityField = value;197 this.RaisePropertyChanged("Priority");198 }199 }200 }201 }202 203 [System.Diagnostics.DebuggerStepThroughAttribute()]204 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]205 16 [System.Runtime.Serialization.DataContractAttribute(Name="HiveItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 206 17 "nsfer")] 207 18 [System.SerializableAttribute()] 19 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.LightweightJob))] 208 20 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.StateLog))] 21 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))] 209 22 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Downtime))] 23 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperimentPermission))] 24 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))] 210 25 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.NamedHiveItem))] 211 26 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperiment))] 27 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))] 212 28 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Resource))] 213 29 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Slave))] 214 30 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.SlaveGroup))] 215 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))]216 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperimentPermission))]217 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))]218 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.LightweightJob))]219 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))]220 31 public partial class HiveItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged 221 32 { … … 270 81 [System.Diagnostics.DebuggerStepThroughAttribute()] 271 82 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 83 [System.Runtime.Serialization.DataContractAttribute(Name="LightweightJob", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 84 "nsfer")] 85 [System.SerializableAttribute()] 86 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))] 87 public partial class LightweightJob : HeuristicLab.Clients.Hive.HiveItem 88 { 89 90 [System.Runtime.Serialization.OptionalFieldAttribute()] 91 private System.Nullable<HeuristicLab.Clients.Hive.Command> CommandField; 92 93 [System.Runtime.Serialization.OptionalFieldAttribute()] 94 private System.TimeSpan ExecutionTimeField; 95 96 [System.Runtime.Serialization.OptionalFieldAttribute()] 97 private System.DateTime LastJobDataUpdateField; 98 99 [System.Runtime.Serialization.OptionalFieldAttribute()] 100 private System.Nullable<System.Guid> ParentJobIdField; 101 102 [System.Runtime.Serialization.OptionalFieldAttribute()] 103 private HeuristicLab.Clients.Hive.JobState StateField; 104 105 [System.Runtime.Serialization.OptionalFieldAttribute()] 106 private System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLogField; 107 108 [System.Runtime.Serialization.DataMemberAttribute()] 109 public System.Nullable<HeuristicLab.Clients.Hive.Command> Command 110 { 111 get 112 { 113 return this.CommandField; 114 } 115 set 116 { 117 if ((this.CommandField.Equals(value) != true)) 118 { 119 this.CommandField = value; 120 this.RaisePropertyChanged("Command"); 121 } 122 } 123 } 124 125 [System.Runtime.Serialization.DataMemberAttribute()] 126 public System.TimeSpan ExecutionTime 127 { 128 get 129 { 130 return this.ExecutionTimeField; 131 } 132 set 133 { 134 if ((this.ExecutionTimeField.Equals(value) != true)) 135 { 136 this.ExecutionTimeField = value; 137 this.RaisePropertyChanged("ExecutionTime"); 138 } 139 } 140 } 141 142 [System.Runtime.Serialization.DataMemberAttribute()] 143 public System.DateTime LastJobDataUpdate 144 { 145 get 146 { 147 return this.LastJobDataUpdateField; 148 } 149 set 150 { 151 if ((this.LastJobDataUpdateField.Equals(value) != true)) 152 { 153 this.LastJobDataUpdateField = value; 154 this.RaisePropertyChanged("LastJobDataUpdate"); 155 } 156 } 157 } 158 159 [System.Runtime.Serialization.DataMemberAttribute()] 160 public System.Nullable<System.Guid> ParentJobId 161 { 162 get 163 { 164 return this.ParentJobIdField; 165 } 166 set 167 { 168 if ((this.ParentJobIdField.Equals(value) != true)) 169 { 170 this.ParentJobIdField = value; 171 this.RaisePropertyChanged("ParentJobId"); 172 } 173 } 174 } 175 176 [System.Runtime.Serialization.DataMemberAttribute()] 177 public HeuristicLab.Clients.Hive.JobState State 178 { 179 get 180 { 181 return this.StateField; 182 } 183 set 184 { 185 if ((this.StateField.Equals(value) != true)) 186 { 187 this.StateField = value; 188 this.RaisePropertyChanged("State"); 189 } 190 } 191 } 192 193 [System.Runtime.Serialization.DataMemberAttribute()] 194 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLog 195 { 196 get 197 { 198 return this.StateLogField; 199 } 200 set 201 { 202 if ((object.ReferenceEquals(this.StateLogField, value) != true)) 203 { 204 this.StateLogField = value; 205 this.RaisePropertyChanged("StateLog"); 206 } 207 } 208 } 209 } 210 211 [System.Diagnostics.DebuggerStepThroughAttribute()] 212 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 272 213 [System.Runtime.Serialization.DataContractAttribute(Name="StateLog", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 273 214 "nsfer")] … … 392 333 this.UserIdField = value; 393 334 this.RaisePropertyChanged("UserId"); 335 } 336 } 337 } 338 } 339 340 [System.Diagnostics.DebuggerStepThroughAttribute()] 341 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 342 [System.Runtime.Serialization.DataContractAttribute(Name="Job", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 343 "nsfer")] 344 [System.SerializableAttribute()] 345 public partial class Job : HeuristicLab.Clients.Hive.LightweightJob 346 { 347 348 [System.Runtime.Serialization.OptionalFieldAttribute()] 349 private int CoresNeededField; 350 351 [System.Runtime.Serialization.OptionalFieldAttribute()] 352 private bool FinishWhenChildJobsFinishedField; 353 354 [System.Runtime.Serialization.OptionalFieldAttribute()] 355 private System.Guid HiveExperimentIdField; 356 357 [System.Runtime.Serialization.OptionalFieldAttribute()] 358 private bool IsParentJobField; 359 360 [System.Runtime.Serialization.OptionalFieldAttribute()] 361 private bool IsPrivilegedField; 362 363 [System.Runtime.Serialization.OptionalFieldAttribute()] 364 private System.Nullable<System.DateTime> LastHeartbeatField; 365 366 [System.Runtime.Serialization.OptionalFieldAttribute()] 367 private int MemoryNeededField; 368 369 [System.Runtime.Serialization.OptionalFieldAttribute()] 370 private System.Collections.Generic.List<System.Guid> PluginsNeededIdsField; 371 372 [System.Runtime.Serialization.OptionalFieldAttribute()] 373 private int PriorityField; 374 375 [System.Runtime.Serialization.DataMemberAttribute()] 376 public int CoresNeeded 377 { 378 get 379 { 380 return this.CoresNeededField; 381 } 382 set 383 { 384 if ((this.CoresNeededField.Equals(value) != true)) 385 { 386 this.CoresNeededField = value; 387 this.RaisePropertyChanged("CoresNeeded"); 388 } 389 } 390 } 391 392 [System.Runtime.Serialization.DataMemberAttribute()] 393 public bool FinishWhenChildJobsFinished 394 { 395 get 396 { 397 return this.FinishWhenChildJobsFinishedField; 398 } 399 set 400 { 401 if ((this.FinishWhenChildJobsFinishedField.Equals(value) != true)) 402 { 403 this.FinishWhenChildJobsFinishedField = value; 404 this.RaisePropertyChanged("FinishWhenChildJobsFinished"); 405 } 406 } 407 } 408 409 [System.Runtime.Serialization.DataMemberAttribute()] 410 public System.Guid HiveExperimentId 411 { 412 get 413 { 414 return this.HiveExperimentIdField; 415 } 416 set 417 { 418 if ((this.HiveExperimentIdField.Equals(value) != true)) 419 { 420 this.HiveExperimentIdField = value; 421 this.RaisePropertyChanged("HiveExperimentId"); 422 } 423 } 424 } 425 426 [System.Runtime.Serialization.DataMemberAttribute()] 427 public bool IsParentJob 428 { 429 get 430 { 431 return this.IsParentJobField; 432 } 433 set 434 { 435 if ((this.IsParentJobField.Equals(value) != true)) 436 { 437 this.IsParentJobField = value; 438 this.RaisePropertyChanged("IsParentJob"); 439 } 440 } 441 } 442 443 [System.Runtime.Serialization.DataMemberAttribute()] 444 public bool IsPrivileged 445 { 446 get 447 { 448 return this.IsPrivilegedField; 449 } 450 set 451 { 452 if ((this.IsPrivilegedField.Equals(value) != true)) 453 { 454 this.IsPrivilegedField = value; 455 this.RaisePropertyChanged("IsPrivileged"); 456 } 457 } 458 } 459 460 [System.Runtime.Serialization.DataMemberAttribute()] 461 public System.Nullable<System.DateTime> LastHeartbeat 462 { 463 get 464 { 465 return this.LastHeartbeatField; 466 } 467 set 468 { 469 if ((this.LastHeartbeatField.Equals(value) != true)) 470 { 471 this.LastHeartbeatField = value; 472 this.RaisePropertyChanged("LastHeartbeat"); 473 } 474 } 475 } 476 477 [System.Runtime.Serialization.DataMemberAttribute()] 478 public int MemoryNeeded 479 { 480 get 481 { 482 return this.MemoryNeededField; 483 } 484 set 485 { 486 if ((this.MemoryNeededField.Equals(value) != true)) 487 { 488 this.MemoryNeededField = value; 489 this.RaisePropertyChanged("MemoryNeeded"); 490 } 491 } 492 } 493 494 [System.Runtime.Serialization.DataMemberAttribute()] 495 public System.Collections.Generic.List<System.Guid> PluginsNeededIds 496 { 497 get 498 { 499 return this.PluginsNeededIdsField; 500 } 501 set 502 { 503 if ((object.ReferenceEquals(this.PluginsNeededIdsField, value) != true)) 504 { 505 this.PluginsNeededIdsField = value; 506 this.RaisePropertyChanged("PluginsNeededIds"); 507 } 508 } 509 } 510 511 [System.Runtime.Serialization.DataMemberAttribute()] 512 public int Priority 513 { 514 get 515 { 516 return this.PriorityField; 517 } 518 set 519 { 520 if ((this.PriorityField.Equals(value) != true)) 521 { 522 this.PriorityField = value; 523 this.RaisePropertyChanged("Priority"); 394 524 } 395 525 } … … 528 658 [System.Diagnostics.DebuggerStepThroughAttribute()] 529 659 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 660 [System.Runtime.Serialization.DataContractAttribute(Name="HiveExperimentPermission", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 661 "nsfer")] 662 [System.SerializableAttribute()] 663 public partial class HiveExperimentPermission : HeuristicLab.Clients.Hive.HiveItem 664 { 665 666 [System.Runtime.Serialization.OptionalFieldAttribute()] 667 private System.Guid GrantedByUserIdField; 668 669 [System.Runtime.Serialization.OptionalFieldAttribute()] 670 private System.Guid GrantedUserIdField; 671 672 [System.Runtime.Serialization.OptionalFieldAttribute()] 673 private System.Guid HiveExperimentIdField; 674 675 [System.Runtime.Serialization.OptionalFieldAttribute()] 676 private HeuristicLab.Clients.Hive.Permission PermissionField; 677 678 [System.Runtime.Serialization.DataMemberAttribute()] 679 public System.Guid GrantedByUserId 680 { 681 get 682 { 683 return this.GrantedByUserIdField; 684 } 685 set 686 { 687 if ((this.GrantedByUserIdField.Equals(value) != true)) 688 { 689 this.GrantedByUserIdField = value; 690 this.RaisePropertyChanged("GrantedByUserId"); 691 } 692 } 693 } 694 695 [System.Runtime.Serialization.DataMemberAttribute()] 696 public System.Guid GrantedUserId 697 { 698 get 699 { 700 return this.GrantedUserIdField; 701 } 702 set 703 { 704 if ((this.GrantedUserIdField.Equals(value) != true)) 705 { 706 this.GrantedUserIdField = value; 707 this.RaisePropertyChanged("GrantedUserId"); 708 } 709 } 710 } 711 712 [System.Runtime.Serialization.DataMemberAttribute()] 713 public System.Guid HiveExperimentId 714 { 715 get 716 { 717 return this.HiveExperimentIdField; 718 } 719 set 720 { 721 if ((this.HiveExperimentIdField.Equals(value) != true)) 722 { 723 this.HiveExperimentIdField = value; 724 this.RaisePropertyChanged("HiveExperimentId"); 725 } 726 } 727 } 728 729 [System.Runtime.Serialization.DataMemberAttribute()] 730 public HeuristicLab.Clients.Hive.Permission Permission 731 { 732 get 733 { 734 return this.PermissionField; 735 } 736 set 737 { 738 if ((this.PermissionField.Equals(value) != true)) 739 { 740 this.PermissionField = value; 741 this.RaisePropertyChanged("Permission"); 742 } 743 } 744 } 745 } 746 747 [System.Diagnostics.DebuggerStepThroughAttribute()] 748 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 749 [System.Runtime.Serialization.DataContractAttribute(Name="PluginData", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 750 "nsfer")] 751 [System.SerializableAttribute()] 752 public partial class PluginData : HeuristicLab.Clients.Hive.HiveItem 753 { 754 755 [System.Runtime.Serialization.OptionalFieldAttribute()] 756 private byte[] DataField; 757 758 [System.Runtime.Serialization.OptionalFieldAttribute()] 759 private string FileNameField; 760 761 [System.Runtime.Serialization.OptionalFieldAttribute()] 762 private System.Guid PluginIdField; 763 764 [System.Runtime.Serialization.DataMemberAttribute()] 765 public byte[] Data 766 { 767 get 768 { 769 return this.DataField; 770 } 771 set 772 { 773 if ((object.ReferenceEquals(this.DataField, value) != true)) 774 { 775 this.DataField = value; 776 this.RaisePropertyChanged("Data"); 777 } 778 } 779 } 780 781 [System.Runtime.Serialization.DataMemberAttribute()] 782 public string FileName 783 { 784 get 785 { 786 return this.FileNameField; 787 } 788 set 789 { 790 if ((object.ReferenceEquals(this.FileNameField, value) != true)) 791 { 792 this.FileNameField = value; 793 this.RaisePropertyChanged("FileName"); 794 } 795 } 796 } 797 798 [System.Runtime.Serialization.DataMemberAttribute()] 799 public System.Guid PluginId 800 { 801 get 802 { 803 return this.PluginIdField; 804 } 805 set 806 { 807 if ((this.PluginIdField.Equals(value) != true)) 808 { 809 this.PluginIdField = value; 810 this.RaisePropertyChanged("PluginId"); 811 } 812 } 813 } 814 } 815 816 [System.Diagnostics.DebuggerStepThroughAttribute()] 817 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 530 818 [System.Runtime.Serialization.DataContractAttribute(Name="NamedHiveItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 531 819 "nsfer")] 532 820 [System.SerializableAttribute()] 533 821 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperiment))] 822 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))] 534 823 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Resource))] 535 824 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Slave))] 536 825 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.SlaveGroup))] 537 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))]538 826 public partial class NamedHiveItem : HeuristicLab.Clients.Hive.HiveItem 539 827 { … … 764 1052 this.ResourceNamesField = value; 765 1053 this.RaisePropertyChanged("ResourceNames"); 1054 } 1055 } 1056 } 1057 } 1058 1059 [System.Diagnostics.DebuggerStepThroughAttribute()] 1060 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 1061 [System.Runtime.Serialization.DataContractAttribute(Name="Plugin", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" + 1062 "nsfer")] 1063 [System.SerializableAttribute()] 1064 public partial class Plugin : HeuristicLab.Clients.Hive.NamedHiveItem 1065 { 1066 1067 [System.Runtime.Serialization.OptionalFieldAttribute()] 1068 private System.DateTime DateCreatedField; 1069 1070 [System.Runtime.Serialization.OptionalFieldAttribute()] 1071 private byte[] HashField; 1072 1073 [System.Runtime.Serialization.OptionalFieldAttribute()] 1074 private System.Guid UserIdField; 1075 1076 [System.Runtime.Serialization.OptionalFieldAttribute()] 1077 private System.Version VersionField; 1078 1079 [System.Runtime.Serialization.DataMemberAttribute()] 1080 public System.DateTime DateCreated 1081 { 1082 get 1083 { 1084 return this.DateCreatedField; 1085 } 1086 set 1087 { 1088 if ((this.DateCreatedField.Equals(value) != true)) 1089 { 1090 this.DateCreatedField = value; 1091 this.RaisePropertyChanged("DateCreated"); 1092 } 1093 } 1094 } 1095 1096 [System.Runtime.Serialization.DataMemberAttribute()] 1097 public byte[] Hash 1098 { 1099 get 1100 { 1101 return this.HashField; 1102 } 1103 set 1104 { 1105 if ((object.ReferenceEquals(this.HashField, value) != true)) 1106 { 1107 this.HashField = value; 1108 this.RaisePropertyChanged("Hash"); 1109 } 1110 } 1111 } 1112 1113 [System.Runtime.Serialization.DataMemberAttribute()] 1114 public System.Guid UserId 1115 { 1116 get 1117 { 1118 return this.UserIdField; 1119 } 1120 set 1121 { 1122 if ((this.UserIdField.Equals(value) != true)) 1123 { 1124 this.UserIdField = value; 1125 this.RaisePropertyChanged("UserId"); 1126 } 1127 } 1128 } 1129 1130 [System.Runtime.Serialization.DataMemberAttribute()] 1131 public System.Version Version 1132 { 1133 get 1134 { 1135 return this.VersionField; 1136 } 1137 set 1138 { 1139 if ((object.ReferenceEquals(this.VersionField, value) != true)) 1140 { 1141 this.VersionField = value; 1142 this.RaisePropertyChanged("Version"); 766 1143 } 767 1144 } … … 1036 1413 public partial class SlaveGroup : HeuristicLab.Clients.Hive.Resource 1037 1414 { 1038 }1039 1040 [System.Diagnostics.DebuggerStepThroughAttribute()]1041 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]1042 [System.Runtime.Serialization.DataContractAttribute(Name="Plugin", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +1043 "nsfer")]1044 [System.SerializableAttribute()]1045 public partial class Plugin : HeuristicLab.Clients.Hive.NamedHiveItem1046 {1047 1048 [System.Runtime.Serialization.OptionalFieldAttribute()]1049 private System.DateTime DateCreatedField;1050 1051 [System.Runtime.Serialization.OptionalFieldAttribute()]1052 private byte[] HashField;1053 1054 [System.Runtime.Serialization.OptionalFieldAttribute()]1055 private System.Guid UserIdField;1056 1057 [System.Runtime.Serialization.OptionalFieldAttribute()]1058 private System.Version VersionField;1059 1060 [System.Runtime.Serialization.DataMemberAttribute()]1061 public System.DateTime DateCreated1062 {1063 get1064 {1065 return this.DateCreatedField;1066 }1067 set1068 {1069 if ((this.DateCreatedField.Equals(value) != true))1070 {1071 this.DateCreatedField = value;1072 this.RaisePropertyChanged("DateCreated");1073 }1074 }1075 }1076 1077 [System.Runtime.Serialization.DataMemberAttribute()]1078 public byte[] Hash1079 {1080 get1081 {1082 return this.HashField;1083 }1084 set1085 {1086 if ((object.ReferenceEquals(this.HashField, value) != true))1087 {1088 this.HashField = value;1089 this.RaisePropertyChanged("Hash");1090 }1091 }1092 }1093 1094 [System.Runtime.Serialization.DataMemberAttribute()]1095 public System.Guid UserId1096 {1097 get1098 {1099 return this.UserIdField;1100 }1101 set1102 {1103 if ((this.UserIdField.Equals(value) != true))1104 {1105 this.UserIdField = value;1106 this.RaisePropertyChanged("UserId");1107 }1108 }1109 }1110 1111 [System.Runtime.Serialization.DataMemberAttribute()]1112 public System.Version Version1113 {1114 get1115 {1116 return this.VersionField;1117 }1118 set1119 {1120 if ((object.ReferenceEquals(this.VersionField, value) != true))1121 {1122 this.VersionField = value;1123 this.RaisePropertyChanged("Version");1124 }1125 }1126 }1127 }1128 1129 [System.Diagnostics.DebuggerStepThroughAttribute()]1130 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]1131 [System.Runtime.Serialization.DataContractAttribute(Name="HiveExperimentPermission", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +1132 "nsfer")]1133 [System.SerializableAttribute()]1134 public partial class HiveExperimentPermission : HeuristicLab.Clients.Hive.HiveItem1135 {1136 1137 [System.Runtime.Serialization.OptionalFieldAttribute()]1138 private System.Guid GrantedByUserIdField;1139 1140 [System.Runtime.Serialization.OptionalFieldAttribute()]1141 private System.Guid GrantedUserIdField;1142 1143 [System.Runtime.Serialization.OptionalFieldAttribute()]1144 private System.Guid HiveExperimentIdField;1145 1146 [System.Runtime.Serialization.OptionalFieldAttribute()]1147 private HeuristicLab.Clients.Hive.Permission PermissionField;1148 1149 [System.Runtime.Serialization.DataMemberAttribute()]1150 public System.Guid GrantedByUserId1151 {1152 get1153 {1154 return this.GrantedByUserIdField;1155 }1156 set1157 {1158 if ((this.GrantedByUserIdField.Equals(value) != true))1159 {1160 this.GrantedByUserIdField = value;1161 this.RaisePropertyChanged("GrantedByUserId");1162 }1163 }1164 }1165 1166 [System.Runtime.Serialization.DataMemberAttribute()]1167 public System.Guid GrantedUserId1168 {1169 get1170 {1171 return this.GrantedUserIdField;1172 }1173 set1174 {1175 if ((this.GrantedUserIdField.Equals(value) != true))1176 {1177 this.GrantedUserIdField = value;1178 this.RaisePropertyChanged("GrantedUserId");1179 }1180 }1181 }1182 1183 [System.Runtime.Serialization.DataMemberAttribute()]1184 public System.Guid HiveExperimentId1185 {1186 get1187 {1188 return this.HiveExperimentIdField;1189 }1190 set1191 {1192 if ((this.HiveExperimentIdField.Equals(value) != true))1193 {1194 this.HiveExperimentIdField = value;1195 this.RaisePropertyChanged("HiveExperimentId");1196 }1197 }1198 }1199 1200 [System.Runtime.Serialization.DataMemberAttribute()]1201 public HeuristicLab.Clients.Hive.Permission Permission1202 {1203 get1204 {1205 return this.PermissionField;1206 }1207 set1208 {1209 if ((this.PermissionField.Equals(value) != true))1210 {1211 this.PermissionField = value;1212 this.RaisePropertyChanged("Permission");1213 }1214 }1215 }1216 }1217 1218 [System.Diagnostics.DebuggerStepThroughAttribute()]1219 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]1220 [System.Runtime.Serialization.DataContractAttribute(Name="PluginData", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +1221 "nsfer")]1222 [System.SerializableAttribute()]1223 public partial class PluginData : HeuristicLab.Clients.Hive.HiveItem1224 {1225 1226 [System.Runtime.Serialization.OptionalFieldAttribute()]1227 private byte[] DataField;1228 1229 [System.Runtime.Serialization.OptionalFieldAttribute()]1230 private string FileNameField;1231 1232 [System.Runtime.Serialization.OptionalFieldAttribute()]1233 private System.Guid PluginIdField;1234 1235 [System.Runtime.Serialization.DataMemberAttribute()]1236 public byte[] Data1237 {1238 get1239 {1240 return this.DataField;1241 }1242 set1243 {1244 if ((object.ReferenceEquals(this.DataField, value) != true))1245 {1246 this.DataField = value;1247 this.RaisePropertyChanged("Data");1248 }1249 }1250 }1251 1252 [System.Runtime.Serialization.DataMemberAttribute()]1253 public string FileName1254 {1255 get1256 {1257 return this.FileNameField;1258 }1259 set1260 {1261 if ((object.ReferenceEquals(this.FileNameField, value) != true))1262 {1263 this.FileNameField = value;1264 this.RaisePropertyChanged("FileName");1265 }1266 }1267 }1268 1269 [System.Runtime.Serialization.DataMemberAttribute()]1270 public System.Guid PluginId1271 {1272 get1273 {1274 return this.PluginIdField;1275 }1276 set1277 {1278 if ((this.PluginIdField.Equals(value) != true))1279 {1280 this.PluginIdField = value;1281 this.RaisePropertyChanged("PluginId");1282 }1283 }1284 }1285 }1286 1287 [System.Diagnostics.DebuggerStepThroughAttribute()]1288 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]1289 [System.Runtime.Serialization.DataContractAttribute(Name="LightweightJob", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +1290 "nsfer")]1291 [System.SerializableAttribute()]1292 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))]1293 public partial class LightweightJob : HeuristicLab.Clients.Hive.HiveItem1294 {1295 1296 [System.Runtime.Serialization.OptionalFieldAttribute()]1297 private System.Nullable<HeuristicLab.Clients.Hive.Command> CommandField;1298 1299 [System.Runtime.Serialization.OptionalFieldAttribute()]1300 private System.TimeSpan ExecutionTimeField;1301 1302 [System.Runtime.Serialization.OptionalFieldAttribute()]1303 private System.DateTime LastJobDataUpdateField;1304 1305 [System.Runtime.Serialization.OptionalFieldAttribute()]1306 private System.Nullable<System.Guid> ParentJobIdField;1307 1308 [System.Runtime.Serialization.OptionalFieldAttribute()]1309 private HeuristicLab.Clients.Hive.JobState StateField;1310 1311 [System.Runtime.Serialization.OptionalFieldAttribute()]1312 private System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLogField;1313 1314 [System.Runtime.Serialization.DataMemberAttribute()]1315 public System.Nullable<HeuristicLab.Clients.Hive.Command> Command1316 {1317 get1318 {1319 return this.CommandField;1320 }1321 set1322 {1323 if ((this.CommandField.Equals(value) != true))1324 {1325 this.CommandField = value;1326 this.RaisePropertyChanged("Command");1327 }1328 }1329 }1330 1331 [System.Runtime.Serialization.DataMemberAttribute()]1332 public System.TimeSpan ExecutionTime1333 {1334 get1335 {1336 return this.ExecutionTimeField;1337 }1338 set1339 {1340 if ((this.ExecutionTimeField.Equals(value) != true))1341 {1342 this.ExecutionTimeField = value;1343 this.RaisePropertyChanged("ExecutionTime");1344 }1345 }1346 }1347 1348 [System.Runtime.Serialization.DataMemberAttribute()]1349 public System.DateTime LastJobDataUpdate1350 {1351 get1352 {1353 return this.LastJobDataUpdateField;1354 }1355 set1356 {1357 if ((this.LastJobDataUpdateField.Equals(value) != true))1358 {1359 this.LastJobDataUpdateField = value;1360 this.RaisePropertyChanged("LastJobDataUpdate");1361 }1362 }1363 }1364 1365 [System.Runtime.Serialization.DataMemberAttribute()]1366 public System.Nullable<System.Guid> ParentJobId1367 {1368 get1369 {1370 return this.ParentJobIdField;1371 }1372 set1373 {1374 if ((this.ParentJobIdField.Equals(value) != true))1375 {1376 this.ParentJobIdField = value;1377 this.RaisePropertyChanged("ParentJobId");1378 }1379 }1380 }1381 1382 [System.Runtime.Serialization.DataMemberAttribute()]1383 public HeuristicLab.Clients.Hive.JobState State1384 {1385 get1386 {1387 return this.StateField;1388 }1389 set1390 {1391 if ((this.StateField.Equals(value) != true))1392 {1393 this.StateField = value;1394 this.RaisePropertyChanged("State");1395 }1396 }1397 }1398 1399 [System.Runtime.Serialization.DataMemberAttribute()]1400 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLog1401 {1402 get1403 {1404 return this.StateLogField;1405 }1406 set1407 {1408 if ((object.ReferenceEquals(this.StateLogField, value) != true))1409 {1410 this.StateLogField = value;1411 this.RaisePropertyChanged("StateLog");1412 }1413 }1414 }1415 1415 } 1416 1416 … … 1929 1929 { 1930 1930 1931 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateSlaveGroup", ReplyAction="http://tempuri.org/IHiveService/UpdateSlaveGroupResponse")] 1932 void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup); 1933 1931 1934 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/DeleteSlave", ReplyAction="http://tempuri.org/IHiveService/DeleteSlaveResponse")] 1932 1935 void DeleteSlave(System.Guid slaveId); … … 2042 2045 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetHiveExperimentPermissions", ReplyAction="http://tempuri.org/IHiveService/GetHiveExperimentPermissionsResponse")] 2043 2046 System.Collections.Generic.List<HeuristicLab.Clients.Hive.HiveExperimentPermission> GetHiveExperimentPermissions(System.Guid hiveExperimentId); 2047 2048 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/IsAllowedPrivileged", ReplyAction="http://tempuri.org/IHiveService/IsAllowedPrivilegedResponse")] 2049 bool IsAllowedPrivileged(); 2044 2050 2045 2051 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/Hello", ReplyAction="http://tempuri.org/IHiveService/HelloResponse")] … … 2091 2097 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateSlave", ReplyAction="http://tempuri.org/IHiveService/UpdateSlaveResponse")] 2092 2098 void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave); 2093 2094 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateSlaveGroup", ReplyAction="http://tempuri.org/IHiveService/UpdateSlaveGroupResponse")]2095 void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup);2096 2099 } 2097 2100 … … 2130 2133 } 2131 2134 2135 public void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup) 2136 { 2137 base.Channel.UpdateSlaveGroup(slaveGroup); 2138 } 2139 2132 2140 public void DeleteSlave(System.Guid slaveId) 2133 2141 { … … 2320 2328 } 2321 2329 2330 public bool IsAllowedPrivileged() 2331 { 2332 return base.Channel.IsAllowedPrivileged(); 2333 } 2334 2322 2335 public void Hello(HeuristicLab.Clients.Hive.Slave slave) 2323 2336 { … … 2398 2411 { 2399 2412 base.Channel.UpdateSlave(slave); 2400 }2401 2402 public void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup)2403 {2404 base.Channel.UpdateSlaveGroup(slaveGroup);2405 2413 } 2406 2414 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs
r6372 r6479 56 56 else 57 57 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(null, null, username, password); 58 58 59 59 return cl; 60 60 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Views/3.4/HiveEngineView.cs
r6444 r6479 38 38 39 39 protected override void DeregisterContentEvents() { 40 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);41 40 Content.ExecutionTimeOnHiveChanged -= new EventHandler(Content_ExecutionTimeOnHiveChanged); 41 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 42 42 base.DeregisterContentEvents(); 43 43 } … … 45 45 protected override void RegisterContentEvents() { 46 46 base.RegisterContentEvents(); 47 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);48 47 Content.ExecutionTimeOnHiveChanged += new EventHandler(Content_ExecutionTimeOnHiveChanged); 48 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 49 49 } 50 50 51 51 #region Event Handlers (Content) 52 private void Content_Execution StateChanged(object sender, EventArgs e) {52 private void Content_ExecutionTimeChanged(object sender, EventArgs e) { 53 53 if (InvokeRequired) { 54 Invoke(new EventHandler(Content_Execution StateChanged), sender, e);54 Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e); 55 55 } else { 56 56 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); … … 92 92 resourceIdsTextBox.ReadOnly = this.ReadOnly; 93 93 priorityTextBox.ReadOnly = this.ReadOnly; 94 isPrivilegedCheckBox.Enabled = !this.ReadOnly; // TODO: check for user rights94 isPrivilegedCheckBox.Enabled = Content.IsAllowedPrivileged; 95 95 } else { 96 96 resourceIdsTextBox.ReadOnly = false; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
r6452 r6479 92 92 } 93 93 94 public bool IsAllowedPrivileged { get; set; } 95 94 96 #region constructors and cloning 95 97 public HiveEngine() { … … 97 99 this.Priority = 0; 98 100 this.log = new ThreadSafeLog(this.log); 101 this.IsAllowedPrivileged = ServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged()); 99 102 } 100 103 … … 249 252 var engineHiveJob = new EngineHiveJob(jobs[i], parentScopeClone); 250 253 engineHiveJob.Job.Priority = this.Priority; 251 hiveExperiment.HiveJobs.Add(engineHiveJob);254 refreshableHiveExperiment.HiveJobs.Add(engineHiveJob); 252 255 253 256 // shuffle random variable to avoid the same random sequence in each operation; todo: does not yet work (it cannot find the random variable) … … 261 264 while (!refreshableHiveExperiment.AllJobsFinished()) { 262 265 Thread.Sleep(2000); 263 this.ExecutionTimeOnHive = TimeSpan.FromMilliseconds(hiveExperiments.Sum(x => x. HiveExperiment.ExecutionTime.TotalMilliseconds));266 this.ExecutionTimeOnHive = TimeSpan.FromMilliseconds(hiveExperiments.Sum(x => x.ExecutionTime.TotalMilliseconds)); 264 267 cancellationToken.ThrowIfCancellationRequested(); 265 268 } 266 log.LogMessage(string.Format("{0} finished (TotalExecutionTime: {1}).", refreshableHiveExperiment.ToString(), refreshableHiveExperiment. HiveExperiment.ExecutionTime));267 268 var failedJobs = hiveExperiment.HiveJobs.Where(x => x.Job.State == JobState.Failed);269 log.LogMessage(string.Format("{0} finished (TotalExecutionTime: {1}).", refreshableHiveExperiment.ToString(), refreshableHiveExperiment.ExecutionTime)); 270 271 var failedJobs = refreshableHiveExperiment.HiveJobs.Where(x => x.Job.State == JobState.Failed); 269 272 if (failedJobs.Count() > 0) { 270 273 throw new HiveEngineException("Job failed: " + failedJobs.First().Job.StateLog.Last().Exception); … … 273 276 // get scopes 274 277 int j = 0; 275 foreach (var hiveJob in hiveExperiment.HiveJobs) {278 foreach (var hiveJob in refreshableHiveExperiment.HiveJobs) { 276 279 var scope = ((IAtomicOperation)((EngineJob)hiveJob.ItemJob).InitialOperation).Scope; 277 280 scopes[j++] = scope; … … 299 302 hiveExperiment.IsPrivileged = this.IsPrivileged; 300 303 var refreshableHiveExperiment = new RefreshableHiveExperiment(hiveExperiment); 301 refreshableHiveExperiment.Is Controllable = false;304 refreshableHiveExperiment.IsDownloadable = false; // download happens automatically so disable button 302 305 hiveExperiments.Add(refreshableHiveExperiment); 303 306 return refreshableHiveExperiment; … … 312 315 313 316 private void ClearData(RefreshableHiveExperiment refreshableHiveExperiment) { 314 var jobs = refreshableHiveExperiment. HiveExperiment.GetAllHiveJobs();317 var jobs = refreshableHiveExperiment.GetAllHiveJobs(); 315 318 foreach (var job in jobs) { 316 319 job.ClearData(); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs
r6463 r6479 119 119 [OperationContract] 120 120 IEnumerable<HiveExperimentPermission> GetHiveExperimentPermissions(Guid hiveExperimentId); 121 122 [OperationContract] 123 bool IsAllowedPrivileged(); // current user may execute privileged jobs 121 124 #endregion 122 125 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj
r6452 r6479 114 114 <DependentUpon>Settings.settings</DependentUpon> 115 115 </Compile> 116 <Compile Include="Tools\CreateHiveDatabaseApplication.cs" />117 116 <Compile Include="TransactionManager.cs" /> 118 117 </ItemGroup> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config
r6478 r6479 36 36 </connectionStrings> 37 37 <system.web> 38 <httpHandlers> 39 <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 40 validate="false" /> 41 </httpHandlers> 38 <authentication mode="Forms" /> 42 39 <compilation debug="true" targetFramework="4.0"> 43 40 <assemblies> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveRoles.cs
r6372 r6479 25 25 public const string Slave = "Hive Slave"; 26 26 public const string Client = "Hive User"; 27 public const string IsAllowedPrivileged = "Hive IsAllowedPrivileged"; 27 28 } 28 29 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
r6465 r6479 328 328 }); 329 329 } 330 331 public bool IsAllowedPrivileged() { 332 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 333 return authen.IsInRole(HiveRoles.IsAllowedPrivileged); 334 } 330 335 #endregion 331 336 … … 516 521 517 522 public Guid GetResourceId(string resourceName) { 518 authen.AuthenticateForAnyRole(HiveRoles.Administrator );523 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 519 524 return trans.UseTransaction(() => { 520 525 var resource = dao.GetResources(x => x.Name == resourceName).FirstOrDefault();
Note: See TracChangeset
for help on using the changeset viewer.