Procházet zdrojové kódy

1、功率显示不×2;
2、用户参数2增加限速微调设置.

Dail před 1 rokem
rodič
revize
a84029b624

binární
.vs/MOTINOVA_MC_Test/v17/.suo


+ 78 - 53
MOTINOVA_MC_Test/Form1.Designer.cs

@@ -364,16 +364,18 @@
             this.label1_Welcom = new System.Windows.Forms.Label();
             this.button_ReadAll = new System.Windows.Forms.Button();
             this.groupBox18 = new System.Windows.Forms.GroupBox();
+            this.richTextBox_DebugInfo = new System.Windows.Forms.RichTextBox();
+            this.radioButton_DebugHex = new System.Windows.Forms.RadioButton();
+            this.radioButton_DebugDec = new System.Windows.Forms.RadioButton();
+            this.checkBox_DebugReset = new System.Windows.Forms.CheckBox();
+            this.checkBox_DebugAuto = new System.Windows.Forms.CheckBox();
             this.button_DebugRead = new System.Windows.Forms.Button();
             this.textBox_DebugAddrEnd = new System.Windows.Forms.TextBox();
             this.textBox_DebugAddrBegin = new System.Windows.Forms.TextBox();
             this.label137 = new System.Windows.Forms.Label();
             this.label138 = new System.Windows.Forms.Label();
-            this.checkBox_DebugAuto = new System.Windows.Forms.CheckBox();
-            this.radioButton_DebugDec = new System.Windows.Forms.RadioButton();
-            this.radioButton_DebugHex = new System.Windows.Forms.RadioButton();
-            this.checkBox_DebugReset = new System.Windows.Forms.CheckBox();
-            this.richTextBox_DebugInfo = new System.Windows.Forms.RichTextBox();
+            this.textBox_Config_SpeedlimitAdj = new System.Windows.Forms.TextBox();
+            this.label133 = new System.Windows.Forms.Label();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -2458,6 +2460,8 @@
             // groupBox4
             // 
             this.groupBox4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(120)))));
+            this.groupBox4.Controls.Add(this.textBox_Config_SpeedlimitAdj);
+            this.groupBox4.Controls.Add(this.label133);
             this.groupBox4.Controls.Add(this.textBox_Config_SpeedlimitStop);
             this.groupBox4.Controls.Add(this.label128);
             this.groupBox4.Controls.Add(this.textBox_Config_SpeedlimitStart);
@@ -4065,6 +4069,59 @@
             this.groupBox18.Text = "内部存储器";
             this.groupBox18.Visible = false;
             // 
+            // richTextBox_DebugInfo
+            // 
+            this.richTextBox_DebugInfo.Location = new System.Drawing.Point(10, 51);
+            this.richTextBox_DebugInfo.Name = "richTextBox_DebugInfo";
+            this.richTextBox_DebugInfo.ReadOnly = true;
+            this.richTextBox_DebugInfo.Size = new System.Drawing.Size(234, 146);
+            this.richTextBox_DebugInfo.TabIndex = 8;
+            this.richTextBox_DebugInfo.Text = "";
+            // 
+            // radioButton_DebugHex
+            // 
+            this.radioButton_DebugHex.AutoSize = true;
+            this.radioButton_DebugHex.Location = new System.Drawing.Point(252, 81);
+            this.radioButton_DebugHex.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.radioButton_DebugHex.Name = "radioButton_DebugHex";
+            this.radioButton_DebugHex.Size = new System.Drawing.Size(55, 24);
+            this.radioButton_DebugHex.TabIndex = 7;
+            this.radioButton_DebugHex.Text = "HEX";
+            this.radioButton_DebugHex.UseVisualStyleBackColor = true;
+            // 
+            // radioButton_DebugDec
+            // 
+            this.radioButton_DebugDec.AutoSize = true;
+            this.radioButton_DebugDec.Checked = true;
+            this.radioButton_DebugDec.Location = new System.Drawing.Point(252, 52);
+            this.radioButton_DebugDec.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.radioButton_DebugDec.Name = "radioButton_DebugDec";
+            this.radioButton_DebugDec.Size = new System.Drawing.Size(55, 24);
+            this.radioButton_DebugDec.TabIndex = 6;
+            this.radioButton_DebugDec.TabStop = true;
+            this.radioButton_DebugDec.Text = "DEC";
+            this.radioButton_DebugDec.UseVisualStyleBackColor = true;
+            // 
+            // checkBox_DebugReset
+            // 
+            this.checkBox_DebugReset.AutoSize = true;
+            this.checkBox_DebugReset.Location = new System.Drawing.Point(252, 110);
+            this.checkBox_DebugReset.Name = "checkBox_DebugReset";
+            this.checkBox_DebugReset.Size = new System.Drawing.Size(56, 24);
+            this.checkBox_DebugReset.TabIndex = 6;
+            this.checkBox_DebugReset.Text = "清除";
+            this.checkBox_DebugReset.UseVisualStyleBackColor = true;
+            // 
+            // checkBox_DebugAuto
+            // 
+            this.checkBox_DebugAuto.AutoSize = true;
+            this.checkBox_DebugAuto.Location = new System.Drawing.Point(252, 139);
+            this.checkBox_DebugAuto.Name = "checkBox_DebugAuto";
+            this.checkBox_DebugAuto.Size = new System.Drawing.Size(56, 24);
+            this.checkBox_DebugAuto.TabIndex = 6;
+            this.checkBox_DebugAuto.Text = "自动";
+            this.checkBox_DebugAuto.UseVisualStyleBackColor = true;
+            // 
             // button_DebugRead
             // 
             this.button_DebugRead.Location = new System.Drawing.Point(252, 168);
