Kaynağa Gözat

默认写保护,增加写保护解锁功能。

Dail 2 yıl önce
ebeveyn
işleme
073e10c914

BIN
.vs/MOTINOVA_MC_Test/v17/.suo


+ 111 - 100
MOTINOVA_MC_Test/Form1.Designer.cs

@@ -217,6 +217,16 @@
             this.label50 = new System.Windows.Forms.Label();
             this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.groupBox4 = new System.Windows.Forms.GroupBox();
+            this.textBox_Config_SpeedlimitStop = new System.Windows.Forms.TextBox();
+            this.label128 = new System.Windows.Forms.Label();
+            this.textBox_Config_SpeedlimitStart = new System.Windows.Forms.TextBox();
+            this.label129 = new System.Windows.Forms.Label();
+            this.textBox_Config_Period = new System.Windows.Forms.TextBox();
+            this.label130 = new System.Windows.Forms.Label();
+            this.textBox_Config_Pulse = new System.Windows.Forms.TextBox();
+            this.label131 = new System.Windows.Forms.Label();
+            this.textBox_Config_SpeedAlarm = new System.Windows.Forms.TextBox();
+            this.label132 = new System.Windows.Forms.Label();
             this.comboBox_TailLightVol = new System.Windows.Forms.ComboBox();
             this.comboBox_AttiSensor = new System.Windows.Forms.ComboBox();
             this.comboBox_FrontLigthVol = new System.Windows.Forms.ComboBox();
@@ -352,16 +362,6 @@
             this.textBox_Sensor1_Avg = new System.Windows.Forms.TextBox();
             this.label127 = new System.Windows.Forms.Label();
             this.label1_Welcom = new System.Windows.Forms.Label();
-            this.textBox_Config_SpeedlimitStop = new System.Windows.Forms.TextBox();
-            this.label128 = new System.Windows.Forms.Label();
-            this.textBox_Config_SpeedlimitStart = new System.Windows.Forms.TextBox();
-            this.label129 = new System.Windows.Forms.Label();
-            this.textBox_Config_Period = new System.Windows.Forms.TextBox();
-            this.label130 = new System.Windows.Forms.Label();
-            this.textBox_Config_Pulse = new System.Windows.Forms.TextBox();
-            this.label131 = new System.Windows.Forms.Label();
-            this.textBox_Config_SpeedAlarm = new System.Windows.Forms.TextBox();
-            this.label132 = new System.Windows.Forms.Label();
             this.button_ReadAll = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -531,6 +531,7 @@
             // 
             // button_Write_Torque_Start
             // 
+            this.button_Write_Torque_Start.Enabled = false;
             this.button_Write_Torque_Start.Location = new System.Drawing.Point(159, 99);
             this.button_Write_Torque_Start.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_Write_Torque_Start.Name = "button_Write_Torque_Start";
@@ -1391,6 +1392,7 @@
             // button_Recovery
             // 
             this.button_Recovery.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.button_Recovery.Enabled = false;
             this.button_Recovery.Location = new System.Drawing.Point(67, 21);
             this.button_Recovery.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_Recovery.Name = "button_Recovery";
@@ -1404,6 +1406,7 @@
             // button_ClearData
             // 
             this.button_ClearData.BackColor = System.Drawing.Color.Red;
+            this.button_ClearData.Enabled = false;
             this.button_ClearData.Location = new System.Drawing.Point(13, 21);
             this.button_ClearData.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_ClearData.Name = "button_ClearData";
@@ -1444,6 +1447,7 @@
             // 
             // button_Write_Mode
             // 
+            this.button_Write_Mode.Enabled = false;
             this.button_Write_Mode.Location = new System.Drawing.Point(249, 24);
             this.button_Write_Mode.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_Write_Mode.Name = "button_Write_Mode";
@@ -1466,6 +1470,7 @@
             // 
             // button_Write_SN
             // 
+            this.button_Write_SN.Enabled = false;
             this.button_Write_SN.Location = new System.Drawing.Point(249, 54);
             this.button_Write_SN.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_Write_SN.Name = "button_Write_SN";
@@ -1745,6 +1750,7 @@
             // 
             // button_Write_Config
             // 
+            this.button_Write_Config.Enabled = false;
             this.button_Write_Config.Location = new System.Drawing.Point(157, 414);
             this.button_Write_Config.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_Write_Config.Name = "button_Write_Config";
