Changeset 7182


Ignore:
Timestamp:
12/13/11 13:13:16 (10 years ago)
Author:
ascheibe
Message:

#1672 switched to HeuristicLab Log and LogView for the Slave UI

Location:
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/LogView.Designer.cs

    r6983 r7182  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.txtLog = new System.Windows.Forms.TextBox();
    4847      this.chkShowBalloonTips = new System.Windows.Forms.CheckBox();
     48      this.hlLogView = new HeuristicLab.Core.Views.LogView();
    4949      this.SuspendLayout();
    50       //
    51       // txtLog
    52       //
    53       this.txtLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    54                   | System.Windows.Forms.AnchorStyles.Left)
    55                   | System.Windows.Forms.AnchorStyles.Right)));
    56       this.txtLog.BackColor = System.Drawing.Color.White;
    57       this.txtLog.Location = new System.Drawing.Point(3, 3);
    58       this.txtLog.Multiline = true;
    59       this.txtLog.Name = "txtLog";
    60       this.txtLog.ReadOnly = true;
    61       this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    62       this.txtLog.Size = new System.Drawing.Size(480, 238);
    63       this.txtLog.TabIndex = 2;
    6450      //
    6551      // chkShowBalloonTips
     
    7561      this.chkShowBalloonTips.CheckedChanged += new System.EventHandler(this.chkShowBalloonTips_CheckedChanged);
    7662      //
     63      // hlLogView
     64      //
     65      this.hlLogView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     66                  | System.Windows.Forms.AnchorStyles.Left)
     67                  | System.Windows.Forms.AnchorStyles.Right)));
     68      this.hlLogView.Caption = "Log View";
     69      this.hlLogView.Content = null;
     70      this.hlLogView.Location = new System.Drawing.Point(3, 3);
     71      this.hlLogView.Name = "hlLogView";
     72      this.hlLogView.ReadOnly = false;
     73      this.hlLogView.Size = new System.Drawing.Size(480, 238);
     74      this.hlLogView.TabIndex = 4;
     75      //
    7776      // LogView
    7877      //
    7978      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    8079      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     80      this.Controls.Add(this.hlLogView);
    8181      this.Controls.Add(this.chkShowBalloonTips);
    82       this.Controls.Add(this.txtLog);
    8382      this.Name = "LogView";
    8483      this.Size = new System.Drawing.Size(486, 267);
     
    9190    #endregion
    9291
    93     private System.Windows.Forms.TextBox txtLog;
    9492    private System.Windows.Forms.CheckBox chkShowBalloonTips;
     93    private HeuristicLab.Core.Views.LogView hlLogView;
    9594  }
    9695}
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/LogView.cs

    r6983 r7182  
    2424using HeuristicLab.Clients.Hive.SlaveCore.Views.Properties;
    2525using HeuristicLab.Common;
     26using HeuristicLab.Core;
    2627using HeuristicLab.Core.Views;
    2728using HeuristicLab.MainForm;
     
    4041    }
    4142
     43    private ILog log;
     44
    4245    public LogView() {
    4346      InitializeComponent();
     47      log = new ThreadSafeLog(Settings.Default.MaxLogCount);
     48      hlLogView.Content = log;
    4449    }
    4550
     
    5863    #endregion
    5964
    60 
    6165    protected override void OnContentChanged() {
    6266      base.OnContentChanged();
     
    6973    #region Event Handlers
    7074    void Content_SlaveMessageLogged(object sender, EventArgs<string> e) {
    71       string msg = string.Format("{0}: {1} {2}", DateTime.Now.ToString("HH:mm:ss"), e.Value, Environment.NewLine);
    72 
    73       if (txtLog.InvokeRequired) {
    74         txtLog.Invoke(new Action<string>(txtLog.AppendText), msg);
    75       } else {
    76         txtLog.AppendText(msg);
    77       }
     75      log.LogMessage(e.Value);
    7876    }
    7977
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/Properties/Settings.Designer.cs

    r7135 r7182  
    9595            }
    9696        }
     97       
     98        [global::System.Configuration.ApplicationScopedSettingAttribute()]
     99        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     100        [global::System.Configuration.DefaultSettingValueAttribute("1000")]
     101        public int MaxLogCount {
     102            get {
     103                return ((int)(this["MaxLogCount"]));
     104            }
     105        }
    97106    }
    98107}
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/Properties/Settings.settings

    r7135 r7182  
    2121      <Value Profile="(Default)">00:00:03</Value>
    2222    </Setting>
     23    <Setting Name="MaxLogCount" Type="System.Int32" Scope="Application">
     24      <Value Profile="(Default)">1000</Value>
     25    </Setting>
    2326  </Settings>
    2427</SettingsFile>
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/app.config

    r7135 r7182  
    44        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
    55            <section name="HeuristicLab.Clients.Hive.SlaveCore.Views.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
     6        </sectionGroup>
     7        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
     8            <section name="HeuristicLab.Clients.Hive.SlaveCore.Views.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    69        </sectionGroup>
    710    </configSections>
     
    2831        </HeuristicLab.Clients.Hive.SlaveCore.Views.Properties.Settings>
    2932    </userSettings>
     33    <applicationSettings>
     34        <HeuristicLab.Clients.Hive.SlaveCore.Views.Properties.Settings>
     35            <setting name="MaxLogCount" serializeAs="String">
     36                <value>1000</value>
     37            </setting>
     38        </HeuristicLab.Clients.Hive.SlaveCore.Views.Properties.Settings>
     39    </applicationSettings>
    3040</configuration>
Note: See TracChangeset for help on using the changeset viewer.