Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/20/18 15:26:57 (5 years ago)
Author:
pfleck
Message:

#2845 Merged trunk changes into branch (15406-15681, 15683-16308)

Location:
branches/2845_EnhancedProgress
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2845_EnhancedProgress

  • branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administratormergedeligible
      /stable/HeuristicLab.Clients.Hive.Administratormergedeligible
      /trunk/HeuristicLab.Clients.Hive.Administratormergedeligible
      /branches/1721-RandomForestPersistence/HeuristicLab.Clients.Hive.Administrator10321-10322
      /branches/Algorithms.GradientDescent/HeuristicLab.Clients.Hive.Administrator5516-5520
      /branches/Async/HeuristicLab.Clients.Hive.Administrator13329-15286
      /branches/Benchmarking/sources/HeuristicLab.Clients.Hive.Administrator6917-7005
      /branches/CloningRefactoring/HeuristicLab.Clients.Hive.Administrator4656-4721
      /branches/CodeEditor/HeuristicLab.Clients.Hive.Administrator11700-11806
      /branches/DataAnalysis Refactoring/HeuristicLab.Clients.Hive.Administrator5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Clients.Hive.Administrator5815-6180
      /branches/DataAnalysis/HeuristicLab.Clients.Hive.Administrator4458-4459,​4462,​4464
      /branches/DataPreprocessing/HeuristicLab.Clients.Hive.Administrator10085-11101
      /branches/GP.Grammar.Editor/HeuristicLab.Clients.Hive.Administrator6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Clients.Hive.Administrator5060
      /branches/HLScript/HeuristicLab.Clients.Hive.Administrator10331-10358
      /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Clients.Hive.Administrator11570-12508
      /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Clients.Hive.Administrator6123-9799
      /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Clients.Hive.Administrator11130-12721
      /branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator15377-15760
      /branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Administrator12440-12877
      /branches/LogResidualEvaluator/HeuristicLab.Clients.Hive.Administrator10202-10483
      /branches/NET40/sources/HeuristicLab.Clients.Hive.Administrator5138-5162
      /branches/NSGA-II Changes/HeuristicLab.Clients.Hive.Administrator12033-12122
      /branches/ParallelEngine/HeuristicLab.Clients.Hive.Administrator5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Clients.Hive.Administrator7568-7810
      /branches/QAPAlgorithms/HeuristicLab.Clients.Hive.Administrator6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Clients.Hive.Administrator6828
      /branches/RuntimeOptimizer/HeuristicLab.Clients.Hive.Administrator8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator7787-8333
      /branches/SlaveShutdown/HeuristicLab.Clients.Hive.Administrator8944-8956
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Clients.Hive.Administrator10204-10479
      /branches/SuccessProgressAnalysis/HeuristicLab.Clients.Hive.Administrator5370-5682
      /branches/Trunk/HeuristicLab.Clients.Hive.Administrator6829-6865
      /branches/UnloadJobs/HeuristicLab.Clients.Hive.Administrator9168-9215
      /branches/VNS/HeuristicLab.Clients.Hive.Administrator5594-5752
      /branches/crossvalidation-2434/HeuristicLab.Clients.Hive.Administrator12948-12950
      /branches/histogram/HeuristicLab.Clients.Hive.Administrator5959-6341
      /branches/symbreg-factors-2650/HeuristicLab.Clients.Hive.Administrator14232-14825
  • branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs

    r16308 r16311  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Clients.Access;
    25 using HeuristicLab.Core.Views;
    2624using HeuristicLab.MainForm;
    2725using HeuristicLab.MainForm.WindowsForms;
    2826
    2927namespace HeuristicLab.Clients.Hive.Administrator.Views {
    30   [View("SlaveView")]
    31   [Content(typeof(Resource), IsDefaultView = true)]
    32   public partial class SlaveView : ItemView {
    33     public new Resource Content {
    34       get { return (Resource)base.Content; }
     28  [View("Slave View")]
     29  [Content(typeof(Slave), IsDefaultView = true)]
     30  public sealed partial class SlaveView : ResourceView {
     31    public new Slave Content {
     32      get { return (Slave)base.Content; }
    3533      set { base.Content = value; }
    3634    }
     
    4038    }
    4139
    42     #region Register Content Events
    43     protected override void DeregisterContentEvents() {
    44       base.DeregisterContentEvents();
    45     }
    46     protected override void RegisterContentEvents() {
    47       base.RegisterContentEvents();
    48     }
    49     #endregion
    50 
     40    #region Overrides
    5141    protected override void OnContentChanged() {
    5242      base.OnContentChanged();
    5343      if (Content == null) {
    54         ShowSlaveUI(true);
    55         txtName.Clear();
    56         txtCPU.Clear();
    57         txtDetailsDescription.Clear();
    58         txtMemory.Clear();
    59         txtOS.Clear();
    60         txtSlaveState.Clear();
    61         txtLastHeartbeat.Clear();
    62         txtFreeMemory.Clear();
    63         txtId.Clear();
    64         txtHbIntervall.Clear();
    65         cbxDisposable.Checked = false;
    66         cbxPublic.Checked = false;
     44        cpuTextBox.Clear();
     45        memoryTextBox.Clear();
     46        operatingSystemTextBox.Clear();
     47        stateTextBox.Clear();
     48        lastHeartbeatTextBox.Clear();
     49        disposableCheckBox.Checked = false;
    6750      } else {
    68         if (Content.GetType() == typeof(Slave)) {
    69           ShowSlaveUI(true);
    70           Slave ct = (Slave)Content;
    71           bool authorized = UserInformation.Instance.UserExists && (ct.OwnerUserId == UserInformation.Instance.User.Id || HiveRoles.CheckAdminUserPermissions());
    72           txtName.Text = ct.Name;
    73           txtHbIntervall.Text = ct.HbInterval.ToString();
    74           cbxPublic.Enabled = authorized;
    75           cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged);
    76           cbxPublic.Checked = ct.OwnerUserId == null;
    77           cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged);
    78           txtCPU.Text = string.Format("{0} Cores @ {1} Mhz, Arch.: {2}", ct.Cores.ToString(), ct.CpuSpeed.ToString(), ct.CpuArchitecture.ToString());
    79           txtDetailsDescription.Text = ct.Description;
    80           txtMemory.Text = ct.Memory.ToString();
    81           txtOS.Text = ct.OperatingSystem;
    82           txtSlaveState.Text = ct.SlaveState.ToString();
    83           txtLastHeartbeat.Text = ct.LastHeartbeat.ToString();
    84           txtFreeMemory.Text = ct.FreeMemory.ToString();
    85           txtId.Text = ct.Id.ToString();
    86           cbxDisposable.Enabled = authorized;
    87           cbxDisposable.Checked = ct.IsDisposable.GetValueOrDefault();
    88         } else if (Content.GetType() == typeof(SlaveGroup)) {
    89           SlaveGroup ct = (SlaveGroup)Content;
    90           txtName.Text = ct.Name;
    91           txtHbIntervall.Text = ct.HbInterval.ToString();
    92           cbxPublic.Enabled = ct.Name != "UNGROUPED" && HiveRoles.CheckAdminUserPermissions();
    93           cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged);
    94           cbxPublic.Checked = ct.OwnerUserId == null;
    95           cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged);
    96           ShowSlaveUI(false);
    97         } else {
    98           throw new Exception("Unknown Resource in SlaveView");
    99         }
     51        cpuTextBox.Text = string.Format("{0} Cores @ {1} MHz, Arch.: {2}", Content.Cores, Content.CpuSpeed, Content.CpuArchitecture);
     52        memoryTextBox.Text = string.Format("{0} ({1} Free)", Content.Memory, Content.FreeMemory);
     53        operatingSystemTextBox.Text = Content.OperatingSystem;
     54        stateTextBox.Text = Content.SlaveState.ToString();
     55        lastHeartbeatTextBox.Text = Content.LastHeartbeat.ToString();
     56        disposableCheckBox.Checked = Content.IsDisposable.GetValueOrDefault();
    10057      }
    101     }
    102 
    103     private void ShowSlaveUI(bool show) {
    104       label1.Visible = show;
    105       label2.Visible = show;
    106       label4.Visible = show;
    107       label10.Visible = show;
    108       label11.Visible = show;
    109       label12.Visible = show;
    110       label13.Visible = show;
    111       label14.Visible = show;
    112       label15.Visible = show;
    113       txtCPU.Visible = show;
    114       txtDetailsDescription.Visible = show;
    115       txtMemory.Visible = show;
    116       txtOS.Visible = show;
    117       txtSlaveState.Visible = show;
    118       txtLastHeartbeat.Visible = show;
    119       txtFreeMemory.Visible = show;
    120       txtId.Visible = show;
    121       txtName.Enabled = !show;
    122       cbxDisposable.Visible = show;
    12358    }
    12459
    12560    protected override void SetEnabledStateOfControls() {
    12661      base.SetEnabledStateOfControls();
     62      bool enabled = Content != null && !Locked;
     63      disposableCheckBox.Enabled = enabled;
    12764    }
     65    #endregion
    12866
    129     private void txtName_TextChanged(object sender, EventArgs e) {
    130       if (Content != null && Content is SlaveGroup) {
    131         Content.Name = txtName.Text;
    132       }
     67    #region Event Handlers
     68    private void disposableCheckBox_CheckedChanged(object sender, EventArgs e) {
     69      if (Content != null)
     70        Content.IsDisposable = disposableCheckBox.Checked;
    13371    }
    134 
    135     private void txtHbIntervall_TextChanged(object sender, EventArgs e) {
    136       if (Content != null) {
    137         if (txtHbIntervall.Text.Length > 0) {
    138           try {
    139             int interval = int.Parse(txtHbIntervall.Text);
    140             Content.HbInterval = interval;
    141           }
    142           catch (Exception) {
    143             MessageBox.Show("Please enter a numeric value for the Heartbeat Interval.", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
    144             txtHbIntervall.Text = "10";
    145           }
    146         }
    147       }
    148     }
    149 
    150     private void cbxDisposable_CheckedChanged(object sender, EventArgs e) {
    151       if (Content != null) {
    152         ((Slave)Content).IsDisposable = cbxDisposable.Checked;
    153       }
    154     }
    155 
    156     private void cbxPublic_CheckedChanged(object sender, EventArgs e) {
    157       if (Content != null) {
    158         Content.OwnerUserId = cbxPublic.Checked ? null : new Guid?(UserInformation.Instance.User.Id);
    159       }
    160     }
     72    #endregion
    16173  }
    16274}
Note: See TracChangeset for help on using the changeset viewer.