From 1c60d225cc7c1ccf17c3d1e6a84ca0d959550cf3 Mon Sep 17 00:00:00 2001
From: Jack.Peng <jack.peng@broconcentric.com>
Date: 星期二, 20 四月 2021 18:54:57 +0800
Subject: [PATCH] 1.新增输出缺陷报表。
---
P066.Data/WriteFile.cs | 4 +-
P066.Data/Form1.Designer.cs | 34 +++++++++++++++--
P066.Data/Form1.cs | 74 +++++++++++++++++++++++++++++++++----
3 files changed, 98 insertions(+), 14 deletions(-)
diff --git a/P066.Data/Form1.Designer.cs b/P066.Data/Form1.Designer.cs
index 5b8f87a..b2d91d7 100644
--- a/P066.Data/Form1.Designer.cs
+++ b/P066.Data/Form1.Designer.cs
@@ -33,12 +33,15 @@
this.btnAnalyze = new System.Windows.Forms.Button();
this.btnLoadData2 = new System.Windows.Forms.Button();
this.btnLoadData3 = new System.Windows.Forms.Button();
+ this.butPictur = new System.Windows.Forms.Button();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// btnLoadData1
//
this.btnLoadData1.Location = new System.Drawing.Point(16, 15);
- this.btnLoadData1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btnLoadData1.Margin = new System.Windows.Forms.Padding(4);
this.btnLoadData1.Name = "btnLoadData1";
this.btnLoadData1.Size = new System.Drawing.Size(176, 29);
this.btnLoadData1.TabIndex = 0;
@@ -49,7 +52,7 @@
// btnAnalyze
//
this.btnAnalyze.Location = new System.Drawing.Point(16, 88);
- this.btnAnalyze.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btnAnalyze.Margin = new System.Windows.Forms.Padding(4);
this.btnAnalyze.Name = "btnAnalyze";
this.btnAnalyze.Size = new System.Drawing.Size(176, 29);
this.btnAnalyze.TabIndex = 1;
@@ -60,7 +63,7 @@
// btnLoadData2
//
this.btnLoadData2.Location = new System.Drawing.Point(16, 51);
- this.btnLoadData2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btnLoadData2.Margin = new System.Windows.Forms.Padding(4);
this.btnLoadData2.Name = "btnLoadData2";
this.btnLoadData2.Size = new System.Drawing.Size(199, 29);
this.btnLoadData2.TabIndex = 1;
@@ -78,18 +81,39 @@
this.btnLoadData3.UseVisualStyleBackColor = true;
this.btnLoadData3.Click += new System.EventHandler(this.btnLoadData3_Click);
//
+ // butPictur
+ //
+ this.butPictur.Location = new System.Drawing.Point(175, 216);
+ this.butPictur.Name = "butPictur";
+ this.butPictur.Size = new System.Drawing.Size(141, 35);
+ this.butPictur.TabIndex = 3;
+ this.butPictur.Text = "鍔犺浇鍥剧墖鏂囦欢澶�";
+ this.butPictur.UseVisualStyleBackColor = true;
+ this.butPictur.Click += new System.EventHandler(this.butPictur_Click);
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.Location = new System.Drawing.Point(405, 134);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(522, 245);
+ this.pictureBox1.TabIndex = 4;
+ this.pictureBox1.TabStop = false;
+ //
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1067, 562);
+ this.Controls.Add(this.pictureBox1);
+ this.Controls.Add(this.butPictur);
this.Controls.Add(this.btnLoadData3);
this.Controls.Add(this.btnAnalyze);
this.Controls.Add(this.btnLoadData2);
this.Controls.Add(this.btnLoadData1);
- this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "Form1";
this.Text = "Form1";
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
@@ -101,6 +125,8 @@
private System.Windows.Forms.Button btnAnalyze;
private System.Windows.Forms.Button btnLoadData2;
private System.Windows.Forms.Button btnLoadData3;
+ private System.Windows.Forms.Button butPictur;
+ private System.Windows.Forms.PictureBox pictureBox1;
}
}
diff --git a/P066.Data/Form1.cs b/P066.Data/Form1.cs
index cc78022..b84b654 100644
--- a/P066.Data/Form1.cs
+++ b/P066.Data/Form1.cs
@@ -18,6 +18,8 @@
DirectoryInfo directoryInfo1;
DirectoryInfo directoryInfo2;
DirectoryInfo directoryInfo3;
+ DirectoryInfo directoryInfo4;
+
private P066RunParam runparam = new P066RunParam();
private ReadFile readfile = new ReadFile();
private WriteFile writefile = new WriteFile();
@@ -44,6 +46,7 @@
return;
directoryInfo2 = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
+
}
private void btnLoadData3_Click(object sender, EventArgs e)
@@ -54,7 +57,16 @@
}
directoryInfo3 = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
}
+ private void butPictur_Click(object sender, EventArgs e)
+ {
+ if (folderBrowserDialog1.ShowDialog()!=DialogResult.OK)
+ {
+ return;
+ }
+ directoryInfo4 = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
+
+ }
private void btnAnalyze_Click(object sender, EventArgs e)
{
var Start = DateTime.Now;
@@ -172,6 +184,50 @@
});
+
+ List<string> listPicyreSor = new List<string>(); //鍔犺浇鍥剧墖鏃堕棿鎴�
+ var directoties = directoryInfo4.GetDirectories();
+ for (int i = 0; i < directoties.Length; i++)
+ {
+ listPicyreSor.Add(directoties[i].Name);
+ }
+ listPicyreSor.Sort();
+
+ if (listPicyreSor.Count!=0)
+ {
+ Task.Run(() =>
+ {
+
+ #region//灏嗚澶囧垽鏂粨鏋滆緭鍑哄埌CSV鎶ヨ〃涓�
+ //ListReexaminationSum.AddRange(GetClassificationLens(fileInfo1, fileInfo2, DataTipsor));
+ var title12 = $"鏃堕棿鎴�,鐩告満搴忓彿,璁惧鍒ゆ柇缁撴灉,缂洪櫡绫诲瀷,璁惧鍚庡鐞嗙粨鏋�,鏈�澶у昂瀵�,浣嶇疆,X,Y,R,瑙掑害";
+ var file12 = $"{directoryInfo1.Parent.FullName}\\{filenameDir + "璁惧妫�绱㈢粨鏋�"}.csv";
+ File.AppendAllText(file12, title12, Encoding.UTF8);
+ File.AppendAllText(file12, "\r\n");
+ foreach (var item in listPicyreSor)
+ {
+ var Lens1 = ListReexaminationSum.FindAll(a => a.TimeTip == item && a.Lensnumber == 1);
+ writefile.WriteJR(Lens1, item, 1, file12);
+ for (int i = 2; i < 5; i++)
+ {
+ var Lens = ListReexaminationSum.FindAll(a => a.TimeTip == item && a.Lensnumber == i);
+ writefile.WriteJR(Lens, "", i, file12);
+ }
+
+ }
+
+
+
+ });
+ }
+
+
+
+
+
+
+
+
task3.Wait();
var task6 = Task.Run(() =>
{
@@ -244,7 +300,7 @@
var defectClearSum = listlensum1 - listlennoclearsum1;
- var content1 = $"{i},{defectSum},{defectClearSum},{(double)(defectSum / defectSum)}";
+ var content1 = $"{i},{defectSum},{defectClearSum},{(double)(defectSum / defectClearSum)}";
File.AppendAllText(file1, content1, Encoding.UTF8);
File.AppendAllText(file1, "\r\n");
}
@@ -775,19 +831,19 @@
int index = i;
Task task = new Task(() => {
var list = CompareFile(fileInfo1[index], fileInfo2[index], DataTipsor);
- if (fileInfo1[index].Name.Contains("鐧界偣"))
- {
+ //if (fileInfo1[index].Name.Contains("鐧界偣"))
+ //{
//WhiteI++;
//list.ForEach(a => a.Lensnumber = WhiteI);
ListReexaminationSum.AddRange(list);
- }
- else if (fileInfo1[index].Name.Contains("鍒櫧"))
- {
+ //}
+ //else if (fileInfo1[index].Name.Contains("鍒櫧"))
+ //{
//WhiteningI++;
//list.ForEach(a => a.Lensnumber = WhiteningI);
- ListReexaminationSum.AddRange(list);
+ //ListReexaminationSum.AddRange(list);
- }
+ //}
if (fileInfo1[index].Name.Contains("鍒濇涓"))
{
list = GetMidLocation(list);
@@ -890,3 +946,5 @@
}
+
+#endregion
\ No newline at end of file
diff --git a/P066.Data/WriteFile.cs b/P066.Data/WriteFile.cs
index 4d919ac..0bbb6bc 100644
--- a/P066.Data/WriteFile.cs
+++ b/P066.Data/WriteFile.cs
@@ -45,7 +45,7 @@
if (lensWhite.Count!=0)
{
- var content = $"{""},{""},{""},{lensWhite[0].DefectType},{lensWhite[0].PostTreatmentResults}";
+ var content = $"{""},{""},{""},{lensWhite[0].DefectType+ lensWhite[0].JudgmentResult},{lensWhite[0].PostTreatmentResults}";
File.AppendAllText(file12, content, Encoding.UTF8);
File.AppendAllText(file12, "\r\n");
for (int i = 0; i < lensWhite.Count; i++)
@@ -58,7 +58,7 @@
if (lensWhiten.Count!=0)
{
- var content = $"{""},{""},{""},{lensWhiten[0].DefectType},{lensWhiten[0].PostTreatmentResults}";
+ var content = $"{""},{""},{""},{lensWhiten[0].DefectType+ lensWhiten[0].JudgmentResult},{lensWhiten[0].PostTreatmentResults}";
File.AppendAllText(file12, content, Encoding.UTF8);
File.AppendAllText(file12, "\r\n");
for (int i = 0; i < lensWhiten.Count; i++)
--
Gitblit v1.8.0