@@ -2288,6 +2294,7 @@
             // 
             // button_Write_MotorConfig
             // 
+            this.button_Write_MotorConfig.Enabled = false;
             this.button_Write_MotorConfig.Location = new System.Drawing.Point(241, 124);
             this.button_Write_MotorConfig.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_Write_MotorConfig.Name = "button_Write_MotorConfig";
@@ -2476,6 +2483,96 @@
             this.groupBox4.Text = "用户参数2";
             this.groupBox4.Visible = false;
             // 
+            // textBox_Config_SpeedlimitStop
+            // 
+            this.textBox_Config_SpeedlimitStop.Location = new System.Drawing.Point(94, 290);
+            this.textBox_Config_SpeedlimitStop.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.textBox_Config_SpeedlimitStop.Name = "textBox_Config_SpeedlimitStop";
+            this.textBox_Config_SpeedlimitStop.Size = new System.Drawing.Size(70, 26);
+            this.textBox_Config_SpeedlimitStop.TabIndex = 27;
+            // 
+            // label128
+            // 
+            this.label128.AutoSize = true;
+            this.label128.Location = new System.Drawing.Point(9, 293);
+            this.label128.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label128.Name = "label128";
+            this.label128.Size = new System.Drawing.Size(65, 20);
+            this.label128.TabIndex = 26;
+            this.label128.Text = "结束限速";
+            // 
+            // textBox_Config_SpeedlimitStart
+            // 
+            this.textBox_Config_SpeedlimitStart.Location = new System.Drawing.Point(94, 264);
+            this.textBox_Config_SpeedlimitStart.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.textBox_Config_SpeedlimitStart.Name = "textBox_Config_SpeedlimitStart";
+            this.textBox_Config_SpeedlimitStart.Size = new System.Drawing.Size(70, 26);
+            this.textBox_Config_SpeedlimitStart.TabIndex = 25;
+            // 
+            // label129
+            // 
+            this.label129.AutoSize = true;
+            this.label129.Location = new System.Drawing.Point(9, 267);
+            this.label129.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label129.Name = "label129";
+            this.label129.Size = new System.Drawing.Size(65, 20);
+            this.label129.TabIndex = 24;
+            this.label129.Text = "起始限速";
+            // 
+            // textBox_Config_Period
+            // 
+            this.textBox_Config_Period.Location = new System.Drawing.Point(94, 238);
+            this.textBox_Config_Period.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.textBox_Config_Period.Name = "textBox_Config_Period";
+            this.textBox_Config_Period.Size = new System.Drawing.Size(70, 26);
+            this.textBox_Config_Period.TabIndex = 23;
+            // 
+            // label130
+            // 
+            this.label130.AutoSize = true;
+            this.label130.Location = new System.Drawing.Point(9, 241);
+            this.label130.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label130.Name = "label130";
+            this.label130.Size = new System.Drawing.Size(65, 20);
+            this.label130.TabIndex = 22;
+            this.label130.Text = "尾灯周期";
+            // 
+            // textBox_Config_Pulse
+            // 
+            this.textBox_Config_Pulse.Location = new System.Drawing.Point(94, 212);
+            this.textBox_Config_Pulse.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.textBox_Config_Pulse.Name = "textBox_Config_Pulse";
+            this.textBox_Config_Pulse.Size = new System.Drawing.Size(70, 26);
+            this.textBox_Config_Pulse.TabIndex = 21;
+            // 
+            // label131
+            // 
+            this.label131.AutoSize = true;
+            this.label131.Location = new System.Drawing.Point(9, 215);
+            this.label131.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label131.Name = "label131";
+            this.label131.Size = new System.Drawing.Size(65, 20);
+            this.label131.TabIndex = 20;
+            this.label131.Text = "尾灯脉宽";
+            // 
+            // textBox_Config_SpeedAlarm
+            // 
+            this.textBox_Config_SpeedAlarm.Location = new System.Drawing.Point(94, 186);
+            this.textBox_Config_SpeedAlarm.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
+            this.textBox_Config_SpeedAlarm.Name = "textBox_Config_SpeedAlarm";
+            this.textBox_Config_SpeedAlarm.Size = new System.Drawing.Size(70, 26);
+            this.textBox_Config_SpeedAlarm.TabIndex = 19;
+            // 
+            // label132
+            // 
+            this.label132.AutoSize = true;
+            this.label132.Location = new System.Drawing.Point(9, 189);
+            this.label132.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label132.Name = "label132";
+            this.label132.Size = new System.Drawing.Size(65, 20);
+            this.label132.TabIndex = 18;
+            this.label132.Text = "报警阈值";
+            // 
             // comboBox_TailLightVol
             // 
             this.comboBox_TailLightVol.FormattingEnabled = true;
