Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1136 for trunk


Ignore:
Timestamp:
01/15/09 15:12:22 (15 years ago)
Author:
aleitner
Message:

updated job-detail panel (#452)

Location:
trunk/sources/HeuristicLab.Hive.Server.Console
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.Designer.cs

    r1126 r1136  
    6262      this.lvUserControl = new System.Windows.Forms.ListView();
    6363      this.ilUserControl = new System.Windows.Forms.ImageList(this.components);
     64      this.lvJobControl = new System.Windows.Forms.ListView();
     65      this.ilJobControl = new System.Windows.Forms.ImageList(this.components);
    6466      this.plClientDetails = new System.Windows.Forms.Panel();
    6567      this.lblLogin = new System.Windows.Forms.Label();
     
    7274      this.btnUserControlClose = new System.Windows.Forms.Button();
    7375      this.pbUserControl = new System.Windows.Forms.PictureBox();
    74       this.lvJobControl = new System.Windows.Forms.ListView();
    75       this.ilJobControl = new System.Windows.Forms.ImageList(this.components);
    7676      this.treeView2 = new System.Windows.Forms.TreeView();
    7777      this.listView2 = new System.Windows.Forms.ListView();
     
    141141      this.jobToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
    142142      this.jobToolStripMenuItem.Text = "Job";
    143       this.jobToolStripMenuItem.Click += new System.EventHandler(this.JobToolStripMenuItem1_Click);
     143      this.jobToolStripMenuItem.Click += new System.EventHandler(this.AddJob_Click);
    144144      //
    145145      // userToolStripMenuItem
     
    157157      this.userToolStripMenuItem1.Size = new System.Drawing.Size(114, 22);
    158158      this.userToolStripMenuItem1.Text = "User";
    159       this.userToolStripMenuItem1.Click += new System.EventHandler(this.UserToolStripMenuItem1_Click);
     159      this.userToolStripMenuItem1.Click += new System.EventHandler(this.AddUser_Click);
    160160      //
    161161      // groupToolStripMenuItem2
     
    164164      this.groupToolStripMenuItem2.Size = new System.Drawing.Size(114, 22);
    165165      this.groupToolStripMenuItem2.Text = "Group";
    166       this.groupToolStripMenuItem2.Click += new System.EventHandler(this.GroupToolStripMenuItem2_Click);
     166      this.groupToolStripMenuItem2.Click += new System.EventHandler(this.AddUserGroup_Click);
    167167      //
    168168      // tcManagementConsole
     
    214214      this.tvClientControl.Size = new System.Drawing.Size(139, 346);
    215215      this.tvClientControl.TabIndex = 0;
    216       this.tvClientControl.Click += new System.EventHandler(this.OnTVClientClicked);
    217216      //
    218217      // lvClientControl
     
    355354      //
    356355      this.lblProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    357       this.lblProgress.AutoSize = true;
    358356      this.lblProgress.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
    359       this.lblProgress.Location = new System.Drawing.Point(361, 99);
     357      this.lblProgress.Location = new System.Drawing.Point(326, 99);
    360358      this.lblProgress.Name = "lblProgress";
    361       this.lblProgress.Size = new System.Drawing.Size(58, 13);
     359      this.lblProgress.Size = new System.Drawing.Size(143, 13);
    362360      this.lblProgress.TabIndex = 8;
    363361      this.lblProgress.Text = "lblProgress";
     
    460458      this.ilUserControl.TransparentColor = System.Drawing.Color.Transparent;
    461459      this.ilUserControl.Images.SetKeyName(0, "Users.png");
     460      //
     461      // lvJobControl
     462      //
     463      this.lvJobControl.AllowDrop = true;
     464      this.lvJobControl.Dock = System.Windows.Forms.DockStyle.Fill;
     465      this.lvJobControl.LargeImageList = this.ilJobControl;
     466      this.lvJobControl.Location = new System.Drawing.Point(0, 0);
     467      this.lvJobControl.MultiSelect = false;
     468      this.lvJobControl.Name = "lvJobControl";
     469      this.lvJobControl.Size = new System.Drawing.Size(494, 346);
     470      this.lvJobControl.TabIndex = 0;
     471      this.lvJobControl.UseCompatibleStateImageBehavior = false;
     472      this.lvJobControl.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lvJobControl_MouseMove);
     473      this.lvJobControl.Click += new System.EventHandler(this.OnLVJobControlClicked);
     474      //
     475      // ilJobControl
     476      //
     477      this.ilJobControl.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilJobControl.ImageStream")));
     478      this.ilJobControl.TransparentColor = System.Drawing.Color.Transparent;
     479      this.ilJobControl.Images.SetKeyName(0, "PlayHS.png");
    462480      //
    463481      // plClientDetails
     
    559577      this.pbUserControl.TabStop = false;
    560578      //
    561       // lvJobControl
    562       //
    563       this.lvJobControl.AllowDrop = true;
    564       this.lvJobControl.Dock = System.Windows.Forms.DockStyle.Fill;
    565       this.lvJobControl.LargeImageList = this.ilJobControl;
    566       this.lvJobControl.Location = new System.Drawing.Point(0, 0);
    567       this.lvJobControl.MultiSelect = false;
    568       this.lvJobControl.Name = "lvJobControl";
    569       this.lvJobControl.Size = new System.Drawing.Size(494, 346);
    570       this.lvJobControl.TabIndex = 0;
    571       this.lvJobControl.UseCompatibleStateImageBehavior = false;
    572       this.lvJobControl.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lvJobControl_MouseMove);
    573       this.lvJobControl.Click += new System.EventHandler(this.OnLVJobControlClicked);
    574       //
    575       // ilJobControl
    576       //
    577       this.ilJobControl.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilJobControl.ImageStream")));
    578       this.ilJobControl.TransparentColor = System.Drawing.Color.Transparent;
    579       this.ilJobControl.Images.SetKeyName(0, "PlayHS.png");
    580       //
    581579      // treeView2
    582580      //
     
    600598      //
    601599      this.timerSyncronize.Interval = 10000;
     600      this.timerSyncronize.Tick += new System.EventHandler(this.TickSync);
    602601      //
    603602      // fileSystemWatcher1
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs

    r1126 r1136  
    4040    public event closeForm closeFormEvent;
    4141
    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
    5261
    5362    public HiveServerManagementConsole() {
     
    5665      AddJobs();
    5766      AddUsers();
    58 
    59       timerSyncronize.Tick += new EventHandler(TickSync);
    6067      timerSyncronize.Start();
    6168    }
    6269
     70    /// <summary>
     71    /// event on Ticker
     72    /// </summary>
     73    /// <param name="obj"></param>
     74    /// <param name="e"></param>
    6375    private void TickSync(object obj, EventArgs e) {
    6476      AddClients();
     
    6779    }
    6880
     81    /// <summary>
     82    /// Adds clients to ListView and TreeView
     83    /// </summary>
    6984    private void AddClients() {
    7085      try {
     
    96111        }
    97112        lvClientControl.Groups.Add(lvunsorted);
     113        if (flagClient) {
     114          ClientClicked();
     115        }
    98116      }
    99117      catch (Exception ex) {
     
    103121    }
    104122
     123    /// <summary>
     124    /// Adds jobs to ListView and TreeView
     125    /// </summary>
    105126    private void AddJobs() {
    106127      try {
     
    137158        lvJobControl.Groups.Add(lvJobFinished);
    138159        lvJobControl.Groups.Add(lvJobPending);
     160        if (flagJob) {
     161          JobClicked();
     162        }
    139163      }
    140164      catch (Exception ex) {
     
    144168    }
    145169
     170    /// <summary>
     171    /// Adds users to ListView and TreeView
     172    /// </summary>
    146173    private void AddUsers() {
    147174      try {
     
    175202        }
    176203        lvUserControl.Groups.Add(lvunsorted);
     204        if (flagUser) {
     205          UserClicked();
     206        }
    177207      }
    178208      catch (Exception ex) {
     
    182212    }
    183213
     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
    184288    /// <summary>
    185289    /// Send event to Login-GUI when closing
     
    205309    }
    206310
    207     private void JobToolStripMenuItem1_Click(object sender, EventArgs e) {
     311    private void AddJob_Click(object sender, EventArgs e) {
    208312      AddJobForm newForm = new AddJobForm();
    209313      newForm.Show();
    210314    }
    211315
    212     private void UserToolStripMenuItem1_Click(object sender, EventArgs e) {
     316    private void AddUser_Click(object sender, EventArgs e) {
    213317      AddUserForm newForm = new AddUserForm("User", false);
    214318      newForm.Show();
    215319    }
    216320
    217     private void GroupToolStripMenuItem2_Click(object sender, EventArgs e) {
     321    private void AddUserGroup_Click(object sender, EventArgs e) {
    218322      AddUserForm newForm = new AddUserForm("User", true);
    219323      newForm.Show();
    220 
    221324    }
    222325
    223326    private void OnLVClientClicked(object sender, EventArgs e) {
    224       currentClient = clientInfo.List[lvClientControl.SelectedItems[0].Index];
     327      idxCurrentClient = lvClientControl.SelectedItems[0].Index;
     328      flagClient = true;
    225329      ClientClicked();
    226330    }
    227331
    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();
    239342    }
    240343
     
    242345      scClientControl.Panel2.Controls.Clear();
    243346      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 
    270350    private void btnJobDetailClose_Click(object sender, EventArgs e) {
    271351      scJobControl.Panel2.Controls.Clear();
    272352      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;
    285354    }
    286355
     
    288357      scUserControl.Panel2.Controls.Clear();
    289358      scUserControl.Panel2.Controls.Add(lvUserControl);
    290     }
    291 
    292     ToolTip tt = new ToolTip();
     359      flagUser = false;
     360    }
     361
    293362    private void lvJobControl_MouseMove(object sender, MouseEventArgs e) {
    294363      if ((lvJobControl.GetItemAt(e.X, e.Y) != null) &&
     
    297366      }
    298367    }
    299 
     368    #endregion
    300369  }
    301370}
  • trunk/sources/HeuristicLab.Hive.Server.Console/ServiceLocator.cs

    r1089 r1136  
    3030        Address != String.Empty &&
    3131        Port != String.Empty) {
     32
     33        NetTcpBinding binding =
     34             new NetTcpBinding();
     35
     36        binding.MaxReceivedMessageSize = 5000000;
     37
    3238        ChannelFactory<IServerConsoleFacade> factory =
    3339          new ChannelFactory<IServerConsoleFacade>(
    34             new NetTcpBinding(),
     40            binding,
    3541            new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/ServerConsoleFacade"));
    3642
Note: See TracChangeset for help on using the changeset viewer.