Changeset 1372
- Timestamp:
- 03/19/09 17:35:41 (16 years ago)
- Location:
- branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.Designer.cs
r1164 r1372 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.msServerConsole = new System.Windows.Forms.MenuStrip(); 48 this.tsmiConsole = new System.Windows.Forms.ToolStripMenuItem(); 49 this.tsmiExit = new System.Windows.Forms.ToolStripMenuItem(); 50 this.gbManager = new System.Windows.Forms.GroupBox(); 47 this.gbConfiguration = new System.Windows.Forms.GroupBox(); 51 48 this.lblPort = new System.Windows.Forms.Label(); 52 49 this.lblIp = new System.Windows.Forms.Label(); … … 54 51 this.tbIp = new System.Windows.Forms.TextBox(); 55 52 this.btnLogin = new System.Windows.Forms.Button(); 56 this.g roupBox1= new System.Windows.Forms.GroupBox();53 this.gpUser = new System.Windows.Forms.GroupBox(); 57 54 this.tbUserName = new System.Windows.Forms.TextBox(); 58 55 this.lblPwd = new System.Windows.Forms.Label(); … … 60 57 this.tbPwd = new System.Windows.Forms.TextBox(); 61 58 this.lblError = new System.Windows.Forms.Label(); 62 this.msServerConsole.SuspendLayout(); 63 this.gbManager.SuspendLayout(); 64 this.groupBox1.SuspendLayout(); 59 this.gbConfiguration.SuspendLayout(); 60 this.gpUser.SuspendLayout(); 65 61 this.SuspendLayout(); 66 62 // 67 // msServerConsole 68 // 69 this.msServerConsole.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 70 this.tsmiConsole}); 71 this.msServerConsole.Location = new System.Drawing.Point(0, 0); 72 this.msServerConsole.Name = "msServerConsole"; 73 this.msServerConsole.Size = new System.Drawing.Size(311, 24); 74 this.msServerConsole.TabIndex = 0; 75 this.msServerConsole.Text = "menuStrip1"; 76 // 77 // tsmiConsole 78 // 79 this.tsmiConsole.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 80 this.tsmiExit}); 81 this.tsmiConsole.Name = "tsmiConsole"; 82 this.tsmiConsole.Size = new System.Drawing.Size(87, 20); 83 this.tsmiConsole.Text = "Serverconsole"; 84 // 85 // tsmiExit 86 // 87 this.tsmiExit.Name = "tsmiExit"; 88 this.tsmiExit.Size = new System.Drawing.Size(103, 22); 89 this.tsmiExit.Text = "Exit"; 90 this.tsmiExit.Click += new System.EventHandler(this.tsmiExit_Click); 91 // 92 // gbManager 93 // 94 this.gbManager.Controls.Add(this.lblPort); 95 this.gbManager.Controls.Add(this.lblIp); 96 this.gbManager.Controls.Add(this.tbPort); 97 this.gbManager.Controls.Add(this.tbIp); 98 this.gbManager.Location = new System.Drawing.Point(16, 124); 99 this.gbManager.Name = "gbManager"; 100 this.gbManager.Size = new System.Drawing.Size(283, 82); 101 this.gbManager.TabIndex = 4; 102 this.gbManager.TabStop = false; 103 this.gbManager.Text = "Manager"; 63 // gbConfiguration 64 // 65 this.gbConfiguration.Controls.Add(this.lblPort); 66 this.gbConfiguration.Controls.Add(this.lblIp); 67 this.gbConfiguration.Controls.Add(this.tbPort); 68 this.gbConfiguration.Controls.Add(this.tbIp); 69 this.gbConfiguration.Location = new System.Drawing.Point(12, 100); 70 this.gbConfiguration.Name = "gbConfiguration"; 71 this.gbConfiguration.Size = new System.Drawing.Size(283, 82); 72 this.gbConfiguration.TabIndex = 4; 73 this.gbConfiguration.TabStop = false; 74 this.gbConfiguration.Text = "Configuration"; 104 75 // 105 76 // lblPort … … 139 110 // btnLogin 140 111 // 141 this.btnLogin.Location = new System.Drawing.Point(1 83, 212);112 this.btnLogin.Location = new System.Drawing.Point(179, 188); 142 113 this.btnLogin.Name = "btnLogin"; 143 114 this.btnLogin.Size = new System.Drawing.Size(116, 23); … … 148 119 this.btnLogin.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress); 149 120 // 150 // g roupBox1151 // 152 this.g roupBox1.Controls.Add(this.tbUserName);153 this.g roupBox1.Controls.Add(this.lblPwd);154 this.g roupBox1.Controls.Add(this.lblUsername);155 this.g roupBox1.Controls.Add(this.tbPwd);156 this.g roupBox1.Location = new System.Drawing.Point(16, 36);157 this.g roupBox1.Name = "groupBox1";158 this.g roupBox1.Size = new System.Drawing.Size(283, 82);159 this.g roupBox1.TabIndex = 1;160 this.g roupBox1.TabStop = false;161 this.g roupBox1.Text = "Manager";121 // gpUser 122 // 123 this.gpUser.Controls.Add(this.tbUserName); 124 this.gpUser.Controls.Add(this.lblPwd); 125 this.gpUser.Controls.Add(this.lblUsername); 126 this.gpUser.Controls.Add(this.tbPwd); 127 this.gpUser.Location = new System.Drawing.Point(12, 12); 128 this.gpUser.Name = "gpUser"; 129 this.gpUser.Size = new System.Drawing.Size(283, 82); 130 this.gpUser.TabIndex = 1; 131 this.gpUser.TabStop = false; 132 this.gpUser.Text = "User"; 162 133 // 163 134 // tbUserName … … 209 180 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 210 181 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 211 this.ClientSize = new System.Drawing.Size(311, 2 63);182 this.ClientSize = new System.Drawing.Size(311, 225); 212 183 this.Controls.Add(this.lblError); 213 this.Controls.Add(this.g roupBox1);184 this.Controls.Add(this.gpUser); 214 185 this.Controls.Add(this.btnLogin); 215 this.Controls.Add(this.gbManager); 216 this.Controls.Add(this.msServerConsole); 217 this.MainMenuStrip = this.msServerConsole; 186 this.Controls.Add(this.gbConfiguration); 218 187 this.Name = "HiveServerConsole"; 219 188 this.Text = "Server Console"; 220 189 this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress); 221 this.msServerConsole.ResumeLayout(false); 222 this.msServerConsole.PerformLayout(); 223 this.gbManager.ResumeLayout(false); 224 this.gbManager.PerformLayout(); 225 this.groupBox1.ResumeLayout(false); 226 this.groupBox1.PerformLayout(); 190 this.gbConfiguration.ResumeLayout(false); 191 this.gbConfiguration.PerformLayout(); 192 this.gpUser.ResumeLayout(false); 193 this.gpUser.PerformLayout(); 227 194 this.ResumeLayout(false); 228 195 this.PerformLayout(); … … 232 199 #endregion 233 200 234 private System.Windows.Forms.MenuStrip msServerConsole; 235 private System.Windows.Forms.ToolStripMenuItem tsmiConsole; 236 private System.Windows.Forms.ToolStripMenuItem tsmiExit; 237 private System.Windows.Forms.GroupBox gbManager; 201 private System.Windows.Forms.GroupBox gbConfiguration; 238 202 private System.Windows.Forms.Label lblPort; 239 203 private System.Windows.Forms.Label lblIp; … … 241 205 private System.Windows.Forms.TextBox tbIp; 242 206 private System.Windows.Forms.Button btnLogin; 243 private System.Windows.Forms.GroupBox g roupBox1;207 private System.Windows.Forms.GroupBox gpUser; 244 208 private System.Windows.Forms.TextBox tbUserName; 245 209 private System.Windows.Forms.Label lblPwd; -
branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.resx
r778 r1372 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="msServerConsole.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">121 <value>17, 17</value>122 </metadata>123 120 </root> -
branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
r1273 r1372 63 63 private bool flagUser = false; 64 64 65 private List<Changes> changes = new List<Changes>(); 66 65 67 private ToolTip tt = new ToolTip(); 66 68 #endregion … … 80 82 /// <param name="e"></param> 81 83 private void TickSync(object obj, EventArgs e) { 82 Refresh(); 83 //updaterWoker.RunWorkerAsync(); 84 //Refresh(); 85 if (!updaterWoker.IsBusy) { 86 updaterWoker.RunWorkerAsync(); 87 } 84 88 } 85 89 … … 375 379 AddJobForm newForm = new AddJobForm(); 376 380 newForm.Show(); 377 newForm.addJobEvent += new addDelegate(Refresh);381 //newForm.addJobEvent += new addDelegate(updaterWoker.RunWorkerAsync); 378 382 } 379 383 … … 481 485 482 486 private void updaterWoker_DoWork(object sender, DoWorkEventArgs e) { 483 #region ClientInfo 484 List<Changes> changes = new List<Changes>(); 485 ResponseList<ClientInfo> clientInfoOld = clientInfo; 487 486 488 IClientManager clientManager = 487 489 ServiceLocator.GetClientManager(); 490 491 #region ClientInfo 492 ResponseList<ClientInfo> clientInfoOld = clientInfo; 493 clientInfo = clientManager.GetAllClients(); 494 495 ResponseList<ClientInfo> clientInfoOldHelp; 496 497 CloneList(clientInfoOld, out clientInfoOldHelp); 498 499 GetDelta(clientInfoOld.List, clientInfoOldHelp.List); 500 #endregion 501 502 #region Clients 503 ResponseList<ClientGroup> clientsOld = clients; 504 505 clients = clientManager.GetAllClientGroups(); 506 507 ResponseList<ClientGroup> clientsOldHelp; 508 509 CloneList(clientsOld, out clientsOldHelp); 510 511 GetDelta(clientsOld.List, clientsOldHelp.List); 512 #endregion 513 514 #region Job 515 ResponseList<Job> jobsOld = jobs; 516 IJobManager jobManager = 517 ServiceLocator.GetJobManager(); 518 519 jobs = jobManager.GetAllJobs(); 520 521 ResponseList<Job> jobsOldHelp = new ResponseList<Job>(); 522 CloneList(jobsOld, out jobsOldHelp); 523 524 //System.Diagnostics.Debug.WriteLine(jobsOldHelp.List[0].Id.ToString()); 525 526 GetDelta(jobsOld.List, jobsOldHelp.List); 527 528 #endregion 529 530 } 531 #endregion 532 533 #region Helper methods 534 535 private void CloneList(ResponseList<Job> oldList, out ResponseList<Job> newList) { 536 newList = new ResponseList<Job>(); 537 newList.List = new List<Job>(); 538 foreach (Job item in oldList.List) { 539 newList.List.Add(item); 540 } 541 } 542 543 private void CloneList(ResponseList<ClientInfo> oldList, out ResponseList<ClientInfo> newList) { 544 newList = new ResponseList<ClientInfo>(); 545 newList.List = new List<ClientInfo>(); 546 foreach (ClientInfo item in oldList.List) { 547 newList.List.Add(item); 548 } 549 } 550 551 private void CloneList(ResponseList<ClientGroup> oldList, out ResponseList<ClientGroup> newList) { 552 newList = new ResponseList<ClientGroup>(); 553 newList.List = new List<ClientGroup>(); 554 foreach (ClientGroup item in oldList.List) { 555 newList.List.Add(item); 556 } 557 } 558 559 private bool IsEqual(ClientInfo ci1, ClientInfo ci2) { 560 if (ci1.ClientId.Equals(ci2.ClientId)) { 561 return true; 562 } else return false; 563 } 564 565 private void GetDelta(IList<ClientInfo> oldClient, IList<ClientInfo> helpClients) { 488 566 bool found = false; 489 clientInfo = clientManager.GetAllClients();490 491 ResponseList<ClientInfo> clientInfoOldHelp = clientInfoOld;492 567 493 568 foreach (ClientInfo ci in clientInfo.List) { 494 for (int i = 0; i < clientInfoOld.List.Count; i++) {495 ClientInfo cio = clientInfoOld.List[i];569 for (int i = 0; i < oldClient.Count; i++) { 570 ClientInfo cio = oldClient[i]; 496 571 if (ci.Id.Equals(cio.Id)) { 497 572 found = true; … … 499 574 changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Update }); 500 575 } 501 for (int j = 0; j < clientInfoOldHelp.List.Count; j++) {502 if (cio.Id.Equals(clientInfoOldHelp.List[i])) {503 clientInfoOldHelp.List.RemoveAt(i);504 505 506 }576 for (int j = 0; j < helpClients.Count; j++) { 577 if (cio.Id.Equals(helpClients[j])) { 578 helpClients.RemoveAt(j); 579 break; 580 } 581 } 507 582 break; 508 583 } … … 511 586 changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Create }); 512 587 } 513 } 514 foreach (ClientInfo ci in clientInfoOldHelp.List) { 588 found = false; 589 } 590 foreach (ClientInfo ci in helpClients) { 515 591 changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Delete }); 516 592 } 517 #endregion 518 519 #region Clients 520 ResponseList<ClientGroup> clientsOld = clients; 521 found = false; 522 clients = clientManager.GetAllClientGroups(); 523 524 ResponseList<ClientGroup> clientsOldHelp = clientsOld; 525 593 594 } 595 596 private void GetDelta(IList<ClientGroup> oldClient, IList<ClientGroup> helpClients) { 597 598 bool found = false; 526 599 foreach (ClientGroup cg in clients.List) { 527 for (int i = 0; i < clientInfoOld.List.Count; i++) {528 ClientGroup cgo = clientsOld.List[i];600 for (int i = 0; i < oldClient.Count; i++) { 601 ClientGroup cgo = oldClient[i]; 529 602 if (cg.Id.Equals(cgo.Id)) { 530 603 found = true; … … 538 611 } 539 612 } 540 for (int j = 0; j < clientInfoOldHelp.List.Count; j++) {541 if (cgo.Id.Equals( clientInfoOldHelp.List[i])) {542 clientInfoOldHelp.List.RemoveAt(i);613 for (int j = 0; j < helpClients.Count; j++) { 614 if (cgo.Id.Equals(helpClients[j])) { 615 helpClients.RemoveAt(j); 543 616 break; 544 617 } … … 550 623 changes.Add(new Changes { Types = Type.ClientGroup, ID = cg.Id, ChangeType = Change.Create }); 551 624 } 552 } 553 foreach (ClientGroup cg in clientsOldHelp.List) { 625 found = false; 626 } 627 foreach (ClientGroup cg in helpClients) { 554 628 changes.Add(new Changes { Types = Type.ClientGroup, ID = cg.Id, ChangeType = Change.Delete }); 555 629 } 556 #endregion 557 558 #region job 559 ResponseList<Job> jobsOld = jobs; 560 IJobManager jobManager = 561 ServiceLocator.GetJobManager(); 562 found = false; 563 jobs = jobManager.GetAllJobs(); 564 565 ResponseList<Job> jobsOldHelp = jobsOld; 566 630 } 631 632 private void GetDelta(IList<Job> oldJobs, IList<Job> helpJobs) { 633 bool found = false; 567 634 foreach (Job job in jobs.List) { 568 for (int i = 0; i < jobsOld.List.Count; i++) { 569 Job jobold = jobsOld.List[i]; 635 636 for (int i = 0; i < oldJobs.Count; i++) { 637 638 Job jobold = oldJobs[i]; 639 570 640 if (job.Id.Equals(jobold.Id)) { 641 571 642 found = true; 572 if ( job.Client != jobold.Client) {643 if (IsEqual(job.Client, jobold.Client)) { 573 644 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Update }); 574 645 } else if (job.DateCalculated != jobold.DateCalculated) { 575 646 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Update }); 576 647 } 577 //for (int j = 0; j < clientInfoOldHelp.List.Count; j++) { 578 // if (job.Id.Equals(clientInfoOldHelp.List[i])) { 579 // clientInfoOldHelp.List.RemoveAt(i); 580 // break; 581 // } 582 //} 648 649 for (int j = 0; j < helpJobs.Count; j++) { 650 if (job.Id.Equals(helpJobs[j].Id)) { 651 helpJobs.RemoveAt(j); 652 break; 653 } 654 } 583 655 break; 584 656 } 657 585 658 } 586 659 if (found == false) { 587 660 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Create }); 588 } 589 } 590 foreach (Job job in jobsOldHelp.List) { 661 System.Diagnostics.Debug.WriteLine("new Job: " + job.Id); 662 } 663 found = false; 664 } 665 foreach (Job job in helpJobs) { 591 666 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Delete }); 592 } 593 #endregion 594 595 } 667 System.Diagnostics.Debug.WriteLine("delete Job: " + job.Id); 668 } 669 } 670 671 596 672 #endregion 673 674 597 675 } 598 676 }
Note: See TracChangeset
for help on using the changeset viewer.