- Timestamp:
- 01/15/09 15:12:22 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
r1126 r1136 40 40 public event closeForm closeFormEvent; 41 41 42 ResponseList<ClientGroup> clients = null; 43 ResponseList<ClientInfo> clientInfo = null; 44 ResponseList<Job> jobs = null; 45 ResponseList<UserGroup> userGroups = null; 46 ResponseList<User> usersList = null; 47 ListView lvClientDetails = null; 48 49 Job currentJob = null; 50 ClientInfo currentClient = null; 51 User currentUser = null; 42 #region private variables 43 private ResponseList<ClientGroup> clients = null; 44 private ResponseList<ClientInfo> clientInfo = null; 45 private ResponseList<Job> jobs = null; 46 private ResponseList<UserGroup> userGroups = null; 47 private ResponseList<User> usersList = null; 48 49 private Job currentJob = null; 50 private ClientInfo currentClient = null; 51 private User currentUser = null; 52 private int idxCurrentJob = 0; 53 private int idxCurrentClient = 0; 54 private int idxCurrentUser = 0; 55 private bool flagJob = false; 56 private bool flagClient = false; 57 private bool flagUser = false; 58 59 private ToolTip tt = new ToolTip(); 60 #endregion 52 61 53 62 public HiveServerManagementConsole() { … … 56 65 AddJobs(); 57 66 AddUsers(); 58 59 timerSyncronize.Tick += new EventHandler(TickSync);60 67 timerSyncronize.Start(); 61 68 } 62 69 70 /// <summary> 71 /// event on Ticker 72 /// </summary> 73 /// <param name="obj"></param> 74 /// <param name="e"></param> 63 75 private void TickSync(object obj, EventArgs e) { 64 76 AddClients(); … … 67 79 } 68 80 81 /// <summary> 82 /// Adds clients to ListView and TreeView 83 /// </summary> 69 84 private void AddClients() { 70 85 try { … … 96 111 } 97 112 lvClientControl.Groups.Add(lvunsorted); 113 if (flagClient) { 114 ClientClicked(); 115 } 98 116 } 99 117 catch (Exception ex) { … … 103 121 } 104 122 123 /// <summary> 124 /// Adds jobs to ListView and TreeView 125 /// </summary> 105 126 private void AddJobs() { 106 127 try { … … 137 158 lvJobControl.Groups.Add(lvJobFinished); 138 159 lvJobControl.Groups.Add(lvJobPending); 160 if (flagJob) { 161 JobClicked(); 162 } 139 163 } 140 164 catch (Exception ex) { … … 144 168 } 145 169 170 /// <summary> 171 /// Adds users to ListView and TreeView 172 /// </summary> 146 173 private void AddUsers() { 147 174 try { … … 175 202 } 176 203 lvUserControl.Groups.Add(lvunsorted); 204 if (flagUser) { 205 UserClicked(); 206 } 177 207 } 178 208 catch (Exception ex) { … … 182 212 } 183 213 214 /// <summary> 215 /// if one client is clicked, a panel is opened with the details 216 /// </summary> 217 private void ClientClicked() { 218 currentClient = clientInfo.List[idxCurrentClient]; 219 scClientControl.Panel2.Controls.Clear(); 220 scClientControl.Panel2.Controls.Add(plClientDetails); 221 pbClientControl.Image = ilClientControl.Images[0]; 222 lblClientName.Text = currentClient.Name; 223 lblLogin.Text = currentClient.Login.ToString(); 224 } 225 226 /// <summary> 227 /// if one job is clicked, a panel is opened with the details 228 /// </summary> 229 private void JobClicked() { 230 int yPos = 0; 231 currentJob = jobs.List[idxCurrentJob]; 232 scJobControl.Panel2.Controls.Clear(); 233 scJobControl.Panel2.Controls.Add(plJobDetails); 234 pbJobControl.Image = ilJobControl.Images[0]; 235 lblJobName.Text = currentJob.Id.ToString(); 236 progressJob.Value = (int)(currentJob.Percentage * 100); 237 yPos = progressJob.Location.Y; 238 yPos += 20; 239 lblProgress.Location = new Point( 240 lblProgress.Location.X, yPos); 241 lblProgress.Text = (int)(currentJob.Percentage * 100) + "% calculated"; 242 yPos += 20; 243 lblUserCreatedJob.Location = new Point( 244 lblUserCreatedJob.Location.X, yPos); 245 lblUserCreatedJob.Text = /* currentJob.User.Name + */ " created Job"; 246 yPos += 20; 247 lblJobCreated.Location = new Point( 248 lblJobCreated.Location.X, yPos); 249 lblJobCreated.Text = "Created at "/* + currentJob.User.CreatedJob + */; 250 if (currentJob.ParentJob != null) { 251 yPos += 20; 252 lblParentJob.Location = new Point( 253 lblParentJob.Location.X, yPos); 254 lblParentJob.Text = currentJob.ParentJob.Id + " is parent job"; 255 } 256 yPos += 20; 257 lblPriorityJob.Location = new Point( 258 lblPriorityJob.Location.X, yPos); 259 lblPriorityJob.Text = "Priority of job is " /* + currentJob.Priority */; 260 if (currentJob.Client != null) { 261 yPos += 20; 262 lblClientCalculating.Location = new Point( 263 lblClientCalculating.Location.X, yPos); 264 lblClientCalculating.Text = currentJob.Client.Name + " calculated Job"; 265 yPos += 20; 266 lblJobCalculationBegin.Location = new Point( 267 lblJobCalculationBegin.Location.X, yPos); 268 lblJobCalculationBegin.Text = "Startet calculation at " /* + currentJob.User.CalculationBegin */; 269 yPos += 20; 270 lblJobCalculationEnd.Location = new Point( 271 lblJobCalculationEnd.Location.X, yPos); 272 lblJobCalculationEnd.Text = "Calculation endet at " /* + currentJob.User.CalculationEnd */; 273 } 274 } 275 276 /// <summary> 277 /// if one user is clicked, a panel is opened with the details 278 /// </summary> 279 private void UserClicked() { 280 currentUser = usersList.List[idxCurrentUser]; 281 scUserControl.Panel2.Controls.Clear(); 282 scUserControl.Panel2.Controls.Add(plUserDetails); 283 pbUserControl.Image = ilUserControl.Images[0]; 284 lblUserName.Text = currentUser.Id.ToString(); 285 } 286 287 #region Eventhandler 184 288 /// <summary> 185 289 /// Send event to Login-GUI when closing … … 205 309 } 206 310 207 private void JobToolStripMenuItem1_Click(object sender, EventArgs e) {311 private void AddJob_Click(object sender, EventArgs e) { 208 312 AddJobForm newForm = new AddJobForm(); 209 313 newForm.Show(); 210 314 } 211 315 212 private void UserToolStripMenuItem1_Click(object sender, EventArgs e) {316 private void AddUser_Click(object sender, EventArgs e) { 213 317 AddUserForm newForm = new AddUserForm("User", false); 214 318 newForm.Show(); 215 319 } 216 320 217 private void GroupToolStripMenuItem2_Click(object sender, EventArgs e) {321 private void AddUserGroup_Click(object sender, EventArgs e) { 218 322 AddUserForm newForm = new AddUserForm("User", true); 219 323 newForm.Show(); 220 221 324 } 222 325 223 326 private void OnLVClientClicked(object sender, EventArgs e) { 224 currentClient = clientInfo.List[lvClientControl.SelectedItems[0].Index]; 327 idxCurrentClient = lvClientControl.SelectedItems[0].Index; 328 flagClient = true; 225 329 ClientClicked(); 226 330 } 227 331 228 private void OnTVClientClicked(object sender, EventArgs e) { 229 // currentClient = clientInfo.List[tvClientControl.SelectedNode.Index]; 230 // ClientClicked(); 231 } 232 233 private void ClientClicked() { 234 scClientControl.Panel2.Controls.Clear(); 235 scClientControl.Panel2.Controls.Add(plClientDetails); 236 pbClientControl.Image = ilClientControl.Images[0]; 237 lblClientName.Text = currentClient.Name; 238 lblLogin.Text = currentClient.Login.ToString(); 332 private void OnLVJobControlClicked(object sender, EventArgs e) { 333 idxCurrentJob = lvJobControl.SelectedItems[0].Index; 334 flagJob = true; 335 JobClicked(); 336 } 337 338 private void OnLVUserControlClicked(object sender, EventArgs e) { 339 idxCurrentUser = lvUserControl.SelectedItems[0].Index; 340 flagUser = true; 341 UserClicked(); 239 342 } 240 343 … … 242 345 scClientControl.Panel2.Controls.Clear(); 243 346 scClientControl.Panel2.Controls.Add(lvClientControl); 244 } 245 246 private void OnLVJobControlClicked(object sender, EventArgs e) { 247 currentJob = jobs.List[lvJobControl.SelectedItems[0].Index]; 248 JobClicked(); 249 250 } 251 private void JobClicked() { 252 scJobControl.Panel2.Controls.Clear(); 253 scJobControl.Panel2.Controls.Add(plJobDetails); 254 pbJobControl.Image = ilJobControl.Images[0]; 255 lblJobName.Text = currentJob.Id.ToString(); 256 progressJob.Value = (int)(currentJob.Percentage * 100); 257 lblProgress.Text = (int)(currentJob.Percentage * 100) + "% calculated"; 258 lblUserCreatedJob.Text = /* currentJob.User.Name + */ " created Job"; 259 lblJobCreated.Text = "Created at "/* + currentJob.User.CreatedJob + */; 260 if (currentJob.ParentJob != null) 261 lblParentJob.Text = currentJob.ParentJob.Id + " is parent job"; 262 lblPriorityJob.Text = "Priority of job is " /* + currentJob.Priority */; 263 if (currentJob.Client != null) { 264 lblClientCalculating.Text = currentJob.Client.Name + " calculated Job"; 265 lblJobCalculationBegin.Text = "Startet calculation at " /* + currentJob.User.CalculationBegin */; 266 lblJobCalculationEnd.Text = "Calculation endet at " /* + currentJob.User.CalculationEnd */; 267 } 268 } 269 347 flagClient = false; 348 } 349 270 350 private void btnJobDetailClose_Click(object sender, EventArgs e) { 271 351 scJobControl.Panel2.Controls.Clear(); 272 352 scJobControl.Panel2.Controls.Add(lvJobControl); 273 } 274 275 private void OnLVUserControlClicked(object sender, EventArgs e) { 276 currentUser = usersList.List[lvUserControl.SelectedItems[0].Index]; 277 UserClicked(); 278 } 279 280 private void UserClicked() { 281 scUserControl.Panel2.Controls.Clear(); 282 scUserControl.Panel2.Controls.Add(plUserDetails); 283 pbUserControl.Image = ilUserControl.Images[0]; 284 lblUserName.Text = currentUser.Id.ToString(); 353 flagJob = false; 285 354 } 286 355 … … 288 357 scUserControl.Panel2.Controls.Clear(); 289 358 scUserControl.Panel2.Controls.Add(lvUserControl); 290 }291 292 ToolTip tt = new ToolTip(); 359 flagUser = false; 360 } 361 293 362 private void lvJobControl_MouseMove(object sender, MouseEventArgs e) { 294 363 if ((lvJobControl.GetItemAt(e.X, e.Y) != null) && … … 297 366 } 298 367 } 299 368 #endregion 300 369 } 301 370 }
Note: See TracChangeset
for help on using the changeset viewer.