@@ -2530,6 +2627,7 @@
             // 
             // button_Write_Config_Ext
             // 
+            this.button_Write_Config_Ext.Enabled = false;
             this.button_Write_Config_Ext.Location = new System.Drawing.Point(99, 414);
             this.button_Write_Config_Ext.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_Write_Config_Ext.Name = "button_Write_Config_Ext";
@@ -3710,6 +3808,7 @@
             // 
             // button_WriteK
             // 
+            this.button_WriteK.Enabled = false;
             this.button_WriteK.Location = new System.Drawing.Point(385, 89);
             this.button_WriteK.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
             this.button_WriteK.Name = "button_WriteK";
@@ -3907,6 +4006,7 @@
             this.label127.Size = new System.Drawing.Size(230, 31);
             this.label127.TabIndex = 19;
             this.label127.Text = "内部使用,严禁外传";
+            this.label127.DoubleClick += new System.EventHandler(this.label127_DoubleClick);
             // 
             // label1_Welcom
             // 
@@ -3919,96 +4019,7 @@
             this.label1_Welcom.TabIndex = 18;
             this.label1_Welcom.Text = "选择正确端口号,\r\n连接成功后开始使用!";
             this.label1_Welcom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // textBox_Config_SpeedlimitStop
-            // 
-            this.textBox_Config_SpeedlimitStop.Location = new System.Drawing.Point(94, 290);
-            this.textBox_Config_SpeedlimitStop.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
-            this.textBox_Config_SpeedlimitStop.Name = "textBox_Config_SpeedlimitStop";
-            this.textBox_Config_SpeedlimitStop.Size = new System.Drawing.Size(70, 26);
-            this.textBox_Config_SpeedlimitStop.TabIndex = 27;
-            // 
-            // label128
-            // 
-            this.label128.AutoSize = true;
-            this.label128.Location = new System.Drawing.Point(9, 293);
-            this.label128.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label128.Name = "label128";
-            this.label128.Size = new System.Drawing.Size(65, 20);
-            this.label128.TabIndex = 26;
-            this.label128.Text = "结束限速";
-            // 
-            // textBox_Config_SpeedlimitStart
-            // 
-            this.textBox_Config_SpeedlimitStart.Location = new System.Drawing.Point(94, 264);
-            this.textBox_Config_SpeedlimitStart.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
-            this.textBox_Config_SpeedlimitStart.Name = "textBox_Config_SpeedlimitStart";
-            this.textBox_Config_SpeedlimitStart.Size = new System.Drawing.Size(70, 26);
-            this.textBox_Config_SpeedlimitStart.TabIndex = 25;
-            // 
-            // label129
-            // 
-            this.label129.AutoSize = true;
-            this.label129.Location = new System.Drawing.Point(9, 267);
-            this.label129.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label129.Name = "label129";
-            this.label129.Size = new System.Drawing.Size(65, 20);
-            this.label129.TabIndex = 24;
-            this.label129.Text = "起始限速";
-            // 
-            // textBox_Config_Period
-            // 
-            this.textBox_Config_Period.Location = new System.Drawing.Point(94, 238);
-            this.textBox_Config_Period.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
-            this.textBox_Config_Period.Name = "textBox_Config_Period";
-            this.textBox_Config_Period.Size = new System.Drawing.Size(70, 26);
-            this.textBox_Config_Period.TabIndex = 23;
-            // 
-            // label130
-            // 
-            this.label130.AutoSize = true;
-            this.label130.Location = new System.Drawing.Point(9, 241);
-            this.label130.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label130.Name = "label130";
-            this.label130.Size = new System.Drawing.Size(65, 20);
-            this.label130.TabIndex = 22;
-            this.label130.Text = "尾灯周期";
-            // 
-            // textBox_Config_Pulse
-            // 
-            this.textBox_Config_Pulse.Location = new System.Drawing.Point(94, 212);
-            this.textBox_Config_Pulse.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
-            this.textBox_Config_Pulse.Name = "textBox_Config_Pulse";
-            this.textBox_Config_Pulse.Size = new System.Drawing.Size(70, 26);
-            this.textBox_Config_Pulse.TabIndex = 21;
-            // 
-            // label131
-            // 
-            this.label131.AutoSize = true;
-            this.label131.Location = new System.Drawing.Point(9, 215);
-            this.label131.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label131.Name = "label131";
-            this.label131.Size = new System.Drawing.Size(65, 20);
-            this.label131.TabIndex = 20;
-            this.label131.Text = "尾灯脉宽";
-            // 
-            // textBox_Config_SpeedAlarm
-            // 
-            this.textBox_Config_SpeedAlarm.Location = new System.Drawing.Point(94, 186);
-            this.textBox_Config_SpeedAlarm.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4);
-            this.textBox_Config_SpeedAlarm.Name = "textBox_Config_SpeedAlarm";
-            this.textBox_Config_SpeedAlarm.Size = new System.Drawing.Size(70, 26);
-            this.textBox_Config_SpeedAlarm.TabIndex = 19;
-            // 
-            // label132
-            // 
-            this.label132.AutoSize = true;
-            this.label132.Location = new System.Drawing.Point(9, 189);
-            this.label132.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label132.Name = "label132";
-            this.label132.Size = new System.Drawing.Size(65, 20);
-            this.label132.TabIndex = 18;
-            this.label132.Text = "报警阈值";
+            this.label1_Welcom.DoubleClick += new System.EventHandler(this.label1_Welcom_DoubleClick);
             // 
             // button_ReadAll
             // 

