Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/16/11 00:18:48 (13 years ago)
Author:
cneumuel
Message:

#1233

  • stability improvements for HiveEngine
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.cs

    r6178 r6200  
    4646    protected override void RegisterContentEvents() {
    4747      base.RegisterContentEvents();
    48       Content.JobItemChanged += new EventHandler(Content_JobItemChanged);
     48      Content.ItemJobChanged += new EventHandler(Content_JobItemChanged);
    4949      Content.JobChanged += new EventHandler(Content_JobChanged);
    5050      Content.JobStateChanged += new EventHandler(Content_JobStateChanged);
     
    5252
    5353    protected override void DeregisterContentEvents() {
    54       Content.JobItemChanged -= new EventHandler(Content_JobItemChanged);
     54      Content.ItemJobChanged -= new EventHandler(Content_JobItemChanged);
    5555      Content.JobChanged -= new EventHandler(Content_JobChanged);
    5656      Content.JobStateChanged -= new EventHandler(Content_JobStateChanged);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/RefreshableHiveExperimentView.cs

    r6198 r6200  
    2121
    2222using System;
    23 using System.ComponentModel;
    2423using System.Linq;
    2524using System.Threading;
     
    5857      base.RegisterContentEvents();
    5958      Content.RefreshAutomaticallyChanged += new EventHandler(Content_RefreshAutomaticallyChanged);
    60       Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Content_PropertyChanged);
    6159      Content.HiveExperimentChanged += new EventHandler(Content_HiveExperimentChanged);
    6260      Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged);
    63     }
     61      Content.JobStatisticsChanged += new EventHandler(Content_JobStatisticsChanged);
     62    }
     63
    6464    protected override void DeregisterContentEvents() {
    6565      Content.RefreshAutomaticallyChanged -= new EventHandler(Content_RefreshAutomaticallyChanged);
    66       Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(Content_PropertyChanged);
    6766      Content.HiveExperimentChanged -= new EventHandler(Content_HiveExperimentChanged);
    6867      Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged);
     68      Content.JobStatisticsChanged -= new EventHandler(Content_JobStatisticsChanged);
    6969      base.DeregisterContentEvents();
    7070    }
     
    104104        //includeJobsCheckBox.Checked = false;
    105105        refreshAutomaticallyCheckBox.Checked = false;
    106         jobsTextBox.Text = "0";
    107         calculatingTextBox.Text = "0";
    108         finishedTextBox.Text = "0";
    109106        logView.Content = null;
    110107      } else {
     
    115112        //includeJobsCheckBox.Checked = Content.IncludeJobs;
    116113        refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically;
    117         jobsTextBox.Text = Content.HiveExperiment.JobCount.ToString();
    118         calculatingTextBox.Text = Content.HiveExperiment.CalculatingCount.ToString();
    119         finishedTextBox.Text = Content.HiveExperiment.FinishedCount.ToString();
    120114        logView.Content = Content.Log;
    121115      }
     116      Content_JobStatisticsChanged(this, EventArgs.Empty);
    122117      Content_HiveExperimentChanged(this, EventArgs.Empty);
    123118      Content_HiveJobChanged(this, EventArgs.Empty);
     
    233228    }
    234229
    235     private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    236       if (InvokeRequired)
    237         Invoke(new PropertyChangedEventHandler(Content_PropertyChanged), sender, e);
    238       else {
    239         jobsTextBox.Text = Content.HiveExperiment.JobCount.ToString();
    240         calculatingTextBox.Text = Content.HiveExperiment.CalculatingCount.ToString();
    241         finishedTextBox.Text = Content.HiveExperiment.FinishedCount.ToString();
    242       }
    243     }
    244 
    245230    private void Content_HiveExperimentChanged(object sender, EventArgs e) {
    246231      if (Content.HiveExperiment != null) {
     
    252237      SetEnabledStateOfControls();
    253238    }
     239    private void Content_JobStatisticsChanged(object sender, EventArgs e) {
     240      if (InvokeRequired)
     241        Invoke(new EventHandler(Content_JobStatisticsChanged), sender, e);
     242      else {
     243        if (Content != null) {
     244          jobsTextBox.Text = Content.HiveExperiment.JobCount.ToString();
     245          calculatingTextBox.Text = Content.HiveExperiment.CalculatingCount.ToString();
     246          finishedTextBox.Text = Content.HiveExperiment.FinishedCount.ToString();
     247        } else {
     248          jobsTextBox.Text = "0";
     249          calculatingTextBox.Text = "0";
     250          finishedTextBox.Text = "0";
     251        }
     252      }
     253    }
    254254    #endregion
    255255
    256256    #region Control events
    257257    private void startButton_Click(object sender, EventArgs e) {
    258       ExperimentManagerClient.StartExperiment(new Action<Exception>((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Start failed.", ex)), Content);
     258      ExperimentManagerClient.StartExperiment((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Start failed.", ex), Content);
    259259    }
    260260    private void pauseButton_Click(object sender, EventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.