From 7bb09d71b24a92ad48a23e02eb960e6d3b7f260b Mon Sep 17 00:00:00 2001 From: lhiven Date: Sat, 17 Aug 2024 18:03:43 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E9=95=BF=E5=BA=A6=E7=9A=84=E9=99=90=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E9=95=BF=E5=BA=A6=E4=B8=8D=E5=A4=9F=EF=BC=8C?= =?UTF-8?q?=E5=BD=93=E6=89=AB=E7=A0=81=E5=A4=B1=E8=B4=A5=E5=A4=84=E7=90=86?= =?UTF-8?q?=202=E3=80=81=E4=BF=AE=E5=A4=8D=E4=BB=8EINPUT=E6=90=AC=E8=BF=90?= =?UTF-8?q?=E5=88=B0EMPTY1=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Commom/GlobalVar.cs | 11 ++ Rs.SkyLine/Commom/Scheduling.cs | 6 +- Rs.SkyLine/Flow/Camera/VisionManager.cs | 11 +- Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs | 50 ++++----- Rs.SkyLine/Flow/TestCenter.cs | 4 + Rs.SkyLine/Properties/AssemblyInfo.cs | 2 +- Rs.SkyLine/SysConfig/CommonConfig.Designer.cs | 25 +++++ Rs.SkyLine/SysConfig/CommonConfig.cs | 5 + Rs.SkyLine/SysConfig/CommonConfig.en-US.resx | 102 +++++++++--------- Rs.SkyLine/SysConfig/CommonConfig.resx | 85 +++++++++++++-- Rs.SkyLine/TestFrm.Designer.cs | 13 +++ Rs.SkyLine/TestFrm.cs | 29 +++++ 12 files changed, 258 insertions(+), 85 deletions(-) diff --git a/Rs.SkyLine/Commom/GlobalVar.cs b/Rs.SkyLine/Commom/GlobalVar.cs index 1422183..91275ba 100644 --- a/Rs.SkyLine/Commom/GlobalVar.cs +++ b/Rs.SkyLine/Commom/GlobalVar.cs @@ -2089,5 +2089,16 @@ namespace Rs.Framework return SysConfigParam.GetValue(nameof(EnablePlaceToFixtureOpenVac)); } } + + + /// + /// 二维码长度 + /// + [ParameterInit("int", "18", "system", "二维码长度")] + public static int QrcodeLength + { + get; + set; + } } } diff --git a/Rs.SkyLine/Commom/Scheduling.cs b/Rs.SkyLine/Commom/Scheduling.cs index 1ab9cce..4de7b4b 100644 --- a/Rs.SkyLine/Commom/Scheduling.cs +++ b/Rs.SkyLine/Commom/Scheduling.cs @@ -715,7 +715,11 @@ namespace Rs.MotionPlat.Commom /// /// 治具光纤检査开关 /// - FixtureOpticalSensorCheck + FixtureOpticalSensorCheck, + /// + /// 条码长度 + /// + BarcodeLength, } } diff --git a/Rs.SkyLine/Flow/Camera/VisionManager.cs b/Rs.SkyLine/Flow/Camera/VisionManager.cs index 04b4bc2..0919906 100644 --- a/Rs.SkyLine/Flow/Camera/VisionManager.cs +++ b/Rs.SkyLine/Flow/Camera/VisionManager.cs @@ -299,8 +299,15 @@ namespace Rs.MotionPlat.Flow.Camera HOperatorSet.FindDataCode2d(imageMulti, out xlds, dataCodeHandle, new HTuple(), new HTuple(), out resultHandles, out decodedDataStrings); if (decodedDataStrings.Length > 0) { - HOperatorSet.ClearDataCode2dModel(dataCodeHandle); - return decodedDataStrings.ToString().Replace("\"", ""); + if (GlobalVar.QrcodeLength == 0 || decodedDataStrings.ToString().Replace("\"", "").Length == GlobalVar.QrcodeLength) + { + HOperatorSet.ClearDataCode2dModel(dataCodeHandle); + return decodedDataStrings.ToString().Replace("\"", ""); + } + else + { + HOperatorSet.ClearDataCode2dModel(dataCodeHandle); + } } else { diff --git a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs index 1947a3a..52331cf 100644 --- a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs @@ -2231,31 +2231,31 @@ namespace Rs.MotionPlat.Flow } logInfo = GetClassName() + $"任务结束已回到安全位"; MessageQueue.Instance.Insert(logInfo); - TraySlot slot = GlobalTray.InputTray.GetSlot(ESlotStatus.Have); - if (slot == null) - { - if (Ops.IsOn("2号料仓缺盘光电检测")) - { - logInfo = GetClassName() + $"{curTask.FromType.ToString()}盘无料,准备切换料盘"; - MessageQueue.Instance.Insert(logInfo); - TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty1, - () => - { - Task.Run(() => - { - StockManager.Instance.GetStock(ETrayType.Input).Load(EStockTrayLoadMode.Whole, null); - }); - }, null, - () => - { - Task.Run(() => - { - StockManager.Instance.GetStock(ETrayType.Empty1).Unload(EStockTrayUnLoadMode.Whole, null); - }); - }); - StockManager.Instance.GetStock(ETrayType.Input).WaitFinished(); - } - } + //TraySlot slot = GlobalTray.InputTray.GetSlot(ESlotStatus.Have); + //if (slot == null) + //{ + // if (Ops.IsOn("2号料仓缺盘光电检测")) + // { + // logInfo = GetClassName() + $"{curTask.FromType.ToString()}盘无料,准备切换料盘"; + // MessageQueue.Instance.Insert(logInfo); + // TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty1, + // () => + // { + // Task.Run(() => + // { + // StockManager.Instance.GetStock(ETrayType.Input).Load(EStockTrayLoadMode.Whole, null); + // }); + // }, null, + // () => + // { + // Task.Run(() => + // { + // StockManager.Instance.GetStock(ETrayType.Empty1).Unload(EStockTrayUnLoadMode.Whole, null); + // }); + // }); + // StockManager.Instance.GetStock(ETrayType.Input).WaitFinished(); + // } + //} flowStep = EDischargeFlowStep.等待任务; //else //{ diff --git a/Rs.SkyLine/Flow/TestCenter.cs b/Rs.SkyLine/Flow/TestCenter.cs index e04b405..4565c8a 100644 --- a/Rs.SkyLine/Flow/TestCenter.cs +++ b/Rs.SkyLine/Flow/TestCenter.cs @@ -54,6 +54,10 @@ namespace Rs.MotionPlat.Flow LogHelper.Debug($"测试软件 >>> FixtureOpticalSensorCheck:{ssi.Info}"); GlobalVar.EnableTestFixtureFiberCheck = bool.Parse(ssi.Info); break; + case SchedulingStatusInfo.InfoType.BarcodeLength: + LogHelper.Debug($"二维码长度设置 >>> BarcodeLength: {ssi.Info}"); + GlobalVar.QrcodeLength = int.Parse(ssi.Info); + break; case SchedulingStatusInfo.InfoType.State: break; case SchedulingStatusInfo.InfoType.RunStatus: diff --git a/Rs.SkyLine/Properties/AssemblyInfo.cs b/Rs.SkyLine/Properties/AssemblyInfo.cs index 0c8aca7..c74c9d9 100644 --- a/Rs.SkyLine/Properties/AssemblyInfo.cs +++ b/Rs.SkyLine/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ using System.Runtime.InteropServices; // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: - [assembly: AssemblyVersion("3.20.24.43")] + [assembly: AssemblyVersion("3.20.24.44")] //[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs b/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs index 5dbbc1c..d5077e5 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs +++ b/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CommonConfig)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); @@ -64,6 +65,7 @@ this.cboxEnableIndexTimeStatistics = new System.Windows.Forms.CheckBox(); this.cboxRunSpace = new System.Windows.Forms.CheckBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.txtQrcodeLength = new System.Windows.Forms.TextBox(); this.groupBox10 = new System.Windows.Forms.GroupBox(); this.txtUpCameraExposureTime = new System.Windows.Forms.TextBox(); this.label21 = new System.Windows.Forms.Label(); @@ -80,6 +82,7 @@ this.label8 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.cboxUpCameraName = new System.Windows.Forms.ComboBox(); + this.label19 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.btnImageSavePath = new System.Windows.Forms.Button(); this.txtImageSaveDays = new System.Windows.Forms.TextBox(); @@ -126,6 +129,7 @@ this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox(); this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox(); this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.tableLayoutPanel1.SuspendLayout(); this.groupBox8.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -413,17 +417,25 @@ // // groupBox3 // + this.groupBox3.Controls.Add(this.txtQrcodeLength); this.groupBox3.Controls.Add(this.groupBox10); this.groupBox3.Controls.Add(this.groupBox9); this.groupBox3.Controls.Add(this.cboxDownLocationCameraName); this.groupBox3.Controls.Add(this.label8); this.groupBox3.Controls.Add(this.label7); this.groupBox3.Controls.Add(this.cboxUpCameraName); + this.groupBox3.Controls.Add(this.label19); resources.ApplyResources(this.groupBox3, "groupBox3"); this.groupBox3.ForeColor = System.Drawing.Color.White; this.groupBox3.Name = "groupBox3"; this.groupBox3.TabStop = false; // + // txtQrcodeLength + // + resources.ApplyResources(this.txtQrcodeLength, "txtQrcodeLength"); + this.txtQrcodeLength.Name = "txtQrcodeLength"; + this.txtQrcodeLength.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp); + // // groupBox10 // this.groupBox10.Controls.Add(this.txtUpCameraExposureTime); @@ -540,6 +552,11 @@ resources.ApplyResources(this.cboxUpCameraName, "cboxUpCameraName"); this.cboxUpCameraName.Name = "cboxUpCameraName"; // + // label19 + // + resources.ApplyResources(this.label19, "label19"); + this.label19.Name = "label19"; + // // groupBox1 // this.groupBox1.Controls.Add(this.btnImageSavePath); @@ -895,6 +912,11 @@ this.cboxEnableScanBarCodeByDownCamera.Name = "cboxEnableScanBarCodeByDownCamera"; this.cboxEnableScanBarCodeByDownCamera.UseVisualStyleBackColor = true; // + // contextMenuStrip1 + // + this.contextMenuStrip1.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1"); + // // CommonConfig // resources.ApplyResources(this, "$this"); @@ -1029,5 +1051,8 @@ private System.Windows.Forms.CheckBox cboxEnableRefreshImageUI; private System.Windows.Forms.TextBox txtClosedQifuValue; private System.Windows.Forms.Label label18; + private System.Windows.Forms.TextBox txtQrcodeLength; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; } } \ No newline at end of file diff --git a/Rs.SkyLine/SysConfig/CommonConfig.cs b/Rs.SkyLine/SysConfig/CommonConfig.cs index e613742..01a8520 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.cs +++ b/Rs.SkyLine/SysConfig/CommonConfig.cs @@ -79,6 +79,11 @@ namespace Rs.MotionPlat.SysConfig ComboBox cbox = (ComboBox)con; cbox.SelectedItem = SysConfigParam.GetValue(cbox.Name.Replace("cbox", "")); } + else if (con is TextBox) + { + TextBox txt = (TextBox)con; + txt.Text = SysConfigParam.GetValue(txt.Name.Replace("txt", "")); + } } foreach (var con in groupBox2.Controls) diff --git a/Rs.SkyLine/SysConfig/CommonConfig.en-US.resx b/Rs.SkyLine/SysConfig/CommonConfig.en-US.resx index 59c495a..0816d1a 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.en-US.resx +++ b/Rs.SkyLine/SysConfig/CommonConfig.en-US.resx @@ -118,6 +118,36 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 853, 3 + + + 845, 432 + + + Device paramter + + + 844, 433 + + + Camera parameter setting + + + 844, 432 + + + Speed + + + 853, 441 + + + 845, 433 + + + 1701, 877 + 251, 388 @@ -133,6 +163,12 @@ Language: + + 519, 322 + + + Pop-up language + 36, 16 @@ -151,12 +187,6 @@ CN - - 519, 322 - - - Pop-up language - 372, 31 @@ -292,14 +322,11 @@ 36, 206 - - 853, 3 - - - 845, 432 + + 305, 146 - - Device paramter + + Upper camera 131, 20 @@ -316,11 +343,14 @@ 131, 47 - - 305, 146 + + 396, 115 - - Upper camera + + 308, 146 + + + Lower camera 159, 20 @@ -355,15 +385,6 @@ 159, 47 - - 396, 115 - - - 308, 146 - - - Lower camera - 132, 67 @@ -382,11 +403,11 @@ 132, 30 - - 844, 433 + + 89, 12 - - Camera parameter setting + + Qrcode length: 470, 243 @@ -400,15 +421,15 @@ 139, 246 + + 838, 66 + 638, 6 Save - - 838, 66 - 296, 100 @@ -511,24 +532,9 @@ Overall speed : - - 844, 432 - - - Speed - 839, 413 - - 853, 441 - - - 845, 433 - - - 1701, 877 - 1701, 877 diff --git a/Rs.SkyLine/SysConfig/CommonConfig.resx b/Rs.SkyLine/SysConfig/CommonConfig.resx index 387d60d..d7746e6 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.resx +++ b/Rs.SkyLine/SysConfig/CommonConfig.resx @@ -1098,6 +1098,30 @@ 0 + + 601, 29 + + + 74, 21 + + + 44 + + + False + + + txtQrcodeLength + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 0 + 宋体, 9pt @@ -1240,7 +1264,7 @@ groupBox3 - 0 + 1 宋体, 9pt @@ -1444,7 +1468,7 @@ groupBox3 - 1 + 2 105, 67 @@ -1465,7 +1489,7 @@ groupBox3 - 2 + 3 True @@ -1495,7 +1519,7 @@ groupBox3 - 3 + 4 True @@ -1525,7 +1549,7 @@ groupBox3 - 4 + 5 105, 30 @@ -1546,7 +1570,40 @@ groupBox3 - 5 + 6 + + + True + + + NoControl + + + 514, 32 + + + 71, 12 + + + 0 + + + 二维码长度: + + + False + + + label19 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 7 Fill @@ -2794,7 +2851,7 @@ $this - 0 + 1 <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="groupBox8" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="groupBox3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupBox1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupBox4" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50,Absolute,20" /></TableLayoutSettings> @@ -2802,6 +2859,18 @@ 17, 17 + + 197, 17 + + + 61, 4 + + + contextMenuStrip1 + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + True @@ -2854,6 +2923,6 @@ CommonConfig - Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=3.20.24.41, Culture=neutral, PublicKeyToken=null + Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=3.20.24.44, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/Rs.SkyLine/TestFrm.Designer.cs b/Rs.SkyLine/TestFrm.Designer.cs index 89db17e..5c1c1c6 100644 --- a/Rs.SkyLine/TestFrm.Designer.cs +++ b/Rs.SkyLine/TestFrm.Designer.cs @@ -65,6 +65,7 @@ this.button28 = new System.Windows.Forms.Button(); this.button30 = new System.Windows.Forms.Button(); this.button31 = new System.Windows.Forms.Button(); + this.button32 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // btnTurnoverSlotException @@ -438,11 +439,22 @@ this.button31.UseVisualStyleBackColor = true; this.button31.Click += new System.EventHandler(this.button31_Click); // + // button32 + // + this.button32.Location = new System.Drawing.Point(540, 732); + this.button32.Name = "button32"; + this.button32.Size = new System.Drawing.Size(75, 23); + this.button32.TabIndex = 10; + this.button32.Text = "button32"; + this.button32.UseVisualStyleBackColor = true; + this.button32.Click += new System.EventHandler(this.button32_Click); + // // TestFrm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1336, 854); + this.Controls.Add(this.button32); this.Controls.Add(this.button31); this.Controls.Add(this.button30); this.Controls.Add(this.button28); @@ -525,5 +537,6 @@ private System.Windows.Forms.Button button28; private System.Windows.Forms.Button button30; private System.Windows.Forms.Button button31; + private System.Windows.Forms.Button button32; } } \ No newline at end of file diff --git a/Rs.SkyLine/TestFrm.cs b/Rs.SkyLine/TestFrm.cs index dec7f4e..c9addea 100644 --- a/Rs.SkyLine/TestFrm.cs +++ b/Rs.SkyLine/TestFrm.cs @@ -4,6 +4,7 @@ using Rs.Framework; using Rs.Motion; using Rs.MotionPlat.Commom; using Rs.MotionPlat.Entitys; +using Rs.MotionPlat.Entitys.Trays; using Rs.MotionPlat.Flow; using Rs.MotionPlat.Flow.Camera; using Rs.MotionPlat.Flow.NgFlow; @@ -461,5 +462,33 @@ namespace Rs.MotionPlat { TrayShake.ShakeAsync(ETrayType.Input); } + + private void button32_Click(object sender, EventArgs e) + { + TurnoverTrayManager.Instance.Slot(1).SN = "1"; + TurnoverTrayManager.Instance.Slot(2).SN = "2"; + TurnoverTrayManager.Instance.Slot(3).SN = "1"; + TurnoverTrayManager.Instance.Slot(4).SN = "3"; + TurnoverTrayManager.Instance.Slot(5).SN = "4"; + TurnoverTrayManager.Instance.Slot(6).SN = "5"; + TurnoverTrayManager.Instance.Slot(7).SN = "6"; + TurnoverTrayManager.Instance.Slot(8).SN = "7"; + + List slotList= new List(); + + slotList.Add(TurnoverTrayManager.Instance.Slot(1)); + slotList.Add(TurnoverTrayManager.Instance.Slot(2)); + slotList.Add(TurnoverTrayManager.Instance.Slot(3)); + slotList.Add(TurnoverTrayManager.Instance.Slot(4)); + slotList.Add(TurnoverTrayManager.Instance.Slot(5)); + slotList.Add(TurnoverTrayManager.Instance.Slot(6)); + slotList.Add(TurnoverTrayManager.Instance.Slot(7)); + slotList.Add(TurnoverTrayManager.Instance.Slot(8)); + + + var gb = slotList.GroupBy(s => s.SN).Where(aa=>aa.Count()>=2).ToList(); + + + } } }