Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/26/11 18:26:02 (13 years ago)
Author:
ascheibe
Message:

#1233

  • implemented last couple of slave ui review comments
  • added global runs view to the job manager
  • some minor ui improvements
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r6792 r6834  
    5252
    5353    protected override void removeButton_Click(object sender, EventArgs e) {
    54       DialogResult result = MessageBox.Show("This action will permanently delete this experiment (also on the hive server). Continue?", "Delete Experiment", MessageBoxButtons.OKCancel);
     54      DialogResult result = MessageBox.Show("This action will permanently delete this job (also on the hive server). Continue?", "Delete Job", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
    5555      if (result == DialogResult.OK) {
    5656        base.removeButton_Click(sender, e);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs

    r6792 r6834  
    5858      this.calculatingLabel = new System.Windows.Forms.Label();
    5959      this.jobsLabel = new System.Windows.Forms.Label();
     60      this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    6061      this.tabControl.SuspendLayout();
    6162      this.tasksTabPage.SuspendLayout();
    6263      this.permissionTabPage.SuspendLayout();
     64      this.runsTabPage.SuspendLayout();
    6365      this.stateTabPage.SuspendLayout();
    6466      this.logTabPage.SuspendLayout();
     
    149151      // runsTabPage
    150152      //
     153      this.runsTabPage.Controls.Add(this.runCollectionViewHost);
    151154      this.runsTabPage.Location = new System.Drawing.Point(4, 22);
    152155      this.runsTabPage.Name = "runsTabPage";
     
    418421      this.jobsLabel.Text = "Waiting:";
    419422      //
    420       // RefreshableHiveExperimentView
     423      // runCollectionViewHost
     424      //
     425      this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     426                  | System.Windows.Forms.AnchorStyles.Left)
     427                  | System.Windows.Forms.AnchorStyles.Right)));
     428      this.runCollectionViewHost.Caption = "View";
     429      this.runCollectionViewHost.Content = null;
     430      this.runCollectionViewHost.Enabled = false;
     431      this.runCollectionViewHost.Location = new System.Drawing.Point(3, 3);
     432      this.runCollectionViewHost.Name = "runCollectionViewHost";
     433      this.runCollectionViewHost.ReadOnly = false;
     434      this.runCollectionViewHost.Size = new System.Drawing.Size(703, 420);
     435      this.runCollectionViewHost.TabIndex = 2;
     436      this.runCollectionViewHost.ViewsLabelVisible = true;
     437      this.runCollectionViewHost.ViewType = null;
     438      //
     439      // RefreshableHiveJobView
    421440      //
    422441      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    437456      this.Controls.Add(this.stopButton);
    438457      this.Controls.Add(this.resetButton);
    439       this.Name = "RefreshableHiveExperimentView";
     458      this.Name = "RefreshableHiveJobView";
    440459      this.Size = new System.Drawing.Size(717, 560);
    441460      this.tabControl.ResumeLayout(false);
    442461      this.tasksTabPage.ResumeLayout(false);
    443462      this.permissionTabPage.ResumeLayout(false);
     463      this.runsTabPage.ResumeLayout(false);
    444464      this.stateTabPage.ResumeLayout(false);
    445465      this.logTabPage.ResumeLayout(false);
     
    484504    private System.Windows.Forms.Button refreshPermissionsButton;
    485505    private System.Windows.Forms.TabPage runsTabPage;
     506    private MainForm.WindowsForms.ViewHost runCollectionViewHost;
    486507
    487508  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r6792 r6834  
    6363      Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged);
    6464      Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged);
    65       Content.HiveJobsChanged += new EventHandler(Content_HiveJobChanged);
     65      Content.HiveTasksChanged += new EventHandler(Content_HiveTasksChanged);
    6666      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
    6767      Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    6868      Content.IsAllowedPrivilegedChanged += new EventHandler(Content_IsAllowedPrivilegedChanged);
     69      Content.Loaded += new EventHandler(Content_Loaded);
    6970    }
    7071
     
    7778      Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged);
    7879      Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged);
    79       Content.HiveJobsChanged -= new EventHandler(Content_HiveJobChanged);
     80      Content.HiveTasksChanged -= new EventHandler(Content_HiveTasksChanged);
    8081      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
    8182      Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
     83      Content.Loaded -= new EventHandler(Content_Loaded);
    8284      base.DeregisterContentEvents();
    8385    }
     
    9294
    9395    private void RegisterHiveJobEvents() {
    94       Content.HiveTasks.ItemsAdded += new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset);
    95       Content.HiveTasks.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset);
    96       Content.HiveTasks.CollectionReset += new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset);
     96      Content.HiveTasks.ItemsAdded += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded);
     97      Content.HiveTasks.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved);
     98      Content.HiveTasks.CollectionReset += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_CollectionReset);
    9799    }
    98100    private void DeregisterHiveJobEvents() {
    99       Content.HiveTasks.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset);
    100       Content.HiveTasks.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset);
    101       Content.HiveTasks.CollectionReset -= new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset);
     101      Content.HiveTasks.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded);
     102      Content.HiveTasks.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved);
     103      Content.HiveTasks.CollectionReset -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_CollectionReset);
    102104    }
    103105
     
    112114        refreshAutomaticallyCheckBox.Checked = false;
    113115        logView.Content = null;
     116        runCollectionViewHost.Content = null;
    114117      } else {
    115118        nameTextBox.Text = Content.Job.Name;
     
    119122        refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically;
    120123        logView.Content = Content.Log;
     124        runCollectionViewHost.Content = GetAllRunsFromJob(Content);
    121125      }
    122126      hiveExperimentPermissionListView.Content = null; // has to be filled by refresh button
    123127      Content_JobStatisticsChanged(this, EventArgs.Empty);
    124128      Content_HiveExperimentChanged(this, EventArgs.Empty);
    125       Content_HiveJobChanged(this, EventArgs.Empty);
     129      Content_HiveTasksChanged(this, EventArgs.Empty);
    126130      Content_IsProgressingChanged(this, EventArgs.Empty);
    127131      Content_StateLogListChanged(this, EventArgs.Empty);
     
    163167
    164168    #region Content Events
    165     private void HiveJobs_ItemsAdded_Removed_Reset(object sender, CollectionItemsChangedEventArgs<HiveTask> e) {
    166       if (InvokeRequired)
    167         Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset), sender, e);
    168       else {
    169         SetEnabledStateOfControls();
    170       }
    171     }
     169    private void HiveTasks_ItemsAdded(object sender, CollectionItemsChangedEventArgs<HiveTask> e) {
     170      if (InvokeRequired)
     171        Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded), sender, e);
     172      else {
     173        foreach (HiveTask t in e.Items) {
     174          t.TaskStateChanged += new EventHandler(HiveTask_TaskStateChanged);
     175        }
     176        SetEnabledStateOfControls();
     177      }
     178    }
     179
     180    private void HiveTasks_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<HiveTask> e) {
     181      if (InvokeRequired)
     182        Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved), sender, e);
     183      else {
     184        foreach (HiveTask t in e.Items) {
     185          t.TaskStateChanged -= new EventHandler(HiveTask_TaskStateChanged);
     186        }
     187        SetEnabledStateOfControls();
     188      }
     189    }
     190
     191    private void HiveTasks_CollectionReset(object sender, CollectionItemsChangedEventArgs<HiveTask> e) {
     192      if (InvokeRequired)
     193        Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_CollectionReset), sender, e);
     194      else {
     195        foreach (HiveTask t in e.Items) {
     196          t.TaskStateChanged -= new EventHandler(HiveTask_TaskStateChanged);
     197        }
     198        SetEnabledStateOfControls();
     199      }
     200    }
     201
     202    void HiveTask_TaskStateChanged(object sender, EventArgs e) {
     203      runCollectionViewHost.Content = GetAllRunsFromJob(Content);
     204    }
     205
    172206    private void Content_ExecutionStateChanged(object sender, EventArgs e) {
    173207      if (InvokeRequired)
     
    224258      }
    225259    }
    226     private void Content_HiveJobChanged(object sender, EventArgs e) {
    227       if (InvokeRequired)
    228         Invoke(new EventHandler(Content_HiveJobChanged), sender, e);
     260    private void Content_HiveTasksChanged(object sender, EventArgs e) {
     261      if (InvokeRequired)
     262        Invoke(new EventHandler(Content_HiveTasksChanged), sender, e);
    229263      else {
    230264        if (Content != null && Content.HiveTasks != null) {
     
    236270        SetEnabledStateOfControls();
    237271      }
     272    }
     273
     274    void Content_Loaded(object sender, EventArgs e) {
     275      runCollectionViewHost.Content = GetAllRunsFromJob(Content);
    238276    }
    239277
     
    419457      }
    420458    }
     459
     460    private RunCollection GetAllRunsFromJob(RefreshableJob job) {
     461      if (job != null) {
     462        RunCollection runs = new RunCollection();
     463
     464        foreach (HiveTask subTask in job.HiveTasks) {
     465          if (subTask is OptimizerHiveTask) {
     466            OptimizerHiveTask ohTask = subTask as OptimizerHiveTask;
     467            runs.AddRange(ohTask.ItemTask.Item.Runs);
     468          }
     469        }
     470        return runs;
     471      } else {
     472        return null;
     473      }
     474    }
    421475  }
    422476}
Note: See TracChangeset for help on using the changeset viewer.