Mercurial > pub > ImplabNet
changeset 214:9c32ef39b851 v2
Added the time delta column to the interactive trace listener
author | cin |
---|---|
date | Fri, 14 Apr 2017 15:57:23 +0300 |
parents | 9ee78a345738 |
children | fe5101083150 |
files | Implab.Diagnostics.Interactive/InteractiveListener.cs Implab.Diagnostics.Interactive/TraceForm.Designer.cs Implab.Diagnostics.Interactive/TraceForm.resx Implab.Diagnostics.Interactive/TraceViewItem.cs |
diffstat | 4 files changed, 40 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/Implab.Diagnostics.Interactive/InteractiveListener.cs Tue Apr 11 01:35:18 2017 +0300 +++ b/Implab.Diagnostics.Interactive/InteractiveListener.cs Fri Apr 14 15:57:23 2017 +0300 @@ -56,7 +56,7 @@ if (m_queue.TryDequeue(out item)) { Interlocked.Decrement(ref m_queueLength); - m_syncGuiThread.Send(x => m_form.AddTraceEvent(item),null); + m_syncGuiThread.Post(x => m_form.AddTraceEvent(item),null); } else { m_queueEvent.WaitOne(); } @@ -113,7 +113,8 @@ Message = entry.ToString(), Thread = args.ThreadId, Channel = args.Channel.ToString(), - Timestamp = Environment.TickCount + Timestamp = Environment.TickCount, + TimeDelta = args.OperationTimeOffset }; Enqueue(item);
--- a/Implab.Diagnostics.Interactive/TraceForm.Designer.cs Tue Apr 11 01:35:18 2017 +0300 +++ b/Implab.Diagnostics.Interactive/TraceForm.Designer.cs Fri Apr 14 15:57:23 2017 +0300 @@ -23,13 +23,14 @@ /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.eventsDataGrid = new System.Windows.Forms.DataGridView(); - this.traceViewItemBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.traceViewItemBindingSource = new System.Windows.Forms.BindingSource(); this.threadDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TimeDelta = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Channel = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.eventsDataGrid)).BeginInit(); @@ -56,20 +57,22 @@ this.eventsDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.eventsDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.threadDataGridViewTextBoxColumn, + this.TimeDelta, this.Channel, this.messageDataGridViewTextBoxColumn}); this.eventsDataGrid.DataSource = this.traceViewItemBindingSource; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.eventsDataGrid.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle4.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.eventsDataGrid.DefaultCellStyle = dataGridViewCellStyle4; this.eventsDataGrid.Location = new System.Drawing.Point(12, 12); this.eventsDataGrid.Name = "eventsDataGrid"; this.eventsDataGrid.ReadOnly = true; + this.eventsDataGrid.RowHeadersVisible = false; this.eventsDataGrid.RowHeadersWidth = 17; this.eventsDataGrid.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.eventsDataGrid.Size = new System.Drawing.Size(939, 480); @@ -82,31 +85,43 @@ // // threadDataGridViewTextBoxColumn // - this.threadDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader; + this.threadDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; this.threadDataGridViewTextBoxColumn.DataPropertyName = "Thread"; this.threadDataGridViewTextBoxColumn.HeaderText = "TID"; this.threadDataGridViewTextBoxColumn.Name = "threadDataGridViewTextBoxColumn"; this.threadDataGridViewTextBoxColumn.ReadOnly = true; - this.threadDataGridViewTextBoxColumn.Width = 5; + this.threadDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.threadDataGridViewTextBoxColumn.Width = 32; + // + // TimeDelta + // + this.TimeDelta.DataPropertyName = "TimeDelta"; + dataGridViewCellStyle2.Format = "\'+\' 0 \'ms\'"; + dataGridViewCellStyle2.NullValue = null; + this.TimeDelta.DefaultCellStyle = dataGridViewCellStyle2; + this.TimeDelta.HeaderText = "TimeDelta"; + this.TimeDelta.Name = "TimeDelta"; + this.TimeDelta.ReadOnly = true; + this.TimeDelta.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // Channel // - this.Channel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.Channel.DataPropertyName = "Channel"; this.Channel.HeaderText = "Channel"; this.Channel.Name = "Channel"; this.Channel.ReadOnly = true; - this.Channel.Width = 79; + this.Channel.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // messageDataGridViewTextBoxColumn // this.messageDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.messageDataGridViewTextBoxColumn.DataPropertyName = "FormattedMessage"; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.messageDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.messageDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle3; this.messageDataGridViewTextBoxColumn.HeaderText = "Message"; this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn"; this.messageDataGridViewTextBoxColumn.ReadOnly = true; + this.messageDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // TraceForm // @@ -127,8 +142,8 @@ private System.Windows.Forms.DataGridView eventsDataGrid; private System.Windows.Forms.BindingSource traceViewItemBindingSource; private System.Windows.Forms.DataGridViewTextBoxColumn threadDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn TimeDelta; private System.Windows.Forms.DataGridViewTextBoxColumn Channel; private System.Windows.Forms.DataGridViewTextBoxColumn messageDataGridViewTextBoxColumn; - } } \ No newline at end of file
--- a/Implab.Diagnostics.Interactive/TraceForm.resx Tue Apr 11 01:35:18 2017 +0300 +++ b/Implab.Diagnostics.Interactive/TraceForm.resx Fri Apr 14 15:57:23 2017 +0300 @@ -117,6 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="TimeDelta.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="Channel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata>
--- a/Implab.Diagnostics.Interactive/TraceViewItem.cs Tue Apr 11 01:35:18 2017 +0300 +++ b/Implab.Diagnostics.Interactive/TraceViewItem.cs Fri Apr 14 15:57:23 2017 +0300 @@ -9,6 +9,7 @@ string m_formattedValue; public string Message { get; set; } + public int TimeDelta { get; set; } public int Timestamp { get; set; } public int Indent { get; set; } public int Thread { get; set; }