Prechádzať zdrojové kódy

增加调试信息。

Dail 1 rok pred
rodič
commit
9e9c892c5a

BIN
.vs/MOTINOVA_MC_Test/FileContentIndex/86392908-4e3d-43cb-9ec7-060c08ba3d6c.vsidx


BIN
.vs/MOTINOVA_MC_Test/v17/.suo


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 459 - 118
MOTINOVA_MC_Test/Form1.Designer.cs


+ 164 - 50
MOTINOVA_MC_Test/Form1.cs

@@ -57,6 +57,11 @@ namespace MOTINOVA_MC_Test
         ushort MC_RunInfo_Refresh_Cnt = 0;
         #endregion
 
+        #region
+        bool MC_DebugInfo_Refresh = false;
+        ushort MC_DebugInfo_Refresh_Cnt = 0;
+        #endregion
+
         #region MC故障码超时计数
         bool MC_ErrorCode_Refresh = false;
         ushort MC_ErrorCode_Refresh_Cnt = 0;
@@ -1060,6 +1065,22 @@ namespace MOTINOVA_MC_Test
             }
             MC_RunInfo_Refresh = false;
 
+            //MC_DebugInfo超时清除
+            if (MC_DebugInfo_Refresh == false)
+            {
+                MC_DebugInfo_Refresh_Cnt++;
+                if (MC_DebugInfo_Refresh_Cnt > 10)//5s
+                {
+                    MC_DebugInfo_Clear();
+                    MC_DebugInfo_Refresh_Cnt = 0;
+                }
+            }
+            else
+            {
+                MC_DebugInfo_Refresh_Cnt = 0;
+            }
+            MC_DebugInfo_Refresh = false;
+
             //MC故障信息超时清除
             if (MC_ErrorCode_Refresh == false)
             {
@@ -1534,56 +1555,7 @@ namespace MOTINOVA_MC_Test
                                 }));
                             }
                             break;
-                        }
-                    case 0x1720://电机程序特性信息
-                        {
-                            unchecked
-                            {
-                                this.Invoke((EventHandler)(delegate
-                                {
-                                    //程序特性
-                                    textBox_Firmware_Special.Text = "";
-                                    for (ushort i = 0; i < 32; i++)
-                                    {
-                                        if (binary_data_1[2 + i] == 0x2E)
-                                        {
-                                            break;
-                                        }
-                                        textBox_Firmware_Special.Text += ((char)binary_data_1[2 + i]).ToString();
-                                    }
-
-                                    //编译时间
-                                    textBox_BuildTime.Text = "";
-                                    do
-                                    {
-                                        ushort[] DateTime = new ushort[6];
-                                        DateTime[0] = (ushort)(binary_data_1[2 + 26] + 2000);
-                                        DateTime[1] = (ushort)(binary_data_1[2 + 27]);
-                                        DateTime[2] = (ushort)(binary_data_1[2 + 28]);
-                                        DateTime[3] = (ushort)(binary_data_1[2 + 29]);
-                                        DateTime[4] = (ushort)(binary_data_1[2 + 30]);
-                                        DateTime[5] = (ushort)(binary_data_1[2 + 31]);
-                                        //年
-                                        textBox_BuildTime.Text += Convert.ToString(DateTime[0]).PadLeft(4, '0');
-                                        //月
-                                        textBox_BuildTime.Text += Convert.ToString(DateTime[1]).PadLeft(2, '0');
-                                        //日
-                                        textBox_BuildTime.Text += Convert.ToString(DateTime[2]).PadLeft(2, '0');
-                                        textBox_BuildTime.Text += " ";
-                                        //时
-                                        textBox_BuildTime.Text += Convert.ToString(DateTime[3]).PadLeft(2, '0');
-                                        textBox_BuildTime.Text += ":";
-                                        //分
-                                        textBox_BuildTime.Text += Convert.ToString(DateTime[4]).PadLeft(2, '0');
-                                        textBox_BuildTime.Text += ":";
-                                        //秒
-                                        textBox_BuildTime.Text += Convert.ToString(DateTime[5]).PadLeft(2, '0');
-                                    } while (false);
-
-                                }));
-                            }
-                            break;
-                        }
+                        }                    
                     case 0x1020://电机运行信息
                         {
                             unchecked
@@ -2376,6 +2348,111 @@ namespace MOTINOVA_MC_Test
                             }
                             break;
                         }
