diff --git a/Rs.SkyLine/BaseForm.cs b/Rs.SkyLine/BaseForm.cs index 86f22f8..35cd6db 100644 --- a/Rs.SkyLine/BaseForm.cs +++ b/Rs.SkyLine/BaseForm.cs @@ -47,6 +47,7 @@ namespace Rs.MotionPlat if (double.TryParse(value, out double dValue)) { SysConfigParam.Update(txtSysParam.Name.Replace("txt", ""), dValue.ToString()); + SysConfigParam.Init(); } } catch (Exception) diff --git a/Rs.SkyLine/Flow/Camera/VisionManager.cs b/Rs.SkyLine/Flow/Camera/VisionManager.cs index 7146960..a136f46 100644 --- a/Rs.SkyLine/Flow/Camera/VisionManager.cs +++ b/Rs.SkyLine/Flow/Camera/VisionManager.cs @@ -281,8 +281,9 @@ namespace Rs.MotionPlat.Flow.Camera { // HOperatorSet.GenRectangle1(out HObject searchRegion, new HTuple(1533), new HTuple(731), new HTuple(1751), new HTuple(1071)); //HOperatorSet.GenRectangle1(out HObject searchRegion,row1, col1, row2, col2); - HOperatorSet.WriteImage(images, "bmp", 0, "d://images//temp"); + HOperatorSet.ReduceDomain(images, _barCodeRegion, out HObject imgReduaced); + HOperatorSet.Emphasize(imgReduaced, out HObject imageEmphasize, new HTuple(7), new HTuple(7), new HTuple(1)); //HOperatorSet.CropDomain(imgReduaced, out HObject imagePart); //HOperatorSet.WriteImage(imagePart, "bmp", 0, "d://images/11"); //HOperatorSet.Threshold(imagePart, out HObject region, new HTuple(200), new HTuple(255)); @@ -307,7 +308,7 @@ namespace Rs.MotionPlat.Flow.Camera foreach (string mode in modes) { HOperatorSet.CreateDataCode2dModel("Data Matrix ECC 200", "default_parameters", mode, out HTuple dataCodeHandle); - HOperatorSet.FindDataCode2d(imgReduaced, out xlds, dataCodeHandle, new HTuple(), new HTuple(), out HTuple resultHandles, out decodedDataStrings); + HOperatorSet.FindDataCode2d(imageEmphasize, out xlds, dataCodeHandle, new HTuple(), new HTuple(), out HTuple resultHandles, out decodedDataStrings); if (decodedDataStrings.Length > 0) { @@ -317,7 +318,12 @@ namespace Rs.MotionPlat.Flow.Camera { if (mode == "maximum_recognition") { - HOperatorSet.WriteImage(images, "bmp", 0, $"d://images/scanfail/{DateTime.Now.ToString("yyyy-MM-dd HHmmss ffff")}"); + string saveDir = $"d://images//{DateTime.Now.ToString("yyyyMMdd")}//Ng"; + if(!Directory.Exists(saveDir)) + { + Directory.CreateDirectory(saveDir); + } + HOperatorSet.WriteImage(images, "bmp", 0, $"{saveDir}/{DateTime.Now.ToString("yyyy-MM-dd HHmmss ffff")}"); HOperatorSet.ClearDataCode2dModel(dataCodeHandle); } } diff --git a/Rs.SkyLine/Flow/NormalFlow/TakeTrayFlow.cs b/Rs.SkyLine/Flow/NormalFlow/TakeTrayFlow.cs index f7403e7..dd86ae7 100644 --- a/Rs.SkyLine/Flow/NormalFlow/TakeTrayFlow.cs +++ b/Rs.SkyLine/Flow/NormalFlow/TakeTrayFlow.cs @@ -245,10 +245,10 @@ namespace Rs.MotionPlat.Flow targetX = SysConfigParam.GetValue($"{m_toTray.ToString()}TakeTrayX"); targetY = SysConfigParam.GetValue($"{m_toTray.ToString()}TakeTrayY"); - errCode = AxisControl.LoadX.MovePos(targetX, GlobalVar.TakeTraySpeed); + errCode = AxisControl.LoadX.MovePos(targetX+2, GlobalVar.TakeTraySpeed); if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis) { - errCode = AxisControl.LoadY.MovePos(targetY - 2, GlobalVar.TakeTraySpeed); + errCode = AxisControl.LoadY.MovePos(targetY - 1, GlobalVar.TakeTraySpeed); if (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis) { if (GlobalVar.VirtualAxis) diff --git a/Rs.SkyLine/SysConfig/NozzleConfig.Designer.cs b/Rs.SkyLine/SysConfig/NozzleConfig.Designer.cs index 04c4c78..6ec5a4e 100644 --- a/Rs.SkyLine/SysConfig/NozzleConfig.Designer.cs +++ b/Rs.SkyLine/SysConfig/NozzleConfig.Designer.cs @@ -99,7 +99,7 @@ this.groupBox5 = new System.Windows.Forms.GroupBox(); this.btnTeachTrayNozzle7TakeHeight = new System.Windows.Forms.Button(); this.btnTeachTrayNozzle3TakeHeight = new System.Windows.Forms.Button(); - this.txtDischangeNozzleDumpStockTrayOffsetHeight = new System.Windows.Forms.TextBox(); + this.txtDischargeNozzleDumpStockTrayOffsetHeight = new System.Windows.Forms.TextBox(); this.txtTrayNozzle9TakeHeight = new System.Windows.Forms.TextBox(); this.label27 = new System.Windows.Forms.Label(); this.txtTrayNozzle5TakeHeight = new System.Windows.Forms.TextBox(); @@ -1077,7 +1077,7 @@ this.groupBox5.ContextMenuStrip = this.contextMenuStrip1; this.groupBox5.Controls.Add(this.btnTeachTrayNozzle7TakeHeight); this.groupBox5.Controls.Add(this.btnTeachTrayNozzle3TakeHeight); - this.groupBox5.Controls.Add(this.txtDischangeNozzleDumpStockTrayOffsetHeight); + this.groupBox5.Controls.Add(this.txtDischargeNozzleDumpStockTrayOffsetHeight); this.groupBox5.Controls.Add(this.txtTrayNozzle9TakeHeight); this.groupBox5.Controls.Add(this.label27); this.groupBox5.Controls.Add(this.txtTrayNozzle5TakeHeight); @@ -1152,21 +1152,21 @@ this.btnTeachTrayNozzle3TakeHeight.UseVisualStyleBackColor = false; this.btnTeachTrayNozzle3TakeHeight.Click += new System.EventHandler(this.Teach_Click); // - // txtDischangeNozzleDumpStockTrayOffsetHeight - // - this.txtDischangeNozzleDumpStockTrayOffsetHeight.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16))))); - this.txtDischangeNozzleDumpStockTrayOffsetHeight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtDischangeNozzleDumpStockTrayOffsetHeight.Font = new System.Drawing.Font("宋体", 9F); - this.txtDischangeNozzleDumpStockTrayOffsetHeight.ForeColor = System.Drawing.Color.White; - this.txtDischangeNozzleDumpStockTrayOffsetHeight.Location = new System.Drawing.Point(86, 301); - this.txtDischangeNozzleDumpStockTrayOffsetHeight.Name = "txtDischangeNozzleDumpStockTrayOffsetHeight"; - this.txtDischangeNozzleDumpStockTrayOffsetHeight.Size = new System.Drawing.Size(60, 21); - this.txtDischangeNozzleDumpStockTrayOffsetHeight.TabIndex = 46; - this.txtDischangeNozzleDumpStockTrayOffsetHeight.Tag = ""; - this.txtDischangeNozzleDumpStockTrayOffsetHeight.Text = "1"; - this.txtDischangeNozzleDumpStockTrayOffsetHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.txtDischangeNozzleDumpStockTrayOffsetHeight.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp); - this.txtDischangeNozzleDumpStockTrayOffsetHeight.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Stop_Click); + // txtDischargeNozzleDumpStockTrayOffsetHeight + // + this.txtDischargeNozzleDumpStockTrayOffsetHeight.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16))))); + this.txtDischargeNozzleDumpStockTrayOffsetHeight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtDischargeNozzleDumpStockTrayOffsetHeight.Font = new System.Drawing.Font("宋体", 9F); + this.txtDischargeNozzleDumpStockTrayOffsetHeight.ForeColor = System.Drawing.Color.White; + this.txtDischargeNozzleDumpStockTrayOffsetHeight.Location = new System.Drawing.Point(86, 301); + this.txtDischargeNozzleDumpStockTrayOffsetHeight.Name = "txtDischargeNozzleDumpStockTrayOffsetHeight"; + this.txtDischargeNozzleDumpStockTrayOffsetHeight.Size = new System.Drawing.Size(60, 21); + this.txtDischargeNozzleDumpStockTrayOffsetHeight.TabIndex = 46; + this.txtDischargeNozzleDumpStockTrayOffsetHeight.Tag = ""; + this.txtDischargeNozzleDumpStockTrayOffsetHeight.Text = "1"; + this.txtDischargeNozzleDumpStockTrayOffsetHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtDischargeNozzleDumpStockTrayOffsetHeight.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp); + this.txtDischargeNozzleDumpStockTrayOffsetHeight.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Stop_Click); // // txtTrayNozzle9TakeHeight // @@ -2136,7 +2136,7 @@ private System.Windows.Forms.Label label23; private System.Windows.Forms.Label label26; private System.Windows.Forms.Label label19; - private System.Windows.Forms.TextBox txtDischangeNozzleDumpStockTrayOffsetHeight; + private System.Windows.Forms.TextBox txtDischargeNozzleDumpStockTrayOffsetHeight; private System.Windows.Forms.Label label27; private System.Windows.Forms.TextBox txtDischargeNozzleDumpTurnoverTrayOffset; private System.Windows.Forms.Label label28;