Changeset 2109 for trunk/sources
- Timestamp:
- 06/25/09 17:31:19 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Server.Console/3.2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerConsole.Designer.cs
r2065 r2109 206 206 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 207 207 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 208 this.BackColor = System.Drawing. Color.White;208 this.BackColor = System.Drawing.SystemColors.Control; 209 209 this.CancelButton = this.btnCancel; 210 210 this.ClientSize = new System.Drawing.Size(482, 226); -
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerConsole.cs
r2103 r2109 90 90 ServiceLocator.Port = tbPort.Text; 91 91 IServerConsoleFacade scf = ServiceLocator.GetServerConsoleFacade(); 92 Response resp; 92 93 try { 93 94 lblError.Text = "Trying to logon..."; 95 this.Cursor = Cursors.WaitCursor; 94 96 t.Start(); 95 Responseresp = scf.Login(tbUserName.Text, tbPwd.Text);97 resp = scf.Login(tbUserName.Text, tbPwd.Text); 96 98 t.Abort(); 97 if (resp.StatusMessage == "Logged in") return true; 99 this.Cursor = Cursors.Default; 100 if (resp.Success == true) return true; 98 101 lblError.Text = resp.StatusMessage; 102 MessageBox.Show("Wrong username or password"); 99 103 } 100 104 catch (EndpointNotFoundException ene) { 105 t.Abort(); 106 this.Cursor = Cursors.Default; 107 MessageBox.Show(ene.Message); 101 108 lblError.Text = "No Service at this address!"; 109 scf = null; 102 110 } 103 catch ( FaultException ex) {111 catch (Exception ex) { 104 112 //login failed 105 lblError.Text = "Logon failed!";106 113 t.Abort(); 107 return false; 114 this.Cursor = Cursors.Default; 115 MessageBox.Show(ex.Message); 116 lblError.Text = "Logon failed! Please restart console"; 108 117 } 109 118 } 110 //validation failed 111 t.Abort(); 112 return false; 119 return false; 113 120 } 121 114 122 115 123 private void ShowWaitDlg() { … … 161 169 this.Visible = true; 162 170 ServiceLocator.ShutDownFacade(); 171 lblError.Text = ""; 163 172 if (error == true) { 164 173 lblError.Text = "Establishing server connection failed."; -
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
r2099 r2109 216 216 changes.Clear(); 217 217 218 //#region ClientInfo219 //ResponseList<ClientInfo> clientInfoOld = clientInfo;220 //clientInfo = ClientManager.GetAllClients();221 222 //IDictionary<int, ClientInfo> clientInfoOldHelp;223 224 //CloneList(clientInfoOld, out clientInfoOldHelp);225 226 //GetDelta(clientInfoOld.List, clientInfoOldHelp);227 //#endregion228 229 #region Clients230 //ResponseList<ClientGroup> clientsOld = clients;231 232 // newClients = ClientManager.GetAllClientGroups();233 234 //IDictionary<Guid, ClientGroup> clientsOldHelp;235 236 //CloneList(clientsOld, out clientsOldHelp);237 238 //GetDelta(clientsOld.List, clientsOldHelp);239 //DetermineDelta();240 #endregion241 242 218 #region Job 243 219 ResponseList<Job> jobsOld = jobs; … … 259 235 260 236 #endregion 261 262 foreach (Changes change in changes) {263 System.Diagnostics.Debug.WriteLine(change.ID + " " + change.ChangeType);264 }265 266 237 } 267 238 … … 290 261 jobGroup.Add(lvJobPending); 291 262 292 foreach (Job job in jobs.List) { 293 if (job.State == State.calculating) { 294 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 1, lvJobCalculating); 295 lvi.Tag = job; 296 jobObjects.Add(lvi); 297 298 lvi.ToolTipText = (job.Percentage * 100) + "% of job calculated"; 299 } else if (job.State == State.finished) { 300 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobFinished); 301 lvi.Tag = job; 302 jobObjects.Add(lvi); 303 //lvJobControl.Items.Add(lvi); 304 } else if (job.State == State.offline) { 305 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 2, lvJobPending); 306 lvi.Tag = job; 307 jobObjects.Add(lvi); 308 } 309 } // Jobs 310 lvJobControl.BeginUpdate(); 311 foreach (ListViewItem lvi in jobObjects) { 312 lvJobControl.Items.Add(lvi); 313 } 314 // actualization 315 lvJobControl.Groups.Add(lvJobCalculating); 316 lvJobControl.Groups.Add(lvJobFinished); 317 lvJobControl.Groups.Add(lvJobPending); 318 lvJobControl.EndUpdate(); 319 320 if (currentJob != null) { 321 JobClicked(); 263 if (jobs != null && jobs.List != null) { 264 265 foreach (Job job in jobs.List) { 266 if (job.State == State.calculating) { 267 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 1, lvJobCalculating); 268 lvi.Tag = job; 269 jobObjects.Add(lvi); 270 271 lvi.ToolTipText = (job.Percentage * 100) + "% of job calculated"; 272 } else if (job.State == State.finished) { 273 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobFinished); 274 lvi.Tag = job; 275 jobObjects.Add(lvi); 276 //lvJobControl.Items.Add(lvi); 277 } else if (job.State == State.offline || job.State == State.pending) { 278 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 2, lvJobPending); 279 lvi.Tag = job; 280 jobObjects.Add(lvi); 281 } 282 } // Jobs 283 lvJobControl.BeginUpdate(); 284 foreach (ListViewItem lvi in jobObjects) { 285 lvJobControl.Items.Add(lvi); 286 } 287 // actualization 288 lvJobControl.Groups.Add(lvJobCalculating); 289 lvJobControl.Groups.Add(lvJobFinished); 290 lvJobControl.Groups.Add(lvJobPending); 291 lvJobControl.EndUpdate(); 292 293 if (currentJob != null) { 294 JobClicked(); 295 } 322 296 } 323 297 } … … 497 471 ResponseObject<JobResult> jobRes = jobManager.GetLastJobResultOf(currentJob.Id); 498 472 499 lvi = null; 500 lvi = new ListViewItem(); 501 lvi.Text = "Calculation ended:"; 502 lvi.SubItems.Add(jobRes.Obj.DateFinished.ToString()); 503 lvJobDetails.Items.Add(lvi); 473 if (jobRes != null && jobRes.Obj != null) { 474 lvi = null; 475 lvi = new ListViewItem(); 476 lvi.Text = "Calculation ended:"; 477 lvi.SubItems.Add(jobRes.Obj.DateFinished.ToString()); 478 lvJobDetails.Items.Add(lvi); 479 } 504 480 } 505 481 } … … 554 530 if (job.Id == change.ID) { 555 531 lvJobControl.Items[i].Tag = job; 556 if (currentJob.Id == change.ID) { 557 currentJob = job; 558 JobClicked(); 532 if (currentJob != null) { 533 if (currentJob.Id == change.ID) { 534 currentJob = job; 535 JobClicked(); 536 } 559 537 } 560 538 break; … … 562 540 } 563 541 State state = jobs.List[change.Position].State; 564 System.Diagnostics.Debug.WriteLine(lvJobControl.Items[i].Text.ToString());565 542 if (state == State.finished) { 566 543 lvJobControl.Items[i].Group = jobGroup[1]; 567 544 lvJobControl.Items[i].ImageIndex = 0; 568 System.Diagnostics.Debug.WriteLine("finished");569 545 } else if (state == State.calculating) { 570 546 lvJobControl.Items[i].Group = jobGroup[0]; 571 547 lvJobControl.Items[i].ImageIndex = 1; 572 System.Diagnostics.Debug.WriteLine("calculating"); 573 } else if (state == State.offline) { 548 } else if (state == State.offline || state == State.pending) { 574 549 lvJobControl.Items[i].Group = jobGroup[2]; 575 550 lvJobControl.Items[i].ImageIndex = 2; 576 System.Diagnostics.Debug.WriteLine("offline");577 578 551 } 579 552 lvJobControl.Refresh(); … … 813 786 if (noCores > 0) { 814 787 int capacity = ((noCores - freeCores) / noCores) * 100; 815 System.Diagnostics.Debug.WriteLine(capacity);816 788 return capacity; 817 789 } … … 862 834 if (found == false) { 863 835 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Create }); 864 System.Diagnostics.Debug.WriteLine("new Job: " + job.Id);865 836 } 866 837 found = false; … … 868 839 foreach (KeyValuePair<int, Job> kvp in helpJobs) { 869 840 changes.Add(new Changes { Types = Type.Job, ID = kvp.Value.Id, ChangeType = Change.Delete, Position = kvp.Key }); 870 System.Diagnostics.Debug.WriteLine("delete Job: " + kvp.Value.Id);871 841 } 872 842 } -
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/LogonDlg.Designer.cs
r2065 r2109 59 59 this.Controls.Add(this.label1); 60 60 this.Controls.Add(this.pictureBox1); 61 this.Cursor = System.Windows.Forms.Cursors.WaitCursor; 61 62 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 62 63 this.Name = "LogonDlg";
Note: See TracChangeset
for help on using the changeset viewer.