Changeset 5451
- Timestamp:
- 02/07/11 16:49:22 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.cs
r5320 r5451 49 49 } else { 50 50 if (Content != null) { 51 Content. HardPauseCore();51 Content.StopAll(); 52 52 } 53 53 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs
r5450 r5451 92 92 } 93 93 94 public void SoftPauseCore() {94 public void PauseAll() { 95 95 try { 96 96 if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed) 97 pipeProxy. StopAll();97 pipeProxy.PauseAll(); 98 98 } 99 99 catch (Exception e) { … … 102 102 } 103 103 104 public void HardPauseCore() {104 public void StopAll() { 105 105 try { 106 106 if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed) 107 pipeProxy. PauseAll();107 pipeProxy.StopAll(); 108 108 } 109 109 catch (Exception e) { … … 122 122 } 123 123 124 public void Sleep() { 125 try { 126 if (pipeFactory.State != CommunicationState.Faulted && pipeFactory.State != CommunicationState.Closed) 127 pipeProxy.Sleep(); 128 } 129 catch (Exception e) { 130 OnMessageLogged("Error sending core to sleep: " + e.ToString()); 131 } 132 } 133 124 134 public void Close() { 125 135 if (pipeFactory.State != CommunicationState.Closed) { … … 130 140 131 141 public event EventHandler<EventArgs<StatusCommons>> SlaveStatusChanged; 132 public void OnStatusChanged(StatusCommons status) { 142 public void OnStatusChanged(StatusCommons status) { 133 143 var handler = SlaveStatusChanged; 134 144 if (handler != null) handler(this, new EventArgs<StatusCommons>(status)); … … 136 146 137 147 public event EventHandler<EventArgs<string>> SlaveMessageLogged; 138 public void OnMessageLogged(string message) { 148 public void OnMessageLogged(string message) { 139 149 var handler = SlaveMessageLogged; 140 150 if (handler != null) handler(this, new EventArgs<string>(message)); … … 142 152 143 153 public event EventHandler SlaveShutdown; 144 public void OnShutdown() { 154 public void OnShutdown() { 145 155 var handler = SlaveShutdown; 146 156 if (handler != null) handler(this, EventArgs.Empty); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.Designer.cs
r5363 r5451 47 47 this.label1 = new System.Windows.Forms.Label(); 48 48 this.txtLog = new System.Windows.Forms.TextBox(); 49 this.btn SoftPause= new System.Windows.Forms.Button();50 this.btn HardPause= new System.Windows.Forms.Button();49 this.btnPauseAll = new System.Windows.Forms.Button(); 50 this.btnStopAll = new System.Windows.Forms.Button(); 51 51 this.btnRestart = new System.Windows.Forms.Button(); 52 this.btnSleep = new System.Windows.Forms.Button(); 52 53 this.SuspendLayout(); 53 54 // … … 72 73 this.txtLog.TabIndex = 1; 73 74 // 74 // btn SoftPause75 // btnPauseAll 75 76 // 76 this.btn SoftPause.Location = new System.Drawing.Point(390, 46);77 this.btn SoftPause.Name = "btnSoftPause";78 this.btn SoftPause.Size = new System.Drawing.Size(111, 23);79 this.btn SoftPause.TabIndex = 2;80 this.btn SoftPause.Text = "Soft Pause Core";81 this.btn SoftPause.UseVisualStyleBackColor = true;82 this.btn SoftPause.Click += new System.EventHandler(this.btnSoftPause_Click);77 this.btnPauseAll.Location = new System.Drawing.Point(390, 24); 78 this.btnPauseAll.Name = "btnPauseAll"; 79 this.btnPauseAll.Size = new System.Drawing.Size(111, 23); 80 this.btnPauseAll.TabIndex = 2; 81 this.btnPauseAll.Text = "Pause all jobs"; 82 this.btnPauseAll.UseVisualStyleBackColor = true; 83 this.btnPauseAll.Click += new System.EventHandler(this.btnSoftPause_Click); 83 84 // 84 // btn HardPause85 // btnStopAll 85 86 // 86 this.btn HardPause.Location = new System.Drawing.Point(390, 87);87 this.btn HardPause.Name = "btnHardPause";88 this.btn HardPause.Size = new System.Drawing.Size(111, 23);89 this.btn HardPause.TabIndex = 3;90 this.btn HardPause.Text = "Hard Pause Core";91 this.btn HardPause.UseVisualStyleBackColor = true;92 this.btn HardPause.Click += new System.EventHandler(this.btnHardPause_Click);87 this.btnStopAll.Location = new System.Drawing.Point(390, 53); 88 this.btnStopAll.Name = "btnStopAll"; 89 this.btnStopAll.Size = new System.Drawing.Size(111, 23); 90 this.btnStopAll.TabIndex = 3; 91 this.btnStopAll.Text = "Stop all jobs"; 92 this.btnStopAll.UseVisualStyleBackColor = true; 93 this.btnStopAll.Click += new System.EventHandler(this.btnHardPause_Click); 93 94 // 94 95 // btnRestart 95 96 // 96 this.btnRestart.Location = new System.Drawing.Point(390, 1 27);97 this.btnRestart.Location = new System.Drawing.Point(390, 111); 97 98 this.btnRestart.Name = "btnRestart"; 98 99 this.btnRestart.Size = new System.Drawing.Size(111, 23); … … 102 103 this.btnRestart.Click += new System.EventHandler(this.btnRestart_Click); 103 104 // 105 // btnSleep 106 // 107 this.btnSleep.Location = new System.Drawing.Point(390, 82); 108 this.btnSleep.Name = "btnSleep"; 109 this.btnSleep.Size = new System.Drawing.Size(111, 23); 110 this.btnSleep.TabIndex = 5; 111 this.btnSleep.Text = "Send slave to sleep"; 112 this.btnSleep.UseVisualStyleBackColor = true; 113 this.btnSleep.Click += new System.EventHandler(this.btnSleep_Click); 114 // 104 115 // SlaveView 105 116 // 106 117 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 107 118 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 119 this.Controls.Add(this.btnSleep); 108 120 this.Controls.Add(this.btnRestart); 109 this.Controls.Add(this.btn HardPause);110 this.Controls.Add(this.btn SoftPause);121 this.Controls.Add(this.btnStopAll); 122 this.Controls.Add(this.btnPauseAll); 111 123 this.Controls.Add(this.txtLog); 112 124 this.Controls.Add(this.label1); … … 122 134 private System.Windows.Forms.Label label1; 123 135 private System.Windows.Forms.TextBox txtLog; 124 private System.Windows.Forms.Button btn SoftPause;125 private System.Windows.Forms.Button btn HardPause;136 private System.Windows.Forms.Button btnPauseAll; 137 private System.Windows.Forms.Button btnStopAll; 126 138 private System.Windows.Forms.Button btnRestart; 139 private System.Windows.Forms.Button btnSleep; 127 140 } 128 141 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs
r5320 r5451 96 96 private void btnSoftPause_Click(object sender, System.EventArgs e) { 97 97 if (Content != null) 98 Content. SoftPauseCore();98 Content.PauseAll(); 99 99 } 100 100 101 101 private void btnHardPause_Click(object sender, System.EventArgs e) { 102 102 if (Content != null) 103 Content. HardPauseCore();103 Content.StopAll(); 104 104 } 105 105 … … 108 108 Content.RestartCore(); 109 109 } 110 111 private void btnSleep_Click(object sender, System.EventArgs e) { 112 if (Content != null) 113 Content.Sleep(); 114 } 110 115 } 111 116 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
r5450 r5451 140 140 } else if (container is MessageContainer) { 141 141 switch (container.Message) { 142 //Pull a Job from the Server143 142 case MessageContainer.MessageType.CalculateJob: 144 143 Job myJob = wcfService.GetJob(container.JobId); … … 147 146 StartJobInAppDomain(myJob, jobData); 148 147 break; 149 150 148 case MessageContainer.MessageType.ShutdownSlave: 151 149 ShutdownCore(); … … 171 169 case MessageContainer.MessageType.Restart: 172 170 DoStartSlave(); 171 break; 172 case MessageContainer.MessageType.Sleep: 173 Sleep(); 173 174 break; 174 175 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeartbeatManager.cs
r5404 r5451 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Diagnostics;25 24 using System.Threading; 26 25 using HeuristicLab.Common; … … 94 93 FreeCores = info.Cores.HasValue ? info.Cores.Value - ConfigManager.Instance.GetUsedCores() : 0, 95 94 FreeMemory = ConfigManager.GetFreeMemory(), 96 JobProgress = ConfigManager.Instance.GetExecutionTimeOfAllJobs() 95 JobProgress = ConfigManager.Instance.GetExecutionTimeOfAllJobs(), 96 AssignJob = true //TODO: check if we want another job 97 97 }; 98 98 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/PluginCache.cs
r5327 r5451 125 125 CopyFile(baseDir, targetDir, "HeuristicLab.Services.Hive.Common-3.4.dll"); 126 126 CopyFile(baseDir, targetDir, "HeuristicLab.Hive-3.4.dll"); 127 CopyFile(baseDir, targetDir, "HeuristicLab.Clients.Common-3.3.dll"); 127 128 128 129 //TODO: remove, just needed for unit tests -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ServiceContracts/ISlaveCommunication.cs
r5450 r5451 38 38 39 39 [OperationContract] 40 void Sleep(); 41 42 [OperationContract] 40 43 void PauseAll(); 41 44 … … 48 51 [OperationContract] 49 52 void ShutdownSlave(); 50 51 53 52 54 //callbacks -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveCommunicationService.cs
r5450 r5451 107 107 MessageQueue.GetInstance().AddMessage(mc); 108 108 } 109 110 public void Sleep() { 111 MessageContainer mc = new MessageContainer(MessageContainer.MessageType.Sleep); 112 MessageQueue.GetInstance().AddMessage(mc); 113 } 109 114 } 110 115 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/MessageContainer.cs
r5450 r5451 42 42 PauseJob, // pause the job and submit the results 43 43 PauseAll, // pause all jobs and submit results 44 Restart, //restart operation after Soft/HardPause 44 Restart, // restart operation after Sleep 45 Sleep, // disconnect from server, but don't shutdown 45 46 ShutdownSlave, // slave should shutdown immediately without submitting results 46 47 SayHello, // Slave should say hello, because he is unknown to the server
Note: See TracChangeset
for help on using the changeset viewer.