@@ -4114,57 +4171,23 @@
             this.label138.TabIndex = 2;
             this.label138.Text = "起始地址";
             // 
-            // checkBox_DebugAuto
-            // 
-            this.checkBox_DebugAuto.AutoSize = true;
-            this.checkBox_DebugAuto.Location = new System.Drawing.Point(252, 139);
-            this.checkBox_DebugAuto.Name = "checkBox_DebugAuto";
-            this.checkBox_DebugAuto.Size = new System.Drawing.Size(56, 24);
-            this.checkBox_DebugAuto.TabIndex = 6;
-            this.checkBox_DebugAuto.Text = "自动";
-            this.checkBox_DebugAuto.UseVisualStyleBackColor = true;
-            // 
-            // radioButton_DebugDec
+            // textBox_Config_SpeedlimitAdj
             // 
-            this.radioButton_DebugDec.AutoSize = true;
-            this.radioButton_DebugDec.Checked = true;
-            this.radioButton_DebugDec.Location = new System.Drawing.Point(252, 52);
-            this.radioButton_DebugDec.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
-            this.radioButton_DebugDec.Name = "radioButton_DebugDec";
-            this.radioButton_DebugDec.Size = new System.Drawing.Size(55, 24);
-            this.radioButton_DebugDec.TabIndex = 6;
-            this.radioButton_DebugDec.Text = "DEC";
-            this.radioButton_DebugDec.UseVisualStyleBackColor = true;
+            this.textBox_Config_SpeedlimitAdj.Location = new System.Drawing.Point(94, 316);
+            this.textBox_Config_SpeedlimitAdj.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.textBox_Config_SpeedlimitAdj.Name = "textBox_Config_SpeedlimitAdj";
+            this.textBox_Config_SpeedlimitAdj.Size = new System.Drawing.Size(70, 26);
+            this.textBox_Config_SpeedlimitAdj.TabIndex = 29;
             // 
-            // radioButton_DebugHex
+            // label133
             // 
-            this.radioButton_DebugHex.AutoSize = true;
-            this.radioButton_DebugHex.Location = new System.Drawing.Point(252, 81);
-            this.radioButton_DebugHex.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
-            this.radioButton_DebugHex.Name = "radioButton_DebugHex";
-            this.radioButton_DebugHex.Size = new System.Drawing.Size(55, 24);
-            this.radioButton_DebugHex.TabIndex = 7;
-            this.radioButton_DebugHex.Text = "HEX";
-            this.radioButton_DebugHex.UseVisualStyleBackColor = true;
-            // 
-            // checkBox_DebugReset
-            // 
-            this.checkBox_DebugReset.AutoSize = true;
-            this.checkBox_DebugReset.Location = new System.Drawing.Point(252, 110);
-            this.checkBox_DebugReset.Name = "checkBox_DebugReset";
-            this.checkBox_DebugReset.Size = new System.Drawing.Size(56, 24);
-            this.checkBox_DebugReset.TabIndex = 6;
-            this.checkBox_DebugReset.Text = "清除";
-            this.checkBox_DebugReset.UseVisualStyleBackColor = true;
-            // 
-            // richTextBox_DebugInfo
-            // 
-            this.richTextBox_DebugInfo.Location = new System.Drawing.Point(10, 51);
-            this.richTextBox_DebugInfo.Name = "richTextBox_DebugInfo";
-            this.richTextBox_DebugInfo.ReadOnly = true;
-            this.richTextBox_DebugInfo.Size = new System.Drawing.Size(234, 146);
-            this.richTextBox_DebugInfo.TabIndex = 8;
-            this.richTextBox_DebugInfo.Text = "";
+            this.label133.AutoSize = true;
+            this.label133.Location = new System.Drawing.Point(9, 319);
+            this.label133.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label133.Name = "label133";
+            this.label133.Size = new System.Drawing.Size(65, 20);
+            this.label133.TabIndex = 28;
+            this.label133.Text = "限速微调";
             // 
             // Form1
             // 
