LB_SmartVision/CSV/CsvDataHelperRecordProductData.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,110 @@ using LB_SmartVision.SQL; using LB_SmartVisionCommon; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using CsvHelper; namespace LB_SmartVision.CSV { internal class CsvDataHelperRecordProductData { /// <summary> /// å°RecordProductDatasåå ¸ä¿åå°CSVæä»¶ /// </summary> /// <param name="filePath">CSVæä»¶è·¯å¾</param> /// <param name="recordProductDatas">è¦ä¿åçæ°æ®åå ¸</param> public static void SaveToCsv(string filePath, List<RecordProductData> recordProductDatas) { try { using (var writer = new StreamWriter(filePath)) using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) { csv.Context.RegisterClassMap<CsvRecordProductDataMap>(); // å°åå ¸è½¬æ¢ä¸ºCsvRecordå表 var records = recordProductDatas.Select(kvp => new CsvRecordProductData { //DictionaryKey = kvp.Key, ProductName = kvp.ProductName, ProductSN = kvp.ProductSN, InspectionOperator = kvp.InspectionOperator, NGType = kvp.NGType, NGSize = kvp.NGSize, DetectionTime = kvp.DetectionTime, CameraInspection = kvp.CameraInspection, }).ToList(); for (int i = 0; i < records.Count; i++) { AsyncLogHelper.Warn("ç©æå·æäº§ååç§°ï¼" + records[i].ProductName + "\r\n" + "ï¼äº§åSNå·ï¼" + records[i].ProductSN + "\r\n" + "ï¼æ£æµä½ä¸åï¼" + records[i].InspectionOperator + "\r\n" + "ï¼NGç±»åï¼" + records[i].NGType + " mm" + "\r\n" + "ï¼NG大å°ï¼" + records[i].NGSize + " mm" + "\r\n" + "ï¼æ£æµæ¶é´ï¼" + records[i].DetectionTime + "\r\n" + "ï¼æ£æµç¸æºï¼" + records[i].CameraInspection + " mm" + "\r\n" ); } csv.WriteRecords(records); } LogHelper.Info($"æ°æ®æåä¿åå°: {filePath}"); } catch (Exception ex) { LogHelper.Error($"ä¿åCSVæä»¶æ¶åºé: {ex.Message}"); //throw; } //Task.Factory.StartNew(() => //{ //}); } /// <summary> /// ä»CSVæä»¶è¯»åæ°æ®å°RecordProductDatasåå ¸ /// </summary> /// <param name="filePath">CSVæä»¶è·¯å¾</param> /// <returns>读åçæ°æ®åå ¸</returns> public static List<RecordProductData> LoadFromCsv(string filePath) { var recordProductDatas = new List<RecordProductData>(); try { if (!File.Exists(filePath)) { LogHelper.Info($"æä»¶ä¸åå¨: {filePath}"); return recordProductDatas; } using (var reader = new StreamReader(filePath)) using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture)) { csv.Context.RegisterClassMap<CsvRecordProductDataMap>(); var records = csv.GetRecords<CsvRecordProductData>(); foreach (var record in records) { var productData = new RecordProductData { ProductName = record.ProductName, ProductSN = record.ProductSN, InspectionOperator = record.InspectionOperator, NGType = record.NGType, NGSize = record.NGSize, DetectionTime = record.DetectionTime, CameraInspection = record.CameraInspection, }; recordProductDatas.Add(productData); } } LogHelper.Info($"ä» {filePath} æå读å {recordProductDatas.Count} æ¡è®°å½"); } catch (Exception ex) { LogHelper.Error($"读åCSVæä»¶æ¶åºé: {ex.Message}"); //throw; } return recordProductDatas; } } } LB_SmartVision/CSV/CsvRecordProductDataMap.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,25 @@ using CsvHelper.Configuration; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LB_SmartVision.CSV { internal class CsvRecordProductDataMap:ClassMap<CsvRecordProductData> { public CsvRecordProductDataMap() { //Map(m => m.DictionaryKey).Name("è®°å½æ¶é´"); Map(m => m.ProductName).Name("ç©æå·æäº§ååç§°"); Map(m => m.ProductSN).Name("产åSNå·"); Map(m => m.InspectionOperator).Name("æ£æµä½ä¸å"); Map(m => m.NGType).Name("NGç±»å"); Map(m => m.NGSize).Name("NG大å°"); Map(m => m.DetectionTime).Name("æ£æµæ¶é´"); Map(m => m.CameraInspection).Name("æ£æµç¸æº"); } } } LB_SmartVision/Forms/Pages/CommunicatorPage/CommunicatorsEditPage.cs
@@ -206,6 +206,16 @@ if (GlobalVar.dicCommunicators.ContainsKey(oldName)) GlobalVar.dicCommunicators.TryRename(oldName, newName); foreach (var item in GlobalVar.dicMotionControlData.Keys) { foreach (var item1 in GlobalVar.dicMotionControlData[item].Keys) { if (GlobalVar.dicMotionControlData[item][item1].CommunicatorsName.Contains(oldName)) { GlobalVar.dicMotionControlData[item][item1].CommunicatorsName = newName; } } } flow.Refresh(); } LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs
@@ -283,14 +283,14 @@ // tableLayoutPanel4.Anchor = AnchorStyles.Top | AnchorStyles.Right; tableLayoutPanel4.ColumnCount = 2; tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.3333321F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.3333321F)); tableLayoutPanel4.Controls.Add(btnHisDataFind, 0, 0); tableLayoutPanel4.Controls.Add(btnHisDataExport, 1, 0); tableLayoutPanel4.Location = new Point(657, 509); tableLayoutPanel4.Name = "tableLayoutPanel4"; tableLayoutPanel4.RowCount = 1; tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel4.Size = new Size(200, 39); tableLayoutPanel4.TabIndex = 1; // @@ -312,6 +312,7 @@ btnHisDataFind.Text = "æ¥è¯¢"; btnHisDataFind.TextColor = Color.White; btnHisDataFind.WarningColor = Color.FromArgb(230, 162, 60); btnHisDataFind.Click += btnHisDataFind_Click; // // btnHisDataExport // @@ -341,6 +342,7 @@ Name = "HistoricalDataEditPage"; Size = new Size(866, 580); grpHisData.ResumeLayout(false); grpHisData.PerformLayout(); tableLayoutPanel1.ResumeLayout(false); tableLayoutPanel2.ResumeLayout(false); tableLayoutPanel3.ResumeLayout(false); LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.cs
@@ -1,9 +1,12 @@ using LB_SmartVisionCommon; using LB_SmartVision.CSV; using LB_SmartVision.SQL; using LB_SmartVisionCommon; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -14,9 +17,13 @@ public partial class HistoricalDataEditPage : UserControl { public Action<string, LogInfoType> LogInfo; // ä¿ååå§æ°æ®çå表 private List<DataGridViewRow> originalRows = new List<DataGridViewRow>(); private int row2OriginalHeight; private int row3OriginalHeight; List<RecordProductData> RecordProductDatas = new List<RecordProductData>(); public HistoricalDataEditPage() { Name = "HistoricalDataEditPage"; @@ -37,30 +44,7 @@ /// </summary> private void InitializeDataGridView() { // 设置DataGridViewå宽 dataGridViewHD.ColumnCount = 4; int totalWidth = dataGridViewHD.ClientSize.Width; int columnCount = dataGridViewHD.ColumnCount; int columnWidth = totalWidth / columnCount; // 设置æå°å®½åº¦ int minWidth = 100; // æå°å®½åº¦ if (columnWidth < minWidth) { columnWidth = minWidth; } for (int i = 0; i < columnCount; i++) { dataGridViewHD.Columns[i].Width = columnWidth; } // è®¾ç½®åæ é¢ dataGridViewHD.Columns[0].Name = "SNå·"; dataGridViewHD.Columns[1].Name = "æ¶é´"; dataGridViewHD.Columns[2].Name = "NGç±»"; dataGridViewHD.Columns[3].Name = "缺é·å¤§å°"; this.dataGridViewHD.DataSource = RecordProductDatas; dataGridViewHD.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; @@ -151,45 +135,68 @@ { dateTimePickerEnd.MinDate = dateTimePickerStart.Value; } public string OpenFileForSave() { using (SaveFileDialog saveFileDialog = new SaveFileDialog()) { // 设置é»è®¤æä»¶ååæ©å±å saveFileDialog.FileName = $"å岿°æ®_{DateTime.Now:yyyyMMdd_HHmmss}"; saveFileDialog.DefaultExt = "xlsx"; // 设置æä»¶è¿æ»¤å¨ saveFileDialog.Filter = "Excelæä»¶ (*.xlsx)|*.xlsx|" + "CSVæä»¶ (*.csv)|*.csv|" + "ææ¬æä»¶ (*.txt)|*.txt|" + "æææä»¶ (*.*)|*.*"; saveFileDialog.Title = "éæ©æä»¶ä¿åä½ç½®"; saveFileDialog.RestoreDirectory = true; // è®°ä½ä¸æ¬¡æå¼çç®å½ saveFileDialog.OverwritePrompt = true; // è¦çæ¶æç¤º if (saveFileDialog.ShowDialog() == DialogResult.OK) { string filePathHD = saveFileDialog.FileName; return filePathHD; } } return null; } private void btnHisDataExport_Click(object sender, EventArgs e) { CsvDataHelperRecordProductData.SaveToCsv(OpenFileForSave(), RecordProductDatas); } public void SaveToCSV(string filePath, int rowIndex) private void btnHisDataFind_Click(object sender, EventArgs e) { // ä½¿ç¨ StreamWriter æ¥åå ¥æä»¶ using (StreamWriter writer = new StreamWriter(filePath)) DateTime startDate = dateTimePickerStart.Value.Date; DateTime endDate = dateTimePickerEnd.Value.Date; switch(comboBoxSearchBasis.SelectedIndex) { DataGridViewRow row = dataGridViewHD.Rows[rowIndex]; int rowCount = 10;//10æ¹ä¸ºé鿬¡æ° writer.WriteLine("SNå·, æ¶é´, NGç±», 缺é·å¤§å°"); // é忝ä¸è¡æ°æ® for (int i = 0; i < rowCount; i++) //便®æ¥ææ¥è¯¢ case 0: RecordProductDatas = RecordProductDataRepository.GetRecordsByTimeRange(DateTime.Parse(this.dateTimePickerStart.Value.ToString()), DateTime.Parse(this.dateTimePickerEnd.Value.ToString())); break; //便®SNå·æ¥è¯¢ case 1: if(string.IsNullOrEmpty(textBoxSN.Text)) { int batchSize = 4; // åå ¥è¿ä¸æ¹æ¬¡çæ¯ä¸åæ°æ® for (int k = 0; k < batchSize; k++) MessageBox.Show("请填åSNå·ï¼", "æç¤º", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { writer.Write($"{row.Cells[k].Value}"); // å¨å ç´ ä¹é´æ·»å éå·ï¼é¤éè¿æ¯æåä¸ä¸ªå ç´ if (k < batchSize - 1) { writer.Write(","); RecordProductDatas = RecordProductDataRepository.GetRecordsByProductNumber(textBoxSN.Text); } break; } // åå ¥å®ä¸è¡åï¼æ¢è¡ writer.WriteLine(); this.dataGridViewHD.DataSource = RecordProductDatas; this.dataGridViewHD.AutoGenerateColumns = true; } } } } } } LB_SmartVision/Forms/Pages/MotionControlPage/MotionControlForm.Designer.cs
@@ -30,6 +30,7 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MotionControlForm)); uiGroupBoxMotionControl = new GroupBox(); panel1 = new Panel(); tableLayoutPanel3 = new TableLayoutPanel(); tableLayoutPanel6 = new TableLayoutPanel(); uiButtonCloseSoftGrab = new Button(); @@ -45,6 +46,12 @@ textBoxAngSpeed = new TextBox(); labelAngSpeed = new Label(); textBoxPointSpeed = new TextBox(); groupBoxPulseMotionSpeedAddress = new GroupBox(); textBoxPulseMotionSpeedAddress = new TextBox(); groupBoxAngularVelocityAddress = new GroupBox(); textBoxAngularVelocityAddress = new TextBox(); groupBoxCom = new GroupBox(); cmbCom = new Sunny.UI.UIComboBox(); tableLayoutPanel2 = new TableLayoutPanel(); uiButtonIncreasePitchAngle = new Button(); groupBoxPitchAnglePosition = new GroupBox(); @@ -62,6 +69,30 @@ uiButtonDecreaseX = new Button(); groupBoxXPosition = new GroupBox(); textBoxXPosition = new TextBox(); groupBoxYVarAddress = new GroupBox(); textBoxYVarAddress = new TextBox(); groupBoxXVarAddress = new GroupBox(); textBoxXVarAddress = new TextBox(); groupBoxZVarAddress = new GroupBox(); textBoxZVarAddress = new TextBox(); groupBoxWVarAddress = new GroupBox(); textBoxWVarAddress = new TextBox(); groupBoxYDetectLocation = new GroupBox(); textBoxYDetectLocation = new TextBox(); groupBoxZDetectLocation = new GroupBox(); textBoxZDetectLocation = new TextBox(); groupBoxWDetectLocation = new GroupBox(); textBoxWDetectLocation = new TextBox(); groupBoxXDetectLocation = new GroupBox(); textBoxXDetectLocation = new TextBox(); groupBoxXOriginalLocation = new GroupBox(); textBoxXOriginalLocation = new TextBox(); groupBoxYOriginalLocation = new GroupBox(); textBoxYOriginalLocation = new TextBox(); groupBoxZOriginalLocation = new GroupBox(); textBoxZOriginalLocation = new TextBox(); groupBoxWOriginalLocation = new GroupBox(); textBoxWOriginalLocation = new TextBox(); tableLayoutPanel1 = new TableLayoutPanel(); textBoxSN = new TextBox(); uiMarkLabelSN = new Label(); @@ -72,45 +103,32 @@ uiSplitContainer1 = new SplitContainer(); themeForm1 = new ReaLTaiizor.Forms.ThemeForm(); controlBox1 = new ReaLTaiizor.Controls.ControlBox(); panel1 = new Panel(); groupBoxXVarAddress = new GroupBox(); textBoxXVarAddress = new TextBox(); groupBoxYVarAddress = new GroupBox(); textBoxYVarAddress = new TextBox(); groupBoxZVarAddress = new GroupBox(); textBoxZVarAddress = new TextBox(); groupBoxWVarAddress = new GroupBox(); textBoxWVarAddress = new TextBox(); groupBoxXDetectLocation = new GroupBox(); textBoxXDetectLocation = new TextBox(); groupBoxYDetectLocation = new GroupBox(); textBoxYDetectLocation = new TextBox(); groupBoxZDetectLocation = new GroupBox(); textBoxZDetectLocation = new TextBox(); groupBoxWDetectLocation = new GroupBox(); textBoxWDetectLocation = new TextBox(); groupBoxXOriginalLocation = new GroupBox(); textBoxXOriginalLocation = new TextBox(); groupBoxYOriginalLocation = new GroupBox(); textBoxYOriginalLocation = new TextBox(); groupBoxZOriginalLocation = new GroupBox(); textBoxZOriginalLocation = new TextBox(); groupBoxWOriginalLocation = new GroupBox(); textBoxWOriginalLocation = new TextBox(); groupBoxPulseMotionSpeedAddress = new GroupBox(); textBoxPulseMotionSpeedAddress = new TextBox(); groupBoxAngularVelocityAddress = new GroupBox(); textBoxAngularVelocityAddress = new TextBox(); uiGroupBoxMotionControl.SuspendLayout(); panel1.SuspendLayout(); tableLayoutPanel3.SuspendLayout(); tableLayoutPanel6.SuspendLayout(); tableLayoutPanel5.SuspendLayout(); tableLayoutPanel4.SuspendLayout(); groupBoxPulseMotionSpeedAddress.SuspendLayout(); groupBoxAngularVelocityAddress.SuspendLayout(); groupBoxCom.SuspendLayout(); tableLayoutPanel2.SuspendLayout(); groupBoxPitchAnglePosition.SuspendLayout(); groupBoxZPosition.SuspendLayout(); groupBoxYPosition.SuspendLayout(); groupBoxXPosition.SuspendLayout(); groupBoxYVarAddress.SuspendLayout(); groupBoxXVarAddress.SuspendLayout(); groupBoxZVarAddress.SuspendLayout(); groupBoxWVarAddress.SuspendLayout(); groupBoxYDetectLocation.SuspendLayout(); groupBoxZDetectLocation.SuspendLayout(); groupBoxWDetectLocation.SuspendLayout(); groupBoxXDetectLocation.SuspendLayout(); groupBoxXOriginalLocation.SuspendLayout(); groupBoxYOriginalLocation.SuspendLayout(); groupBoxZOriginalLocation.SuspendLayout(); groupBoxWOriginalLocation.SuspendLayout(); tableLayoutPanel1.SuspendLayout(); tableLayoutPanel7.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)uiSplitContainer1).BeginInit(); @@ -118,21 +136,6 @@ uiSplitContainer1.Panel2.SuspendLayout(); uiSplitContainer1.SuspendLayout(); themeForm1.SuspendLayout(); panel1.SuspendLayout(); groupBoxXVarAddress.SuspendLayout(); groupBoxYVarAddress.SuspendLayout(); groupBoxZVarAddress.SuspendLayout(); groupBoxWVarAddress.SuspendLayout(); groupBoxXDetectLocation.SuspendLayout(); groupBoxYDetectLocation.SuspendLayout(); groupBoxZDetectLocation.SuspendLayout(); groupBoxWDetectLocation.SuspendLayout(); groupBoxXOriginalLocation.SuspendLayout(); groupBoxYOriginalLocation.SuspendLayout(); groupBoxZOriginalLocation.SuspendLayout(); groupBoxWOriginalLocation.SuspendLayout(); groupBoxPulseMotionSpeedAddress.SuspendLayout(); groupBoxAngularVelocityAddress.SuspendLayout(); SuspendLayout(); // // uiGroupBoxMotionControl @@ -150,6 +153,16 @@ uiGroupBoxMotionControl.TabIndex = 18; uiGroupBoxMotionControl.TabStop = false; uiGroupBoxMotionControl.Text = "è¿å¨æ§å¶åæ°"; // // panel1 // panel1.Controls.Add(tableLayoutPanel3); panel1.Dock = DockStyle.Fill; panel1.Location = new Point(0, 23); panel1.Name = "panel1"; panel1.Padding = new Padding(0, 3, 0, 0); panel1.Size = new Size(580, 661); panel1.TabIndex = 1; // // tableLayoutPanel3 // @@ -245,7 +258,6 @@ tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 160F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F)); tableLayoutPanel4.Controls.Add(labelPointSpeed, 0, 0); tableLayoutPanel4.Controls.Add(textBoxAngleNow, 1, 3); tableLayoutPanel4.Controls.Add(labelAngleNow, 0, 3); @@ -256,14 +268,16 @@ tableLayoutPanel4.Controls.Add(textBoxPointSpeed, 1, 0); tableLayoutPanel4.Controls.Add(groupBoxPulseMotionSpeedAddress, 2, 0); tableLayoutPanel4.Controls.Add(groupBoxAngularVelocityAddress, 2, 1); tableLayoutPanel4.Controls.Add(groupBoxCom, 0, 4); tableLayoutPanel4.Dock = DockStyle.Fill; tableLayoutPanel4.Location = new Point(3, 371); tableLayoutPanel4.Name = "tableLayoutPanel4"; tableLayoutPanel4.RowCount = 5; tableLayoutPanel4.RowCount = 6; tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F)); tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F)); tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F)); tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F)); tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Absolute, 60F)); tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel4.Size = new Size(574, 284); tableLayoutPanel4.TabIndex = 2; @@ -361,6 +375,88 @@ textBoxPointSpeed.TextChanged += textBoxPointSpeed_TextChanged; textBoxPointSpeed.KeyDown += textBoxXPosition_KeyDown; textBoxPointSpeed.KeyPress += textBoxXPosition_KeyPress; // // groupBoxPulseMotionSpeedAddress // groupBoxPulseMotionSpeedAddress.Controls.Add(textBoxPulseMotionSpeedAddress); groupBoxPulseMotionSpeedAddress.Dock = DockStyle.Fill; groupBoxPulseMotionSpeedAddress.Font = new Font("å®ä½", 8F); groupBoxPulseMotionSpeedAddress.ForeColor = Color.White; groupBoxPulseMotionSpeedAddress.Location = new Point(323, 3); groupBoxPulseMotionSpeedAddress.Name = "groupBoxPulseMotionSpeedAddress"; groupBoxPulseMotionSpeedAddress.Size = new Size(114, 39); groupBoxPulseMotionSpeedAddress.TabIndex = 30; groupBoxPulseMotionSpeedAddress.TabStop = false; groupBoxPulseMotionSpeedAddress.Text = "ç¹é度å°å"; // // textBoxPulseMotionSpeedAddress // textBoxPulseMotionSpeedAddress.Dock = DockStyle.Bottom; textBoxPulseMotionSpeedAddress.Font = new Font("å®ä½", 10F); textBoxPulseMotionSpeedAddress.Location = new Point(3, 16); textBoxPulseMotionSpeedAddress.Multiline = true; textBoxPulseMotionSpeedAddress.Name = "textBoxPulseMotionSpeedAddress"; textBoxPulseMotionSpeedAddress.Size = new Size(108, 20); textBoxPulseMotionSpeedAddress.TabIndex = 12; textBoxPulseMotionSpeedAddress.Text = "1"; // // groupBoxAngularVelocityAddress // groupBoxAngularVelocityAddress.Controls.Add(textBoxAngularVelocityAddress); groupBoxAngularVelocityAddress.Dock = DockStyle.Fill; groupBoxAngularVelocityAddress.Font = new Font("å®ä½", 8F); groupBoxAngularVelocityAddress.ForeColor = Color.White; groupBoxAngularVelocityAddress.Location = new Point(323, 48); groupBoxAngularVelocityAddress.Name = "groupBoxAngularVelocityAddress"; groupBoxAngularVelocityAddress.Size = new Size(114, 39); groupBoxAngularVelocityAddress.TabIndex = 30; groupBoxAngularVelocityAddress.TabStop = false; groupBoxAngularVelocityAddress.Text = "è§é度å°å"; // // textBoxAngularVelocityAddress // textBoxAngularVelocityAddress.Dock = DockStyle.Bottom; textBoxAngularVelocityAddress.Font = new Font("å®ä½", 10F); textBoxAngularVelocityAddress.Location = new Point(3, 16); textBoxAngularVelocityAddress.Multiline = true; textBoxAngularVelocityAddress.Name = "textBoxAngularVelocityAddress"; textBoxAngularVelocityAddress.Size = new Size(108, 20); textBoxAngularVelocityAddress.TabIndex = 12; textBoxAngularVelocityAddress.Text = "1"; // // groupBoxCom // groupBoxCom.Controls.Add(cmbCom); groupBoxCom.Dock = DockStyle.Fill; groupBoxCom.Font = new Font("å®ä½", 9F, FontStyle.Regular, GraphicsUnit.Point, 134); groupBoxCom.ForeColor = Color.White; groupBoxCom.Location = new Point(3, 183); groupBoxCom.Name = "groupBoxCom"; groupBoxCom.Size = new Size(154, 54); groupBoxCom.TabIndex = 31; groupBoxCom.TabStop = false; groupBoxCom.Text = "é讯"; // // cmbCom // cmbCom.DataSource = null; cmbCom.Dock = DockStyle.Fill; cmbCom.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; cmbCom.FillColor = Color.White; cmbCom.Font = new Font("å®ä½", 12F, FontStyle.Regular, GraphicsUnit.Point, 134); cmbCom.ItemHoverColor = Color.FromArgb(155, 200, 255); cmbCom.ItemSelectForeColor = Color.FromArgb(235, 243, 255); cmbCom.Location = new Point(3, 21); cmbCom.Margin = new Padding(4, 5, 4, 5); cmbCom.MinimumSize = new Size(63, 0); cmbCom.Name = "cmbCom"; cmbCom.Padding = new Padding(0, 0, 30, 2); cmbCom.Size = new Size(148, 30); cmbCom.SymbolSize = 24; cmbCom.TabIndex = 0; cmbCom.TextAlignment = ContentAlignment.MiddleLeft; cmbCom.Watermark = ""; cmbCom.SelectedIndexChanged += cmbCom_SelectedIndexChanged; // // tableLayoutPanel2 // @@ -614,6 +710,294 @@ textBoxXPosition.KeyDown += textBoxXPosition_KeyDown; textBoxXPosition.KeyPress += textBoxXPosition_KeyPress; // // groupBoxYVarAddress // groupBoxYVarAddress.Controls.Add(textBoxYVarAddress); groupBoxYVarAddress.Dock = DockStyle.Fill; groupBoxYVarAddress.Font = new Font("å®ä½", 8F); groupBoxYVarAddress.ForeColor = Color.White; groupBoxYVarAddress.Location = new Point(193, 48); groupBoxYVarAddress.Name = "groupBoxYVarAddress"; groupBoxYVarAddress.Size = new Size(122, 39); groupBoxYVarAddress.TabIndex = 29; groupBoxYVarAddress.TabStop = false; groupBoxYVarAddress.Text = "Yè½´åéå°å"; // // textBoxYVarAddress // textBoxYVarAddress.Dock = DockStyle.Bottom; textBoxYVarAddress.Font = new Font("å®ä½", 10F); textBoxYVarAddress.Location = new Point(3, 16); textBoxYVarAddress.Multiline = true; textBoxYVarAddress.Name = "textBoxYVarAddress"; textBoxYVarAddress.Size = new Size(116, 20); textBoxYVarAddress.TabIndex = 12; textBoxYVarAddress.Text = "1"; // // groupBoxXVarAddress // groupBoxXVarAddress.Controls.Add(textBoxXVarAddress); groupBoxXVarAddress.Dock = DockStyle.Fill; groupBoxXVarAddress.Font = new Font("å®ä½", 8F); groupBoxXVarAddress.ForeColor = Color.White; groupBoxXVarAddress.Location = new Point(193, 3); groupBoxXVarAddress.Name = "groupBoxXVarAddress"; groupBoxXVarAddress.Size = new Size(122, 39); groupBoxXVarAddress.TabIndex = 28; groupBoxXVarAddress.TabStop = false; groupBoxXVarAddress.Text = "Xè½´åéå°å"; // // textBoxXVarAddress // textBoxXVarAddress.Dock = DockStyle.Bottom; textBoxXVarAddress.Font = new Font("å®ä½", 10F); textBoxXVarAddress.Location = new Point(3, 16); textBoxXVarAddress.Multiline = true; textBoxXVarAddress.Name = "textBoxXVarAddress"; textBoxXVarAddress.Size = new Size(116, 20); textBoxXVarAddress.TabIndex = 12; textBoxXVarAddress.Text = "1"; // // groupBoxZVarAddress // groupBoxZVarAddress.Controls.Add(textBoxZVarAddress); groupBoxZVarAddress.Dock = DockStyle.Fill; groupBoxZVarAddress.Font = new Font("å®ä½", 8F); groupBoxZVarAddress.ForeColor = Color.White; groupBoxZVarAddress.Location = new Point(193, 93); groupBoxZVarAddress.Name = "groupBoxZVarAddress"; groupBoxZVarAddress.Size = new Size(122, 39); groupBoxZVarAddress.TabIndex = 29; groupBoxZVarAddress.TabStop = false; groupBoxZVarAddress.Text = "Zè½´åéå°å"; // // textBoxZVarAddress // textBoxZVarAddress.Dock = DockStyle.Bottom; textBoxZVarAddress.Font = new Font("å®ä½", 10F); textBoxZVarAddress.Location = new Point(3, 16); textBoxZVarAddress.Multiline = true; textBoxZVarAddress.Name = "textBoxZVarAddress"; textBoxZVarAddress.Size = new Size(116, 20); textBoxZVarAddress.TabIndex = 12; textBoxZVarAddress.Text = "1"; // // groupBoxWVarAddress // groupBoxWVarAddress.Controls.Add(textBoxWVarAddress); groupBoxWVarAddress.Dock = DockStyle.Fill; groupBoxWVarAddress.Font = new Font("å®ä½", 8F); groupBoxWVarAddress.ForeColor = Color.White; groupBoxWVarAddress.Location = new Point(193, 138); groupBoxWVarAddress.Name = "groupBoxWVarAddress"; groupBoxWVarAddress.Size = new Size(122, 41); groupBoxWVarAddress.TabIndex = 29; groupBoxWVarAddress.TabStop = false; groupBoxWVarAddress.Text = "Wè½´åéå°å"; // // textBoxWVarAddress // textBoxWVarAddress.Dock = DockStyle.Bottom; textBoxWVarAddress.Font = new Font("å®ä½", 10F); textBoxWVarAddress.Location = new Point(3, 18); textBoxWVarAddress.Multiline = true; textBoxWVarAddress.Name = "textBoxWVarAddress"; textBoxWVarAddress.Size = new Size(116, 20); textBoxWVarAddress.TabIndex = 12; textBoxWVarAddress.Text = "1"; // // groupBoxYDetectLocation // groupBoxYDetectLocation.Controls.Add(textBoxYDetectLocation); groupBoxYDetectLocation.Dock = DockStyle.Fill; groupBoxYDetectLocation.Font = new Font("å®ä½", 8F); groupBoxYDetectLocation.ForeColor = Color.White; groupBoxYDetectLocation.Location = new Point(321, 48); groupBoxYDetectLocation.Name = "groupBoxYDetectLocation"; groupBoxYDetectLocation.Size = new Size(122, 39); groupBoxYDetectLocation.TabIndex = 30; groupBoxYDetectLocation.TabStop = false; groupBoxYDetectLocation.Text = "Yè½´æ£æµä½ç½®"; // // textBoxYDetectLocation // textBoxYDetectLocation.Dock = DockStyle.Bottom; textBoxYDetectLocation.Font = new Font("å®ä½", 10F); textBoxYDetectLocation.Location = new Point(3, 16); textBoxYDetectLocation.Multiline = true; textBoxYDetectLocation.Name = "textBoxYDetectLocation"; textBoxYDetectLocation.Size = new Size(116, 20); textBoxYDetectLocation.TabIndex = 12; textBoxYDetectLocation.Text = "1"; // // groupBoxZDetectLocation // groupBoxZDetectLocation.Controls.Add(textBoxZDetectLocation); groupBoxZDetectLocation.Dock = DockStyle.Fill; groupBoxZDetectLocation.Font = new Font("å®ä½", 8F); groupBoxZDetectLocation.ForeColor = Color.White; groupBoxZDetectLocation.Location = new Point(321, 93); groupBoxZDetectLocation.Name = "groupBoxZDetectLocation"; groupBoxZDetectLocation.Size = new Size(122, 39); groupBoxZDetectLocation.TabIndex = 30; groupBoxZDetectLocation.TabStop = false; groupBoxZDetectLocation.Text = "Zè½´æ£æµä½ç½®"; // // textBoxZDetectLocation // textBoxZDetectLocation.Dock = DockStyle.Bottom; textBoxZDetectLocation.Font = new Font("å®ä½", 10F); textBoxZDetectLocation.Location = new Point(3, 16); textBoxZDetectLocation.Multiline = true; textBoxZDetectLocation.Name = "textBoxZDetectLocation"; textBoxZDetectLocation.Size = new Size(116, 20); textBoxZDetectLocation.TabIndex = 12; textBoxZDetectLocation.Text = "1"; // // groupBoxWDetectLocation // groupBoxWDetectLocation.Controls.Add(textBoxWDetectLocation); groupBoxWDetectLocation.Dock = DockStyle.Fill; groupBoxWDetectLocation.Font = new Font("å®ä½", 8F); groupBoxWDetectLocation.ForeColor = Color.White; groupBoxWDetectLocation.Location = new Point(321, 138); groupBoxWDetectLocation.Name = "groupBoxWDetectLocation"; groupBoxWDetectLocation.Size = new Size(122, 41); groupBoxWDetectLocation.TabIndex = 30; groupBoxWDetectLocation.TabStop = false; groupBoxWDetectLocation.Text = "Wè½´æ£æµä½ç½®"; // // textBoxWDetectLocation // textBoxWDetectLocation.Dock = DockStyle.Bottom; textBoxWDetectLocation.Font = new Font("å®ä½", 10F); textBoxWDetectLocation.Location = new Point(3, 18); textBoxWDetectLocation.Multiline = true; textBoxWDetectLocation.Name = "textBoxWDetectLocation"; textBoxWDetectLocation.Size = new Size(116, 20); textBoxWDetectLocation.TabIndex = 12; textBoxWDetectLocation.Text = "1"; // // groupBoxXDetectLocation // groupBoxXDetectLocation.Controls.Add(textBoxXDetectLocation); groupBoxXDetectLocation.Dock = DockStyle.Fill; groupBoxXDetectLocation.Font = new Font("å®ä½", 8F); groupBoxXDetectLocation.ForeColor = Color.White; groupBoxXDetectLocation.Location = new Point(321, 3); groupBoxXDetectLocation.Name = "groupBoxXDetectLocation"; groupBoxXDetectLocation.Size = new Size(122, 39); groupBoxXDetectLocation.TabIndex = 30; groupBoxXDetectLocation.TabStop = false; groupBoxXDetectLocation.Text = "Xè½´æ£æµä½ç½®"; // // textBoxXDetectLocation // textBoxXDetectLocation.Dock = DockStyle.Bottom; textBoxXDetectLocation.Font = new Font("å®ä½", 10F); textBoxXDetectLocation.Location = new Point(3, 16); textBoxXDetectLocation.Multiline = true; textBoxXDetectLocation.Name = "textBoxXDetectLocation"; textBoxXDetectLocation.Size = new Size(116, 20); textBoxXDetectLocation.TabIndex = 12; textBoxXDetectLocation.Text = "1"; // // groupBoxXOriginalLocation // groupBoxXOriginalLocation.Controls.Add(textBoxXOriginalLocation); groupBoxXOriginalLocation.Dock = DockStyle.Fill; groupBoxXOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxXOriginalLocation.ForeColor = Color.White; groupBoxXOriginalLocation.Location = new Point(449, 3); groupBoxXOriginalLocation.Name = "groupBoxXOriginalLocation"; groupBoxXOriginalLocation.Size = new Size(122, 39); groupBoxXOriginalLocation.TabIndex = 30; groupBoxXOriginalLocation.TabStop = false; groupBoxXOriginalLocation.Text = "Xè½´åç¹ä½ç½®"; // // textBoxXOriginalLocation // textBoxXOriginalLocation.Dock = DockStyle.Bottom; textBoxXOriginalLocation.Font = new Font("å®ä½", 10F); textBoxXOriginalLocation.Location = new Point(3, 16); textBoxXOriginalLocation.Multiline = true; textBoxXOriginalLocation.Name = "textBoxXOriginalLocation"; textBoxXOriginalLocation.Size = new Size(116, 20); textBoxXOriginalLocation.TabIndex = 12; textBoxXOriginalLocation.Text = "1"; // // groupBoxYOriginalLocation // groupBoxYOriginalLocation.Controls.Add(textBoxYOriginalLocation); groupBoxYOriginalLocation.Dock = DockStyle.Fill; groupBoxYOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxYOriginalLocation.ForeColor = Color.White; groupBoxYOriginalLocation.Location = new Point(449, 48); groupBoxYOriginalLocation.Name = "groupBoxYOriginalLocation"; groupBoxYOriginalLocation.Size = new Size(122, 39); groupBoxYOriginalLocation.TabIndex = 30; groupBoxYOriginalLocation.TabStop = false; groupBoxYOriginalLocation.Text = "Yè½´åç¹ä½ç½®"; // // textBoxYOriginalLocation // textBoxYOriginalLocation.Dock = DockStyle.Bottom; textBoxYOriginalLocation.Font = new Font("å®ä½", 10F); textBoxYOriginalLocation.Location = new Point(3, 16); textBoxYOriginalLocation.Multiline = true; textBoxYOriginalLocation.Name = "textBoxYOriginalLocation"; textBoxYOriginalLocation.Size = new Size(116, 20); textBoxYOriginalLocation.TabIndex = 12; textBoxYOriginalLocation.Text = "1"; // // groupBoxZOriginalLocation // groupBoxZOriginalLocation.Controls.Add(textBoxZOriginalLocation); groupBoxZOriginalLocation.Dock = DockStyle.Fill; groupBoxZOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxZOriginalLocation.ForeColor = Color.White; groupBoxZOriginalLocation.Location = new Point(449, 93); groupBoxZOriginalLocation.Name = "groupBoxZOriginalLocation"; groupBoxZOriginalLocation.Size = new Size(122, 39); groupBoxZOriginalLocation.TabIndex = 30; groupBoxZOriginalLocation.TabStop = false; groupBoxZOriginalLocation.Text = "Zè½´åç¹ä½ç½®"; // // textBoxZOriginalLocation // textBoxZOriginalLocation.Dock = DockStyle.Bottom; textBoxZOriginalLocation.Font = new Font("å®ä½", 10F); textBoxZOriginalLocation.Location = new Point(3, 16); textBoxZOriginalLocation.Multiline = true; textBoxZOriginalLocation.Name = "textBoxZOriginalLocation"; textBoxZOriginalLocation.Size = new Size(116, 20); textBoxZOriginalLocation.TabIndex = 12; textBoxZOriginalLocation.Text = "1"; // // groupBoxWOriginalLocation // groupBoxWOriginalLocation.Controls.Add(textBoxWOriginalLocation); groupBoxWOriginalLocation.Dock = DockStyle.Fill; groupBoxWOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxWOriginalLocation.ForeColor = Color.White; groupBoxWOriginalLocation.Location = new Point(449, 138); groupBoxWOriginalLocation.Name = "groupBoxWOriginalLocation"; groupBoxWOriginalLocation.Size = new Size(122, 41); groupBoxWOriginalLocation.TabIndex = 30; groupBoxWOriginalLocation.TabStop = false; groupBoxWOriginalLocation.Text = "Wè½´åç¹ä½ç½®"; // // textBoxWOriginalLocation // textBoxWOriginalLocation.Dock = DockStyle.Bottom; textBoxWOriginalLocation.Font = new Font("å®ä½", 10F); textBoxWOriginalLocation.Location = new Point(3, 18); textBoxWOriginalLocation.Multiline = true; textBoxWOriginalLocation.Name = "textBoxWOriginalLocation"; textBoxWOriginalLocation.Size = new Size(116, 20); textBoxWOriginalLocation.TabIndex = 12; textBoxWOriginalLocation.Text = "1"; // // tableLayoutPanel1 // tableLayoutPanel1.ColumnCount = 2; @@ -760,352 +1144,6 @@ controlBox1.TabIndex = 21; controlBox1.Text = "controlBox1"; // // panel1 // panel1.Controls.Add(tableLayoutPanel3); panel1.Dock = DockStyle.Fill; panel1.Location = new Point(0, 23); panel1.Name = "panel1"; panel1.Padding = new Padding(0, 3, 0, 0); panel1.Size = new Size(580, 661); panel1.TabIndex = 1; // // groupBoxXVarAddress // groupBoxXVarAddress.Controls.Add(textBoxXVarAddress); groupBoxXVarAddress.Dock = DockStyle.Fill; groupBoxXVarAddress.Font = new Font("å®ä½", 8F); groupBoxXVarAddress.ForeColor = Color.White; groupBoxXVarAddress.Location = new Point(193, 3); groupBoxXVarAddress.Name = "groupBoxXVarAddress"; groupBoxXVarAddress.Size = new Size(122, 39); groupBoxXVarAddress.TabIndex = 28; groupBoxXVarAddress.TabStop = false; groupBoxXVarAddress.Text = "Xè½´åéå°å"; // // textBoxXVarAddress // textBoxXVarAddress.Dock = DockStyle.Bottom; textBoxXVarAddress.Font = new Font("å®ä½", 10F); textBoxXVarAddress.Location = new Point(3, 16); textBoxXVarAddress.Multiline = true; textBoxXVarAddress.Name = "textBoxXVarAddress"; textBoxXVarAddress.Size = new Size(116, 20); textBoxXVarAddress.TabIndex = 12; textBoxXVarAddress.Text = "1"; // // groupBoxYVarAddress // groupBoxYVarAddress.Controls.Add(textBoxYVarAddress); groupBoxYVarAddress.Dock = DockStyle.Fill; groupBoxYVarAddress.Font = new Font("å®ä½", 8F); groupBoxYVarAddress.ForeColor = Color.White; groupBoxYVarAddress.Location = new Point(193, 48); groupBoxYVarAddress.Name = "groupBoxYVarAddress"; groupBoxYVarAddress.Size = new Size(122, 39); groupBoxYVarAddress.TabIndex = 29; groupBoxYVarAddress.TabStop = false; groupBoxYVarAddress.Text = "Yè½´åéå°å"; // // textBoxYVarAddress // textBoxYVarAddress.Dock = DockStyle.Bottom; textBoxYVarAddress.Font = new Font("å®ä½", 10F); textBoxYVarAddress.Location = new Point(3, 16); textBoxYVarAddress.Multiline = true; textBoxYVarAddress.Name = "textBoxYVarAddress"; textBoxYVarAddress.Size = new Size(116, 20); textBoxYVarAddress.TabIndex = 12; textBoxYVarAddress.Text = "1"; // // groupBoxZVarAddress // groupBoxZVarAddress.Controls.Add(textBoxZVarAddress); groupBoxZVarAddress.Dock = DockStyle.Fill; groupBoxZVarAddress.Font = new Font("å®ä½", 8F); groupBoxZVarAddress.ForeColor = Color.White; groupBoxZVarAddress.Location = new Point(193, 93); groupBoxZVarAddress.Name = "groupBoxZVarAddress"; groupBoxZVarAddress.Size = new Size(122, 39); groupBoxZVarAddress.TabIndex = 29; groupBoxZVarAddress.TabStop = false; groupBoxZVarAddress.Text = "Zè½´åéå°å"; // // textBoxZVarAddress // textBoxZVarAddress.Dock = DockStyle.Bottom; textBoxZVarAddress.Font = new Font("å®ä½", 10F); textBoxZVarAddress.Location = new Point(3, 16); textBoxZVarAddress.Multiline = true; textBoxZVarAddress.Name = "textBoxZVarAddress"; textBoxZVarAddress.Size = new Size(116, 20); textBoxZVarAddress.TabIndex = 12; textBoxZVarAddress.Text = "1"; // // groupBoxWVarAddress // groupBoxWVarAddress.Controls.Add(textBoxWVarAddress); groupBoxWVarAddress.Dock = DockStyle.Fill; groupBoxWVarAddress.Font = new Font("å®ä½", 8F); groupBoxWVarAddress.ForeColor = Color.White; groupBoxWVarAddress.Location = new Point(193, 138); groupBoxWVarAddress.Name = "groupBoxWVarAddress"; groupBoxWVarAddress.Size = new Size(122, 41); groupBoxWVarAddress.TabIndex = 29; groupBoxWVarAddress.TabStop = false; groupBoxWVarAddress.Text = "Wè½´åéå°å"; // // textBoxWVarAddress // textBoxWVarAddress.Dock = DockStyle.Bottom; textBoxWVarAddress.Font = new Font("å®ä½", 10F); textBoxWVarAddress.Location = new Point(3, 18); textBoxWVarAddress.Multiline = true; textBoxWVarAddress.Name = "textBoxWVarAddress"; textBoxWVarAddress.Size = new Size(116, 20); textBoxWVarAddress.TabIndex = 12; textBoxWVarAddress.Text = "1"; // // groupBoxXDetectLocation // groupBoxXDetectLocation.Controls.Add(textBoxXDetectLocation); groupBoxXDetectLocation.Dock = DockStyle.Fill; groupBoxXDetectLocation.Font = new Font("å®ä½", 8F); groupBoxXDetectLocation.ForeColor = Color.White; groupBoxXDetectLocation.Location = new Point(321, 3); groupBoxXDetectLocation.Name = "groupBoxXDetectLocation"; groupBoxXDetectLocation.Size = new Size(122, 39); groupBoxXDetectLocation.TabIndex = 30; groupBoxXDetectLocation.TabStop = false; groupBoxXDetectLocation.Text = "Xè½´æ£æµä½ç½®"; // // textBoxXDetectLocation // textBoxXDetectLocation.Dock = DockStyle.Bottom; textBoxXDetectLocation.Font = new Font("å®ä½", 10F); textBoxXDetectLocation.Location = new Point(3, 16); textBoxXDetectLocation.Multiline = true; textBoxXDetectLocation.Name = "textBoxXDetectLocation"; textBoxXDetectLocation.Size = new Size(116, 20); textBoxXDetectLocation.TabIndex = 12; textBoxXDetectLocation.Text = "1"; // // groupBoxYDetectLocation // groupBoxYDetectLocation.Controls.Add(textBoxYDetectLocation); groupBoxYDetectLocation.Dock = DockStyle.Fill; groupBoxYDetectLocation.Font = new Font("å®ä½", 8F); groupBoxYDetectLocation.ForeColor = Color.White; groupBoxYDetectLocation.Location = new Point(321, 48); groupBoxYDetectLocation.Name = "groupBoxYDetectLocation"; groupBoxYDetectLocation.Size = new Size(122, 39); groupBoxYDetectLocation.TabIndex = 30; groupBoxYDetectLocation.TabStop = false; groupBoxYDetectLocation.Text = "Yè½´æ£æµä½ç½®"; // // textBoxYDetectLocation // textBoxYDetectLocation.Dock = DockStyle.Bottom; textBoxYDetectLocation.Font = new Font("å®ä½", 10F); textBoxYDetectLocation.Location = new Point(3, 16); textBoxYDetectLocation.Multiline = true; textBoxYDetectLocation.Name = "textBoxYDetectLocation"; textBoxYDetectLocation.Size = new Size(116, 20); textBoxYDetectLocation.TabIndex = 12; textBoxYDetectLocation.Text = "1"; // // groupBoxZDetectLocation // groupBoxZDetectLocation.Controls.Add(textBoxZDetectLocation); groupBoxZDetectLocation.Dock = DockStyle.Fill; groupBoxZDetectLocation.Font = new Font("å®ä½", 8F); groupBoxZDetectLocation.ForeColor = Color.White; groupBoxZDetectLocation.Location = new Point(321, 93); groupBoxZDetectLocation.Name = "groupBoxZDetectLocation"; groupBoxZDetectLocation.Size = new Size(122, 39); groupBoxZDetectLocation.TabIndex = 30; groupBoxZDetectLocation.TabStop = false; groupBoxZDetectLocation.Text = "Zè½´æ£æµä½ç½®"; // // textBoxZDetectLocation // textBoxZDetectLocation.Dock = DockStyle.Bottom; textBoxZDetectLocation.Font = new Font("å®ä½", 10F); textBoxZDetectLocation.Location = new Point(3, 16); textBoxZDetectLocation.Multiline = true; textBoxZDetectLocation.Name = "textBoxZDetectLocation"; textBoxZDetectLocation.Size = new Size(116, 20); textBoxZDetectLocation.TabIndex = 12; textBoxZDetectLocation.Text = "1"; // // groupBoxWDetectLocation // groupBoxWDetectLocation.Controls.Add(textBoxWDetectLocation); groupBoxWDetectLocation.Dock = DockStyle.Fill; groupBoxWDetectLocation.Font = new Font("å®ä½", 8F); groupBoxWDetectLocation.ForeColor = Color.White; groupBoxWDetectLocation.Location = new Point(321, 138); groupBoxWDetectLocation.Name = "groupBoxWDetectLocation"; groupBoxWDetectLocation.Size = new Size(122, 41); groupBoxWDetectLocation.TabIndex = 30; groupBoxWDetectLocation.TabStop = false; groupBoxWDetectLocation.Text = "Wè½´æ£æµä½ç½®"; // // textBoxWDetectLocation // textBoxWDetectLocation.Dock = DockStyle.Bottom; textBoxWDetectLocation.Font = new Font("å®ä½", 10F); textBoxWDetectLocation.Location = new Point(3, 18); textBoxWDetectLocation.Multiline = true; textBoxWDetectLocation.Name = "textBoxWDetectLocation"; textBoxWDetectLocation.Size = new Size(116, 20); textBoxWDetectLocation.TabIndex = 12; textBoxWDetectLocation.Text = "1"; // // groupBoxXOriginalLocation // groupBoxXOriginalLocation.Controls.Add(textBoxXOriginalLocation); groupBoxXOriginalLocation.Dock = DockStyle.Fill; groupBoxXOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxXOriginalLocation.ForeColor = Color.White; groupBoxXOriginalLocation.Location = new Point(449, 3); groupBoxXOriginalLocation.Name = "groupBoxXOriginalLocation"; groupBoxXOriginalLocation.Size = new Size(122, 39); groupBoxXOriginalLocation.TabIndex = 30; groupBoxXOriginalLocation.TabStop = false; groupBoxXOriginalLocation.Text = "Xè½´åç¹ä½ç½®"; // // textBoxXOriginalLocation // textBoxXOriginalLocation.Dock = DockStyle.Bottom; textBoxXOriginalLocation.Font = new Font("å®ä½", 10F); textBoxXOriginalLocation.Location = new Point(3, 16); textBoxXOriginalLocation.Multiline = true; textBoxXOriginalLocation.Name = "textBoxXOriginalLocation"; textBoxXOriginalLocation.Size = new Size(116, 20); textBoxXOriginalLocation.TabIndex = 12; textBoxXOriginalLocation.Text = "1"; // // groupBoxYOriginalLocation // groupBoxYOriginalLocation.Controls.Add(textBoxYOriginalLocation); groupBoxYOriginalLocation.Dock = DockStyle.Fill; groupBoxYOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxYOriginalLocation.ForeColor = Color.White; groupBoxYOriginalLocation.Location = new Point(449, 48); groupBoxYOriginalLocation.Name = "groupBoxYOriginalLocation"; groupBoxYOriginalLocation.Size = new Size(122, 39); groupBoxYOriginalLocation.TabIndex = 30; groupBoxYOriginalLocation.TabStop = false; groupBoxYOriginalLocation.Text = "Yè½´åç¹ä½ç½®"; // // textBoxYOriginalLocation // textBoxYOriginalLocation.Dock = DockStyle.Bottom; textBoxYOriginalLocation.Font = new Font("å®ä½", 10F); textBoxYOriginalLocation.Location = new Point(3, 16); textBoxYOriginalLocation.Multiline = true; textBoxYOriginalLocation.Name = "textBoxYOriginalLocation"; textBoxYOriginalLocation.Size = new Size(116, 20); textBoxYOriginalLocation.TabIndex = 12; textBoxYOriginalLocation.Text = "1"; // // groupBoxZOriginalLocation // groupBoxZOriginalLocation.Controls.Add(textBoxZOriginalLocation); groupBoxZOriginalLocation.Dock = DockStyle.Fill; groupBoxZOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxZOriginalLocation.ForeColor = Color.White; groupBoxZOriginalLocation.Location = new Point(449, 93); groupBoxZOriginalLocation.Name = "groupBoxZOriginalLocation"; groupBoxZOriginalLocation.Size = new Size(122, 39); groupBoxZOriginalLocation.TabIndex = 30; groupBoxZOriginalLocation.TabStop = false; groupBoxZOriginalLocation.Text = "Zè½´åç¹ä½ç½®"; // // textBoxZOriginalLocation // textBoxZOriginalLocation.Dock = DockStyle.Bottom; textBoxZOriginalLocation.Font = new Font("å®ä½", 10F); textBoxZOriginalLocation.Location = new Point(3, 16); textBoxZOriginalLocation.Multiline = true; textBoxZOriginalLocation.Name = "textBoxZOriginalLocation"; textBoxZOriginalLocation.Size = new Size(116, 20); textBoxZOriginalLocation.TabIndex = 12; textBoxZOriginalLocation.Text = "1"; // // groupBoxWOriginalLocation // groupBoxWOriginalLocation.Controls.Add(textBoxWOriginalLocation); groupBoxWOriginalLocation.Dock = DockStyle.Fill; groupBoxWOriginalLocation.Font = new Font("å®ä½", 8F); groupBoxWOriginalLocation.ForeColor = Color.White; groupBoxWOriginalLocation.Location = new Point(449, 138); groupBoxWOriginalLocation.Name = "groupBoxWOriginalLocation"; groupBoxWOriginalLocation.Size = new Size(122, 41); groupBoxWOriginalLocation.TabIndex = 30; groupBoxWOriginalLocation.TabStop = false; groupBoxWOriginalLocation.Text = "Wè½´åç¹ä½ç½®"; // // textBoxWOriginalLocation // textBoxWOriginalLocation.Dock = DockStyle.Bottom; textBoxWOriginalLocation.Font = new Font("å®ä½", 10F); textBoxWOriginalLocation.Location = new Point(3, 18); textBoxWOriginalLocation.Multiline = true; textBoxWOriginalLocation.Name = "textBoxWOriginalLocation"; textBoxWOriginalLocation.Size = new Size(116, 20); textBoxWOriginalLocation.TabIndex = 12; textBoxWOriginalLocation.Text = "1"; // // groupBoxPulseMotionSpeedAddress // groupBoxPulseMotionSpeedAddress.Controls.Add(textBoxPulseMotionSpeedAddress); groupBoxPulseMotionSpeedAddress.Dock = DockStyle.Fill; groupBoxPulseMotionSpeedAddress.Font = new Font("å®ä½", 8F); groupBoxPulseMotionSpeedAddress.ForeColor = Color.White; groupBoxPulseMotionSpeedAddress.Location = new Point(323, 3); groupBoxPulseMotionSpeedAddress.Name = "groupBoxPulseMotionSpeedAddress"; groupBoxPulseMotionSpeedAddress.Size = new Size(114, 39); groupBoxPulseMotionSpeedAddress.TabIndex = 30; groupBoxPulseMotionSpeedAddress.TabStop = false; groupBoxPulseMotionSpeedAddress.Text = "ç¹é度å°å"; // // textBoxPulseMotionSpeedAddress // textBoxPulseMotionSpeedAddress.Dock = DockStyle.Bottom; textBoxPulseMotionSpeedAddress.Font = new Font("å®ä½", 10F); textBoxPulseMotionSpeedAddress.Location = new Point(3, 16); textBoxPulseMotionSpeedAddress.Multiline = true; textBoxPulseMotionSpeedAddress.Name = "textBoxPulseMotionSpeedAddress"; textBoxPulseMotionSpeedAddress.Size = new Size(108, 20); textBoxPulseMotionSpeedAddress.TabIndex = 12; textBoxPulseMotionSpeedAddress.Text = "1"; // // groupBoxAngularVelocityAddress // groupBoxAngularVelocityAddress.Controls.Add(textBoxAngularVelocityAddress); groupBoxAngularVelocityAddress.Dock = DockStyle.Fill; groupBoxAngularVelocityAddress.Font = new Font("å®ä½", 8F); groupBoxAngularVelocityAddress.ForeColor = Color.White; groupBoxAngularVelocityAddress.Location = new Point(323, 48); groupBoxAngularVelocityAddress.Name = "groupBoxAngularVelocityAddress"; groupBoxAngularVelocityAddress.Size = new Size(114, 39); groupBoxAngularVelocityAddress.TabIndex = 30; groupBoxAngularVelocityAddress.TabStop = false; groupBoxAngularVelocityAddress.Text = "è§é度å°å"; // // textBoxAngularVelocityAddress // textBoxAngularVelocityAddress.Dock = DockStyle.Bottom; textBoxAngularVelocityAddress.Font = new Font("å®ä½", 10F); textBoxAngularVelocityAddress.Location = new Point(3, 16); textBoxAngularVelocityAddress.Multiline = true; textBoxAngularVelocityAddress.Name = "textBoxAngularVelocityAddress"; textBoxAngularVelocityAddress.Size = new Size(108, 20); textBoxAngularVelocityAddress.TabIndex = 12; textBoxAngularVelocityAddress.Text = "1"; // // MotionControlForm // AutoScaleDimensions = new SizeF(120F, 120F); @@ -1119,11 +1157,17 @@ Text = "è¿å¨æ§å¶è®¾ç½®"; TransparencyKey = Color.Fuchsia; uiGroupBoxMotionControl.ResumeLayout(false); panel1.ResumeLayout(false); tableLayoutPanel3.ResumeLayout(false); tableLayoutPanel6.ResumeLayout(false); tableLayoutPanel5.ResumeLayout(false); tableLayoutPanel4.ResumeLayout(false); tableLayoutPanel4.PerformLayout(); groupBoxPulseMotionSpeedAddress.ResumeLayout(false); groupBoxPulseMotionSpeedAddress.PerformLayout(); groupBoxAngularVelocityAddress.ResumeLayout(false); groupBoxAngularVelocityAddress.PerformLayout(); groupBoxCom.ResumeLayout(false); tableLayoutPanel2.ResumeLayout(false); groupBoxPitchAnglePosition.ResumeLayout(false); groupBoxPitchAnglePosition.PerformLayout(); @@ -1133,6 +1177,30 @@ groupBoxYPosition.PerformLayout(); groupBoxXPosition.ResumeLayout(false); groupBoxXPosition.PerformLayout(); groupBoxYVarAddress.ResumeLayout(false); groupBoxYVarAddress.PerformLayout(); groupBoxXVarAddress.ResumeLayout(false); groupBoxXVarAddress.PerformLayout(); groupBoxZVarAddress.ResumeLayout(false); groupBoxZVarAddress.PerformLayout(); groupBoxWVarAddress.ResumeLayout(false); groupBoxWVarAddress.PerformLayout(); groupBoxYDetectLocation.ResumeLayout(false); groupBoxYDetectLocation.PerformLayout(); groupBoxZDetectLocation.ResumeLayout(false); groupBoxZDetectLocation.PerformLayout(); groupBoxWDetectLocation.ResumeLayout(false); groupBoxWDetectLocation.PerformLayout(); groupBoxXDetectLocation.ResumeLayout(false); groupBoxXDetectLocation.PerformLayout(); groupBoxXOriginalLocation.ResumeLayout(false); groupBoxXOriginalLocation.PerformLayout(); groupBoxYOriginalLocation.ResumeLayout(false); groupBoxYOriginalLocation.PerformLayout(); groupBoxZOriginalLocation.ResumeLayout(false); groupBoxZOriginalLocation.PerformLayout(); groupBoxWOriginalLocation.ResumeLayout(false); groupBoxWOriginalLocation.PerformLayout(); tableLayoutPanel1.ResumeLayout(false); tableLayoutPanel1.PerformLayout(); tableLayoutPanel7.ResumeLayout(false); @@ -1142,35 +1210,6 @@ ((System.ComponentModel.ISupportInitialize)uiSplitContainer1).EndInit(); uiSplitContainer1.ResumeLayout(false); themeForm1.ResumeLayout(false); panel1.ResumeLayout(false); groupBoxXVarAddress.ResumeLayout(false); groupBoxXVarAddress.PerformLayout(); groupBoxYVarAddress.ResumeLayout(false); groupBoxYVarAddress.PerformLayout(); groupBoxZVarAddress.ResumeLayout(false); groupBoxZVarAddress.PerformLayout(); groupBoxWVarAddress.ResumeLayout(false); groupBoxWVarAddress.PerformLayout(); groupBoxXDetectLocation.ResumeLayout(false); groupBoxXDetectLocation.PerformLayout(); groupBoxYDetectLocation.ResumeLayout(false); groupBoxYDetectLocation.PerformLayout(); groupBoxZDetectLocation.ResumeLayout(false); groupBoxZDetectLocation.PerformLayout(); groupBoxWDetectLocation.ResumeLayout(false); groupBoxWDetectLocation.PerformLayout(); groupBoxXOriginalLocation.ResumeLayout(false); groupBoxXOriginalLocation.PerformLayout(); groupBoxYOriginalLocation.ResumeLayout(false); groupBoxYOriginalLocation.PerformLayout(); groupBoxZOriginalLocation.ResumeLayout(false); groupBoxZOriginalLocation.PerformLayout(); groupBoxWOriginalLocation.ResumeLayout(false); groupBoxWOriginalLocation.PerformLayout(); groupBoxPulseMotionSpeedAddress.ResumeLayout(false); groupBoxPulseMotionSpeedAddress.PerformLayout(); groupBoxAngularVelocityAddress.ResumeLayout(false); groupBoxAngularVelocityAddress.PerformLayout(); ResumeLayout(false); } @@ -1250,5 +1289,7 @@ private TextBox textBoxPulseMotionSpeedAddress; private GroupBox groupBoxAngularVelocityAddress; private TextBox textBoxAngularVelocityAddress; private GroupBox groupBoxCom; private Sunny.UI.UIComboBox cmbCom; } } LB_SmartVision/Forms/Pages/MotionControlPage/MotionControlForm.cs
@@ -1,6 +1,8 @@ using LB_VisionControl; using LB_SmartVisionCommon; using LB_VisionControl; using LB_VisionProcesses.Cameras; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -12,6 +14,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Forms; using System.Windows.Media.Media3D; using static ZXing.QrCode.Internal.Mode; namespace LB_SmartVision.Forms.Pages.MotionControlPage @@ -20,10 +23,12 @@ { BaseCamera camera { get; set; } UserPictureBox onlinePictureBox { get; set; } string communicatorsName { get; set; } public MotionControlForm() { InitializeComponent(); } string cameraSN = string.Empty; public MotionControlForm(BaseCamera camera) { @@ -35,7 +40,7 @@ this.camera = camera; this.Text = camera.SN; textBoxSN.Text = camera.SN; cameraSN = camera.SN; onlinePictureBox = new UserPictureBox(uiGroupBoxImage); this.uiGroupBoxImage.Controls.Clear(); this.uiGroupBoxImage.Controls.Add(onlinePictureBox); @@ -43,8 +48,12 @@ //å è½½åè°å½æ° Subscribe(); foreach (var name in GlobalVar.dicCommunicators.Items.Keys) { cmbCom.Items.Add(name); } } ConcurrentDictionary<string, RecordMotionControlData> concurrentDictionary = new ConcurrentDictionary<string, RecordMotionControlData>(); private void CameraForm_FormClosing(object sender, FormClosingEventArgs e) { if (camera == null) @@ -53,7 +62,141 @@ camera.StopGrabbing(); camera.StartGrabbing(); if (GlobalVar.dicMotionControlData.Keys.Contains(GlobalVar.strProductName)) { concurrentDictionary = GlobalVar.dicMotionControlData[GlobalVar.strProductName]; double xAxisDetectLocationValue, xAxisOriginalLocationValue, yAxisDetectLocationValue, yAxisOriginalLocationValue, zAxisDetectLocationValue, zAxisOriginalLocationValue, wAxisDetectLocationValue, wAxisOriginalLocationValue, pulseMotionSpeedValue, angularVelocityValue; xAxisDetectLocationValue = double.Parse(this.textBoxXDetectLocation.Text); xAxisOriginalLocationValue = double.Parse(this.textBoxXOriginalLocation.Text); yAxisDetectLocationValue = double.Parse(this.textBoxYDetectLocation.Text); yAxisOriginalLocationValue = double.Parse(this.textBoxYOriginalLocation.Text); zAxisDetectLocationValue = double.Parse(this.textBoxZDetectLocation.Text); zAxisOriginalLocationValue = double.Parse(this.textBoxZOriginalLocation.Text); wAxisDetectLocationValue = double.Parse(this.textBoxWDetectLocation.Text); wAxisOriginalLocationValue = double.Parse(this.textBoxWOriginalLocation.Text); pulseMotionSpeedValue = double.Parse(this.textBoxPointSpeed.Text); angularVelocityValue = double.Parse(this.textBoxPointSpeed.Text); if (concurrentDictionary.Keys.Contains(cameraSN)) { RecordMotionControlData recordMotionControlData = new RecordMotionControlData { ProductName = GlobalVar.strProductName, CommunicatorsName = communicatorsName, CameraSN = cameraSN, XAxisAddress = this.textBoxXVarAddress.Text, XAxisDetectLocationValue = xAxisDetectLocationValue, XAxisOriginalLocationValue = xAxisOriginalLocationValue, YAxisAddress = this.textBoxYVarAddress.Text, YAxisDetectLocationValue = yAxisDetectLocationValue, YAxisOriginalLocationValue = yAxisOriginalLocationValue, ZAxisAddress = this.textBoxZVarAddress.Text, ZAxisDetectLocationValue = zAxisDetectLocationValue, ZAxisOriginalLocationValue = zAxisOriginalLocationValue, WAxisAddress = this.textBoxWVarAddress.Text, WAxisDetectLocationValue = wAxisDetectLocationValue, WAxisOriginalLocationValue = wAxisOriginalLocationValue, PulseMotionSpeedAddress = this.textBoxPulseMotionSpeedAddress.Text, PulseMotionSpeedValue = pulseMotionSpeedValue, AngularVelocityAddress = this.textBoxAngularVelocityAddress.Text, AngularVelocityValue = angularVelocityValue }; concurrentDictionary.TryAdd(cameraSN, recordMotionControlData); } else { RecordMotionControlData recordMotionControlData = new RecordMotionControlData { ProductName = GlobalVar.strProductName, CommunicatorsName = communicatorsName, CameraSN = cameraSN, XAxisAddress = this.textBoxXVarAddress.Text, XAxisDetectLocationValue = xAxisDetectLocationValue, XAxisOriginalLocationValue = xAxisOriginalLocationValue, YAxisAddress = this.textBoxYVarAddress.Text, YAxisDetectLocationValue = yAxisDetectLocationValue, YAxisOriginalLocationValue = yAxisOriginalLocationValue, ZAxisAddress = this.textBoxZVarAddress.Text, ZAxisDetectLocationValue = zAxisDetectLocationValue, ZAxisOriginalLocationValue = zAxisOriginalLocationValue, WAxisAddress = this.textBoxWVarAddress.Text, WAxisDetectLocationValue = wAxisDetectLocationValue, WAxisOriginalLocationValue = wAxisOriginalLocationValue, PulseMotionSpeedAddress = this.textBoxPulseMotionSpeedAddress.Text, PulseMotionSpeedValue = pulseMotionSpeedValue, AngularVelocityAddress = this.textBoxAngularVelocityAddress.Text, AngularVelocityValue = angularVelocityValue }; concurrentDictionary.TryAdd(cameraSN, recordMotionControlData); } } else { double xAxisDetectLocationValue, xAxisOriginalLocationValue, yAxisDetectLocationValue, yAxisOriginalLocationValue, zAxisDetectLocationValue, zAxisOriginalLocationValue, wAxisDetectLocationValue, wAxisOriginalLocationValue, pulseMotionSpeedValue, angularVelocityValue; xAxisDetectLocationValue = double.Parse(this.textBoxXDetectLocation.Text); xAxisOriginalLocationValue = double.Parse(this.textBoxXOriginalLocation.Text); yAxisDetectLocationValue = double.Parse(this.textBoxYDetectLocation.Text); yAxisOriginalLocationValue = double.Parse(this.textBoxYOriginalLocation.Text); zAxisDetectLocationValue = double.Parse(this.textBoxZDetectLocation.Text); zAxisOriginalLocationValue = double.Parse(this.textBoxZOriginalLocation.Text); wAxisDetectLocationValue = double.Parse(this.textBoxWDetectLocation.Text); wAxisOriginalLocationValue = double.Parse(this.textBoxWOriginalLocation.Text); pulseMotionSpeedValue = double.Parse(this.textBoxPointSpeed.Text); angularVelocityValue = double.Parse(this.textBoxPointSpeed.Text); if (concurrentDictionary.Keys.Contains(cameraSN)) { RecordMotionControlData recordMotionControlData = new RecordMotionControlData { ProductName = GlobalVar.strProductName, CommunicatorsName = communicatorsName, CameraSN = cameraSN, XAxisAddress = this.textBoxXVarAddress.Text, XAxisDetectLocationValue = xAxisDetectLocationValue, XAxisOriginalLocationValue = xAxisOriginalLocationValue, YAxisAddress = this.textBoxYVarAddress.Text, YAxisDetectLocationValue = yAxisDetectLocationValue, YAxisOriginalLocationValue = yAxisOriginalLocationValue, ZAxisAddress = this.textBoxZVarAddress.Text, ZAxisDetectLocationValue = zAxisDetectLocationValue, ZAxisOriginalLocationValue = zAxisOriginalLocationValue, WAxisAddress = this.textBoxWVarAddress.Text, WAxisDetectLocationValue = wAxisDetectLocationValue, WAxisOriginalLocationValue = wAxisOriginalLocationValue, PulseMotionSpeedAddress = this.textBoxPulseMotionSpeedAddress.Text, PulseMotionSpeedValue = pulseMotionSpeedValue, AngularVelocityAddress = this.textBoxAngularVelocityAddress.Text, AngularVelocityValue = angularVelocityValue }; concurrentDictionary.TryAdd(cameraSN, recordMotionControlData); } else { RecordMotionControlData recordMotionControlData = new RecordMotionControlData { ProductName = GlobalVar.strProductName, CommunicatorsName = communicatorsName, CameraSN = cameraSN, XAxisAddress = this.textBoxXVarAddress.Text, XAxisDetectLocationValue = xAxisDetectLocationValue, XAxisOriginalLocationValue = xAxisOriginalLocationValue, YAxisAddress = this.textBoxYVarAddress.Text, YAxisDetectLocationValue = yAxisDetectLocationValue, YAxisOriginalLocationValue = yAxisOriginalLocationValue, ZAxisAddress = this.textBoxZVarAddress.Text, ZAxisDetectLocationValue = zAxisDetectLocationValue, ZAxisOriginalLocationValue = zAxisOriginalLocationValue, WAxisAddress = this.textBoxWVarAddress.Text, WAxisDetectLocationValue = wAxisDetectLocationValue, WAxisOriginalLocationValue = wAxisOriginalLocationValue, PulseMotionSpeedAddress = this.textBoxPulseMotionSpeedAddress.Text, PulseMotionSpeedValue = pulseMotionSpeedValue, AngularVelocityAddress = this.textBoxAngularVelocityAddress.Text, AngularVelocityValue = angularVelocityValue }; concurrentDictionary.TryAdd(cameraSN, recordMotionControlData); } } GlobalVar.dicMotionControlData.TryAdd(GlobalVar.strProductName, concurrentDictionary); ConfigManager<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>.SaveConfig<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>(GlobalVar.dicMotionControlData, GlobalVar.allMotionControlDataPath); Unsubscribe(); } @@ -370,5 +513,10 @@ { } private void cmbCom_SelectedIndexChanged(object sender, EventArgs e) { communicatorsName = cmbCom.Text; } } } LB_SmartVision/Forms/Pages/MotionControlPage/MotionControlForm.resx
@@ -121,7 +121,7 @@ <data name="themeForm1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wQAADsEBuJFr7QAAA+JJREFUWEftVkuIHGUQbt34iMEoq2S2q3p3yTJsuqpnJ+L6WBRdwaigohfFgEou vwAADr8BOAVTJAAAA+JJREFUWEftVkuIHGUQbt34iMEoq2S2q3p3yTJsuqpnJ+L6WBRdwaigohfFgEou BkVBUPCBCEG8BXNQ48GLeImCehIJxMsqhsSZruod46K4HtSIGjU+4iOr0c1I9fSsM3/PLNtCPO0H36m/ evz/X11VnreKVRTAHPOZumkY6lFwqURws3BwZ8ywTQnuiCP/+iTCzY1qaUPzdm/Atf3PaHre6XPsjyQM 2xLGV4XwIyX4QRj+UMK/lPFvJTyhBMeV8IgQvmRJuH4Ko+l5p9UjGBbCJ5RxTgj+VMZmXxKcSAjekHE/ LB_SmartVision/Forms/Pages/MotionControlPage/RecordMotionControlData.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,93 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LB_SmartVision.Forms.Pages.MotionControlPage { /// <summary> /// è®°å½è¿å¨æ§å¶ç¸å ³åæ° /// </summary> [JsonObject(MemberSerialization.OptOut)] public class RecordMotionControlData { /// <summary> /// 产ååç§° /// </summary> public required string ProductName { get; set; } /// <summary> /// é讯åç§° /// </summary> public required string CommunicatorsName { get; set; } /// <summary> /// ç¸æºåºåå· /// </summary> public required string CameraSN { get; set; } /// <summary> /// Xè½´PLCå°å /// </summary> public required string XAxisAddress { get; set; } /// <summary> /// Xè½´PLCæ£æµä½ç½®å¼ /// </summary> public required double XAxisDetectLocationValue { get; set; } /// <summary> /// Xè½´PLCåç¹ä½ç½®å¼ /// </summary> public required double XAxisOriginalLocationValue { get; set; } /// <summary> /// Yè½´PLCå°å /// </summary> public required string YAxisAddress { get; set; } /// <summary> /// Yè½´PLCæ£æµä½ç½®å¼ /// </summary> public required double YAxisDetectLocationValue { get; set; } /// <summary> /// Yè½´PLCåç¹ä½ç½®å¼ /// </summary> public required double YAxisOriginalLocationValue { get; set; } /// <summary> /// Zè½´PLCå°å /// </summary> public required string ZAxisAddress { get; set; } /// <summary> /// Zè½´PLCæ£æµä½ç½®å¼ /// </summary> public required double ZAxisDetectLocationValue { get; set; } /// <summary> /// Zè½´PLCåç¹ä½ç½®å¼ /// </summary> public required double ZAxisOriginalLocationValue { get; set; } /// <summary> /// Wè½´PLCå°å /// </summary> public required string WAxisAddress { get; set; } /// <summary> /// Wè½´PLCæ£æµä½ç½®å¼ /// </summary> public required double WAxisDetectLocationValue { get; set; } /// <summary> /// Wè½´PLCåç¹ä½ç½®å¼ /// </summary> public required double WAxisOriginalLocationValue { get; set; } /// <summary> /// ç¹å¨é度å°å /// </summary> public required string PulseMotionSpeedAddress { get; set; } /// <summary> /// ç¹å¨éåº¦å¼ /// </summary> public required double PulseMotionSpeedValue { get; set; } /// <summary> /// è§é度å°å /// </summary> public required string AngularVelocityAddress { get; set; } /// <summary> /// è§éåº¦å¼ /// </summary> public required double AngularVelocityValue { get; set; } } } LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.Designer.cs
@@ -50,10 +50,10 @@ comboBoxPermission = new ComboBox(); dataGridViewUM = new DataGridView(); tableLayoutPanel4 = new TableLayoutPanel(); btnEdit = new HopeButton(); btnFind = new HopeButton(); btnDel = new HopeButton(); btnEdit = new HopeButton(); btnAdd = new ForeverButton(); btnDel = new HopeButton(); grpSetting.SuspendLayout(); tableLayoutPanel1.SuspendLayout(); tableLayoutPanel2.SuspendLayout(); @@ -250,20 +250,40 @@ // tableLayoutPanel4.Anchor = AnchorStyles.Top | AnchorStyles.Right; tableLayoutPanel4.ColumnCount = 4; tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableLayoutPanel4.Controls.Add(btnEdit, 1, 0); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); tableLayoutPanel4.Controls.Add(btnFind, 0, 0); tableLayoutPanel4.Controls.Add(btnDel, 3, 0); tableLayoutPanel4.Controls.Add(btnEdit, 1, 0); tableLayoutPanel4.Controls.Add(btnAdd, 2, 0); tableLayoutPanel4.Controls.Add(btnDel, 3, 0); tableLayoutPanel4.Location = new Point(457, 509); tableLayoutPanel4.Name = "tableLayoutPanel4"; tableLayoutPanel4.RowCount = 1; tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel4.Size = new Size(400, 39); tableLayoutPanel4.TabIndex = 1; // // btnFind // btnFind.BorderColor = Color.FromArgb(220, 223, 230); btnFind.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary; btnFind.DangerColor = Color.FromArgb(245, 108, 108); btnFind.DefaultColor = Color.FromArgb(255, 255, 255); btnFind.Font = new Font("Segoe UI", 12F); btnFind.HoverTextColor = Color.FromArgb(48, 49, 51); btnFind.InfoColor = Color.FromArgb(144, 147, 153); btnFind.Location = new Point(3, 3); btnFind.Name = "btnFind"; btnFind.PrimaryColor = Color.FromArgb(64, 158, 255); btnFind.Size = new Size(94, 33); btnFind.SuccessColor = Color.FromArgb(103, 194, 58); btnFind.TabIndex = 1; btnFind.Text = "æ¥è¯¢"; btnFind.TextColor = Color.White; btnFind.WarningColor = Color.FromArgb(230, 162, 60); btnFind.Click += btnFind_Click; // // btnEdit // @@ -285,24 +305,19 @@ btnEdit.WarningColor = Color.FromArgb(230, 162, 60); btnEdit.Click += btnEdit_Click; // // btnFind // btnAdd // btnFind.BorderColor = Color.FromArgb(220, 223, 230); btnFind.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary; btnFind.DangerColor = Color.FromArgb(245, 108, 108); btnFind.DefaultColor = Color.FromArgb(255, 255, 255); btnFind.Font = new Font("Segoe UI", 12F); btnFind.HoverTextColor = Color.FromArgb(48, 49, 51); btnFind.InfoColor = Color.FromArgb(144, 147, 153); btnFind.Location = new Point(3, 3); btnFind.Name = "btnFind"; btnFind.PrimaryColor = Color.FromArgb(64, 158, 255); btnFind.Size = new Size(94, 33); btnFind.SuccessColor = Color.FromArgb(103, 194, 58); btnFind.TabIndex = 1; btnFind.Text = "æ¥è¯¢"; btnFind.TextColor = Color.White; btnFind.WarningColor = Color.FromArgb(230, 162, 60); btnAdd.BackColor = Color.Transparent; btnAdd.BaseColor = Color.FromArgb(35, 168, 109); btnAdd.Font = new Font("Segoe UI", 12F); btnAdd.Location = new Point(203, 3); btnAdd.Name = "btnAdd"; btnAdd.Rounded = false; btnAdd.Size = new Size(94, 33); btnAdd.TabIndex = 4; btnAdd.Text = "æ·»å "; btnAdd.TextColor = Color.FromArgb(243, 243, 243); btnAdd.Click += btnAdd_Click; // // btnDel // @@ -323,20 +338,6 @@ btnDel.TextColor = Color.White; btnDel.WarningColor = Color.FromArgb(230, 162, 60); btnDel.Click += btnDel_Click; // // btnAdd // btnAdd.BackColor = Color.Transparent; btnAdd.BaseColor = Color.FromArgb(35, 168, 109); btnAdd.Font = new Font("Segoe UI", 12F); btnAdd.Location = new Point(203, 3); btnAdd.Name = "btnAdd"; btnAdd.Rounded = false; btnAdd.Size = new Size(94, 33); btnAdd.TabIndex = 4; btnAdd.Text = "æ·»å "; btnAdd.TextColor = Color.FromArgb(243, 243, 243); btnAdd.Click += btnAdd_Click; // // UserManagementEditPage // LB_SmartVision/Forms/Pages/UserManagementPage/UserManagementEditPage.cs
@@ -1,25 +1,27 @@ using LB_SmartVision.Forms.Pages.ProcessPage; using LB_SmartVision.Forms.Pages.CameraPage; using LB_SmartVision.Forms.Pages.ProcessPage; using LB_SmartVision.Forms.Pages.SettingPage; using LB_SmartVision.ProcessRun; using LB_SmartVision.SQL; using LB_SmartVisionCommon; using LB_VisionControl; using LB_VisionProcesses; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; 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.Text; using System.Windows.Forms; using VisionControl.Forms; using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel; namespace LB_SmartVision.Forms.Pages.UserManagementPage { public partial class UserManagementEditPage : UserControl { public Action<string, LogInfoType> LogInfo; List<RecordUserData> recordUserDatas = new List<RecordUserData>(); public UserManagementEditPage() { @@ -27,8 +29,9 @@ Text = "ç¨æ·ç®¡ç设置"; InitializeComponent(); InitializeDataGridView(); InitializeComboBox(); InitializeDataGridView(); } /// <summary> @@ -36,42 +39,9 @@ /// </summary> private void InitializeDataGridView() { this.dataGridViewUM.DataSource = recordUserDatas; // 设置DataGridViewå宽 dataGridViewUM.ColumnCount = 4; 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[1].Name = "å§å"; dataGridViewUM.Columns[2].Name = "å·¥å·"; dataGridViewUM.Columns[3].Name = "æé"; dataGridViewUM.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; // ç¦æ¢ç¼è¾åå æ ¼ï¼å¯éï¼ dataGridViewUM.ReadOnly = true; // å 许å¤è¡éæ©ï¼å¯éï¼ dataGridViewUM.MultiSelect = false; // æ¾ç¤ºè¡æ é¢ï¼å¯éï¼ dataGridViewUM.RowHeadersVisible = true; } /// <summary> @@ -99,6 +69,8 @@ comboBoxPermission.SelectedIndex = 0; textBoxUsername.Focus(); // å°ç¦ç¹è®¾ç½®åç¨æ·åè¾å ¥æ¡ } #region æ·»å ç¨æ·æé® private void btnAdd_Click(object sender, EventArgs e) { // éªè¯è¾å ¥ @@ -112,41 +84,81 @@ return; } // å建æ°è¡æ°æ® string[] row = new string[] RecordUserData user = new RecordUserData(); user.EmployeeNumber = this.textBoxEmployeeID.Text; user.EmployeeAccount = this.textBoxUsername.Text; user.EmployeePassword = this.textBoxPassword.Text; user.EmployeeName = this.textBoxName.Text; user.EmployeePermission = (UserPermission)this.comboBoxPermission.SelectedIndex; // æ·»å å° UserManager bool success = UserManager.Instance.AddUser(user); if (success) { textBoxUsername.Text, //textBoxPassword.Text, // å®é åºç¨ä¸å¯ç åºè¯¥å å¯ textBoxName.Text, textBoxEmployeeID.Text, comboBoxPermission.SelectedItem.ToString() }; recordUserDatas.Add(user); // 设置æ´ä¸ªDataGridViewçé»è®¤åä½åé¢è² dataGridViewUM.DefaultCellStyle.Font = new Font("å®ä½", 12); dataGridViewUM.DefaultCellStyle.ForeColor = Color.Black; // åä½é¢è² dataGridViewUM.DefaultCellStyle.BackColor = Color.White; // èæ¯é¢è² // æ·»å æ°è¡å°DataGridView dataGridViewUM.Rows.Add(row); //MessageBox.Show("ç¨æ·æ·»å æåï¼", "æç¤º", // MessageBoxButtons.OK, MessageBoxIcon.Information); // æ¸ ç©ºè¾å ¥æ¡ ClearInputFields(); } else { MessageBox.Show("æ·»å ç¨æ·å¤±è´¥ï¼", "é误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } #endregion #region å é¤ç¨æ·æé® private void btnDel_Click(object sender, EventArgs e) { if (dataGridViewUM.SelectedRows.Count > 0) { // è·åéä¸çè¡ DataGridViewRow selectedRow = dataGridViewUM.SelectedRows[0]; // 确认å é¤ DialogResult result = MessageBox.Show("ç¡®å®è¦å é¤éä¸çè¡åï¼", "确认å é¤", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { foreach (DataGridViewRow row in dataGridViewUM.SelectedRows) try { dataGridViewUM.Rows.Remove(row); // å è·åè¦å é¤çæ°æ® string employeeNumber = selectedRow.Cells[0].Value?.ToString(); if (!string.IsNullOrEmpty(employeeNumber)) { // 1. 仿°æ®æºå é¤ var dataSource = dataGridViewUM.DataSource as List<RecordUserData>; if (dataSource != null) { var itemToRemove = dataSource.FirstOrDefault(u => u.EmployeeNumber == employeeNumber); if (itemToRemove != null) { dataSource.Remove(itemToRemove); } } // 2. ä»ç¨æ·ç®¡çå¨å é¤ UserManager.Instance.DeleteUser(employeeNumber); // 3. å·æ°æ°æ®ç»å® dataGridViewUM.DataSource = null; dataGridViewUM.DataSource = dataSource; //MessageBox.Show("å 餿åï¼", "æç¤º", // MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show($"å é¤å¤±è´¥: {ex.Message}", "é误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } @@ -156,9 +168,11 @@ MessageBoxButtons.OK, MessageBoxIcon.Information); } } #endregion private int editingRowIndex = -1; private bool isEditingMode = false; private string originalButtonText = "ä¿®æ¹"; #region ä¿®æ¹ç¨æ·ä¿¡æ¯ private void btnEdit_Click(object sender, EventArgs e) { // åå æ ¼å¯ç¼è¾ @@ -227,8 +241,16 @@ // æ¸ ç©ºè¾å ¥æ¡ ClearInputFields(); MessageBox.Show("ä¿®æ¹å®æï¼", "æç¤º", MessageBoxButtons.OK, MessageBoxIcon.Information); RecordUserData user = new RecordUserData(); user.EmployeeNumber = this.textBoxEmployeeID.Text; user.EmployeeAccount = this.textBoxUsername.Text; user.EmployeePassword = this.textBoxPassword.Text; user.EmployeeName = this.textBoxName.Text; user.EmployeePermission = (UserPermission)this.comboBoxPermission.SelectedIndex; UserManager.Instance.UpdateUser(user); //MessageBox.Show("ä¿®æ¹å®æï¼", "æç¤º", // MessageBoxButtons.OK, MessageBoxIcon.Information); } } @@ -277,7 +299,6 @@ //textBoxPassword.PlaceholderText = "å¦éä¿®æ¹å¯ç 请填å"; } } private void UpdateRowData(int rowIndex) { if (rowIndex >= 0 && rowIndex < dataGridViewUM.Rows.Count) @@ -304,5 +325,17 @@ row.Cells[3].Value = comboBoxPermission.SelectedItem.ToString(); } } #endregion #region æ¥è¯¢ç¨æ·ä¿¡æ¯ private void btnFind_Click(object sender, EventArgs e) { List<RecordUserData> recordUserDatas = UserManager.Instance.GetAllUsers(); this.dataGridViewUM.DataSource = recordUserDatas; this.dataGridViewUM.AutoGenerateColumns = true; } #endregion } } LB_SmartVision/GlobalVar.cs
@@ -1,4 +1,5 @@ using LB_SmartVision.Forms.Pages.SettingPage; using LB_SmartVision.Forms.Pages.MotionControlPage; using LB_SmartVision.Forms.Pages.SettingPage; using LB_SmartVision.ProcessRun; using LB_SmartVision.Tool; using LB_VisionProcesses.Cameras; @@ -48,6 +49,14 @@ public static ConcurrentDictionary<int, ConcurrentDictionary<string, string>> dicProcessSetting { get; set; } = new ConcurrentDictionary<int, ConcurrentDictionary<string, string>>(); /// <summary> /// è¿å¨æ§æ°æ®å¶éå Key:产ååç§°ï¼Value: SN,RecordMotionControlData /// </summary> public static ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>> dicMotionControlData { get; set; } = new ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>(); public static string allMotionControlDataPath => GlobalVar.strApplicationPath + "\\ææäº§å\\" + GlobalVar.strProductName + "\\A_MotionControlDatas.json"; /// <summary> /// å¸å±éå /// </summary> public static ConcurrentDictionary<int, Layout> dicLayout { get; set; } = new ConcurrentDictionary<int, Layout>(); LB_SmartVision/LB_SmartVision.csproj
@@ -47,6 +47,7 @@ </ItemGroup> <ItemGroup> <PackageReference Include="CsvHelper" Version="33.1.0" /> <PackageReference Include="MaterialSkin.NET5" Version="1.0.2" /> </ItemGroup> LB_SmartVision/SQL/DatabaseRecordProductDataHelper.cs
@@ -47,7 +47,7 @@ InspectionOperator VARCHAR(255), NGType VARCHAR(255), NGSize VARCHAR(255), DetectionTime VARCHAR(255)), DetectionTime VARCHAR(255), CameraInspection VARCHAR(255), CreatedDate DATETIME DEFAULT CURRENT_TIMESTAMP, INDEX idx_created_date (CreatedDate), LB_SmartVision/VisionForm.Designer.cs
@@ -61,7 +61,7 @@ theme_VisionForm.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); theme_VisionForm.Image = (Image)resources.GetObject("theme_VisionForm.Image"); theme_VisionForm.Location = new Point(0, 0); theme_VisionForm.Margin = new Padding(4, 4, 4, 4); theme_VisionForm.Margin = new Padding(4); theme_VisionForm.Name = "theme_VisionForm"; theme_VisionForm.Padding = new Padding(12, 88, 12, 11); theme_VisionForm.RoundCorners = true; @@ -77,7 +77,7 @@ sc_VisionForm.Dock = DockStyle.Fill; sc_VisionForm.FixedPanel = FixedPanel.Panel2; sc_VisionForm.Location = new Point(12, 88); sc_VisionForm.Margin = new Padding(4, 4, 4, 4); sc_VisionForm.Margin = new Padding(4); sc_VisionForm.Name = "sc_VisionForm"; sc_VisionForm.Orientation = Orientation.Horizontal; // @@ -89,7 +89,7 @@ // sc_VisionForm.Panel2.Controls.Add(grb_Info); sc_VisionForm.Size = new Size(1416, 781); sc_VisionForm.SplitterDistance = 595; sc_VisionForm.SplitterDistance = 592; sc_VisionForm.SplitterWidth = 5; sc_VisionForm.TabIndex = 1; // @@ -108,7 +108,7 @@ tlp_MainView.RowStyles.Add(new RowStyle(SizeType.Absolute, 60F)); tlp_MainView.RowStyles.Add(new RowStyle(SizeType.Absolute, 39F)); tlp_MainView.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tlp_MainView.Size = new Size(1416, 595); tlp_MainView.Size = new Size(1416, 592); tlp_MainView.TabIndex = 1; tlp_MainView.TagString = null; // @@ -122,7 +122,7 @@ materialTabControl.MouseState = MaterialSkin.MouseState.HOVER; materialTabControl.Name = "materialTabControl"; materialTabControl.SelectedIndex = 0; materialTabControl.Size = new Size(1412, 492); materialTabControl.Size = new Size(1412, 489); materialTabControl.TabIndex = 0; // // tlp_VisionMainOperator @@ -144,7 +144,7 @@ tlp_VisionMainOperator.Controls.Add(com_ProductName, 8, 0); tlp_VisionMainOperator.Dock = DockStyle.Fill; tlp_VisionMainOperator.Location = new Point(4, 64); tlp_VisionMainOperator.Margin = new Padding(4, 4, 4, 4); tlp_VisionMainOperator.Margin = new Padding(4); tlp_VisionMainOperator.Name = "tlp_VisionMainOperator"; tlp_VisionMainOperator.RowCount = 1; tlp_VisionMainOperator.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); @@ -158,7 +158,7 @@ ckb_AllowRun.Font = new Font("å®ä½", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134); ckb_AllowRun.ForeColor = SystemColors.Control; ckb_AllowRun.Location = new Point(4, 4); ckb_AllowRun.Margin = new Padding(4, 4, 4, 4); ckb_AllowRun.Margin = new Padding(4); ckb_AllowRun.MinimumSize = new Size(1, 1); ckb_AllowRun.Name = "ckb_AllowRun"; ckb_AllowRun.Size = new Size(148, 23); @@ -177,7 +177,7 @@ btn_Login.ImageAlign = ContentAlignment.MiddleLeft; btn_Login.InactiveColor = Color.FromArgb(32, 34, 37); btn_Login.Location = new Point(160, 4); btn_Login.Margin = new Padding(4, 4, 4, 4); btn_Login.Margin = new Padding(4); btn_Login.Name = "btn_Login"; btn_Login.PressedBorderColor = Color.FromArgb(165, 37, 37); btn_Login.PressedColor = Color.FromArgb(165, 37, 37); @@ -199,7 +199,7 @@ btn_GlobalVar.ImageAlign = ContentAlignment.MiddleLeft; btn_GlobalVar.InactiveColor = Color.FromArgb(32, 34, 37); btn_GlobalVar.Location = new Point(1096, 4); btn_GlobalVar.Margin = new Padding(4, 4, 4, 4); btn_GlobalVar.Margin = new Padding(4); btn_GlobalVar.Name = "btn_GlobalVar"; btn_GlobalVar.PressedBorderColor = Color.FromArgb(165, 37, 37); btn_GlobalVar.PressedColor = Color.FromArgb(165, 37, 37); @@ -219,7 +219,7 @@ com_ProductName.FormattingEnabled = true; com_ProductName.ItemHeight = 20; com_ProductName.Location = new Point(1252, 4); com_ProductName.Margin = new Padding(4, 4, 4, 4); com_ProductName.Margin = new Padding(4); com_ProductName.Name = "com_ProductName"; com_ProductName.Size = new Size(152, 26); com_ProductName.TabIndex = 5; @@ -231,7 +231,7 @@ materialTabSelector.Depth = 0; materialTabSelector.Dock = DockStyle.Fill; materialTabSelector.Location = new Point(4, 4); materialTabSelector.Margin = new Padding(4, 4, 4, 4); materialTabSelector.Margin = new Padding(4); materialTabSelector.MouseState = MaterialSkin.MouseState.HOVER; materialTabSelector.Name = "materialTabSelector"; materialTabSelector.Size = new Size(1408, 52); @@ -249,7 +249,7 @@ grb_Info.MinimumSize = new Size(1, 1); grb_Info.Name = "grb_Info"; grb_Info.Padding = new Padding(0, 40, 0, 0); grb_Info.Size = new Size(1416, 181); grb_Info.Size = new Size(1416, 184); grb_Info.TabIndex = 1; grb_Info.Text = "æ¥å¿æ¾ç¤ºåºï¼"; grb_Info.TextAlignment = ContentAlignment.MiddleLeft; @@ -265,7 +265,7 @@ rich_Info.Name = "rich_Info"; rich_Info.Padding = new Padding(2); rich_Info.ShowText = false; rich_Info.Size = new Size(1416, 141); rich_Info.Size = new Size(1416, 144); rich_Info.TabIndex = 0; rich_Info.TextAlignment = ContentAlignment.MiddleLeft; // @@ -279,8 +279,8 @@ cb_VisionForm.EnableMaximizeButton = true; cb_VisionForm.EnableMinimizeButton = true; cb_VisionForm.ForeColor = Color.FromArgb(155, 155, 155); cb_VisionForm.Location = new Point(1330, 13); cb_VisionForm.Margin = new Padding(4, 4, 4, 4); cb_VisionForm.Location = new Point(1330, 18); cb_VisionForm.Margin = new Padding(4); cb_VisionForm.MaximizeHoverColor = Color.FromArgb(74, 74, 74); cb_VisionForm.MinimizeHoverColor = Color.FromArgb(63, 63, 65); cb_VisionForm.Name = "cb_VisionForm"; @@ -296,7 +296,7 @@ Controls.Add(theme_VisionForm); FormBorderStyle = FormBorderStyle.None; Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(4, 4, 4, 4); Margin = new Padding(4); MinimumSize = new Size(326, 76); Name = "VisionForm"; Text = "è½®èå¤è§è§è§æ£æµç³»ç»"; LB_SmartVision/VisionForm.cs
@@ -10,6 +10,7 @@ using LB_SmartVision.Forms.Pages.SettingPage; using LB_SmartVision.Forms.Pages.UserManagementPage; using LB_SmartVision.ProcessRun; using LB_SmartVision.SQL; using LB_SmartVision.Tool; using LB_SmartVisionCommon; using LB_SmartVisionLoginUI; @@ -633,7 +634,15 @@ { LogInfo("å ¨å±åéå 载失败", LogInfoType.ERROR); } GlobalVar.dicMotionControlData.Clear(); if (LoadMotionControlDatas(GlobalVar.allMotionControlDataPath)) { LogInfo("è¿å¨æ§å¶åæ°å è½½æå", LogInfoType.PASS); } else { LogInfo("è¿å¨æ§å¶åæ°å 载失败", LogInfoType.ERROR); } //å è½½æµç¨ GlobalVar.dicProcesses.Clear(); if (LoadAllProcess(GlobalVar.allProcessConnectionStringPath)) @@ -687,6 +696,7 @@ com_ProductName.Items.Add("æ°å¢"); com_ProductName.Text = GlobalVar.strProductName; this.WindowState = FormWindowState.Maximized; DatabaseRecordProductDataHelper.InitializeDatabase(); } public void SaveAllSetting() @@ -698,6 +708,54 @@ SaveAllProcessSetting(); SaveAllLayout(); SaveAllCsv(); SaveMotionControlDatas(); } public bool LoadMotionControlDatas(string alMotionControlDataPath) { try { GlobalVar.dicMotionControlData = ConfigManager<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>.LoadConfig<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>(alMotionControlDataPath); } catch { return false; } return true; } public bool SaveMotionControlDatas() { try { ConcurrentDictionary<string, List<string>> removeCameraSN = new ConcurrentDictionary<string, List<string>>(); foreach (var item in GlobalVar.dicMotionControlData.Keys) { List<string> list = new List<string>(); foreach (var itemSN in GlobalVar.dicMotionControlData[item].Keys) { if (!GlobalVar.dicCameras.Keys.Contains(itemSN)) { list.Add(itemSN); } } if (list.Count > 0) { removeCameraSN.TryAdd(item, list); } } foreach (var item in removeCameraSN.Keys) { foreach (var itemSN in removeCameraSN[item]) { GlobalVar.dicMotionControlData[item].Keys.Remove(itemSN); } } ConfigManager<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>.SaveConfig<ConcurrentDictionary<string, ConcurrentDictionary<string, RecordMotionControlData>>>(GlobalVar.dicMotionControlData, GlobalVar.allMotionControlDataPath); } catch { return false; } return true; } public bool LoadAllCameras(string allCamerasConnectionStringPath) LB_SmartVisionCommon/UserManager.cs
@@ -113,11 +113,11 @@ { _currentUser = user; } if (!CheckPermission(true)) { MessageBox.Show("éè¦ç®¡çåæéæè½æ·»å ç¨æ·ï¼", "æéä¸è¶³", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; } //if (!CheckPermission(true)) //{ // MessageBox.Show("éè¦ç®¡çåæéæè½æ·»å ç¨æ·ï¼", "æéä¸è¶³", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return false; //} if (_users.Any(u => u.Value.EmployeeNumber == user.EmployeeNumber || u.Value.EmployeeAccount == user.EmployeeAccount)) @@ -125,6 +125,7 @@ MessageBox.Show("åå·¥å·æè´¦å·å·²åå¨ï¼", "æ·»å 失败", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; } RecordUserData recordUserData = new RecordUserData(); recordUserData.EmployeeNumber = user.EmployeeNumber; recordUserData.EmployeeAccount = user.EmployeeAccount; @@ -143,18 +144,18 @@ /// <returns>æ¯å¦å 餿å</returns> public bool DeleteUser(string employeeNumber) { if (!CheckPermission(true)) { MessageBox.Show("éè¦ç®¡çåæéæè½å é¤ç¨æ·ï¼", "æéä¸è¶³", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; } //if (!CheckPermission(true)) //{ // MessageBox.Show("éè¦ç®¡çåæéæè½å é¤ç¨æ·ï¼", "æéä¸è¶³", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return false; //} // 管çåä¸è½å é¤èªå·± if (_currentUser.EmployeeNumber == employeeNumber) { MessageBox.Show("ä¸è½å é¤å½åç»å½çç¨æ·ï¼", "å é¤å¤±è´¥", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; } //// 管çåä¸è½å é¤èªå·± //if (_currentUser.EmployeeNumber == employeeNumber) //{ // MessageBox.Show("ä¸è½å é¤å½åç»å½çç¨æ·ï¼", "å é¤å¤±è´¥", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return false; //} var user = _users.FirstOrDefault(u => u.Value.EmployeeNumber == employeeNumber); if (user.Value != null)