Commit b2fb4069 LN

点料算法更新

1 个父辈 6e29a642
...@@ -75,29 +75,18 @@ ...@@ -75,29 +75,18 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.CarerayImage.GetLocalCount(System.String,System.Double,System.Int32,System.Int32@,Asa.API.EyemImage@)"> <member name="M:Asa.CarerayImage.GetLocalCount(System.String,System.Double,System.Int32,System.String@,Asa.API.EyemImage@)">
<summary> <summary>
本地文件器件点料 本地文件普通器件点料
</summary> </summary>
<param name="path"></param> <param name="path"></param>
<param name="dOffset"></param> <param name="dOffset"></param>
<param name="iWinSize"></param> <param name="iWinSize"></param>
<param name="iObjCount"></param> <param name="count"></param>
<param name="tpDstImg"></param> <param name="tpDstImg"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.CarerayImage.GetLocalCountHuge(System.String,System.Double,System.Int32,System.Int32@,Asa.API.EyemImage@)"> <member name="M:Asa.CarerayImage.GetLocalCountIrregular(System.String,System.Double,System.Int32,System.Int32,System.String@,Asa.API.EyemImage@)">
<summary>
本地文件大器件点料
</summary>
<param name="path"></param>
<param name="dOffset"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.GetLocalCountIrregular(System.String,System.Double,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary> <summary>
本地文件异性器件点料 本地文件异性器件点料
</summary> </summary>
...@@ -105,7 +94,7 @@ ...@@ -105,7 +94,7 @@
<param name="dOffset"></param> <param name="dOffset"></param>
<param name="type"></param> <param name="type"></param>
<param name="iWinSize"></param> <param name="iWinSize"></param>
<param name="iObjCount"></param> <param name="count"></param>
<param name="tpDstImg"></param> <param name="tpDstImg"></param>
<returns></returns> <returns></returns>
</member> </member>
...@@ -124,23 +113,9 @@ ...@@ -124,23 +113,9 @@
</summary> </summary>
<param name="ipImage"></param> <param name="ipImage"></param>
</member> </member>
<member name="M:Asa.API.eyemCountObject(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)"> <member name="M:Asa.API.eyemCountObject(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.IntPtr@,Asa.API.EyemImage@)">
<summary>
小盘点料
</summary>
<param name="tpSrcImg"></param>
<param name="fileName"></param>
<param name="dOffset"></param>
<param name="iMinArea"></param>
<param name="iMaxArea"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
<member name="M:Asa.API.eyemCountObject4Huge(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary> <summary>
大盘点料 普通器件
</summary> </summary>
<param name="tpSrcImg"></param> <param name="tpSrcImg"></param>
<param name="fileName"></param> <param name="fileName"></param>
...@@ -148,13 +123,13 @@ ...@@ -148,13 +123,13 @@
<param name="iMinArea"></param> <param name="iMinArea"></param>
<param name="iMaxArea"></param> <param name="iMaxArea"></param>
<param name="iWinSize"></param> <param name="iWinSize"></param>
<param name="iObjCount"></param> <param name="pNumObj"></param>
<param name="tpDstImg"></param> <param name="tpDstImg"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.API.eyemCountObjectIrregularParts(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)"> <member name="M:Asa.API.eyemCountObjectIrregularParts(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.IntPtr@,Asa.API.EyemImage@)">
<summary> <summary>
器件 器件
</summary> </summary>
<param name="tpSrcImg"></param> <param name="tpSrcImg"></param>
<param name="fileName"></param> <param name="fileName"></param>
...@@ -162,7 +137,7 @@ ...@@ -162,7 +137,7 @@
<param name="iType"></param> <param name="iType"></param>
<param name="iMaxArea"></param> <param name="iMaxArea"></param>
<param name="iWinSize"></param> <param name="iWinSize"></param>
<param name="iObjCount"></param> <param name="pNumObj"></param>
<param name="tpDstImg"></param> <param name="tpDstImg"></param>
<returns></returns> <returns></returns>
</member> </member>
......
...@@ -142,7 +142,7 @@ namespace OnlineStore.AutoCountClient ...@@ -142,7 +142,7 @@ namespace OnlineStore.AutoCountClient
list.Add(obj.ToCSVStr()); list.Add(obj.ToCSVStr());
} }
File.WriteAllLines(filePath, list.ToArray<string>(), Encoding.GetEncoding("gbk")); File.WriteAllLines(filePath, list.ToArray<string>(), Encoding.UTF8);
MessageBox.Show("成功导出程序到文件:" + "\r\n" + filePath); MessageBox.Show("成功导出程序到文件:" + "\r\n" + filePath);
} }
} }
......
...@@ -282,7 +282,7 @@ namespace OnlineStore.AutoCountClient ...@@ -282,7 +282,7 @@ namespace OnlineStore.AutoCountClient
txtFengzhuang.Text = ""; txtFengzhuang.Text = "";
txtPartNum.Text = ""; txtPartNum.Text = "";
cmbSuanfa.SelectedIndex = 5; cmbSuanfa.SelectedIndex = 5;
lblTuijian.Text = "";
txtPartNum.Enabled = true; txtPartNum.Enabled = true;
groupInfo.Text = "新增元器件"; groupInfo.Text = "新增元器件";
} }
......
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblImgeInfo = new System.Windows.Forms.Label();
this.lblFolder = new System.Windows.Forms.Label();
this.lblCountInfo = new System.Windows.Forms.Label();
this.imgCurrImg = new Acc.ImageBox.ImageBox(); this.imgCurrImg = new Acc.ImageBox.ImageBox();
this.lblPnInfo = new System.Windows.Forms.Label(); this.lblPnInfo = new System.Windows.Forms.Label();
this.btnTest = new System.Windows.Forms.Button(); this.btnTest = new System.Windows.Forms.Button();
...@@ -41,18 +44,21 @@ ...@@ -41,18 +44,21 @@
this.btnEnd = new System.Windows.Forms.Button(); this.btnEnd = new System.Windows.Forms.Button();
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.buttonA = new System.Windows.Forms.Button();
this.buttonB = new System.Windows.Forms.Button();
this.buttonC = new System.Windows.Forms.Button();
this.buttonD = new System.Windows.Forms.Button();
this.buttonE = new System.Windows.Forms.Button(); this.buttonE = new System.Windows.Forms.Button();
this.lblCountInfo = new System.Windows.Forms.Label(); this.buttonD = new System.Windows.Forms.Button();
this.lblFolder = new System.Windows.Forms.Label(); this.buttonC = new System.Windows.Forms.Button();
this.lblImgeInfo = new System.Windows.Forms.Label(); this.buttonB = new System.Windows.Forms.Button();
this.buttonA = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblPN = new System.Windows.Forms.Label();
this.lblFeng = new System.Windows.Forms.Label();
this.lblDes = new System.Windows.Forms.Label();
this.lblProName = new System.Windows.Forms.Label();
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();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBox1 // groupBox1
...@@ -72,6 +78,41 @@ ...@@ -72,6 +78,41 @@
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "料盘图片"; this.groupBox1.Text = "料盘图片";
// //
// lblImgeInfo
//
this.lblImgeInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblImgeInfo.AutoSize = true;
this.lblImgeInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblImgeInfo.Location = new System.Drawing.Point(414, 701);
this.lblImgeInfo.Name = "lblImgeInfo";
this.lblImgeInfo.Size = new System.Drawing.Size(54, 17);
this.lblImgeInfo.TabIndex = 301;
this.lblImgeInfo.Text = "Zoom:";
this.lblImgeInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblFolder
//
this.lblFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblFolder.AutoSize = true;
this.lblFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblFolder.Location = new System.Drawing.Point(7, 699);
this.lblFolder.Name = "lblFolder";
this.lblFolder.Size = new System.Drawing.Size(80, 17);
this.lblFolder.TabIndex = 300;
this.lblFolder.Text = "当前文件夹:";
this.lblFolder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblCountInfo
//
this.lblCountInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblCountInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCountInfo.Location = new System.Drawing.Point(791, 699);
this.lblCountInfo.Name = "lblCountInfo";
this.lblCountInfo.Size = new System.Drawing.Size(166, 18);
this.lblCountInfo.TabIndex = 299;
this.lblCountInfo.Text = "第1张/共10张";
this.lblCountInfo.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// imgCurrImg // imgCurrImg
// //
this.imgCurrImg.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.imgCurrImg.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
...@@ -101,7 +142,7 @@ ...@@ -101,7 +142,7 @@
this.btnTest.BackColor = System.Drawing.Color.White; this.btnTest.BackColor = System.Drawing.Color.White;
this.btnTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTest.Location = new System.Drawing.Point(32, 442); this.btnTest.Location = new System.Drawing.Point(30, 354);
this.btnTest.Name = "btnTest"; this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(235, 46); this.btnTest.Size = new System.Drawing.Size(235, 46);
this.btnTest.TabIndex = 285; this.btnTest.TabIndex = 285;
...@@ -115,7 +156,7 @@ ...@@ -115,7 +156,7 @@
this.btnNext.BackColor = System.Drawing.Color.White; this.btnNext.BackColor = System.Drawing.Color.White;
this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNext.Location = new System.Drawing.Point(1009, 593); this.btnNext.Location = new System.Drawing.Point(1005, 652);
this.btnNext.Name = "btnNext"; this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(133, 50); this.btnNext.Size = new System.Drawing.Size(133, 50);
this.btnNext.TabIndex = 298; this.btnNext.TabIndex = 298;
...@@ -126,7 +167,7 @@ ...@@ -126,7 +167,7 @@
// numWSize // numWSize
// //
this.numWSize.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numWSize.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numWSize.Location = new System.Drawing.Point(117, 72); this.numWSize.Location = new System.Drawing.Point(222, 47);
this.numWSize.Maximum = new decimal(new int[] { this.numWSize.Maximum = new decimal(new int[] {
1000, 1000,
0, 0,
...@@ -140,20 +181,22 @@ ...@@ -140,20 +181,22 @@
0, 0,
0, 0,
0}); 0});
this.numWSize.Visible = false;
// //
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(45, 75); this.label3.Location = new System.Drawing.Point(150, 50);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(68, 20); this.label3.Size = new System.Drawing.Size(68, 20);
this.label3.TabIndex = 296; this.label3.TabIndex = 296;
this.label3.Text = "窗口大小:"; this.label3.Text = "窗口大小:";
this.label3.Visible = false;
// //
// 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(117, 34); this.numTh.Location = new System.Drawing.Point(222, 9);
this.numTh.Name = "numTh"; this.numTh.Name = "numTh";
this.numTh.Size = new System.Drawing.Size(80, 26); this.numTh.Size = new System.Drawing.Size(80, 26);
this.numTh.TabIndex = 295; this.numTh.TabIndex = 295;
...@@ -162,15 +205,17 @@ ...@@ -162,15 +205,17 @@
0, 0,
0, 0,
0}); 0});
this.numTh.Visible = false;
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(71, 37); this.label1.Location = new System.Drawing.Point(176, 12);
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
// //
...@@ -178,7 +223,7 @@ ...@@ -178,7 +223,7 @@
this.btnEnd.BackColor = System.Drawing.Color.White; this.btnEnd.BackColor = System.Drawing.Color.White;
this.btnEnd.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnEnd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnEnd.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnEnd.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnEnd.Location = new System.Drawing.Point(1148, 593); this.btnEnd.Location = new System.Drawing.Point(1144, 652);
this.btnEnd.Name = "btnEnd"; this.btnEnd.Name = "btnEnd";
this.btnEnd.Size = new System.Drawing.Size(133, 50); this.btnEnd.Size = new System.Drawing.Size(133, 50);
this.btnEnd.TabIndex = 286; this.btnEnd.TabIndex = 286;
...@@ -204,58 +249,32 @@ ...@@ -204,58 +249,32 @@
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.Controls.Add(this.label1);
this.groupBox4.Location = new System.Drawing.Point(990, 42); this.groupBox4.Location = new System.Drawing.Point(990, 175);
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(308, 512); this.groupBox4.Size = new System.Drawing.Size(308, 431);
this.groupBox4.TabIndex = 295; this.groupBox4.TabIndex = 295;
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
this.groupBox4.Text = "请选择参数"; this.groupBox4.Text = "请选择参数";
// //
// buttonA // buttonE
//
this.buttonA.BackColor = System.Drawing.Color.White;
this.buttonA.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonA.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonA.Location = new System.Drawing.Point(84, 132);
this.buttonA.Name = "buttonA";
this.buttonA.Size = new System.Drawing.Size(133, 50);
this.buttonA.TabIndex = 299;
this.buttonA.Text = "算法A";
this.buttonA.UseVisualStyleBackColor = false;
this.buttonA.Click += new System.EventHandler(this.buttonA_Click);
//
// buttonB
//
this.buttonB.BackColor = System.Drawing.Color.White;
this.buttonB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonB.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonB.Location = new System.Drawing.Point(84, 189);
this.buttonB.Name = "buttonB";
this.buttonB.Size = new System.Drawing.Size(133, 50);
this.buttonB.TabIndex = 300;
this.buttonB.Text = "算法B";
this.buttonB.UseVisualStyleBackColor = false;
this.buttonB.Click += new System.EventHandler(this.buttonB_Click);
//
// buttonC
// //
this.buttonC.BackColor = System.Drawing.Color.White; this.buttonE.BackColor = System.Drawing.Color.White;
this.buttonC.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonE.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonC.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.buttonE.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonC.Location = new System.Drawing.Point(84, 246); this.buttonE.Location = new System.Drawing.Point(82, 272);
this.buttonC.Name = "buttonC"; this.buttonE.Name = "buttonE";
this.buttonC.Size = new System.Drawing.Size(133, 50); this.buttonE.Size = new System.Drawing.Size(133, 50);
this.buttonC.TabIndex = 301; this.buttonE.TabIndex = 303;
this.buttonC.Text = "算法C"; this.buttonE.Text = "算法E";
this.buttonC.UseVisualStyleBackColor = false; this.buttonE.UseVisualStyleBackColor = false;
this.buttonC.Click += new System.EventHandler(this.buttonC_Click); this.buttonE.Click += new System.EventHandler(this.buttonE_Click);
// //
// buttonD // buttonD
// //
this.buttonD.BackColor = System.Drawing.Color.White; this.buttonD.BackColor = System.Drawing.Color.White;
this.buttonD.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonD.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonD.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.buttonD.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonD.Location = new System.Drawing.Point(84, 303); this.buttonD.Location = new System.Drawing.Point(82, 215);
this.buttonD.Name = "buttonD"; this.buttonD.Name = "buttonD";
this.buttonD.Size = new System.Drawing.Size(133, 50); this.buttonD.Size = new System.Drawing.Size(133, 50);
this.buttonD.TabIndex = 302; this.buttonD.TabIndex = 302;
...@@ -263,53 +282,96 @@ ...@@ -263,53 +282,96 @@
this.buttonD.UseVisualStyleBackColor = false; this.buttonD.UseVisualStyleBackColor = false;
this.buttonD.Click += new System.EventHandler(this.buttonD_Click); this.buttonD.Click += new System.EventHandler(this.buttonD_Click);
// //
// buttonE // buttonC
//
this.buttonE.BackColor = System.Drawing.Color.White;
this.buttonE.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonE.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonE.Location = new System.Drawing.Point(84, 360);
this.buttonE.Name = "buttonE";
this.buttonE.Size = new System.Drawing.Size(133, 50);
this.buttonE.TabIndex = 303;
this.buttonE.Text = "算法E";
this.buttonE.UseVisualStyleBackColor = false;
this.buttonE.Click += new System.EventHandler(this.buttonE_Click);
// //
// lblCountInfo this.buttonC.BackColor = System.Drawing.Color.White;
this.buttonC.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonC.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonC.Location = new System.Drawing.Point(82, 158);
this.buttonC.Name = "buttonC";
this.buttonC.Size = new System.Drawing.Size(133, 50);
this.buttonC.TabIndex = 301;
this.buttonC.Text = "算法C";
this.buttonC.UseVisualStyleBackColor = false;
this.buttonC.Click += new System.EventHandler(this.buttonC_Click);
// //
this.lblCountInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); // buttonB
this.lblCountInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCountInfo.Location = new System.Drawing.Point(791, 699);
this.lblCountInfo.Name = "lblCountInfo";
this.lblCountInfo.Size = new System.Drawing.Size(166, 18);
this.lblCountInfo.TabIndex = 299;
this.lblCountInfo.Text = "第1张/共10张";
this.lblCountInfo.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// lblFolder this.buttonB.BackColor = System.Drawing.Color.White;
this.buttonB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonB.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonB.Location = new System.Drawing.Point(82, 101);
this.buttonB.Name = "buttonB";
this.buttonB.Size = new System.Drawing.Size(133, 50);
this.buttonB.TabIndex = 300;
this.buttonB.Text = "算法B";
this.buttonB.UseVisualStyleBackColor = false;
this.buttonB.Click += new System.EventHandler(this.buttonB_Click);
// //
this.lblFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); // buttonA
this.lblFolder.AutoSize = true;
this.lblFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblFolder.Location = new System.Drawing.Point(7, 699);
this.lblFolder.Name = "lblFolder";
this.lblFolder.Size = new System.Drawing.Size(80, 17);
this.lblFolder.TabIndex = 300;
this.lblFolder.Text = "当前文件夹:";
this.lblFolder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// lblImgeInfo this.buttonA.BackColor = System.Drawing.Color.White;
this.buttonA.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonA.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonA.Location = new System.Drawing.Point(82, 44);
this.buttonA.Name = "buttonA";
this.buttonA.Size = new System.Drawing.Size(133, 50);
this.buttonA.TabIndex = 299;
this.buttonA.Text = "算法A";
this.buttonA.UseVisualStyleBackColor = false;
this.buttonA.Click += new System.EventHandler(this.buttonA_Click);
// //
this.lblImgeInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); // groupBox2
this.lblImgeInfo.AutoSize = true; //
this.lblImgeInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lblImgeInfo.Location = new System.Drawing.Point(414, 701); this.groupBox2.Controls.Add(this.lblPN);
this.lblImgeInfo.Name = "lblImgeInfo"; this.groupBox2.Controls.Add(this.lblFeng);
this.lblImgeInfo.Size = new System.Drawing.Size(54, 17); this.groupBox2.Controls.Add(this.lblDes);
this.lblImgeInfo.TabIndex = 301; this.groupBox2.Controls.Add(this.lblProName);
this.lblImgeInfo.Text = "Zoom:"; this.groupBox2.Location = new System.Drawing.Point(990, 4);
this.lblImgeInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(308, 153);
this.groupBox2.TabIndex = 299;
this.groupBox2.TabStop = false;
//
// lblPN
//
this.lblPN.Location = new System.Drawing.Point(8, 22);
this.lblPN.Name = "lblPN";
this.lblPN.Size = new System.Drawing.Size(291, 25);
this.lblPN.TabIndex = 77;
this.lblPN.Text = "元器件编号:";
this.lblPN.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblFeng
//
this.lblFeng.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblFeng.Location = new System.Drawing.Point(8, 115);
this.lblFeng.Name = "lblFeng";
this.lblFeng.Size = new System.Drawing.Size(291, 25);
this.lblFeng.TabIndex = 76;
this.lblFeng.Text = "封装:";
this.lblFeng.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblDes
//
this.lblDes.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblDes.Location = new System.Drawing.Point(8, 53);
this.lblDes.Name = "lblDes";
this.lblDes.Size = new System.Drawing.Size(291, 25);
this.lblDes.TabIndex = 75;
this.lblDes.Text = "描述:";
this.lblDes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblProName
//
this.lblProName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblProName.Location = new System.Drawing.Point(8, 84);
this.lblProName.Name = "lblProName";
this.lblProName.Size = new System.Drawing.Size(291, 25);
this.lblProName.TabIndex = 74;
this.lblProName.Text = "产品:";
this.lblProName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// FrmLearning // FrmLearning
// //
...@@ -317,6 +379,7 @@ ...@@ -317,6 +379,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1344, 729); this.ClientSize = new System.Drawing.Size(1344, 729);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnEnd); this.Controls.Add(this.btnEnd);
...@@ -335,6 +398,7 @@ ...@@ -335,6 +398,7 @@
((System.ComponentModel.ISupportInitialize)(this.numTh)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numTh)).EndInit();
this.groupBox4.ResumeLayout(false); this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout(); this.groupBox4.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -361,5 +425,10 @@ ...@@ -361,5 +425,10 @@
private System.Windows.Forms.Label lblCountInfo; private System.Windows.Forms.Label lblCountInfo;
private System.Windows.Forms.Label lblFolder; private System.Windows.Forms.Label lblFolder;
private System.Windows.Forms.Label lblImgeInfo; private System.Windows.Forms.Label lblImgeInfo;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label lblPN;
private System.Windows.Forms.Label lblFeng;
private System.Windows.Forms.Label lblDes;
private System.Windows.Forms.Label lblProName;
} }
} }
\ No newline at end of file \ No newline at end of file
using Acc.ImageBox; using Acc.ImageBox;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.DeviceLibrary; using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
...@@ -21,8 +22,7 @@ namespace OnlineStore.AutoCountClient ...@@ -21,8 +22,7 @@ namespace OnlineStore.AutoCountClient
{ {
InitializeComponent(); InitializeComponent();
} }
private ImageBox currShowBox = null; private int CurrType = -2;
private int CurrType = -1;
private string CurrFullFileName = ""; private string CurrFullFileName = "";
private string CurrPN = ""; private string CurrPN = "";
...@@ -85,7 +85,6 @@ namespace OnlineStore.AutoCountClient ...@@ -85,7 +85,6 @@ namespace OnlineStore.AutoCountClient
{ {
btnNext.Enabled = false; btnNext.Enabled = false;
MessageBox.Show("已经是最后一张图片"); MessageBox.Show("已经是最后一张图片");
return; return;
} }
string fullFName = ImageList[currIndex]; string fullFName = ImageList[currIndex];
...@@ -126,6 +125,24 @@ namespace OnlineStore.AutoCountClient ...@@ -126,6 +125,24 @@ namespace OnlineStore.AutoCountClient
{ {
btnNext.Enabled = false; btnNext.Enabled = false;
} }
if (LoadCSVLibrary.CSVBomManager.allComMap.ContainsKey(CurrPN))
{
ComponetInfo com = CSVBomManager.allComMap[CurrPN];
lblDes.Text = "描述:" + com.Describe;
lblFeng.Text = "封装:" + com.Encapsulations;
lblPN.Text = "元器件编号:" + com.PartNum;
lblProName.Text = "产品:" + com.ProductName;
}
else
{
lblPN.Text = "元器件编号:" + CurrPN;
lblDes.Text = "--";
lblFeng.Text = "--";
lblProName.Text = "--";
}
timer1.Start(); timer1.Start();
} }
...@@ -138,10 +155,12 @@ namespace OnlineStore.AutoCountClient ...@@ -138,10 +155,12 @@ namespace OnlineStore.AutoCountClient
CurrType = type; CurrType = type;
int index = 0; int index = 0;
btnTest.Text = "请选择算法"; btnTest.Text = "请选择算法";
bool findsuanfa = false;
foreach (Button btn in SelBtnList) foreach (Button btn in SelBtnList)
{ {
if (index.Equals(type)) if (index.Equals(type))
{ {
findsuanfa = true;
btn.Text = gouStr + btn.Tag; btn.Text = gouStr + btn.Tag;
btnTest.Text = btn.Tag + "-点料测试"; btnTest.Text = btn.Tag + "-点料测试";
btn.BackColor = Color.LightGreen; btn.BackColor = Color.LightGreen;
...@@ -153,12 +172,9 @@ namespace OnlineStore.AutoCountClient ...@@ -153,12 +172,9 @@ namespace OnlineStore.AutoCountClient
} }
index++; index++;
} }
bool isShowBtn = (type >= 0&&type<5);
btnTest.Enabled = isShowBtn;
btnNext.Enabled = isShowBtn;
btnEnd.Enabled = true ;
btnTest.Enabled = findsuanfa;
btnNext.Enabled = findsuanfa;
} }
private void btnTest_Click(object sender, EventArgs e) private void btnTest_Click(object sender, EventArgs e)
...@@ -248,7 +264,7 @@ namespace OnlineStore.AutoCountClient ...@@ -248,7 +264,7 @@ namespace OnlineStore.AutoCountClient
private void btnNext_Click(object sender, EventArgs e) private void btnNext_Click(object sender, EventArgs e)
{ {
btnNext.Enabled = false; //btnNext.Enabled = false;
this.Cursor = System.Windows.Forms.Cursors.WaitCursor; this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
try try
{ {
...@@ -258,7 +274,7 @@ namespace OnlineStore.AutoCountClient ...@@ -258,7 +274,7 @@ namespace OnlineStore.AutoCountClient
{ {
LogUtil.error("下一张 报错:" + ex.ToString()); LogUtil.error("下一张 报错:" + ex.ToString());
} }
btnNext.Enabled = true; //btnNext.Enabled = true;
this.Cursor = System.Windows.Forms.Cursors.Default; this.Cursor = System.Windows.Forms.Cursors.Default;
} }
......
type,sign,value,threshold,windowSize type,sign,value,threshold,windowSize
6H10B,1,5,0,0 6H10B,1,5,0,0
7H5S1,0,0,0,0 7H5S1,0,0,0,0
6H106,1,0,0,0 6H106,1,0,0,0
......
...@@ -559,29 +559,50 @@ namespace OnlineStore.DeviceLibrary ...@@ -559,29 +559,50 @@ namespace OnlineStore.DeviceLibrary
} }
public int GetCountResult(string fileP, CountParam param,out Asa.API.EyemImage tpDstImg) public int GetCountResult(string fileP, CountParam param, out Asa.API.EyemImage tpDstImg)
{ {
// 器件类型
//"小器件" GetLocalCount
//"粘连不严重" GetLocalCountIrregular type = 0
//"大器件" GetLocalCountIrregular type = 1
//"长条型器件" GetLocalCountIrregular type = 2
//"E形状" GetLocalCountIrregular type = 3
//返回的数量是string类型,count = "4000,3000,3500,2000"
int count = 0; int count = 0;
tpDstImg = new API.EyemImage();
try
{
string countStr = "";
int result = 0; int result = 0;
int type = param.Sign; int type = param.Sign;
int threshold = param.Threshold; int threshold = param.Threshold;
int windowsize = param.WindowSize; int windowsize = param.WindowSize;
if (param.Sign.Equals(0)) if (param.Sign.Equals(0))
{ {
result = carerayImage.GetLocalCount(fileP, threshold, windowsize, out count, out tpDstImg); result = carerayImage.GetLocalCount(fileP, threshold, windowsize, out countStr, out tpDstImg);
LogUtil.info("GetCountResult "+ type + " 调用 GetLocalCount 【" + fileP+"】【"+threshold+"】【"+windowsize+"】,返回【"+result+"】,结果【"+count+"】"); LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + threshold + "】【" + windowsize + "】,返回【" + result + "】,结果【" + countStr + "】");
} }
else if (param.Sign.Equals(1)) //else if (param.Sign.Equals(1))
//{
// result = carerayImage.GetLocalCountHuge(fileP, threshold, windowsize, out countStr, out tpDstImg);
// LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + threshold + "】【" + windowsize + "】,返回【" + result + "】,结果【" + countStr + "】");
//}
else
{ {
result = carerayImage.GetLocalCountHuge(fileP, threshold, windowsize, out count, out tpDstImg); int t = param.Sign - 1;
LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + threshold + "】【" + windowsize + "】,返回【" + result + "】,结果【" + count + "】"); result = carerayImage.GetLocalCountIrregular(fileP, threshold, t, windowsize, out countStr, out tpDstImg);
LogUtil.info("GetCountResult " + type + " 调用 GetLocalCountIrregular 【" + fileP + "】【" + threshold + "】[" + t + "]【" + windowsize + "】,返回【" + result + "】,结果【" + countStr + "】");
} }
else string[] array = countStr.Split(',');
if (array.Length > 0)
{
count= Convert.ToInt32(array[0]);
}
}
catch (Exception ex)
{ {
int t = param.Sign - 2; LogUtil.error("GetCountResult 出错: " + ex.ToString());
WorkLog("点料:开始调用 carerayImage.GetLocalCountIrregular ");
result = carerayImage.GetLocalCountIrregular(fileP, threshold, t, windowsize, out count, out tpDstImg);
LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + threshold + "】["+t+"]【" + windowsize + "】,返回【" + result + "】,结果【" + count + "】");
} }
return count; return count;
} }
......
...@@ -121,6 +121,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -121,6 +121,8 @@ namespace OnlineStore.DeviceLibrary
File.WriteAllLines(ConfigFilePath, lineList); File.WriteAllLines(ConfigFilePath, lineList);
LogUtil.info("SaveMapToFile 【" + ConfigFilePath + "】"); LogUtil.info("SaveMapToFile 【" + ConfigFilePath + "】");
CSVBomManager.BackFile(ConfigFilePath, lineList.ToArray());
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -162,7 +162,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -162,7 +162,7 @@ namespace OnlineStore.LoadCSVLibrary
if (!titleIndex.ContainsKey(str)) if (!titleIndex.ContainsKey(str))
{ {
LogUtil.error("未找到必须列:" + str + ",加载数据失败!"); LogUtil.error("未找到必须列:" + str + ",加载数据失败!");
throw new CVSFieldNotMatchingExection("未找到必须列:" + str + ",加载数据失败!"); throw new CVSFieldNotMatchingExection("【"+ lineValue + "】未找到必须列:【" + str + "】,加载数据失败!");
} }
} }
} }
......
...@@ -57,8 +57,14 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -57,8 +57,14 @@ namespace OnlineStore.LoadCSVLibrary
public static string getFilePath() public static string getFilePath()
{ {
string ComPath_Config = ConfigAppSettings.GetValue(Setting_Init.ComPath_Config);
if (String.IsNullOrEmpty(ComPath_Config))
{
ComPath_Config = @"\XRAY\pnDetailedList.csv";
ConfigAppSettings.SaveValue(Setting_Init.ComPath_Config, ComPath_Config);
}
string appPath = Application.StartupPath; string appPath = Application.StartupPath;
string fileName = appPath + ConfigAppSettings.GetValue(Setting_Init.ComPath_Config); string fileName = appPath + ComPath_Config;
return fileName; return fileName;
} }
/// <summary> /// <summary>
...@@ -245,6 +251,8 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -245,6 +251,8 @@ namespace OnlineStore.LoadCSVLibrary
} }
bool result = WriteCSVFile(filePath, lines); bool result = WriteCSVFile(filePath, lines);
LogUtil.info("保存物料库列表到文件 SaveToFile :" + result); LogUtil.info("保存物料库列表到文件 SaveToFile :" + result);
BackFile(filePath, lines);
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
...@@ -264,6 +272,56 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -264,6 +272,56 @@ namespace OnlineStore.LoadCSVLibrary
return false; return false;
} }
public static void BackFile(string filePath, string[] lines)
{
//备份保存
//try
//{
// FileInfo file = new FileInfo(filePath);
// string date = DateTime.Now.ToString("yyyy-MM-dd");
// string targetBackPath = @"C:\configBack\" + date + @"\";
// if (!Directory.Exists(targetBackPath))
// {
// Directory.CreateDirectory(targetBackPath);
// }
// string fileName = file.Name;
// string backFile = targetBackPath + fileName;
// if (File.Exists(backFile))
// {
// File.Delete(backFile);
// }
// File.WriteAllLines(backFile, lines, Encoding.GetEncoding("gbk"));
//}
//catch (Exception e)
//{
// LogUtil.error("备份["+ filePath + "]到C:configBack出错:" + e.ToString());
//}
//备份保存
try
{
FileInfo file = new FileInfo(filePath);
string date = DateTime.Now.ToString("yyyy-MM-dd");
string targetBackPath = @"D:\configBack\" + date + @"\";
if (!Directory.Exists(targetBackPath))
{
Directory.CreateDirectory(targetBackPath);
}
string fileName = file.Name;
string backFile = targetBackPath + fileName;
if (File.Exists(backFile))
{
File.Delete(backFile);
}
File.WriteAllLines(backFile, lines, Encoding.UTF8);
}
catch (Exception e)
{
LogUtil.error("备份[" + filePath + "]到D:configBack出错:" + e.ToString());
}
}
public static ComponetInfo GetCom(string partNum) public static ComponetInfo GetCom(string partNum)
{ {
if (allComMap.ContainsKey(partNum)) if (allComMap.ContainsKey(partNum))
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!