Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5315


Ignore:
Timestamp:
01/17/11 20:58:36 (14 years ago)
Author:
ascheibe
Message:

#1233 added buttons to gui for slave control

Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.Designer.cs

    r5314 r5315  
    2828      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
    2929      this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
    30       this.slaveView = new HeuristicLab.Clients.Hive.Slave.Views.SlaveView();
    3130      this.contextMenuNotifyIcon = new System.Windows.Forms.ContextMenuStrip(this.components);
    3231      this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    3332      this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     33      this.slaveView = new HeuristicLab.Clients.Hive.Slave.Views.SlaveView();
    3434      this.contextMenuNotifyIcon.SuspendLayout();
    3535      this.SuspendLayout();
     
    4444      this.notifyIcon.Visible = true;
    4545      this.notifyIcon.DoubleClick += new System.EventHandler(this.notifyIcon_DoubleClick);
    46       //
    47       // slaveView
    48       //
    49       this.slaveView.Caption = "HeuristicLab Slave View";
    50       this.slaveView.Content = null;
    51       this.slaveView.Location = new System.Drawing.Point(12, 12);
    52       this.slaveView.Name = "slaveView";
    53       this.slaveView.ReadOnly = false;
    54       this.slaveView.Size = new System.Drawing.Size(509, 343);
    55       this.slaveView.TabIndex = 0;
    5646      //
    5747      // contextMenuNotifyIcon
     
    7767      this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
    7868      //
     69      // slaveView
     70      //
     71      this.slaveView.Caption = "HeuristicLab Slave View";
     72      this.slaveView.Content = null;
     73      this.slaveView.Location = new System.Drawing.Point(12, 12);
     74      this.slaveView.Name = "slaveView";
     75      this.slaveView.ReadOnly = false;
     76      this.slaveView.Size = new System.Drawing.Size(658, 343);
     77      this.slaveView.TabIndex = 0;
     78      //
    7979      // MainWindow
    8080      //
    8181      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    8282      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    83       this.ClientSize = new System.Drawing.Size(643, 433);
     83      this.ClientSize = new System.Drawing.Size(676, 433);
    8484      this.ContextMenuStrip = this.contextMenuNotifyIcon;
    8585      this.Controls.Add(this.slaveView);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs

    r5314 r5315  
    9292    }
    9393
     94    public void SoftPauseCore() {
     95      try {
     96        if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed)
     97          pipeProxy.SoftPause();
     98      }
     99      catch (Exception e) {
     100        OnMessageLogged("Error soft pausening core: " + e.ToString());
     101      }
     102    }
     103
     104    public void HardPauseCore() {
     105      try {
     106        if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed)
     107          pipeProxy.HardPause();
     108      }
     109      catch (Exception e) {
     110        OnMessageLogged("Error hard pausening core: " + e.ToString());
     111      }
     112    }
     113
     114    public void RestartCore() {
     115      try {
     116        if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed)
     117          pipeProxy.Restart();
     118      }
     119      catch (Exception e) {
     120        OnMessageLogged("Error restarting core: " + e.ToString());
     121      }
     122    }
     123
    94124    public void Close() {
    95125      if (pipeFactory.State != CommunicationState.Closed) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.Designer.cs

    r5314 r5315  
    4747      this.label1 = new System.Windows.Forms.Label();
    4848      this.txtLog = new System.Windows.Forms.TextBox();
     49      this.btnSoftPause = new System.Windows.Forms.Button();
     50      this.btnHardPause = new System.Windows.Forms.Button();
     51      this.btnRestart = new System.Windows.Forms.Button();
    4952      this.SuspendLayout();
    5053      //
     
    6871      this.txtLog.TabIndex = 1;
    6972      //
     73      // btnSoftPause
     74      //
     75      this.btnSoftPause.Location = new System.Drawing.Point(390, 46);
     76      this.btnSoftPause.Name = "btnSoftPause";
     77      this.btnSoftPause.Size = new System.Drawing.Size(111, 23);
     78      this.btnSoftPause.TabIndex = 2;
     79      this.btnSoftPause.Text = "Soft Pause Core";
     80      this.btnSoftPause.UseVisualStyleBackColor = true;
     81      this.btnSoftPause.Click += new System.EventHandler(this.btnSoftPause_Click);
     82      //
     83      // btnHardPause
     84      //
     85      this.btnHardPause.Location = new System.Drawing.Point(390, 87);
     86      this.btnHardPause.Name = "btnHardPause";
     87      this.btnHardPause.Size = new System.Drawing.Size(111, 23);
     88      this.btnHardPause.TabIndex = 3;
     89      this.btnHardPause.Text = "Hard Pause Core";
     90      this.btnHardPause.UseVisualStyleBackColor = true;
     91      this.btnHardPause.Click += new System.EventHandler(this.btnHardPause_Click);
     92      //
     93      // btnRestart
     94      //
     95      this.btnRestart.Location = new System.Drawing.Point(390, 127);
     96      this.btnRestart.Name = "btnRestart";
     97      this.btnRestart.Size = new System.Drawing.Size(111, 23);
     98      this.btnRestart.TabIndex = 4;
     99      this.btnRestart.Text = "Restart Core";
     100      this.btnRestart.UseVisualStyleBackColor = true;
     101      this.btnRestart.Click += new System.EventHandler(this.btnRestart_Click);
     102      //
    70103      // SlaveView
    71104      //
    72105      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    73106      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     107      this.Controls.Add(this.btnRestart);
     108      this.Controls.Add(this.btnHardPause);
     109      this.Controls.Add(this.btnSoftPause);
    74110      this.Controls.Add(this.txtLog);
    75111      this.Controls.Add(this.label1);
     
    85121    private System.Windows.Forms.Label label1;
    86122    private System.Windows.Forms.TextBox txtLog;
     123    private System.Windows.Forms.Button btnSoftPause;
     124    private System.Windows.Forms.Button btnHardPause;
     125    private System.Windows.Forms.Button btnRestart;
    87126  }
    88127}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs

    r5314 r5315  
    9090    }
    9191    #endregion
     92
     93    private void btnSoftPause_Click(object sender, System.EventArgs e) {
     94      if (Content != null)
     95        Content.SoftPauseCore();
     96    }
     97
     98    private void btnHardPause_Click(object sender, System.EventArgs e) {
     99      if (Content != null)
     100        Content.HardPauseCore();
     101    }
     102
     103    private void btnRestart_Click(object sender, System.EventArgs e) {
     104      if (Content != null)
     105        Content.RestartCore();
     106    }
    92107  }
    93108}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r5314 r5315  
    3838  /// </summary>
    3939  public class Core : MarshalByRefObject {
     40
     41    //TODO: this class should be a singleton; there is only one instance, the reference is meanwhile save in TheCore
     42    public static Core TheCore;
     43
    4044    public static bool abortRequested { get; set; }
    4145    private Semaphore waitShutdownSem = new Semaphore(0, 1);
     
    6266
    6367    public Core() {
     68      TheCore = this;
    6469    }
    6570
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveCommunicationService.cs

    r5314 r5315  
    2828  public class SlaveCommunicationService : ISlaveCommunication {
    2929    private static List<ISlaveCommunicationCallbacks> subscribers = new List<ISlaveCommunicationCallbacks>();
    30     public Core SlaveCore { get; set; }
    31 
    3230
    3331    public bool Subscribe() {
     
    8684
    8785    public void Restart() {
    88       SlaveCore.Restart();
     86      Core.TheCore.Restart();
    8987    }
    9088    public void HardPause() {
    91       SlaveCore.HardPause();
     89      Core.TheCore.HardPause();
    9290    }
    9391
    9492    public void SoftPause() {
    95       SlaveCore.SoftPause();
     93      Core.TheCore.SoftPause();
    9694    }
    9795
    9896    public void ShutdownSlave() {
    99       SlaveCore.Shutdown();
     97      Core.TheCore.Shutdown();
    10098    }
    10199  }
Note: See TracChangeset for help on using the changeset viewer.