Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/11 14:12:10 (13 years ago)
Author:
cneumuel
Message:

#1233

  • removed Job-dto objects from slave core (since it stores outdated objects)
  • added command textbox to HiveJobView
  • improved the way the control buttons behave in HiveJobView
  • improved job control (pause and stop is also possible when job is not currently calculating)
  • improved gantt chart view (last state log entry is also displayed)
  • unified code for downloading jobs between experiment manager and hive engine
File:
1 edited

Legend:

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

    r6110 r6168  
    3535    private JobResultPoller jobResultPoller;
    3636    private JobDownloader<ItemJob> jobDownloader = new JobDownloader<ItemJob>(2, 2);
     37    private static object locker = new object();
    3738
    3839    [Storable]
     
    6667      get { return refreshAutomatically; }
    6768      set {
    68         if (refreshAutomatically != value) {
    69           refreshAutomatically = value;
    70           OnRefreshAutomaticallyChanged();
    71         }
    72         if (RefreshAutomatically && hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) {
    73           StartResultPolling();
    74         } else {
    75           StopResultPolling();
     69        lock (locker) {
     70          if (refreshAutomatically != value) {
     71            refreshAutomatically = value;
     72            OnRefreshAutomaticallyChanged();
     73          }
     74          if (RefreshAutomatically) {
     75            if (hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) {
     76              StartResultPolling();
     77            }
     78          } else {
     79            StopResultPolling();
     80          }
    7681        }
    7782      }
     
    156161          // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated
    157162          if (lastJobDataUpdate != DateTime.MinValue && lastJobDataUpdate < hj.Job.LastJobDataUpdate) {
    158             jobDownloader.DownloadJob(hj.Job.Id, (itemJob) => {
     163            jobDownloader.DownloadJob(hj.Job.Id, (id, itemJob, exception) => {
     164              if (exception != null) {
     165                throw new JobDownloaderException("Downloading job failed.", exception);
     166              }
     167
    159168              if (itemJob == null) {
    160169                // something bad happened to this job. bad job, BAAAD job!
     
    218227      hiveExperiment.ExecutionTime = TimeSpan.FromMilliseconds(hiveExperiment.GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.HasValue ? x.Job.ExecutionTime.Value.TotalMilliseconds : 0));
    219228    }
    220 
    221     public void OnLoaded() {
    222       this.UpdateTotalExecutionTime();
    223 
    224       if (hiveExperiment.ExecutionState != ExecutionState.Stopped) {
    225         this.RefreshAutomatically = true;
    226       }
    227     }
    228229    #endregion
    229230
     
    235236      hiveExperiment.ModifiedChanged += new EventHandler(hiveExperiment_ModifiedChanged);
    236237      hiveExperiment.IsProgressingChanged += new EventHandler(hiveExperiment_IsProgressingChanged);
     238      hiveExperiment.Loaded += new EventHandler(hiveExperiment_Loaded);
    237239    }
    238240
     
    244246      hiveExperiment.ModifiedChanged -= new EventHandler(hiveExperiment_ModifiedChanged);
    245247      hiveExperiment.IsProgressingChanged -= new EventHandler(hiveExperiment_IsProgressingChanged);
     248      hiveExperiment.Loaded -= new EventHandler(hiveExperiment_Loaded);
     249    }
     250
     251    private void hiveExperiment_Loaded(object sender, EventArgs e) {
     252      this.UpdateTotalExecutionTime();
     253
     254      if (hiveExperiment.ExecutionState != ExecutionState.Stopped) {
     255        this.RefreshAutomatically = true;
     256      }
    246257    }
    247258
Note: See TracChangeset for help on using the changeset viewer.