+ 28 - 0
MOTINOVA_MC_Test/Form1.cs

@@ -85,6 +85,10 @@ namespace MOTINOVA_MC_Test
         bool CDL_Online_Flag = true;
         #endregion
 
+        #region 解锁写保护标志
+        bool WriteProtectUnlock = false;
+        #endregion 
+
         Form2 LoginForm = new Form2();
 
         #endregion
@@ -3518,5 +3522,29 @@ namespace MOTINOVA_MC_Test
             SendCmd((ushort)0x751, (byte)0x11, (ushort)0x2E00, null);
             MC_RideInfo_Clear();
         }
+
+
+
+        //双击时允许解锁写保护
+        private void label127_DoubleClick(object sender, EventArgs e)
+        {
+            WriteProtectUnlock = true;
+        }
+
+        //双击解锁写保护
+        private void label1_Welcom_DoubleClick(object sender, EventArgs e)
+        {
+            if (WriteProtectUnlock == false)
+                return;
+            button_WriteK.Enabled = true;
+            button_Write_Torque_Start.Enabled = true;
+            button_ClearData.Enabled = true;
+            button_Recovery.Enabled = true;
+            button_Write_Config.Enabled = true;
+            button_Write_Config_Ext.Enabled = true;
+            button_Write_MotorConfig.Enabled = true;
+            button_Write_Mode.Enabled = true;
+            button_Write_SN.Enabled = true;
+        }
     }
 }

+ 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>oyoZPNZxaCyu37QxEnPZxlMFV+4=</dsig:DigestValue>
+        <dsig:DigestValue>JMXNWIIugUYndcXU8o51rE9eAhM=</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="225792">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="226304">
       <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>mp8jy+1mDoQHBYVB483oz9aVhtM=</dsig:DigestValue>
+        <dsig:DigestValue>biM2zQhXvJ7BXcnvUSSBdsSZ+3s=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
MOTINOVA_MC_Test/bin/Debug/MOTINOVA_MC_Test.pdb


BIN
MOTINOVA_MC_Test/bin/Debug/MOTINOVA_MC_Test_V2.1.6-1.exe


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>oyoZPNZxaCyu37QxEnPZxlMFV+4=</dsig:DigestValue>
+        <dsig:DigestValue>JMXNWIIugUYndcXU8o51rE9eAhM=</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="225792">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_MC_Test.exe" size="226304">
       <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>mp8jy+1mDoQHBYVB483oz9aVhtM=</dsig:DigestValue>
+        <dsig:DigestValue>biM2zQhXvJ7BXcnvUSSBdsSZ+3s=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
MOTINOVA_MC_Test/obj/Debug/MOTINOVA_MC_Test.pdb