优化扫码

优化料盘搬运
master
lhiven 2 years ago
parent ba89149653
commit 9f39f71010

@ -47,6 +47,7 @@ namespace Rs.MotionPlat
if (double.TryParse(value, out double dValue)) if (double.TryParse(value, out double dValue))
{ {
SysConfigParam.Update(txtSysParam.Name.Replace("txt", ""), dValue.ToString()); SysConfigParam.Update(txtSysParam.Name.Replace("txt", ""), dValue.ToString());
SysConfigParam.Init();
} }
} }
catch (Exception) catch (Exception)

@ -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, new HTuple(1533), new HTuple(731), new HTuple(1751), new HTuple(1071));
//HOperatorSet.GenRectangle1(out HObject searchRegion,row1, col1, row2, col2); //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.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.CropDomain(imgReduaced, out HObject imagePart);
//HOperatorSet.WriteImage(imagePart, "bmp", 0, "d://images/11"); //HOperatorSet.WriteImage(imagePart, "bmp", 0, "d://images/11");
//HOperatorSet.Threshold(imagePart, out HObject region, new HTuple(200), new HTuple(255)); //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) foreach (string mode in modes)
{ {
HOperatorSet.CreateDataCode2dModel("Data Matrix ECC 200", "default_parameters", mode, out HTuple dataCodeHandle); 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) if (decodedDataStrings.Length > 0)
{ {
@ -317,7 +318,12 @@ namespace Rs.MotionPlat.Flow.Camera
{ {
if (mode == "maximum_recognition") 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); HOperatorSet.ClearDataCode2dModel(dataCodeHandle);
} }
} }

@ -245,10 +245,10 @@ namespace Rs.MotionPlat.Flow
targetX = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayX"); targetX = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayX");
targetY = SysConfigParam.GetValue<double>($"{m_toTray.ToString()}TakeTrayY"); targetY = SysConfigParam.GetValue<double>($"{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) 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 (errCode == Motion.ErrorCode.Ok || GlobalVar.VirtualAxis)
{ {
if (GlobalVar.VirtualAxis) if (GlobalVar.VirtualAxis)

@ -99,7 +99,7 @@
this.groupBox5 = new System.Windows.Forms.GroupBox(); this.groupBox5 = new System.Windows.Forms.GroupBox();
this.btnTeachTrayNozzle7TakeHeight = new System.Windows.Forms.Button(); this.btnTeachTrayNozzle7TakeHeight = new System.Windows.Forms.Button();
this.btnTeachTrayNozzle3TakeHeight = 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.txtTrayNozzle9TakeHeight = new System.Windows.Forms.TextBox();
this.label27 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label();
this.txtTrayNozzle5TakeHeight = new System.Windows.Forms.TextBox(); this.txtTrayNozzle5TakeHeight = new System.Windows.Forms.TextBox();
@ -1077,7 +1077,7 @@
this.groupBox5.ContextMenuStrip = this.contextMenuStrip1; this.groupBox5.ContextMenuStrip = this.contextMenuStrip1;
this.groupBox5.Controls.Add(this.btnTeachTrayNozzle7TakeHeight); this.groupBox5.Controls.Add(this.btnTeachTrayNozzle7TakeHeight);
this.groupBox5.Controls.Add(this.btnTeachTrayNozzle3TakeHeight); 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.txtTrayNozzle9TakeHeight);
this.groupBox5.Controls.Add(this.label27); this.groupBox5.Controls.Add(this.label27);
this.groupBox5.Controls.Add(this.txtTrayNozzle5TakeHeight); this.groupBox5.Controls.Add(this.txtTrayNozzle5TakeHeight);
@ -1152,21 +1152,21 @@
this.btnTeachTrayNozzle3TakeHeight.UseVisualStyleBackColor = false; this.btnTeachTrayNozzle3TakeHeight.UseVisualStyleBackColor = false;
this.btnTeachTrayNozzle3TakeHeight.Click += new System.EventHandler(this.Teach_Click); this.btnTeachTrayNozzle3TakeHeight.Click += new System.EventHandler(this.Teach_Click);
// //
// txtDischangeNozzleDumpStockTrayOffsetHeight // txtDischargeNozzleDumpStockTrayOffsetHeight
// //
this.txtDischangeNozzleDumpStockTrayOffsetHeight.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16))))); this.txtDischargeNozzleDumpStockTrayOffsetHeight.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16)))));
this.txtDischangeNozzleDumpStockTrayOffsetHeight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtDischargeNozzleDumpStockTrayOffsetHeight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtDischangeNozzleDumpStockTrayOffsetHeight.Font = new System.Drawing.Font("宋体", 9F); this.txtDischargeNozzleDumpStockTrayOffsetHeight.Font = new System.Drawing.Font("宋体", 9F);
this.txtDischangeNozzleDumpStockTrayOffsetHeight.ForeColor = System.Drawing.Color.White; this.txtDischargeNozzleDumpStockTrayOffsetHeight.ForeColor = System.Drawing.Color.White;
this.txtDischangeNozzleDumpStockTrayOffsetHeight.Location = new System.Drawing.Point(86, 301); this.txtDischargeNozzleDumpStockTrayOffsetHeight.Location = new System.Drawing.Point(86, 301);
this.txtDischangeNozzleDumpStockTrayOffsetHeight.Name = "txtDischangeNozzleDumpStockTrayOffsetHeight"; this.txtDischargeNozzleDumpStockTrayOffsetHeight.Name = "txtDischargeNozzleDumpStockTrayOffsetHeight";
this.txtDischangeNozzleDumpStockTrayOffsetHeight.Size = new System.Drawing.Size(60, 21); this.txtDischargeNozzleDumpStockTrayOffsetHeight.Size = new System.Drawing.Size(60, 21);
this.txtDischangeNozzleDumpStockTrayOffsetHeight.TabIndex = 46; this.txtDischargeNozzleDumpStockTrayOffsetHeight.TabIndex = 46;
this.txtDischangeNozzleDumpStockTrayOffsetHeight.Tag = ""; this.txtDischargeNozzleDumpStockTrayOffsetHeight.Tag = "";
this.txtDischangeNozzleDumpStockTrayOffsetHeight.Text = "1"; this.txtDischargeNozzleDumpStockTrayOffsetHeight.Text = "1";
this.txtDischangeNozzleDumpStockTrayOffsetHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtDischargeNozzleDumpStockTrayOffsetHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtDischangeNozzleDumpStockTrayOffsetHeight.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp); this.txtDischargeNozzleDumpStockTrayOffsetHeight.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp);
this.txtDischangeNozzleDumpStockTrayOffsetHeight.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Stop_Click); this.txtDischargeNozzleDumpStockTrayOffsetHeight.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Stop_Click);
// //
// txtTrayNozzle9TakeHeight // txtTrayNozzle9TakeHeight
// //
@ -2136,7 +2136,7 @@
private System.Windows.Forms.Label label23; private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label26; private System.Windows.Forms.Label label26;
private System.Windows.Forms.Label label19; 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.Label label27;
private System.Windows.Forms.TextBox txtDischargeNozzleDumpTurnoverTrayOffset; private System.Windows.Forms.TextBox txtDischargeNozzleDumpTurnoverTrayOffset;
private System.Windows.Forms.Label label28; private System.Windows.Forms.Label label28;

Loading…
Cancel
Save