ソースを参照

量产模式测试功能修改增加权限。

Dail 1 年間 前
コミット
f70a119f63

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


BIN
Welling_Motor_Debug_Tool/Images/Lock.png


BIN
Welling_Motor_Debug_Tool/Images/Unlock.png


BIN
Welling_Motor_Debug_Tool/Images/mx_screencap_20240412_182056.png


BIN
Welling_Motor_Debug_Tool/Images/mx_screencap_20240412_182131.png


+ 20 - 0
Welling_Motor_Debug_Tool/Properties/Resources.Designer.cs

@@ -70,6 +70,16 @@ namespace Welling_Motor_Debug_Tool.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap Lock {
+            get {
+                object obj = ResourceManager.GetObject("Lock", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
@@ -90,6 +100,16 @@ namespace Welling_Motor_Debug_Tool.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap Unlock {
+            get {
+                object obj = ResourceManager.GetObject("Unlock", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>

+ 12 - 6
Welling_Motor_Debug_Tool/Properties/Resources.resx

@@ -118,16 +118,22 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="about" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\Resources\about.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
-  </data>
-  <data name="Welling Log" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\Resources\Welling Log.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
-  </data>
   <data name="ttium" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Images\ttium.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
   <data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Images\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="Welling Log" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\Welling Log.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="about" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\about.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="Unlock" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Images\Unlock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="Lock" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Images\Lock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

+ 2 - 0
Welling_Motor_Debug_Tool/Welling_Motor_Debug_Tool.csproj

@@ -137,6 +137,8 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Images\ttium.bmp" />
+    <None Include="Images\Unlock.png" />
+    <None Include="Images\Lock.png" />
     <Content Include="motor.ico" />
     <None Include="Resources\about.png" />
   </ItemGroup>

BIN
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool.pdb


ファイルの差分が大きいため隠しています
+ 303 - 262
Welling_Motor_Debug_Tool/mainForm.Designer.cs


+ 95 - 0
Welling_Motor_Debug_Tool/mainForm.cs

@@ -1560,6 +1560,7 @@ namespace Welling_Motor_Debug_Tool
                                     textBox_FacModeGit.Text = "";
                                     for (ushort i = 0; i < 9; i++)
                                     {
+                                        textBox_SP.Text += ((char)Data[23 + i]).ToString();
                                         textBox_FacModeGit.Text += ((char)Data[23 + i]).ToString();
                                     }
 
@@ -7159,5 +7160,99 @@ namespace Welling_Motor_Debug_Tool
             else
                 numericUpDown_SpeedAdj.Value += 1;
         }
+
+
+        bool WriteLockStatus = true;
+        private void pictureBox_WriteLock_Click(object sender, EventArgs e)
+        {
+            EnterForm1.ShowDialog();
+            try
+            {
+                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
+                {
+                    if (EnterForm1.comboBox_User.Text == "工程配置")
+                    {
+                        if (WriteLockStatus == true)
+                        {
+                            pictureBox_WriteLock.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Unlock;
+                            foreach (Control c in groupBox2.Controls)
+                            {
+                                if (c is CheckBox)
+                                    c.Enabled = true;                                
+                            }
+                        }
+                        else                         
+                        {
+                            pictureBox_WriteLock.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Lock;
+                            foreach (Control c in groupBox2.Controls)
+                            {
+                                if (c is CheckBox)
+                                    c.Enabled = false;
+                            }
+                        }
+
+                        WriteLockStatus = !WriteLockStatus;
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
+                }
+                else
+                {
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+        }
+
+        bool ReadLockStatus = true;
+        private void pictureBox_ReadLock_Click(object sender, EventArgs e)
+        {
+            EnterForm1.ShowDialog();
+            try
+            {
+                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
+                {
+                    if (EnterForm1.comboBox_User.Text == "工程配置")
+                    {
+                        if (ReadLockStatus == true)
+                        {
+                            pictureBox_ReadLock.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Unlock;
+                            foreach (Control c in groupBox29.Controls)
+                            {
+                                if (c is CheckBox)
+                                    c.Enabled = true;
+                            }
+                        }
+                        else
+                        {
+                            pictureBox_ReadLock.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Lock;
+                            foreach (Control c in groupBox29.Controls)
+                            {
+                                if (c is CheckBox)
+                                    c.Enabled = false;
+                            }
+                        }
+                        ReadLockStatus = !ReadLockStatus;
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
+                }
+                else
+                {
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+        }
     }
 }

BIN
Welling_Motor_Debug_Tool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.Properties.Resources.resources


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


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません