Changeset 15956 for branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views
- Timestamp:
- 06/08/18 15:34:12 (7 years ago)
- Location:
- branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.Designer.cs
r15920 r15956 248 248 protected HeuristicLab.Clients.Hive.Views.TreeView.NoDoubleClickTreeView resourcesTreeView; 249 249 private System.Windows.Forms.GroupBox summaryGroupBox; 250 pr ivateSystem.Windows.Forms.Label coresLabel;251 pr ivateSystem.Windows.Forms.Label memorySummaryLabel;252 pr ivateSystem.Windows.Forms.Label memoryLabel;253 pr ivateSystem.Windows.Forms.Label coresSummaryLabel;250 protected System.Windows.Forms.Label coresLabel; 251 protected System.Windows.Forms.Label memorySummaryLabel; 252 protected System.Windows.Forms.Label memoryLabel; 253 protected System.Windows.Forms.Label coresSummaryLabel; 254 254 } 255 255 } -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r15922 r15956 148 148 } 149 149 150 public int AssignedCores { 151 get { 152 HashSet<Slave> newAssignedSlaves = new HashSet<Slave>(newAssignedResources.OfType<Slave>()); 153 foreach(var slaveGroup in newAssignedResources.OfType<SlaveGroup>()) { 154 foreach(var slave in HiveClient.Instance.GetAvailableResourceDescendants(slaveGroup.Id).OfType<Slave>()) { 155 newAssignedSlaves.Add(slave); 156 } 157 } 158 return newAssignedSlaves.Sum(x => x.Cores.GetValueOrDefault()); 159 } 160 } 161 150 162 public IEnumerable<Resource> AssignedResources { 151 163 get { return newAssignedResources; } … … 425 437 } 426 438 } 427 } else { // existent, unchanged jobs get all assigned resources439 } else if(selectedProject.Id == projectId) { // existent, unchanged jobs get all assigned resources 428 440 // update assigned resources 429 441 var assignedJobResources = GetAssignedResourcesForJob(JobId); -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.Designer.cs
r15953 r15956 50 50 this.refreshButton = new System.Windows.Forms.Button(); 51 51 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 52 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 52 53 this.hiveResourceSelector = new HeuristicLab.Clients.Hive.JobManager.Views.HiveProjectSelector(); 54 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 53 55 this.SuspendLayout(); 54 56 // … … 64 66 this.okButton.Text = "&OK"; 65 67 this.okButton.UseVisualStyleBackColor = true; 68 this.errorProvider.SetIconAlignment(this.okButton, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 69 this.errorProvider.SetIconPadding(this.okButton, 2); 66 70 // 67 71 // cancelButton … … 87 91 this.refreshButton.UseVisualStyleBackColor = true; 88 92 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 93 // 94 // errorProvider 95 // 96 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 97 this.errorProvider.ContainerControl = this; 89 98 // 90 99 // hiveResourceSelector … … 127 136 this.Text = "Select Project"; 128 137 this.Load += new System.EventHandler(this.HiveResourceSelectorDialog_Load); 138 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 129 139 this.ResumeLayout(false); 130 140 … … 137 147 protected System.Windows.Forms.Button refreshButton; 138 148 protected System.Windows.Forms.ToolTip toolTip; 149 protected System.Windows.Forms.ErrorProvider errorProvider; 139 150 protected HiveProjectSelector hiveResourceSelector; 140 151 } -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs
r15933 r15956 134 134 135 135 private void hiveResourceSelector_SelectedProjectChanged(object sender, EventArgs e) { 136 okButton.Enabled = hiveResourceSelector.SelectedProject != null ;136 okButton.Enabled = hiveResourceSelector.SelectedProject != null && hiveResourceSelector.AssignedResources.Any(); 137 137 } 138 138 139 139 private void hiveResourceSelector_SelectedResourcesChanged(object sender, EventArgs e) { 140 140 okButton.Enabled = hiveResourceSelector.AssignedResources.Any(); 141 142 if(!hiveResourceSelector.AssignedResources.Any()) { 143 errorProvider.SetError(okButton, "Note: currently no resources are assigned"); 144 } else if(hiveResourceSelector.AssignedCores == 0) { 145 errorProvider.SetError(okButton, "Note: currently no resources with cores are assigned"); 146 } else { 147 errorProvider.SetError(okButton, string.Empty); 148 } 141 149 } 142 150
Note: See TracChangeset
for help on using the changeset viewer.