@@ -4595,6 +4618,8 @@
         private System.Windows.Forms.Label label137;
         private System.Windows.Forms.Label label138;
         private System.Windows.Forms.RichTextBox richTextBox_DebugInfo;
+        private System.Windows.Forms.TextBox textBox_Config_SpeedlimitAdj;
+        private System.Windows.Forms.Label label133;
     }
 }
 

+ 8 - 1
MOTINOVA_MC_Test/Form1.cs

@@ -1354,7 +1354,7 @@ namespace MOTINOVA_MC_Test
                                     Class_MotorSpeed.Data = DataTemp;
                                     //电功率
                                     DataTemp = (ushort)(binary_data_1[7] * 256 + binary_data_1[6]);
-                                    textBox_RunInfo_Power.Text = Convert.ToString(DataTemp * 2) + " W";
+                                    textBox_RunInfo_Power.Text = Convert.ToString(DataTemp) + " W";
                                     //母线电压
                                     DataTemp = (ushort)(binary_data_1[9] * 256 + binary_data_1[8]);
                                     textBox_RunInfo_Voltage.Text = Convert.ToString(DataTemp) + " mV";
@@ -2040,6 +2040,10 @@ namespace MOTINOVA_MC_Test
                                     //结束限速
                                     DataTemp_byte = (sbyte)(binary_data_1[17]);
                                     textBox_Config_SpeedlimitStop.Text = ((float)DataTemp_byte / 10f).ToString("#0.0");
+                                    //限速微调
+                                    DataTemp_int16 = (short)binary_data_1[18];
+                                    textBox_Config_SpeedlimitAdj.Text = Convert.ToString((DataTemp_int16 >= 128) ? (DataTemp_int16 - 256) : DataTemp_int16);
+
                                 }));
                             }
                             break;
@@ -2597,6 +2601,9 @@ namespace MOTINOVA_MC_Test
             DataTemp_Int16 = (short)(decimal.Parse(textBox_Config_SpeedlimitStop.Text) * 10);
             ConfigParam[15] = (byte)(DataTemp_Int16 & 0xFF);
 
+            //限速微调
+            ConfigParam[16] = (byte)Convert.ToInt16(textBox_Config_SpeedlimitAdj.Text);
+
             SendCmd((ushort)0x751, (byte)0x16, (ushort)0x3120, ConfigParam);
         }
 

+ 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>hSbq9Qbnip0MA7L6SXymik6sdXQ=</dsig:DigestValue>
+        <dsig:DigestValue>+MuIKraTOEAXt/icKUKadVX4fo0=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

binární
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="231424">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="231936">
       <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>9oKf8wuDYP0v5NhcoLxRfRyX624=</dsig:DigestValue>
+        <dsig:DigestValue>5hyqaK/6h2loRozJnzFRZ5ChgbU=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

binární
MOTINOVA_MC_Test/bin/Debug/MOTINOVA_MC_Test.pdb


binární
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>hSbq9Qbnip0MA7L6SXymik6sdXQ=</dsig:DigestValue>
+        <dsig:DigestValue>+MuIKraTOEAXt/icKUKadVX4fo0=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

binární
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.csproj.GenerateResource.cache


binární
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="231424">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="231936">
       <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>9oKf8wuDYP0v5NhcoLxRfRyX624=</dsig:DigestValue>
+        <dsig:DigestValue>5hyqaK/6h2loRozJnzFRZ5ChgbU=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

binární
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.pdb