From efac9037f25e301ca5564354547776737e8562e7 Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期三, 31 十二月 2025 13:56:21 +0800
Subject: [PATCH] Merge branch 'master' of http://lanpucloud.cn:1111/r/~zhengyabo/LB_TyreAppearanceInspectionSoftware
---
LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs | 143 +----------------------
LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.cs | 11 +
LB_SmartVision/Forms/Pages/CameraPage/CreateCameraForm.Designer.cs | 7
LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.Designer.cs | 2
LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs | 134 ++++++++++++----------
LB_SmartVision/VisionForm.Designer.cs | 5
6 files changed, 101 insertions(+), 201 deletions(-)
diff --git a/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.Designer.cs b/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.Designer.cs
index efcc15a..cfbcc7f 100644
--- a/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.Designer.cs
+++ b/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.Designer.cs
@@ -100,8 +100,8 @@
tableLayoutPanel1.ColumnCount = 1;
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F));
- tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 1);
tableLayoutPanel1.Controls.Add(uiFlowLayoutPanel1, 0, 0);
+ tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 1);
tableLayoutPanel1.Dock = DockStyle.Fill;
tableLayoutPanel1.Location = new Point(0, 0);
tableLayoutPanel1.Name = "tableLayoutPanel1";
diff --git a/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.cs b/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.cs
index 275f5a4..1d9acea 100644
--- a/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.cs
+++ b/LB_SmartVision/Forms/Pages/CameraPage/CamerasEditPage.cs
@@ -137,11 +137,16 @@
if (name != Name)
continue;
- if (GlobalVar.dicCameras.ContainsKey(name))
+ RemoveFlowEvent(flow);
+ uiFlowLayoutPanel1.Controls.Remove(uiFlowLayoutPanel1.Controls[i]);
+ if (GlobalVar.dicCameras.TryRemove(name, out BaseCamera BaseCamera))
{
- MotionControlPage.MotionControlForm cameraForm = new MotionControlPage.MotionControlForm(GlobalVar.dicCameras[name]);
- cameraForm.Show();
+ BaseCamera.Dispose();
+ LogInfo?.Invoke(string.Format("绉婚櫎鐩告満[{0}]", name), LogInfoType.INFO);
}
+ else
+ LogInfo?.Invoke(string.Format("绉婚櫎鐩告満[{0}]澶辫触", name), LogInfoType.ERROR);
+
}
}
diff --git a/LB_SmartVision/Forms/Pages/CameraPage/CreateCameraForm.Designer.cs b/LB_SmartVision/Forms/Pages/CameraPage/CreateCameraForm.Designer.cs
index cf3fce9..ceb57b3 100644
--- a/LB_SmartVision/Forms/Pages/CameraPage/CreateCameraForm.Designer.cs
+++ b/LB_SmartVision/Forms/Pages/CameraPage/CreateCameraForm.Designer.cs
@@ -105,7 +105,7 @@
uiComboBoxBrand.Margin = new Padding(4, 5, 4, 5);
uiComboBoxBrand.MinimumSize = new Size(63, 0);
uiComboBoxBrand.Name = "uiComboBoxBrand";
- uiComboBoxBrand.Size = new Size(150, 28);
+ uiComboBoxBrand.Size = new Size(150, 24);
uiComboBoxBrand.TabIndex = 11;
uiComboBoxBrand.SelectedIndexChanged += uiComboBoxBrand_SelectedIndexChanged;
uiComboBoxBrand.MouseClick += uiComboBoxBrand_MouseClick;
@@ -117,7 +117,7 @@
uiComboBoxSN.Margin = new Padding(4, 5, 4, 5);
uiComboBoxSN.MinimumSize = new Size(63, 0);
uiComboBoxSN.Name = "uiComboBoxSN";
- uiComboBoxSN.Size = new Size(150, 28);
+ uiComboBoxSN.Size = new Size(150, 24);
uiComboBoxSN.TabIndex = 12;
uiComboBoxSN.MouseClick += uiComboBoxSN_MouseClick;
//
@@ -171,8 +171,9 @@
Controls.Add(uiLabel2);
Controls.Add(uiLabel1);
Controls.Add(themeForm1);
- ForeColor = SystemColors.ControlText;
FormBorderStyle = FormBorderStyle.None;
+ MaximizeBox = false;
+ MinimizeBox = false;
MinimumSize = new Size(261, 61);
Name = "CreateCameraForm";
Text = "鍒涘缓鐩告満";
diff --git a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs
index 564f17c..4d4b002 100644
--- a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs
+++ b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs
@@ -1,22 +1,19 @@
锘�
using ReaLTaiizor.Controls;
-using Sunny.UI;
-using System.Drawing.Printing;
-using System.Windows.Forms;
namespace LB_SmartVision.Forms.Pages.UserManagementPage
{
partial class UserManagementEditPage
{
- /// <summary>
- /// 蹇呴渶鐨勮璁″櫒鍙橀噺銆�
+ /// <summary>
+ /// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// 娓呯悊鎵�鏈夋鍦ㄤ娇鐢ㄧ殑璧勬簮銆�
+ /// <summary>
+ /// Clean up any resources being used.
/// </summary>
- /// <param name="disposing">濡傛灉搴旈噴鏀炬墭绠¤祫婧愶紝涓� true锛涘惁鍒欎负 false銆�</param>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
@@ -26,15 +23,17 @@
base.Dispose(disposing);
}
- #region 缁勪欢璁捐鍣ㄧ敓鎴愮殑浠g爜
+ #region Windows Form Designer generated code
- /// <summary>
- /// 璁捐鍣ㄦ敮鎸佹墍闇�鐨勬柟娉� - 涓嶈淇敼
- /// 浣跨敤浠g爜缂栬緫鍣ㄤ慨鏀规鏂规硶鐨勫唴瀹广��
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
- grpSetting = new ParrotGroupBox();
+ btn_Add = new HopeButton();
+ btn_Clear = new LostButton();
+ uiFlowLayoutPanel1 = new FlowLayoutPanel();
tableLayoutPanel1 = new TableLayoutPanel();
tableLayoutPanel2 = new TableLayoutPanel();
tableLayoutPanel3 = new TableLayoutPanel();
@@ -57,33 +56,68 @@
grpSetting.SuspendLayout();
tableLayoutPanel1.SuspendLayout();
tableLayoutPanel2.SuspendLayout();
- tableLayoutPanel3.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)dataGridViewUM).BeginInit();
- tableLayoutPanel4.SuspendLayout();
SuspendLayout();
//
- // grpSetting
+ // btn_Add
//
- grpSetting.BorderColor = Color.DodgerBlue;
- grpSetting.BorderWidth = 1;
- grpSetting.Controls.Add(tableLayoutPanel1);
- grpSetting.Dock = DockStyle.Fill;
- grpSetting.Font = new Font("瀹嬩綋", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
- grpSetting.Location = new Point(0, 0);
- grpSetting.Name = "grpSetting";
- grpSetting.ShowText = true;
- grpSetting.Size = new Size(866, 580);
- grpSetting.TabIndex = 6;
- grpSetting.TabStop = false;
- grpSetting.Text = "鐢ㄦ埛绠$悊璁剧疆";
- grpSetting.TextColor = Color.DodgerBlue;
+ btn_Add.BorderColor = Color.FromArgb(220, 223, 230);
+ btn_Add.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary;
+ btn_Add.Cursor = Cursors.Hand;
+ btn_Add.DangerColor = Color.FromArgb(245, 108, 108);
+ btn_Add.DefaultColor = Color.FromArgb(255, 255, 255);
+ btn_Add.Dock = DockStyle.Fill;
+ btn_Add.Font = new Font("瀹嬩綋", 12F);
+ btn_Add.HoverTextColor = Color.FromArgb(48, 49, 51);
+ btn_Add.InfoColor = Color.FromArgb(144, 147, 153);
+ btn_Add.Location = new Point(503, 3);
+ btn_Add.MinimumSize = new Size(1, 1);
+ btn_Add.Name = "btn_Add";
+ btn_Add.PrimaryColor = Color.FromArgb(64, 158, 255);
+ btn_Add.Size = new Size(95, 38);
+ btn_Add.SuccessColor = Color.FromArgb(103, 194, 58);
+ btn_Add.TabIndex = 11;
+ btn_Add.Text = "澧炲姞";
+ btn_Add.TextColor = Color.White;
+ btn_Add.WarningColor = Color.FromArgb(230, 162, 60);
+ //
+ // btn_Clear
+ //
+ btn_Clear.BackColor = Color.FromArgb(45, 45, 48);
+ btn_Clear.Cursor = Cursors.Hand;
+ btn_Clear.Dock = DockStyle.Fill;
+ btn_Clear.Font = new Font("瀹嬩綋", 12F);
+ btn_Clear.ForeColor = Color.White;
+ btn_Clear.HoverColor = Color.DodgerBlue;
+ btn_Clear.Image = null;
+ btn_Clear.Location = new Point(403, 3);
+ btn_Clear.MinimumSize = new Size(1, 1);
+ btn_Clear.Name = "btn_Clear";
+ btn_Clear.Size = new Size(94, 38);
+ btn_Clear.TabIndex = 12;
+ btn_Clear.Text = "娓呴櫎";
+ //
+ // uiFlowLayoutPanel1
+ //
+ uiFlowLayoutPanel1.BackColor = Color.FromArgb(32, 41, 50);
+ uiFlowLayoutPanel1.Dock = DockStyle.Fill;
+ uiFlowLayoutPanel1.Font = new Font("瀹嬩綋", 12F);
+ uiFlowLayoutPanel1.ForeColor = SystemColors.Control;
+ uiFlowLayoutPanel1.Location = new Point(4, 5);
+ uiFlowLayoutPanel1.Margin = new Padding(4, 5, 4, 5);
+ uiFlowLayoutPanel1.MinimumSize = new Size(1, 1);
+ uiFlowLayoutPanel1.Name = "uiFlowLayoutPanel1";
+ uiFlowLayoutPanel1.Padding = new Padding(2);
+ uiFlowLayoutPanel1.Size = new Size(599, 293);
+ uiFlowLayoutPanel1.TabIndex = 10;
+ uiFlowLayoutPanel1.Text = "`";
//
// tableLayoutPanel1
//
tableLayoutPanel1.ColumnCount = 1;
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
- tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 0);
- tableLayoutPanel1.Controls.Add(tableLayoutPanel4, 0, 1);
+ tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F));
+ tableLayoutPanel1.Controls.Add(uiFlowLayoutPanel1, 0, 0);
+ tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 1);
tableLayoutPanel1.Dock = DockStyle.Fill;
tableLayoutPanel1.Location = new Point(3, 22);
tableLayoutPanel1.Name = "tableLayoutPanel1";
@@ -101,7 +135,7 @@
tableLayoutPanel2.Controls.Add(tableLayoutPanel3, 0, 0);
tableLayoutPanel2.Controls.Add(dataGridViewUM, 1, 0);
tableLayoutPanel2.Dock = DockStyle.Fill;
- tableLayoutPanel2.Location = new Point(3, 3);
+ tableLayoutPanel2.Location = new Point(3, 306);
tableLayoutPanel2.Name = "tableLayoutPanel2";
tableLayoutPanel2.RowCount = 1;
tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
@@ -340,42 +374,22 @@
// UserManagementEditPage
//
BackColor = Color.FromArgb(32, 41, 50);
- Controls.Add(grpSetting);
+ Controls.Add(tableLayoutPanel1);
+ ForeColor = SystemColors.Control;
Name = "UserManagementEditPage";
- Size = new Size(866, 580);
- grpSetting.ResumeLayout(false);
- grpSetting.PerformLayout();
+ Size = new Size(607, 353);
+ Paint += MESEditPage_Paint;
tableLayoutPanel1.ResumeLayout(false);
tableLayoutPanel2.ResumeLayout(false);
- tableLayoutPanel3.ResumeLayout(false);
- tableLayoutPanel3.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)dataGridViewUM).EndInit();
- tableLayoutPanel4.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
- private ParrotGroupBox grpSetting;
+ private ReaLTaiizor.Controls.HopeButton btn_Add;
+ private ReaLTaiizor.Controls.LostButton btn_Clear;
+ private FlowLayoutPanel uiFlowLayoutPanel1;
private TableLayoutPanel tableLayoutPanel1;
private TableLayoutPanel tableLayoutPanel2;
- private TableLayoutPanel tableLayoutPanel3;
- private Label labelUsername;
- private TextBox textBoxUsername;
- private TextBox textBoxEmployeeID;
- private Label labelEmployeeID;
- private TextBox textBoxName;
- private Label labelName;
- private Label labelPermission;
- private TextBox textBoxPassword;
- private Label labelPassword;
- private ComboBox comboBoxPermission;
- private DataGridView dataGridViewUM;
- private TableLayoutPanel tableLayoutPanel4;
- private HopeButton btnDel;
- private HopeButton btnEdit;
- private HopeButton btnFind;
- private ForeverButton btnAdd;
}
-
}
\ No newline at end of file
diff --git a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs
index 0cd133d..5bcb882 100644
--- a/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs
+++ b/LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs
@@ -1,153 +1,28 @@
-锘縰sing LB_SmartVision.Forms.Pages.ProcessPage;
-using LB_SmartVision.ProcessRun;
-using LB_VisionControl;
-using LB_VisionProcesses;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
+锘縰sing LB_VisionControl;
+using OpenCvSharp.Flann;
+using System;
using System.Collections.Concurrent;
-using System.Data;
-using System.Text;
-using VisionControl.Forms;
-using LB_SmartVision.Forms.Pages.SettingPage;
-using LB_SmartVisionCommon;
-using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
-using LB_SmartVision.Forms.Pages.CameraPage;
-using System.Security.Principal;
using System.Windows.Forms;
+using System.Xml.Linq;
namespace LB_SmartVision.Forms.Pages.UserManagementPage
{
public partial class UserManagementEditPage : UserControl
{
public Action<string, LogInfoType> LogInfo;
- RunSettingPage RunSettingPage = new RunSettingPage();
- LayoutPage LayoutPage = new LayoutPage();
- CsvPage CsvPage = new CsvPage();
+
+
public UserManagementEditPage()
{
Name = "UserManagementEditPage";
Text = "鐢ㄦ埛绠$悊璁剧疆";
-
- InitializeComponent();
- InitializeDataGridView();
- InitializeComboBox();
}
- private void InitializeDataGridView()
+ private void MESEditPage_Paint(object sender, PaintEventArgs e)
{
- // 璁剧疆DataGridView鍒楀
- dataGridViewUM.ColumnCount = 5;
-
- int totalWidth = dataGridViewUM.ClientSize.Width;
- int columnCount = dataGridViewUM.ColumnCount;
- int columnWidth = totalWidth / columnCount;
-
- // 璁剧疆鏈�灏忓搴�
- int minWidth = 100; // 鏈�灏忓搴�
- if (columnWidth < minWidth)
- {
- columnWidth = minWidth;
- }
-
- for (int i = 0; i < columnCount; i++)
- {
- dataGridViewUM.Columns[i].Width = columnWidth;
- }
-
- // 璁剧疆鍒楁爣棰�
- dataGridViewUM.Columns[0].Name = "鐢ㄦ埛鍚�";
- dataGridViewUM.Columns[1].Name = "瀵嗙爜";
- dataGridViewUM.Columns[2].Name = "濮撳悕";
- dataGridViewUM.Columns[3].Name = "宸ュ彿";
- dataGridViewUM.Columns[4].Name = "鏉冮檺";
-
- dataGridViewUM.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
-
- // 绂佹缂栬緫鍗曞厓鏍硷紙鍙�夛級
- dataGridViewUM.ReadOnly = true;
-
- // 鍏佽澶氳閫夋嫨锛堝彲閫夛級
- dataGridViewUM.MultiSelect = false;
-
- // 鏄剧ず琛屾爣棰橈紙鍙�夛級
- dataGridViewUM.RowHeadersVisible = true;
+ uiFlowLayoutPanel1.Controls.Clear();
}
- private void InitializeComboBox()
- {
- // 娣诲姞鏉冮檺閫夐」
- comboBoxPermission.Items.Add("绠$悊鍛�");
- comboBoxPermission.Items.Add("鎿嶄綔鍛�");
-
- // 璁剧疆榛樿閫夋嫨椤�
- comboBoxPermission.SelectedIndex = 1;
- }
-
- private void ClearInputFields()
- {
- textBoxUsername.Clear();
- textBoxPassword.Clear();
- textBoxName.Clear();
- textBoxEmployeeID.Clear();
- comboBoxPermission.SelectedIndex = 1;
- textBoxUsername.Focus(); // 灏嗙劍鐐硅缃洖鐢ㄦ埛鍚嶈緭鍏ユ
- }
- private void btnAdd_Click(object sender, EventArgs e)
- {
- // 楠岃瘉杈撳叆
- if (string.IsNullOrWhiteSpace(textBoxUsername.Text) ||
- string.IsNullOrWhiteSpace(textBoxPassword.Text) ||
- string.IsNullOrWhiteSpace(textBoxName.Text) ||
- string.IsNullOrWhiteSpace(textBoxEmployeeID.Text))
- {
- MessageBox.Show("璇峰~鍐欐墍鏈夊繀濉瓧娈碉紒", "鎻愮ず",
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
-
- // 鍒涘缓鏂拌鏁版嵁
- string[] row = new string[]
- {
- textBoxUsername.Text,
- textBoxPassword.Text, // 瀹為檯搴旂敤涓瘑鐮佸簲璇ュ姞瀵�
- textBoxName.Text,
- textBoxEmployeeID.Text,
- comboBoxPermission.SelectedItem.ToString()
- };
-
- // 璁剧疆鏁翠釜DataGridView鐨勯粯璁ゅ瓧浣撳拰棰滆壊
- dataGridViewUM.DefaultCellStyle.Font = new Font("瀹嬩綋", 12);
- dataGridViewUM.DefaultCellStyle.ForeColor = Color.Black; // 瀛椾綋棰滆壊
- dataGridViewUM.DefaultCellStyle.BackColor = Color.White; // 鑳屾櫙棰滆壊
-
- // 娣诲姞鏂拌鍒癉ataGridView
- dataGridViewUM.Rows.Add(row);
-
- // 娓呯┖杈撳叆妗�
- ClearInputFields();
- }
-
- private void btnDel_Click(object sender, EventArgs e)
- {
- if (dataGridViewUM.SelectedRows.Count > 0)
- {
- // 纭鍒犻櫎
- DialogResult result = MessageBox.Show("纭畾瑕佸垹闄ら�変腑鐨勮鍚楋紵",
- "纭鍒犻櫎", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
-
- if (result == DialogResult.Yes)
- {
- foreach (DataGridViewRow row in dataGridViewUM.SelectedRows)
- {
- dataGridViewUM.Rows.Remove(row);
- }
- }
- }
- else
- {
- MessageBox.Show("璇峰厛閫夋嫨瑕佸垹闄ょ殑琛岋紒", "鎻愮ず",
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
+
}
}
diff --git a/LB_SmartVision/VisionForm.Designer.cs b/LB_SmartVision/VisionForm.Designer.cs
index e291852..bfbf818 100644
--- a/LB_SmartVision/VisionForm.Designer.cs
+++ b/LB_SmartVision/VisionForm.Designer.cs
@@ -109,6 +109,11 @@
tlp_MainView.TabIndex = 1;
tlp_MainView.TagString = null;
//
+ sc_VisionMainViewer.Panel2.Controls.Add(materialTabControl);
+ sc_VisionMainViewer.Size = new Size(1776, 873);
+ sc_VisionMainViewer.SplitterDistance = 124;
+ sc_VisionMainViewer.SplitterWidth = 5;
+ sc_VisionMainViewer.TabIndex = 0;
// materialTabControl
//
materialTabControl.AccessibleRole = AccessibleRole.Sound;
--
Gitblit v1.9.3