瀏覽代碼

修改控制器内阻标定的指令。

Dail 1 年之前
父節點
當前提交
3e2d109a8f

二進制
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 66 - 24
Welling_Motor_Debug_Tool/Version.Designer.cs

@@ -29,44 +29,39 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Version));
-            this.label1 = new System.Windows.Forms.Label();
             this.label_Ver = new System.Windows.Forms.Label();
             this.label_BT = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.button_CheckVersion = new System.Windows.Forms.Button();
+            this.richTextBox_Log = new System.Windows.Forms.RichTextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+            this.statusStrip1.SuspendLayout();
             this.SuspendLayout();
             // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label1.Location = new System.Drawing.Point(49, 164);
-            this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(282, 21);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "版权所有:武汉天腾动力科技有限公司";
-            // 
             // label_Ver
             // 
             this.label_Ver.AutoSize = true;
+            this.label_Ver.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_Ver.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label_Ver.Location = new System.Drawing.Point(49, 102);
+            this.label_Ver.Location = new System.Drawing.Point(14, 58);
             this.label_Ver.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
             this.label_Ver.Name = "label_Ver";
-            this.label_Ver.Size = new System.Drawing.Size(104, 21);
+            this.label_Ver.Size = new System.Drawing.Size(60, 20);
             this.label_Ver.TabIndex = 0;
-            this.label_Ver.Text = "版本:V2.1.2";
+            this.label_Ver.Text = "版本:V";
             // 
             // label_BT
             // 
             this.label_BT.AutoSize = true;
+            this.label_BT.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_BT.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label_BT.Location = new System.Drawing.Point(49, 133);
+            this.label_BT.Location = new System.Drawing.Point(140, 58);
             this.label_BT.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
             this.label_BT.Name = "label_BT";
-            this.label_BT.Size = new System.Drawing.Size(243, 21);
+            this.label_BT.Size = new System.Drawing.Size(213, 20);
             this.label_BT.TabIndex = 0;
             this.label_BT.Text = "编译时间:2022-05-22 14:00:00";
             // 
@@ -74,7 +69,7 @@
             // 
             this.pictureBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.pictureBox2.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.about;
-            this.pictureBox2.Location = new System.Drawing.Point(111, 46);
+            this.pictureBox2.Location = new System.Drawing.Point(19, 18);
             this.pictureBox2.Name = "pictureBox2";
             this.pictureBox2.Size = new System.Drawing.Size(167, 23);
             this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -85,7 +80,7 @@
             // 
             this.button_CheckVersion.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.button_CheckVersion.ForeColor = System.Drawing.Color.White;
-            this.button_CheckVersion.Location = new System.Drawing.Point(278, 209);
+            this.button_CheckVersion.Location = new System.Drawing.Point(378, 284);
             this.button_CheckVersion.Name = "button_CheckVersion";
             this.button_CheckVersion.Size = new System.Drawing.Size(94, 40);
             this.button_CheckVersion.TabIndex = 19;
@@ -93,38 +88,85 @@
             this.button_CheckVersion.UseVisualStyleBackColor = false;
             this.button_CheckVersion.Click += new System.EventHandler(this.button_CheckVersion_Click);
             // 
+            // richTextBox_Log
+            // 
+            this.richTextBox_Log.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.richTextBox_Log.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.richTextBox_Log.Location = new System.Drawing.Point(14, 124);
+            this.richTextBox_Log.Name = "richTextBox_Log";
+            this.richTextBox_Log.ReadOnly = true;
+            this.richTextBox_Log.Size = new System.Drawing.Size(352, 200);
+            this.richTextBox_Log.TabIndex = 20;
+            this.richTextBox_Log.Text = "V2.1.6\n修改控制器内阻校准指令,增加写入存储标志。";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label2.Location = new System.Drawing.Point(14, 91);
+            this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(79, 20);
+            this.label2.TabIndex = 0;
+            this.label2.Text = "修订记录:";
+            // 
+            // statusStrip1
+            // 
+            this.statusStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripStatusLabel1});
+            this.statusStrip1.Location = new System.Drawing.Point(0, 339);
+            this.statusStrip1.Name = "statusStrip1";
+            this.statusStrip1.Size = new System.Drawing.Size(484, 22);
+            this.statusStrip1.TabIndex = 21;
+            this.statusStrip1.Text = "statusStrip1";
+            // 
+            // toolStripStatusLabel1
+            // 
+            this.toolStripStatusLabel1.ForeColor = System.Drawing.Color.White;
+            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(212, 17);
+            this.toolStripStatusLabel1.Text = "版权所有:武汉天腾动力科技有限公司";
+            // 
             // Version
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
-            this.ClientSize = new System.Drawing.Size(384, 261);
+            this.ClientSize = new System.Drawing.Size(484, 361);
+            this.Controls.Add(this.statusStrip1);
+            this.Controls.Add(this.richTextBox_Log);
             this.Controls.Add(this.button_CheckVersion);
             this.Controls.Add(this.pictureBox2);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.label_BT);
             this.Controls.Add(this.label_Ver);
-            this.Controls.Add(this.label1);
             this.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.Margin = new System.Windows.Forms.Padding(5);
             this.MaximizeBox = false;
             this.Name = "Version";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "Version";
             this.Load += new System.EventHandler(this.Version_Load);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+            this.statusStrip1.ResumeLayout(false);
+            this.statusStrip1.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();
 
         }
 
         #endregion
-
-        private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label_Ver;
         private System.Windows.Forms.Label label_BT;
         private System.Windows.Forms.PictureBox pictureBox2;
         private System.Windows.Forms.Button button_CheckVersion;
+        private System.Windows.Forms.RichTextBox richTextBox_Log;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.StatusStrip statusStrip1;
+        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
     }
 }

+ 3 - 0
Welling_Motor_Debug_Tool/Version.resx

@@ -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="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 20 - 20
Welling_Motor_Debug_Tool/mainForm.cs

@@ -23,7 +23,7 @@ namespace Welling_Motor_Debug_Tool
     {
         #region 变量定义
         //版本号
-        public static string Version = "2.1.5";
+        public static string Version = "2.1.6";
         //串口实例
         Serial_Process mySerialProcess = new Serial_Process();
         string PortNumSave = "";
@@ -7520,12 +7520,11 @@ namespace Welling_Motor_Debug_Tool
             textBox_MOS_R3.Text = "";
             try
             {
-                var Code = new byte[16];
-                for (int i = 0; i < 16; i++)
-                    Code[i] = 0;
-                ushort uwDataTemp = 0;                
-                Code[0] = 0xAA;
-                Code[1] = 0xAA;
+                var Code = new byte[18];
+                for (int i = 0; i < 18; i++)
+                    Code[i] = 0;                
+                Code[0] = (byte)((写入存储ToolStripMenuItem.Checked) ? 0x01 : 0x00);
+                ushort uwDataTemp = 0;
                 uwDataTemp = Convert.ToUInt16(textBox_MOS_K1.Text);
                 Code[2] = (byte)(uwDataTemp & 0xFF);
                 Code[3] = (byte)(uwDataTemp >> 8);
@@ -7541,7 +7540,7 @@ namespace Welling_Motor_Debug_Tool
                 uwDataTemp = Convert.ToUInt16(textBox_MOS_K5.Text);
                 Code[10] = (byte)(uwDataTemp & 0xFF);
                 Code[11] = (byte)(uwDataTemp >> 8);
-                mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x4A10, Code);
+                mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x4A12, Code);
             }
             catch (Exception)
             {
@@ -7564,35 +7563,36 @@ namespace Welling_Motor_Debug_Tool
         {
             try
             {
-                var Code = new byte[32];
-                for (int i = 0; i < 32; i++)
+                var Code = new byte[34];
+                for (int i = 0; i < 34; i++)
                     Code[i] = 0;
+                Code[0] = (byte)((写入存储ToolStripMenuItem.Checked) ? 0x01 : 0x00);
                 ushort uwDataTemp = 0;
                 uwDataTemp = Convert.ToUInt16(textBox_MOS_R1.Text);
-                Code[0] = (byte)(uwDataTemp & 0xFF);
-                Code[1] = (byte)(uwDataTemp >> 8);
-                uwDataTemp = Convert.ToUInt16(textBox_MOS_R2.Text);
                 Code[2] = (byte)(uwDataTemp & 0xFF);
                 Code[3] = (byte)(uwDataTemp >> 8);
-                uwDataTemp = Convert.ToUInt16(textBox_MOS_R3.Text);
+                uwDataTemp = Convert.ToUInt16(textBox_MOS_R2.Text);
                 Code[4] = (byte)(uwDataTemp & 0xFF);
                 Code[5] = (byte)(uwDataTemp >> 8);
-                uwDataTemp = Convert.ToUInt16(textBox_MOS_K1.Text);
+                uwDataTemp = Convert.ToUInt16(textBox_MOS_R3.Text);
                 Code[6] = (byte)(uwDataTemp & 0xFF);
                 Code[7] = (byte)(uwDataTemp >> 8);
-                uwDataTemp = Convert.ToUInt16(textBox_MOS_K2.Text);
+                uwDataTemp = Convert.ToUInt16(textBox_MOS_K1.Text);
                 Code[8] = (byte)(uwDataTemp & 0xFF);
                 Code[9] = (byte)(uwDataTemp >> 8);
-                uwDataTemp = Convert.ToUInt16(textBox_MOS_K3.Text);
+                uwDataTemp = Convert.ToUInt16(textBox_MOS_K2.Text);
                 Code[10] = (byte)(uwDataTemp & 0xFF);
                 Code[11] = (byte)(uwDataTemp >> 8);
-                uwDataTemp = Convert.ToUInt16(textBox_MOS_K4.Text);
+                uwDataTemp = Convert.ToUInt16(textBox_MOS_K3.Text);
                 Code[12] = (byte)(uwDataTemp & 0xFF);
                 Code[13] = (byte)(uwDataTemp >> 8);
-                uwDataTemp = Convert.ToUInt16(textBox_MOS_K5.Text);
+                uwDataTemp = Convert.ToUInt16(textBox_MOS_K4.Text);
                 Code[14] = (byte)(uwDataTemp & 0xFF);
                 Code[15] = (byte)(uwDataTemp >> 8);
-                mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x4C20, Code);
+                uwDataTemp = Convert.ToUInt16(textBox_MOS_K5.Text);
+                Code[16] = (byte)(uwDataTemp & 0xFF);
+                Code[17] = (byte)(uwDataTemp >> 8);
+                mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x4C22, Code);
             }
             catch (Exception)
             {

二進制
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.GenerateResource.cache


二進制
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


二進制
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb