Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6263


Ignore:
Timestamp:
05/24/11 14:30:55 (13 years ago)
Author:
ascheibe
Message:

#1233

  • added view for displaying jobs
  • improved slave ui
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.Designer.cs

    r6257 r6263  
    3636      this.tabSlaveView = new System.Windows.Forms.TabPage();
    3737      this.slaveView = new HeuristicLab.Clients.Hive.SlaveCore.Views.SlaveView();
     38      this.tabJobs = new System.Windows.Forms.TabPage();
     39      this.jobsView = new HeuristicLab.Clients.Hive.SlaveCore.Views.JobsView();
    3840      this.tabLog = new System.Windows.Forms.TabPage();
    3941      this.logView = new HeuristicLab.Clients.Hive.SlaveCore.Views.LogView();
     
    4345      this.mainTabControl.SuspendLayout();
    4446      this.tabSlaveView.SuspendLayout();
     47      this.tabJobs.SuspendLayout();
    4548      this.tabLog.SuspendLayout();
    4649      this.tabAbout.SuspendLayout();
     
    98101      // mainTabControl
    99102      //
    100       this.mainTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    101                   | System.Windows.Forms.AnchorStyles.Left)
    102                   | System.Windows.Forms.AnchorStyles.Right)));
    103103      this.mainTabControl.Controls.Add(this.tabSlaveView);
     104      this.mainTabControl.Controls.Add(this.tabJobs);
    104105      this.mainTabControl.Controls.Add(this.tabLog);
    105106      this.mainTabControl.Controls.Add(this.tabAbout);
    106       this.mainTabControl.Location = new System.Drawing.Point(12, 12);
     107      this.mainTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
     108      this.mainTabControl.Location = new System.Drawing.Point(0, 0);
     109      this.mainTabControl.Margin = new System.Windows.Forms.Padding(1);
    107110      this.mainTabControl.Name = "mainTabControl";
    108111      this.mainTabControl.SelectedIndex = 0;
    109       this.mainTabControl.Size = new System.Drawing.Size(581, 369);
     112      this.mainTabControl.Size = new System.Drawing.Size(605, 393);
    110113      this.mainTabControl.TabIndex = 1;
    111114      //
     
    116119      this.tabSlaveView.Name = "tabSlaveView";
    117120      this.tabSlaveView.Padding = new System.Windows.Forms.Padding(3);
    118       this.tabSlaveView.Size = new System.Drawing.Size(573, 343);
     121      this.tabSlaveView.Size = new System.Drawing.Size(597, 367);
    119122      this.tabSlaveView.TabIndex = 0;
    120123      this.tabSlaveView.Text = "Overview";
     
    131134      this.slaveView.Name = "slaveView";
    132135      this.slaveView.ReadOnly = false;
    133       this.slaveView.Size = new System.Drawing.Size(561, 331);
     136      this.slaveView.Size = new System.Drawing.Size(585, 355);
    134137      this.slaveView.TabIndex = 0;
     138      //
     139      // tabJobs
     140      //
     141      this.tabJobs.Controls.Add(this.jobsView);
     142      this.tabJobs.Location = new System.Drawing.Point(4, 22);
     143      this.tabJobs.Name = "tabJobs";
     144      this.tabJobs.Size = new System.Drawing.Size(597, 367);
     145      this.tabJobs.TabIndex = 3;
     146      this.tabJobs.Text = "Jobs";
     147      this.tabJobs.UseVisualStyleBackColor = true;
     148      //
     149      // jobsView
     150      //
     151      this.jobsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     152                  | System.Windows.Forms.AnchorStyles.Left)
     153                  | System.Windows.Forms.AnchorStyles.Right)));
     154      this.jobsView.Caption = "JobsView";
     155      this.jobsView.Content = null;
     156      this.jobsView.Location = new System.Drawing.Point(4, 4);
     157      this.jobsView.Name = "jobsView";
     158      this.jobsView.ReadOnly = false;
     159      this.jobsView.Size = new System.Drawing.Size(590, 360);
     160      this.jobsView.TabIndex = 0;
    135161      //
    136162      // tabLog
     
    140166      this.tabLog.Name = "tabLog";
    141167      this.tabLog.Padding = new System.Windows.Forms.Padding(3);
    142       this.tabLog.Size = new System.Drawing.Size(573, 277);
     168      this.tabLog.Size = new System.Drawing.Size(597, 367);
    143169      this.tabLog.TabIndex = 1;
    144170      this.tabLog.Text = "Log";
     
    155181      this.logView.Name = "logView";
    156182      this.logView.ReadOnly = false;
    157       this.logView.Size = new System.Drawing.Size(560, 264);
     183      this.logView.Size = new System.Drawing.Size(584, 352);
    158184      this.logView.TabIndex = 0;
    159185      //
     
    163189      this.tabAbout.Location = new System.Drawing.Point(4, 22);
    164190      this.tabAbout.Name = "tabAbout";
    165       this.tabAbout.Size = new System.Drawing.Size(573, 277);
     191      this.tabAbout.Size = new System.Drawing.Size(577, 347);
    166192      this.tabAbout.TabIndex = 2;
    167193      this.tabAbout.Text = "About HeuristicLab Hive";
     
    178204      this.aboutView.Name = "aboutView";
    179205      this.aboutView.ReadOnly = false;
    180       this.aboutView.Size = new System.Drawing.Size(567, 271);
     206      this.aboutView.Size = new System.Drawing.Size(571, 275);
    181207      this.aboutView.TabIndex = 0;
    182208      //
     
    187213      this.ClientSize = new System.Drawing.Size(605, 393);
    188214      this.Controls.Add(this.mainTabControl);
    189       this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
    190215      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
    191216      this.Name = "MainWindow";
     
    195220      this.mainTabControl.ResumeLayout(false);
    196221      this.tabSlaveView.ResumeLayout(false);
     222      this.tabJobs.ResumeLayout(false);
    197223      this.tabLog.ResumeLayout(false);
    198224      this.tabAbout.ResumeLayout(false);
     
    216242    private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
    217243    private System.Windows.Forms.ToolStripMenuItem homepageToolStripMenuItem;
     244    private System.Windows.Forms.TabPage tabJobs;
     245    private Views.JobsView jobsView;
    218246  }
    219247}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveTrayIcon/MainWindow.cs

    r6257 r6263  
    1212        slaveView.Content = value;
    1313        logView.Content = value;
     14        jobsView.Content = value;
    1415        Content.UserVisibleMessageFired += new EventHandler<Common.EventArgs<string>>(Content_UserVisibleMessageFired);
    1516      }
     
    5859        e.Cancel = true;
    5960        MinimizeToTray();
    60       } else {
    61         if (Content != null) {
    62           Content.StopAll();
    63         }
    6461      }
    6562    }
     
    7269      System.Diagnostics.Process.Start("http://dev.heuristiclab.com");
    7370    }
    74 
    75 
    7671  }
    7772}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/HeuristicLab.Clients.Hive.Slave.Views-3.4.csproj

    r6225 r6263  
    129129      <DependentUpon>AboutView.cs</DependentUpon>
    130130    </Compile>
     131    <Compile Include="JobsView.cs">
     132      <SubType>UserControl</SubType>
     133    </Compile>
     134    <Compile Include="JobsView.Designer.cs">
     135      <DependentUpon>JobsView.cs</DependentUpon>
     136    </Compile>
    131137    <Compile Include="LogView.cs">
    132138      <SubType>UserControl</SubType>
     
    174180    <EmbeddedResource Include="AboutView.resx">
    175181      <DependentUpon>AboutView.cs</DependentUpon>
     182    </EmbeddedResource>
     183    <EmbeddedResource Include="JobsView.resx">
     184      <DependentUpon>JobsView.cs</DependentUpon>
    176185    </EmbeddedResource>
    177186    <EmbeddedResource Include="LogView.resx">
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/LogView.Designer.cs

    r6225 r6263  
    6060      this.txtLog.ReadOnly = true;
    6161      this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    62       this.txtLog.Size = new System.Drawing.Size(480, 209);
     62      this.txtLog.Size = new System.Drawing.Size(480, 238);
    6363      this.txtLog.TabIndex = 2;
    6464      //
     
    6767      this.chkShowBalloonTips.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    6868      this.chkShowBalloonTips.AutoSize = true;
    69       this.chkShowBalloonTips.Location = new System.Drawing.Point(4, 219);
     69      this.chkShowBalloonTips.Location = new System.Drawing.Point(3, 247);
    7070      this.chkShowBalloonTips.Name = "chkShowBalloonTips";
    7171      this.chkShowBalloonTips.Size = new System.Drawing.Size(291, 17);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/Properties/Resources.Designer.cs

    r5602 r6263  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.1
     4//     Runtime Version:4.0.30319.225
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs

    r6257 r6263  
    9292      try {
    9393        pipeProxy = pipeFactory.CreateChannel();
    94         pipeProxy.Subscribe();
    95         return true;
     94        StatusCommons st = pipeProxy.Subscribe();
     95        if (st != null) {
     96          OnStatusChanged(st);
     97          return true;
     98        } else {
     99          return false;
     100        }
    96101      }
    97102      catch (Exception) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.Designer.cs

    r6257 r6263  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    48       System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel5 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
    49       System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel6 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
    50       System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel7 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
    51       System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel8 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
    52       System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
     47      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     48      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel1 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
     49      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel2 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
     50      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel3 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
     51      System.Windows.Forms.DataVisualization.Charting.CustomLabel customLabel4 = new System.Windows.Forms.DataVisualization.Charting.CustomLabel();
     52      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
     53      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
     54      System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
     55      System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
     56      System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
     57      System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
     58      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     59      System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
    5360      System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
    54       System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series();
    55       System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series();
    56       System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series();
    57       System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    58       System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
    59       System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series();
     61      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SlaveView));
    6062      this.jobChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
    6163      this.coresChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
     
    7173      // jobChart
    7274      //
     75      this.jobChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     76                  | System.Windows.Forms.AnchorStyles.Left)
     77                  | System.Windows.Forms.AnchorStyles.Right)));
    7378      this.jobChart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
    74       customLabel5.Text = "Jobs";
    75       customLabel6.Text = "Aborted Jobs";
    76       customLabel7.Text = "Finished Jobs";
    77       customLabel8.Text = "Fetched Jobs";
    78       chartArea3.AxisX.CustomLabels.Add(customLabel5);
    79       chartArea3.AxisX.CustomLabels.Add(customLabel6);
    80       chartArea3.AxisX.CustomLabels.Add(customLabel7);
    81       chartArea3.AxisX.CustomLabels.Add(customLabel8);
    82       chartArea3.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.True;
    83       chartArea3.AxisX.MajorGrid.Enabled = false;
    84       chartArea3.AxisX.MajorTickMark.Enabled = false;
    85       chartArea3.Name = "ChartArea1";
    86       this.jobChart.ChartAreas.Add(chartArea3);
    87       legend3.Name = "Legend1";
    88       this.jobChart.Legends.Add(legend3);
    89       this.jobChart.Location = new System.Drawing.Point(0, 3);
     79      customLabel1.Text = "Jobs";
     80      customLabel2.Text = "Aborted Jobs";
     81      customLabel3.Text = "Finished Jobs";
     82      customLabel4.Text = "Fetched Jobs";
     83      chartArea1.AxisX.CustomLabels.Add(customLabel1);
     84      chartArea1.AxisX.CustomLabels.Add(customLabel2);
     85      chartArea1.AxisX.CustomLabels.Add(customLabel3);
     86      chartArea1.AxisX.CustomLabels.Add(customLabel4);
     87      chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.True;
     88      chartArea1.AxisX.MajorGrid.Enabled = false;
     89      chartArea1.AxisX.MajorTickMark.Enabled = false;
     90      chartArea1.Name = "ChartArea1";
     91      this.jobChart.ChartAreas.Add(chartArea1);
     92      legend1.Name = "Legend1";
     93      this.jobChart.Legends.Add(legend1);
     94      this.jobChart.Location = new System.Drawing.Point(3, 121);
    9095      this.jobChart.Name = "jobChart";
     96      series1.ChartArea = "ChartArea1";
     97      series1.Legend = "Legend1";
     98      series1.Name = "Series1";
     99      series2.ChartArea = "ChartArea1";
     100      series2.Legend = "Legend1";
     101      series2.Name = "Series2";
     102      series3.ChartArea = "ChartArea1";
     103      series3.Legend = "Legend1";
     104      series3.Name = "Series3";
     105      series4.ChartArea = "ChartArea1";
     106      series4.Legend = "Legend1";
     107      series4.Name = "Series4";
     108      series5.ChartArea = "ChartArea1";
     109      series5.Legend = "Legend1";
     110      series5.Name = "Series5";
     111      this.jobChart.Series.Add(series1);
     112      this.jobChart.Series.Add(series2);
     113      this.jobChart.Series.Add(series3);
     114      this.jobChart.Series.Add(series4);
     115      this.jobChart.Series.Add(series5);
     116      this.jobChart.Size = new System.Drawing.Size(412, 189);
     117      this.jobChart.TabIndex = 7;
     118      //
     119      // coresChart
     120      //
     121      this.coresChart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     122      chartArea2.Name = "ChartArea1";
     123      this.coresChart.ChartAreas.Add(chartArea2);
     124      legend2.Name = "Legend1";
     125      this.coresChart.Legends.Add(legend2);
     126      this.coresChart.Location = new System.Drawing.Point(186, 3);
     127      this.coresChart.Name = "coresChart";
    91128      series6.ChartArea = "ChartArea1";
     129      series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
    92130      series6.Legend = "Legend1";
    93131      series6.Name = "Series1";
    94       series7.ChartArea = "ChartArea1";
    95       series7.Legend = "Legend1";
    96       series7.Name = "Series2";
    97       series8.ChartArea = "ChartArea1";
    98       series8.Legend = "Legend1";
    99       series8.Name = "Series3";
    100       series9.ChartArea = "ChartArea1";
    101       series9.Legend = "Legend1";
    102       series9.Name = "Series4";
    103       this.jobChart.Series.Add(series6);
    104       this.jobChart.Series.Add(series7);
    105       this.jobChart.Series.Add(series8);
    106       this.jobChart.Series.Add(series9);
    107       this.jobChart.Size = new System.Drawing.Size(280, 156);
    108       this.jobChart.TabIndex = 7;
    109       //
    110       // coresChart
    111       //
    112       chartArea4.Name = "ChartArea1";
    113       this.coresChart.ChartAreas.Add(chartArea4);
    114       legend4.Name = "Legend1";
    115       this.coresChart.Legends.Add(legend4);
    116       this.coresChart.Location = new System.Drawing.Point(3, 165);
    117       this.coresChart.Name = "coresChart";
    118       series10.ChartArea = "ChartArea1";
    119       series10.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
    120       series10.Legend = "Legend1";
    121       series10.Name = "Series1";
    122       this.coresChart.Series.Add(series10);
    123       this.coresChart.Size = new System.Drawing.Size(277, 135);
     132      this.coresChart.Series.Add(series6);
     133      this.coresChart.Size = new System.Drawing.Size(229, 80);
    124134      this.coresChart.TabIndex = 9;
    125135      //
    126136      // btnStart
    127137      //
    128       this.btnStart.Location = new System.Drawing.Point(467, 111);
     138      this.btnStart.Image = ((System.Drawing.Image)(resources.GetObject("btnStart.Image")));
     139      this.btnStart.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     140      this.btnStart.Location = new System.Drawing.Point(10, 89);
    129141      this.btnStart.Name = "btnStart";
    130142      this.btnStart.Size = new System.Drawing.Size(75, 23);
     
    136148      // btnStop
    137149      //
    138       this.btnStop.Location = new System.Drawing.Point(467, 82);
     150      this.btnStop.Image = ((System.Drawing.Image)(resources.GetObject("btnStop.Image")));
     151      this.btnStop.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     152      this.btnStop.Location = new System.Drawing.Point(10, 60);
    139153      this.btnStop.Name = "btnStop";
    140154      this.btnStop.Size = new System.Drawing.Size(75, 23);
     
    146160      // btnKill
    147161      //
    148       this.btnKill.Location = new System.Drawing.Point(467, 53);
     162      this.btnKill.Location = new System.Drawing.Point(10, 31);
    149163      this.btnKill.Name = "btnKill";
    150164      this.btnKill.Size = new System.Drawing.Size(75, 23);
     
    156170      // lblSlaveState
    157171      //
    158       this.lblSlaveState.Location = new System.Drawing.Point(370, 3);
     172      this.lblSlaveState.Location = new System.Drawing.Point(75, 5);
    159173      this.lblSlaveState.Name = "lblSlaveState";
    160       this.lblSlaveState.Size = new System.Drawing.Size(100, 23);
     174      this.lblSlaveState.Size = new System.Drawing.Size(78, 13);
    161175      this.lblSlaveState.TabIndex = 13;
    162176      //
     
    164178      //
    165179      this.label1.AutoSize = true;
    166       this.label1.Location = new System.Drawing.Point(286, 3);
     180      this.label1.Location = new System.Drawing.Point(7, 5);
    167181      this.label1.Name = "label1";
    168182      this.label1.Size = new System.Drawing.Size(62, 13);
     
    182196      this.Controls.Add(this.jobChart);
    183197      this.Name = "SlaveView";
    184       this.Size = new System.Drawing.Size(590, 313);
     198      this.Size = new System.Drawing.Size(418, 313);
    185199      ((System.ComponentModel.ISupportInitialize)(this.jobChart)).EndInit();
    186200      ((System.ComponentModel.ISupportInitialize)(this.coresChart)).EndInit();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs

    r6257 r6263  
    4040  public partial class SlaveView : ItemView {
    4141
     42    private const UInt32 BCM_SETSHIELD = 0x160C;
     43    [DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
     44    static extern int SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, IntPtr lParam);
     45
    4246    public new SlaveItem Content {
    4347      get { return (SlaveItem)base.Content; }
     
    5155    private SlaveDisplayStat lastSlaveDisplayStat;
    5256
    53     [DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
    54     static extern int SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, IntPtr lParam);
    55 
    56     const UInt32 BCM_SETSHIELD = 0x160C;
    57 
    5857    public SlaveView() {
    5958      InitializeComponent();
    6059
    61       this.btnKill.FlatStyle = FlatStyle.System;
    62       SendMessage(btnKill.Handle, BCM_SETSHIELD, 0, (IntPtr)1);
     60      if (CheckRunAsAdmin()) {
     61        btnKill.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     62        btnKill.Image = HeuristicLab.Common.Resources.VSImageLibrary.BreakpointActive;
     63      } else {
     64        this.btnKill.FlatStyle = FlatStyle.System;
     65        SendMessage(btnKill.Handle, BCM_SETSHIELD, 0, (IntPtr)1);
     66      }
    6367
    6468      lblSlaveState.Text = SlaveDisplayStat.NoService.ToString();
    65       btnKill.Enabled = false;
    66       btnStart.Enabled = false;
    67       btnStop.Enabled = false;
     69      lastSlaveDisplayStat = SlaveDisplayStat.NoService;
     70      Content_SlaveDisplayStateChanged(this, new EventArgs<SlaveDisplayStat>(lastSlaveDisplayStat));
    6871    }
    6972
     
    106109
    107110    private void Connector() {
     111      Content_SlaveDisplayStateChanged(this, new EventArgs<SlaveDisplayStat>(SlaveDisplayStat.NoService));
    108112      bool connected = false;
    109113      while (!connected) {
     
    163167      jobChart.Series[2].Points.Clear();
    164168      jobChart.Series[3].Points.Clear();
     169      jobChart.Series[4].Points.Clear();
     170
    165171
    166172      DataPoint pJobs = new DataPoint(1, status.Jobs.Count);
     
    168174      DataPoint pJobsDone = new DataPoint(3, status.JobsFinished);
    169175      DataPoint pJobsFetched = new DataPoint(4, status.JobsFetched);
     176      DataPoint pJobsFailed = new DataPoint(5, status.JobsFailed);
    170177
    171178      pJobs.LegendText = "Current jobs: " + status.Jobs.Count;
    172       pJobs.Color = System.Drawing.Color.Orange;
     179      pJobs.Color = System.Drawing.Color.Yellow;
    173180      pJobs.ToolTip = pJobs.LegendText;
     181      jobChart.Series[0].Color = System.Drawing.Color.Yellow;
    174182      jobChart.Series[0].LegendText = pJobs.LegendText;
    175183      jobChart.Series[0].Points.Add(pJobs);
    176184
    177185      pJobsAborted.LegendText = "Aborted jobs: " + status.JobsAborted;
    178       pJobsAborted.Color = System.Drawing.Color.Red;
     186      pJobsAborted.Color = System.Drawing.Color.Orange;
    179187      pJobsAborted.ToolTip = pJobsAborted.LegendText;
     188      jobChart.Series[1].Color = System.Drawing.Color.Orange;
    180189      jobChart.Series[1].LegendText = pJobsAborted.LegendText;
    181190      jobChart.Series[1].Points.Add(pJobsAborted);
     
    184193      pJobsDone.Color = System.Drawing.Color.Green;
    185194      pJobsDone.ToolTip = pJobsDone.LegendText;
     195      jobChart.Series[2].Color = System.Drawing.Color.Green;
    186196      jobChart.Series[2].LegendText = pJobsDone.LegendText;
    187197      jobChart.Series[2].Points.Add(pJobsDone);
     
    190200      pJobsFetched.ToolTip = pJobsFetched.LegendText;
    191201      pJobsFetched.Color = System.Drawing.Color.Blue;
     202      jobChart.Series[3].Color = System.Drawing.Color.Blue;
    192203      jobChart.Series[3].LegendText = pJobsFetched.LegendText;
    193204      jobChart.Series[3].Points.Add(pJobsFetched);
     205
     206      pJobsFailed.LegendText = "Failed jobs: " + status.JobsFailed;
     207      pJobsFailed.ToolTip = pJobsFailed.LegendText;
     208      pJobsFailed.Color = System.Drawing.Color.Red;
     209      jobChart.Series[4].Color = System.Drawing.Color.Red;
     210      jobChart.Series[4].LegendText = pJobsFailed.LegendText;
     211      jobChart.Series[4].Points.Add(pJobsFailed);
    194212    }
    195213
     
    222240    }
    223241
     242    /// <summary>
     243    /// shows the windows UAC dialog and restarts tray icon app
     244    /// </summary>
    224245    private void ElevateApplication() {
    225246      // Launch itself as administrator
     
    234255      }
    235256      catch {
    236         // The user refused to allow privileges elevation.
    237         // Do nothing and return directly ...
     257        // user refused to allow privileges elevation       
    238258        return;
    239259      }
    240       Application.Exit();  // Quit itself
     260      Application.Exit();
    241261    }
    242262
     
    265285    private void StopService() {
    266286      string serviceName = "HeuristicLab.Clients.Hive.SlaveCore.SlaveWindowsService";
    267       TimeSpan timeout = TimeSpan.FromMilliseconds(5000);
     287      TimeSpan timeout = TimeSpan.FromMilliseconds(7000);
    268288
    269289      ServiceController service = new ServiceController(serviceName);
     
    288308        ElevateApplication();
    289309      }
    290 
    291310    }
    292311
     
    310329      }
    311330    }
     331
     332
    312333  }
    313334}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.resx

    r5314 r6263  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     121  <data name="btnStart.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     122    <value>
     123        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
     124        JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsPAAALDwGS+QOlAAABEElE
     125        QVQ4T2P4//8/AzpO6HnCjE0cmxiGZpAioAEyQMxEjCFYDSic9fx//OS3SsQYgtWA3JnP/id03/sfN+G1
     126        BiHvYDUgY8rT//P2//4f1HDzNdAAW3yG4AqD/7P3/frfufXvf7fSy/+BBtjjMgSrAZFdj/5P2fbrf8nS
     127        v/8Tpv/9b5N7FqchWA0IbH74v3Xte7Bm45Iv/6Wjr/03jlz236HobDy6S7Aa4FF1/3/J3HdwzYouPf+l
     128        fVYHEp0O7Evv/g9seQa2GaJ5pReuNIHVBRZ5d/7bFFyBabbBl6CwGmCYdRusWcpruSuh1IjVAJ20G0Bn
     129        r/ElpBkkj9UAKe+1ftLeK4jKUFgNIMZmmBqKDQAA4djU9Io7KYIAAAAASUVORK5CYII=
     130</value>
     131  </data>
     132  <data name="btnStop.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     133    <value>
     134        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
     135        JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsPAAALDwGS+QOlAAABa0lE
     136        QVQ4T82TP0gCYRjGXQoaoq0xWloiISiKlgiCcHIJIaFJCII0GoIyKrCyvxyUKEViZhJKKR5YRtkfarAS
     137        EqHCEBeNDAoRvDTPK57uc7uGC3Ko4Rt/v+d7n5dXAkBSyisJJsH/TEB5P7FIFzDrzkHnZDBhT2N04wXD
     138        5mcMrT5i0JTIfO9LMAKB7+MfuEtwCDwUcHjDwhtk4QqwsPizkCp2eF5YukBAkqNPHIJRrgg6L/JY8+Ww
     139        4mUwZ4+hTr4lLiDfvo1zOAqx2D7Lw8iDemcGY9ZXqKkwarrWxQVk5qsIB/cln3zwjvldAqegMSahGDlF
     140        dbtBXEAK84dZ2E7yWKbfoLWm0W9IQjkTg2xgD1UtS+IC0rbnmoVxP4tJewpqEw/ro5BrQ+jsc6GiUS8u
     141        IKvaPGYwbYtAQ4WgHD/nkz3oUDnQ2mNGWYNOXED23KbyoamXRn23A7UyS3HuyuYFlEunfhb85qj+/ha+
     142        AFwj9H5OYBpkAAAAAElFTkSuQmCC
     143</value>
     144  </data>
    120145</root>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r6258 r6263  
    8484        if (ServiceEventLog != null) {
    8585          try {
    86             ServiceEventLog.WriteEntry(string.Format("Hive Slave threw exception: {0} with stack trace: {1}", ex.ToString(), ex.StackTrace));
     86            ServiceEventLog.WriteEntry(string.Format("Hive Slave threw exception: {0} with stack trace: {1}", ex.ToString(), ex.StackTrace), EventLogEntryType.Error);
    8787          }
    8888          catch (Exception) { }
     
    295295    private void DoAbortAll() {
    296296      lock (slaveJobs) {
    297         foreach (SlaveJob sj in slaveJobs.Values) {
     297        foreach (SlaveJob sj in new List<SlaveJob>(slaveJobs.Values)) {
    298298          if (!sj.Finished) {
    299299            sj.KillAppDomain();
     
    311311
    312312      lock (slaveJobs) {
    313         foreach (SlaveJob sj in slaveJobs.Values) {
     313        foreach (SlaveJob sj in new List<SlaveJob>(slaveJobs.Values)) {
    314314          if (!sj.Finished) {
    315315            sj.PauseJob();
     
    326326
    327327      lock (slaveJobs) {
    328         foreach (SlaveJob sj in slaveJobs.Values) {
     328        foreach (SlaveJob sj in new List<SlaveJob>(slaveJobs.Values)) {
    329329          if (!sj.Finished) {
    330330            sj.StopJob();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ServiceContracts/ISlaveCommunication.cs

    r5826 r6263  
    2828
    2929    [OperationContract]
    30     bool Subscribe();
     30    StatusCommons Subscribe();
    3131
    3232    [OperationContract]
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveCommunicationService.cs

    r5826 r6263  
    3030    private static List<ISlaveCommunicationCallbacks> subscribers = new List<ISlaveCommunicationCallbacks>();
    3131
    32     public bool Subscribe() {
     32    public StatusCommons Subscribe() {
    3333      try {
    3434        ISlaveCommunicationCallbacks callback = OperationContext.Current.GetCallbackChannel<ISlaveCommunicationCallbacks>();
     
    3636          subscribers.Add(callback);
    3737        }
    38         return true;
     38        return ConfigManager.Instance.GetStatusForClientConsole();
    3939      }
    4040      catch {
    41         return false;
     41        return null;
    4242      }
    4343    }
Note: See TracChangeset for help on using the changeset viewer.