+                    case 0x1720://电机程序特性信息
+                        {
+                            unchecked
+                            {
+                                this.Invoke((EventHandler)(delegate
+                                {
+                                    //程序特性
+                                    textBox_Firmware_Special.Text = "";
+                                    for (ushort i = 0; i < 32; i++)
+                                    {
+                                        if (binary_data_1[2 + i] == 0x2E)
+                                        {
+                                            break;
+                                        }
+                                        textBox_Firmware_Special.Text += ((char)binary_data_1[2 + i]).ToString();
+                                    }
+
+                                    //编译时间
+                                    textBox_BuildTime.Text = "";
+                                    do
+                                    {
+                                        ushort[] DateTime = new ushort[6];
+                                        DateTime[0] = (ushort)(binary_data_1[2 + 26] + 2000);
+                                        DateTime[1] = (ushort)(binary_data_1[2 + 27]);
+                                        DateTime[2] = (ushort)(binary_data_1[2 + 28]);
+                                        DateTime[3] = (ushort)(binary_data_1[2 + 29]);
+                                        DateTime[4] = (ushort)(binary_data_1[2 + 30]);
+                                        DateTime[5] = (ushort)(binary_data_1[2 + 31]);
+                                        //年
+                                        textBox_BuildTime.Text += Convert.ToString(DateTime[0]).PadLeft(4, '0');
+                                        //月
+                                        textBox_BuildTime.Text += Convert.ToString(DateTime[1]).PadLeft(2, '0');
+                                        //日
+                                        textBox_BuildTime.Text += Convert.ToString(DateTime[2]).PadLeft(2, '0');
+                                        textBox_BuildTime.Text += " ";
+                                        //时
+                                        textBox_BuildTime.Text += Convert.ToString(DateTime[3]).PadLeft(2, '0');
+                                        textBox_BuildTime.Text += ":";
+                                        //分
+                                        textBox_BuildTime.Text += Convert.ToString(DateTime[4]).PadLeft(2, '0');
+                                        textBox_BuildTime.Text += ":";
+                                        //秒
+                                        textBox_BuildTime.Text += Convert.ToString(DateTime[5]).PadLeft(2, '0');
+                                    } while (false);
+
+                                }));
+                            }
+                            break;
+                        }
+                    case 0xBA20: //调试信息
+                        {
+                            unchecked
+                            {
+                                this.Invoke((EventHandler)(delegate
+                                {
+                                    MC_DebugInfo_Refresh = true;
+                                    //系统状态机
+                                    DataTemp_int16 = (short)(binary_data_1[2]);
+                                    textBox_DebugInfo_SysFun.Text = Convert.ToString(DataTemp_int16);
+                                    //二层状态机
+                                    DataTemp_int16 = (short)(binary_data_1[3]);
+                                    textBox_DebugInfo_SecondFun.Text = Convert.ToString(DataTemp_int16);
+                                    //电机状态机
+                                    DataTemp_int16 = (short)(binary_data_1[4]);
+                                    textBox_DebugInfo_MotorFun.Text = Convert.ToString(DataTemp_int16);
+                                    //助力状态机
+                                    DataTemp_int16 = (short)(binary_data_1[5]);
+                                    textBox_DebugInfo_AssistFun.Text = Convert.ToString(DataTemp_int16);
+                                    //IdRef
+                                    DataTemp_int16 = (short)(binary_data_1[7] * 256 + binary_data_1[6]);
+                                    textBox_DebugInfo_IdRef.Text = Convert.ToString(DataTemp_int16);
+                                    //IqRef
+                                    DataTemp_int16 = (short)(binary_data_1[9] * 256 + binary_data_1[8]);
+                                    textBox_DebugInfo_IqRef.Text = Convert.ToString(DataTemp_int16);
+                                    //UdRef
+                                    DataTemp_int16 = (short)(binary_data_1[11] * 256 + binary_data_1[10]);
+                                    textBox_DebugInfo_UdRef.Text = Convert.ToString(DataTemp_int16);
+                                    //UqRef
+                                    DataTemp_int16 = (short)(binary_data_1[13] * 256 + binary_data_1[12]);
+                                    textBox_DebugInfo_UqRef.Text = Convert.ToString(DataTemp_int16);
+                                    //瞬时力矩
+                                    DataTemp_int16 = (short)(binary_data_1[15] * 256 + binary_data_1[14]);
+                                    textBox_DebugInfo_TorquePu.Text = Convert.ToString(DataTemp_int16);
+                                    //时间滤波力矩
+                                    DataTemp_int16 = (short)(binary_data_1[17] * 256 + binary_data_1[16]);
+                                    textBox_DebugInfo_TorqueFil.Text = Convert.ToString(DataTemp_int16);
+                                    //踏频滤波力矩
+                                    DataTemp_int16 = (short)(binary_data_1[19] * 256 + binary_data_1[18]);
+                                    textBox_DebugInfo_TorqueCadence.Text = Convert.ToString(DataTemp_int16);
+                                    //IdFdb
+                                    DataTemp_int16 = (short)(binary_data_1[21] * 256 + binary_data_1[20]);
+                                    textBox_DebugInfo_IdFdb.Text = Convert.ToString(DataTemp_int16);
+                                    //IqFdb
+                                    DataTemp_int16 = (short)(binary_data_1[23] * 256 + binary_data_1[22]);
+                                    textBox_DebugInfo_IqFdb.Text = Convert.ToString(DataTemp_int16);
+                                    //助力输出
+                                    DataTemp_int16 = (short)(binary_data_1[25] * 256 + binary_data_1[24]);
+                                    textBox_DebugInfo_AssistOut.Text = Convert.ToString(DataTemp_int16);
+
+                                    //数据保存
+                                    DateAutoSave();
+                                }));
+                            }
+                            break;
+                        }
                     default: break;
                 }
                 //存储器导出数据显示
