# HG changeset patch # User cin # Date 1492174643 -10800 # Node ID 9c32ef39b8519acf3686c05af119cfb89577f098 # Parent 9ee78a345738900193b23d8f2d5e1eca99334312 Added the time delta column to the interactive trace listener diff -r 9ee78a345738 -r 9c32ef39b851 Implab.Diagnostics.Interactive/InteractiveListener.cs --- 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); diff -r 9ee78a345738 -r 9c32ef39b851 Implab.Diagnostics.Interactive/TraceForm.Designer.cs --- 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. /// 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 diff -r 9ee78a345738 -r 9c32ef39b851 Implab.Diagnostics.Interactive/TraceForm.resx --- 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 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + True diff -r 9ee78a345738 -r 9c32ef39b851 Implab.Diagnostics.Interactive/TraceViewItem.cs --- 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; }