From 6307eb8dbda9076bbc52cc0e7673fcbfdc83fb58 Mon Sep 17 00:00:00 2001 From: Frantisek Burian Date: Thu, 7 Nov 2013 19:04:51 +0100 Subject: [PATCH] Add cycle log for CAN2 --- sw/canshark-gui/Forms/frmMain.Designer.cs | 214 ++++++++++++++++++++-- sw/canshark-gui/Forms/frmMain.cs | 44 ++++- sw/canshark-gui/Forms/frmMain.resx | 21 +++ 3 files changed, 249 insertions(+), 30 deletions(-) diff --git a/sw/canshark-gui/Forms/frmMain.Designer.cs b/sw/canshark-gui/Forms/frmMain.Designer.cs index 5f06f54..3a7d7f1 100644 --- a/sw/canshark-gui/Forms/frmMain.Designer.cs +++ b/sw/canshark-gui/Forms/frmMain.Designer.cs @@ -38,12 +38,21 @@ private void InitializeComponent() System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.channel = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -59,12 +68,23 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Length = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.trackBar1 = new System.Windows.Forms.TrackBar(); this.lperiod = new System.Windows.Forms.Label(); + this.dataGridView3 = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label3 = new System.Windows.Forms.Label(); + this.lperiod2 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit(); this.SuspendLayout(); // // timer1 @@ -96,7 +116,7 @@ private void InitializeComponent() this.pkts_tx, this.pkts_rx, this.pkts_err}); - this.dataGridView1.Location = new System.Drawing.Point(15, 50); + this.dataGridView1.Location = new System.Drawing.Point(15, 66); this.dataGridView1.MultiSelect = false; this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.ReadOnly = true; @@ -177,7 +197,7 @@ private void InitializeComponent() // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.label1.Location = new System.Drawing.Point(12, 34); + this.label1.Location = new System.Drawing.Point(12, 50); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(110, 13); this.label1.TabIndex = 3; @@ -199,6 +219,8 @@ private void InitializeComponent() this.dataGridView2.AllowUserToDeleteRows = false; this.dataGridView2.AllowUserToOrderColumns = true; this.dataGridView2.AllowUserToResizeRows = false; + this.dataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; this.dataGridView2.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; @@ -215,25 +237,26 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn1, this.dataGridViewTextBoxColumn2, this.dataGridViewTextBoxColumn3, + this.Length, this.dataGridViewTextBoxColumn4}); this.dataGridView2.Location = new System.Drawing.Point(15, 155); this.dataGridView2.MultiSelect = false; this.dataGridView2.Name = "dataGridView2"; this.dataGridView2.ReadOnly = true; - dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle16.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle16; this.dataGridView2.RowHeadersVisible = false; this.dataGridView2.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; this.dataGridView2.RowTemplate.Height = 18; this.dataGridView2.ScrollBars = System.Windows.Forms.ScrollBars.None; this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView2.Size = new System.Drawing.Size(613, 152); + this.dataGridView2.Size = new System.Drawing.Size(613, 297); this.dataGridView2.TabIndex = 4; // // dir @@ -269,17 +292,28 @@ private void InitializeComponent() // // dataGridViewTextBoxColumn3 // - dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle13; this.dataGridViewTextBoxColumn3.HeaderText = "Delay"; this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; this.dataGridViewTextBoxColumn3.ReadOnly = true; - this.dataGridViewTextBoxColumn3.Width = 64; + this.dataGridViewTextBoxColumn3.Width = 80; // - // dataGridViewTextBoxColumn4 + // Length // + this.Length.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; - this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle14; + this.Length.DefaultCellStyle = dataGridViewCellStyle14; + this.Length.HeaderText = "Length"; + this.Length.Name = "Length"; + this.Length.ReadOnly = true; + this.Length.Width = 80; + // + // dataGridViewTextBoxColumn4 + // + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; + this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle15; this.dataGridViewTextBoxColumn4.HeaderText = "Counter"; this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; this.dataGridViewTextBoxColumn4.ReadOnly = true; @@ -288,7 +322,7 @@ private void InitializeComponent() // trackBar1 // this.trackBar1.LargeChange = 50; - this.trackBar1.Location = new System.Drawing.Point(15, 380); + this.trackBar1.Location = new System.Drawing.Point(12, 5); this.trackBar1.Maximum = 1000; this.trackBar1.Minimum = 10; this.trackBar1.Name = "trackBar1"; @@ -309,11 +343,140 @@ private void InitializeComponent() this.lperiod.TabIndex = 7; this.lperiod.Text = "0 ms"; // + // dataGridView3 + // + this.dataGridView3.AllowUserToAddRows = false; + this.dataGridView3.AllowUserToDeleteRows = false; + this.dataGridView3.AllowUserToOrderColumns = true; + this.dataGridView3.AllowUserToResizeRows = false; + this.dataGridView3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.dataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.dataGridView3.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; + dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle17.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView3.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17; + this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView3.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn5, + this.dataGridViewTextBoxColumn6, + this.dataGridViewTextBoxColumn7, + this.dataGridViewTextBoxColumn8, + this.dataGridViewTextBoxColumn9, + this.dataGridViewTextBoxColumn10}); + this.dataGridView3.Location = new System.Drawing.Point(647, 155); + this.dataGridView3.MultiSelect = false; + this.dataGridView3.Name = "dataGridView3"; + this.dataGridView3.ReadOnly = true; + dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle24.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView3.RowHeadersDefaultCellStyle = dataGridViewCellStyle24; + this.dataGridView3.RowHeadersVisible = false; + this.dataGridView3.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + this.dataGridView3.RowTemplate.Height = 18; + this.dataGridView3.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView3.Size = new System.Drawing.Size(613, 297); + this.dataGridView3.TabIndex = 8; + // + // dataGridViewTextBoxColumn5 + // + this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle18; + this.dataGridViewTextBoxColumn5.HeaderText = "Dir"; + this.dataGridViewTextBoxColumn5.MinimumWidth = 20; + this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; + this.dataGridViewTextBoxColumn5.ReadOnly = true; + this.dataGridViewTextBoxColumn5.Width = 30; + // + // dataGridViewTextBoxColumn6 + // + dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle19.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle19; + this.dataGridViewTextBoxColumn6.HeaderText = "COB-ID"; + this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; + this.dataGridViewTextBoxColumn6.ReadOnly = true; + this.dataGridViewTextBoxColumn6.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.dataGridViewTextBoxColumn6.Width = 74; + // + // dataGridViewTextBoxColumn7 + // + this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle20; + this.dataGridViewTextBoxColumn7.HeaderText = "Data"; + this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; + this.dataGridViewTextBoxColumn7.ReadOnly = true; + // + // dataGridViewTextBoxColumn8 + // + this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; + this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle21; + this.dataGridViewTextBoxColumn8.HeaderText = "Delay"; + this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; + this.dataGridViewTextBoxColumn8.ReadOnly = true; + this.dataGridViewTextBoxColumn8.Width = 80; + // + // dataGridViewTextBoxColumn9 + // + this.dataGridViewTextBoxColumn9.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; + this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle22; + this.dataGridViewTextBoxColumn9.HeaderText = "Length"; + this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9"; + this.dataGridViewTextBoxColumn9.ReadOnly = true; + this.dataGridViewTextBoxColumn9.Width = 80; + // + // dataGridViewTextBoxColumn10 + // + dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; + this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle23; + this.dataGridViewTextBoxColumn10.HeaderText = "Counter"; + this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; + this.dataGridViewTextBoxColumn10.ReadOnly = true; + this.dataGridViewTextBoxColumn10.Width = 76; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.label3.Location = new System.Drawing.Point(644, 139); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(167, 13); + this.label3.TabIndex = 9; + this.label3.Text = "Canopen cycle log for CAN2"; + // + // lperiod2 + // + this.lperiod2.AutoSize = true; + this.lperiod2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.lperiod2.Location = new System.Drawing.Point(877, 139); + this.lperiod2.Name = "lperiod2"; + this.lperiod2.Size = new System.Drawing.Size(33, 13); + this.lperiod2.TabIndex = 10; + this.lperiod2.Text = "0 ms"; + // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(676, 508); + this.ClientSize = new System.Drawing.Size(1369, 464); + this.Controls.Add(this.lperiod2); + this.Controls.Add(this.label3); + this.Controls.Add(this.dataGridView3); this.Controls.Add(this.lperiod); this.Controls.Add(this.trackBar1); this.Controls.Add(this.label2); @@ -327,6 +490,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -345,13 +509,23 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewTextBoxColumn pkts_err; private System.Windows.Forms.Label label2; private System.Windows.Forms.DataGridView dataGridView2; + private System.Windows.Forms.TrackBar trackBar1; + private System.Windows.Forms.Label lperiod; private System.Windows.Forms.DataGridViewTextBoxColumn dir; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn Length; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; - private System.Windows.Forms.TrackBar trackBar1; - private System.Windows.Forms.Label lperiod; + private System.Windows.Forms.DataGridView dataGridView3; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label lperiod2; } } diff --git a/sw/canshark-gui/Forms/frmMain.cs b/sw/canshark-gui/Forms/frmMain.cs index 75d927d..b30e0f4 100644 --- a/sw/canshark-gui/Forms/frmMain.cs +++ b/sw/canshark-gui/Forms/frmMain.cs @@ -68,19 +68,43 @@ private void timer1_Tick(object sender, EventArgs e) lperiod.Text = Cycle[0].SyncPeriod.ToString("F3") + " ms"; - if (cycle.Length == 0) - return; + if (cycle.Length > 0) + { + + int basecount = (int)cycle[0].count; + + for (int i = 0; i < cycle.Length; i++) + { + dataGridView2[0, i].Value = cycle[i].dir ? "TX" : "RX"; + dataGridView2[1, i].Value = cycle[i].COBstr; + dataGridView2[2, i].Value = cycle[i].data; + dataGridView2[3, i].Value = "+" + cycle[i].delay.ToString("F3") + " ms"; + dataGridView2[4, i].Value = "+" + cycle[i].length.ToString("F3") + " ms"; + dataGridView2[5, i].Value = (cycle[i].count - basecount).ToString("D"); + } + } - int basecount = (int)cycle[0].count; + cycle = Cycle[1].GetCycleSnapshot(); - for (int i = 0; i < cycle.Length; i++) + while (dataGridView3.RowCount < cycle.Length) + dataGridView3.Rows.Add(); + + lperiod2.Text = Cycle[1].SyncPeriod.ToString("F3") + " ms"; + + if (cycle.Length > 0) { - dataGridView2[0, i].Value = cycle[i].dir ? "TX" : "RX"; - dataGridView2[1, i].Value = cycle[i].COBstr; - dataGridView2[2, i].Value = cycle[i].data; - dataGridView2[3, i].Value = "+" + cycle[i].delay.ToString("F3") + " ms"; - dataGridView2[4, i].Value = "+" + cycle[i].length.ToString("F3") + " ms"; - dataGridView2[5, i].Value = (cycle[i].count - basecount).ToString("D"); + + int basecount = (int)cycle[0].count; + + for (int i = 0; i < cycle.Length; i++) + { + dataGridView3[0, i].Value = cycle[i].dir ? "TX" : "RX"; + dataGridView3[1, i].Value = cycle[i].COBstr; + dataGridView3[2, i].Value = cycle[i].data; + dataGridView3[3, i].Value = "+" + cycle[i].delay.ToString("F3") + " ms"; + dataGridView3[4, i].Value = "+" + cycle[i].length.ToString("F3") + " ms"; + dataGridView3[5, i].Value = (cycle[i].count - basecount).ToString("D"); + } } } diff --git a/sw/canshark-gui/Forms/frmMain.resx b/sw/canshark-gui/Forms/frmMain.resx index 639ea41..7ef2828 100644 --- a/sw/canshark-gui/Forms/frmMain.resx +++ b/sw/canshark-gui/Forms/frmMain.resx @@ -150,7 +150,28 @@ True + + True + True + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file