Commit 4bdb98f9 刘韬

1

1 个父辈 0a6a361a
...@@ -99,7 +99,7 @@ namespace OnlineStore.AutoCountClient ...@@ -99,7 +99,7 @@ namespace OnlineStore.AutoCountClient
{ {
var suanfa = SignType.AUTO; var suanfa = SignType.AUTO;
Enum.TryParse<SignType>(obj.Sufan.ToString(), out suanfa); Enum.TryParse<SignType>(obj.Sufan.ToString(), out suanfa);
ParamManager.UpdateParam(new CountParam(obj.PartNum, RobotManager.robot.XrayBean.ThresholdValue, 3, suanfa)); ParamManager.UpdateParam(new CountParam(obj.PartNum, 0, 0, suanfa));
ParamManager.SaveMapToFile(); ParamManager.SaveMapToFile();
} }
} }
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.label_coutresult = new System.Windows.Forms.Label(); this.label_coutresult = new System.Windows.Forms.Label();
this.buttonT = new System.Windows.Forms.Button();
this.buttonE = new System.Windows.Forms.Button(); this.buttonE = new System.Windows.Forms.Button();
this.buttonD = new System.Windows.Forms.Button(); this.buttonD = new System.Windows.Forms.Button();
this.buttonC = new System.Windows.Forms.Button(); this.buttonC = new System.Windows.Forms.Button();
...@@ -55,7 +56,6 @@ ...@@ -55,7 +56,6 @@
this.lblFeng = new System.Windows.Forms.Label(); this.lblFeng = new System.Windows.Forms.Label();
this.lblDes = new System.Windows.Forms.Label(); this.lblDes = new System.Windows.Forms.Label();
this.lblProName = new System.Windows.Forms.Label(); this.lblProName = new System.Windows.Forms.Label();
this.buttonT = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numWSize)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numWSize)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numTh)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numTh)).BeginInit();
...@@ -164,11 +164,6 @@ ...@@ -164,11 +164,6 @@
this.numWSize.Name = "numWSize"; this.numWSize.Name = "numWSize";
this.numWSize.Size = new System.Drawing.Size(56, 26); this.numWSize.Size = new System.Drawing.Size(56, 26);
this.numWSize.TabIndex = 297; this.numWSize.TabIndex = 297;
this.numWSize.Value = new decimal(new int[] {
3,
0,
0,
0});
this.numWSize.Visible = false; this.numWSize.Visible = false;
// //
// label3 // label3
...@@ -184,26 +179,19 @@ ...@@ -184,26 +179,19 @@
// numTh // numTh
// //
this.numTh.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numTh.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numTh.Location = new System.Drawing.Point(271, 19); this.numTh.Location = new System.Drawing.Point(1136, 595);
this.numTh.Name = "numTh"; this.numTh.Name = "numTh";
this.numTh.Size = new System.Drawing.Size(56, 26); this.numTh.Size = new System.Drawing.Size(56, 26);
this.numTh.TabIndex = 295; this.numTh.TabIndex = 295;
this.numTh.Value = new decimal(new int[] {
30,
0,
0,
0});
this.numTh.Visible = false;
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(245, 22); this.label1.Location = new System.Drawing.Point(1090, 597);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 20); this.label1.Size = new System.Drawing.Size(40, 20);
this.label1.TabIndex = 294; this.label1.TabIndex = 294;
this.label1.Text = "阈值:"; this.label1.Text = "阈值:";
this.label1.Visible = false;
// //
// btnEnd // btnEnd
// //
...@@ -235,10 +223,8 @@ ...@@ -235,10 +223,8 @@
this.groupBox4.Controls.Add(this.buttonB); this.groupBox4.Controls.Add(this.buttonB);
this.groupBox4.Controls.Add(this.buttonAuto); this.groupBox4.Controls.Add(this.buttonAuto);
this.groupBox4.Controls.Add(this.buttonA); this.groupBox4.Controls.Add(this.buttonA);
this.groupBox4.Controls.Add(this.numTh);
this.groupBox4.Controls.Add(this.numWSize); this.groupBox4.Controls.Add(this.numWSize);
this.groupBox4.Controls.Add(this.label3); this.groupBox4.Controls.Add(this.label3);
this.groupBox4.Controls.Add(this.label1);
this.groupBox4.Location = new System.Drawing.Point(990, 162); this.groupBox4.Location = new System.Drawing.Point(990, 162);
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(308, 426); this.groupBox4.Size = new System.Drawing.Size(308, 426);
...@@ -255,6 +241,19 @@ ...@@ -255,6 +241,19 @@
this.label_coutresult.TabIndex = 304; this.label_coutresult.TabIndex = 304;
this.label_coutresult.Text = "点料结果:"; this.label_coutresult.Text = "点料结果:";
// //
// buttonT
//
this.buttonT.BackColor = System.Drawing.Color.White;
this.buttonT.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonT.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonT.Location = new System.Drawing.Point(80, 315);
this.buttonT.Name = "buttonT";
this.buttonT.Size = new System.Drawing.Size(133, 39);
this.buttonT.TabIndex = 303;
this.buttonT.Text = "模版";
this.buttonT.UseVisualStyleBackColor = false;
this.buttonT.Click += new System.EventHandler(this.buttonT_Click);
//
// buttonE // buttonE
// //
this.buttonE.BackColor = System.Drawing.Color.White; this.buttonE.BackColor = System.Drawing.Color.White;
...@@ -388,19 +387,6 @@ ...@@ -388,19 +387,6 @@
this.lblProName.Text = "产品:"; this.lblProName.Text = "产品:";
this.lblProName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblProName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// buttonT
//
this.buttonT.BackColor = System.Drawing.Color.White;
this.buttonT.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonT.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonT.Location = new System.Drawing.Point(80, 315);
this.buttonT.Name = "buttonT";
this.buttonT.Size = new System.Drawing.Size(133, 39);
this.buttonT.TabIndex = 303;
this.buttonT.Text = "模版";
this.buttonT.UseVisualStyleBackColor = false;
this.buttonT.Click += new System.EventHandler(this.buttonT_Click);
//
// FrmLearning // FrmLearning
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
...@@ -412,6 +398,8 @@ ...@@ -412,6 +398,8 @@
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnEnd); this.Controls.Add(this.btnEnd);
this.Controls.Add(this.btnNext); this.Controls.Add(this.btnNext);
this.Controls.Add(this.numTh);
this.Controls.Add(this.label1);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "FrmLearning"; this.Name = "FrmLearning";
...@@ -428,6 +416,7 @@ ...@@ -428,6 +416,7 @@
this.groupBox4.PerformLayout(); this.groupBox4.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
......
...@@ -831,15 +831,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -831,15 +831,19 @@ namespace OnlineStore.DeviceLibrary
int threshold = param.Threshold; int threshold = param.Threshold;
int windowsize = param.WindowSize; int windowsize = param.WindowSize;
XrayImage.setProcessLevel(4); XrayImage.setProcessLevel(4);
if (threshold>0)
XrayImage.setProcessLevel(threshold);
if (param.Sign == CountParam.SignType.AUTO) if (param.Sign == CountParam.SignType.AUTO)
{ {
LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + 100 + "】"); LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + 100 + "】"+ threshold);
result = XrayImage.GetLocalCount(fileP, 100, out countStr, out dst); result = XrayImage.GetLocalCount(fileP, 100, out countStr, out dst);
LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】"); LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
} }
else if (param.Sign == CountParam.SignType.IP_Template_PARTS) else if (param.Sign == CountParam.SignType.IP_Template_PARTS)
{ {
XrayImage.setProcessLevel(2); XrayImage.setProcessLevel(2);
if (threshold > 0)
XrayImage.setProcessLevel(threshold);
XrayImage.ReloadTpl(); XrayImage.ReloadTpl();
var tpl = Path.Combine("CountTemplate", param.PN + ".tpl"); var tpl = Path.Combine("CountTemplate", param.PN + ".tpl");
...@@ -848,7 +852,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -848,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("GetLocalCountTemplate " + tpl + " 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】"); LogUtil.info("GetLocalCountTemplate " + tpl + " 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
} }
else { else {
LogUtil.info("GetLocalCountIrregular " + type + " 【" + fileP + "】【" + 100 + "】"); LogUtil.info("GetLocalCountIrregular " + type + " 【" + fileP + "】【" + 100 + "】"+ threshold);
result = XrayImage.GetLocalCountIrregular(fileP, 100, type.ToString(), out countStr, out dst); result = XrayImage.GetLocalCountIrregular(fileP, 100, type.ToString(), out countStr, out dst);
LogUtil.info("GetLocalCountIrregular " + type + " 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】"); LogUtil.info("GetLocalCountIrregular " + type + " 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
} }
......
...@@ -302,7 +302,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -302,7 +302,7 @@ namespace OnlineStore.DeviceLibrary
Enum.TryParse<SignType>(array[1].Trim(), out sign); Enum.TryParse<SignType>(array[1].Trim(), out sign);
int value = 0;// Convert.ToInt32(array[2].Trim()); int value = 0;// Convert.ToInt32(array[2].Trim());
int th =0;// Convert.ToInt32(array[3].Trim()); int th =Convert.ToInt32(array[3].Trim());
int size = 0;//Convert.ToInt32(array[4].Trim()); int size = 0;//Convert.ToInt32(array[4].Trim());
return new CountParam(pn, th, size, sign, value); return new CountParam(pn, th, size, sign, value);
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!