@@ -2484,6 +2561,19 @@ namespace MOTINOVA_MC_Test
             }
         }
 
+        //电机调试信息清除
+        private void MC_DebugInfo_Clear()
+        {
+            foreach (Control c in tabPage2.Controls)
+            {
+                if ((c is TextBox))
+                {
+                    if (c.Name != tabPage2.ToString())
+                        c.Text = "---";
+                }
+            }
+        }
+
         //姿态传感器信息清除
         private void MC_AttitudeAngle_Clear()
         {
@@ -3105,6 +3195,13 @@ namespace MOTINOVA_MC_Test
                         SaveData += c.Text + " , ";
                     }
                 }
+                foreach (Control c in tabPage2.Controls)
+                {
+                    if (c is TextBox)
+                    {
+                        SaveData += c.Text + " , ";
+                    }
+                }
                 SaveData += "\r\n";
                 System.IO.File.AppendAllText(AutoSaveFileName, SaveData);//sb.ToString());
             }
@@ -4084,6 +4181,9 @@ namespace MOTINOVA_MC_Test
             checkBox_Sensor3.Checked = false;
 
             this.BackColor = System.Drawing.Color.FromArgb((int)0, (int)192, (int)192);
+            tabPage1.BackColor = System.Drawing.Color.FromArgb((int)0, (int)192, (int)192);
+            tabPage2.BackColor = System.Drawing.Color.FromArgb((int)0, (int)192, (int)192);
+            textBox_RevCnt.BackColor = System.Drawing.Color.FromArgb((int)0, (int)192, (int)192);
         }
 
         //选择三力矩
@@ -4108,6 +4208,20 @@ namespace MOTINOVA_MC_Test
             checkBox_Sensor3.Checked = true;
 
             this.BackColor = System.Drawing.Color.FromArgb((int)46, (int)193, (int)144);
+            tabPage1.BackColor = System.Drawing.Color.FromArgb((int)46, (int)193, (int)144);
+            tabPage2.BackColor = System.Drawing.Color.FromArgb((int)46, (int)193, (int)144);
+            textBox_RevCnt.BackColor = System.Drawing.Color.FromArgb((int)46, (int)193, (int)144);
+        }
+
+        private void radioButton_DebugMode_Confg_Click(object sender, EventArgs e)
+        {
+            var RunMode = new byte[1];
+
+            RunMode[0] = 0x02;
+
+            SendCmd((ushort)0x751, (byte)0x16, (ushort)0x1901, RunMode);
+
+            checkBox_AutoSend.Checked = false;
         }
     }
 }

+ 1 - 1
MOTINOVA_MC_Test/Form2.Designer.cs

@@ -418,7 +418,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(120)))));
+            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.ClientSize = new System.Drawing.Size(1064, 582);
             this.Controls.Add(this.groupBox3);
             this.Controls.Add(this.label5);

+ 1 - 1
MOTINOVA_MC_Test/bin/Debug/MOTINOVA_MC_Test.application

@@ -11,7 +11,7 @@
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-        <dsig:DigestValue>fEyjXWdtddt0iG6T6yVDVJFjmnA=</dsig:DigestValue>
+        <dsig:DigestValue>MRSfo1BJ0WlDs/xu2qwyBDsSRUM=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
MOTINOVA_MC_Test/bin/Debug/MOTINOVA_MC_Test.exe


+ 2 - 2
MOTINOVA_MC_Test/bin/Debug/MOTINOVA_MC_Test.exe.manifest

@@ -48,14 +48,14 @@
     </dependentAssembly>
   </dependency>
   <dependency>
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="257536">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="265728">
       <assemblyIdentity name="MOTINOVA_MC_Test" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
       <hash>
         <dsig:Transforms>
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-        <dsig:DigestValue>JSyYLv3LicRggXoGaNjQj0SRzrQ=</dsig:DigestValue>
+        <dsig:DigestValue>LI1cPGMRX9sbMMQcpyEi+ltHO/k=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
MOTINOVA_MC_Test/bin/Debug/MOTINOVA_MC_Test.pdb


BIN
MOTINOVA_MC_Test/bin/Debug/app.publish/MOTINOVA_MC_Test.exe


+ 1 - 1
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.application

@@ -11,7 +11,7 @@
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-        <dsig:DigestValue>fEyjXWdtddt0iG6T6yVDVJFjmnA=</dsig:DigestValue>
+        <dsig:DigestValue>MRSfo1BJ0WlDs/xu2qwyBDsSRUM=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.csproj.GenerateResource.cache


BIN
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.exe


+ 2 - 2
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.exe.manifest

@@ -48,14 +48,14 @@
     </dependentAssembly>
   </dependency>
   <dependency>
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="257536">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="265728">
       <assemblyIdentity name="MOTINOVA_MC_Test" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
       <hash>
         <dsig:Transforms>
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-        <dsig:DigestValue>JSyYLv3LicRggXoGaNjQj0SRzrQ=</dsig:DigestValue>
+        <dsig:DigestValue>LI1cPGMRX9sbMMQcpyEi+ltHO/k=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.pdb


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov