Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/08/18 15:34:12 (6 years ago)
Author:
jzenisek
Message:

#2839:

  • fixed project/resource selector in HiveJobManager
  • added error provider to project/resource selector
  • changed datetime pickers in HiveAdmin...
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  
    248248    protected HeuristicLab.Clients.Hive.Views.TreeView.NoDoubleClickTreeView resourcesTreeView;
    249249    private System.Windows.Forms.GroupBox summaryGroupBox;
    250     private System.Windows.Forms.Label coresLabel;
    251     private System.Windows.Forms.Label memorySummaryLabel;
    252     private System.Windows.Forms.Label memoryLabel;
    253     private System.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;
    254254  }
    255255}
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r15922 r15956  
    148148    }
    149149
     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
    150162    public IEnumerable<Resource> AssignedResources {
    151163      get { return newAssignedResources; }
     
    425437          }
    426438        }
    427       } else { // existent, unchanged jobs get all assigned resources
     439      } else if(selectedProject.Id == projectId) { // existent, unchanged jobs get all assigned resources
    428440        // update assigned resources
    429441        var assignedJobResources = GetAssignedResourcesForJob(JobId);
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.Designer.cs

    r15953 r15956  
    5050      this.refreshButton = new System.Windows.Forms.Button();
    5151      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     52      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    5253      this.hiveResourceSelector = new HeuristicLab.Clients.Hive.JobManager.Views.HiveProjectSelector();
     54      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5355      this.SuspendLayout();
    5456      //
     
    6466      this.okButton.Text = "&OK";
    6567      this.okButton.UseVisualStyleBackColor = true;
     68      this.errorProvider.SetIconAlignment(this.okButton, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     69      this.errorProvider.SetIconPadding(this.okButton, 2);
    6670      //
    6771      // cancelButton
     
    8791      this.refreshButton.UseVisualStyleBackColor = true;
    8892      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;
    8998      //
    9099      // hiveResourceSelector
     
    127136      this.Text = "Select Project";
    128137      this.Load += new System.EventHandler(this.HiveResourceSelectorDialog_Load);
     138      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    129139      this.ResumeLayout(false);
    130140
     
    137147    protected System.Windows.Forms.Button refreshButton;
    138148    protected System.Windows.Forms.ToolTip toolTip;
     149    protected System.Windows.Forms.ErrorProvider errorProvider;
    139150    protected HiveProjectSelector hiveResourceSelector;
    140151  }
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs

    r15933 r15956  
    134134
    135135    private void hiveResourceSelector_SelectedProjectChanged(object sender, EventArgs e) {
    136       okButton.Enabled = hiveResourceSelector.SelectedProject != null;
     136      okButton.Enabled = hiveResourceSelector.SelectedProject != null && hiveResourceSelector.AssignedResources.Any();
    137137    }
    138138
    139139    private void hiveResourceSelector_SelectedResourcesChanged(object sender, EventArgs e) {
    140140      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      }
    141149    }
    142150
Note: See TracChangeset for help on using the changeset viewer.