Compare commits
No commits in common. "44de774d4e400efdda9186ec6dfd7771ffb67ad1" and "df8736bcb1158a139d4d1fe936764fbf9d0f3577" have entirely different histories.
44de774d4e
...
df8736bcb1
@ -33,38 +33,38 @@ namespace HisenceYoloDetection
|
||||
int rectX = 0;
|
||||
int rectY = height - rectSize; // 确保是左下角
|
||||
|
||||
// 检查左下角矩形框是否在图像范围内
|
||||
// 防止越界
|
||||
if (rectY < 0 || rectX < 0 || rectSize > width || rectSize > height)
|
||||
{
|
||||
Console.WriteLine("图像尺寸不足以获取指定区域");
|
||||
return image;
|
||||
}
|
||||
|
||||
// 定义感兴趣区域 (ROI) 并计算其平均颜色
|
||||
Rect roi = new Rect(rectX, rectY, rectSize, rectSize);
|
||||
Mat roiMat = new Mat(image, roi);
|
||||
|
||||
// 计算平均颜色值
|
||||
Scalar meanColor = Cv2.Mean(roiMat);
|
||||
Vec3b fillColor = new Vec3b((byte)meanColor.Val0, (byte)meanColor.Val1, (byte)meanColor.Val2);
|
||||
|
||||
// 创建 Scalar 类型的颜色填充
|
||||
Scalar fillColor = new Scalar(meanColor.Val0, meanColor.Val1, meanColor.Val2);
|
||||
|
||||
// 修改 fillRect 的 Y 和 Height 属性以覆盖整个图像的高度
|
||||
fillRect.Y = 0; // 起始位置为顶部
|
||||
fillRect.Height = height; // 高度覆盖整个图像
|
||||
|
||||
// 检查填充矩形是否在图像范围内
|
||||
if (fillRect.X < 0 || fillRect.X + fillRect.Width > width)
|
||||
// 防止越界
|
||||
if (fillRect.X < 0 || fillRect.Y < 0 || fillRect.X + fillRect.Width > width || fillRect.Y + fillRect.Height > height)
|
||||
{
|
||||
Console.WriteLine("填充区域超出图像范围");
|
||||
return image;
|
||||
}
|
||||
|
||||
// 使用 OpenCV 的 rectangle 函数进行填充
|
||||
Cv2.Rectangle(image, fillRect.TopLeft, fillRect.BottomRight, fillColor, Cv2.FILLED);
|
||||
// 填充指定区域
|
||||
for (int y = fillRect.Y; y < fillRect.Y + fillRect.Height; y++)
|
||||
{
|
||||
for (int x = fillRect.X; x < fillRect.X + fillRect.Width; x++)
|
||||
{
|
||||
image.Set<Vec3b>(y, x, fillColor);
|
||||
}
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@ -247,17 +247,17 @@ namespace HisenceYoloDetection
|
||||
Cv2.Resize(img2, img2, new Size(550, 270));
|
||||
Cv2.Rectangle(img2, boundingRect, Scalar.Red, thickness: 2);
|
||||
isMatch = false;
|
||||
string savePath2 = Path.Combine("D:\\Hisence\\Test\\2\\ng",filename + "_Rect.png");
|
||||
string savePath2 = Path.Combine("D:\\Hisence\\Test\\2\\ng", Path.GetFileNameWithoutExtension(path1) + filename + "_Rect.png");
|
||||
// 保存结果
|
||||
//string savePath = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path2) + "_diff.png");
|
||||
Cv2.ImWrite(savePath2, img2);
|
||||
CheckDiffSciHelper1.ResizeImage(savePath2, savePath2, 640, 480, 75);
|
||||
|
||||
ResultMat = img2.Clone();
|
||||
string savePath = Path.Combine("D:\\Hisence\\Test\\2\\ng", Path.GetFileNameWithoutExtension(path1) + filename + "_diff.png");
|
||||
//string savePath = Path.Combine("D:\\Hisence\\Test\\2\\ng", Path.GetFileNameWithoutExtension(path1) + filename + "_diff.png");
|
||||
// 保存结果
|
||||
//string savePath = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path2) + "_diff.png");
|
||||
Cv2.ImWrite(savePath, blackhatImg);
|
||||
//Cv2.ImWrite(savePath, blackhatImg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ namespace HisenceYoloDetection
|
||||
double ratio1 = whiteArea1 / (thr1.Rows * thr1.Cols);
|
||||
double ratio2 = whiteArea2 / (thr2.Rows * thr2.Cols);
|
||||
|
||||
if (Math.Abs(ratio1 - ratio2) >= 0.90)
|
||||
if (Math.Abs(ratio1 - ratio2) >= 0.95)
|
||||
{
|
||||
isMatch = true;
|
||||
}
|
||||
@ -498,7 +498,7 @@ namespace HisenceYoloDetection
|
||||
// 保存结果
|
||||
//string savePath = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path2) + "_diff.png");
|
||||
Cv2.ImWrite(savePath2, img2);
|
||||
//ResizeImage(savePath2, savePath2, 640, 480, 75);
|
||||
ResizeImage(savePath2, savePath2, 640, 480, 75);
|
||||
//string savePath = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path1) + filename + "_diff.png");
|
||||
// 保存结果
|
||||
//string savePath = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path2) + "_diff.png");
|
||||
|
24
HisenceYoloDetection/Form2.Designer.cs
generated
24
HisenceYoloDetection/Form2.Designer.cs
generated
@ -35,44 +35,40 @@
|
||||
//
|
||||
// button1
|
||||
//
|
||||
button1.Location = new Point(192, 58);
|
||||
button1.Margin = new Padding(2, 2, 2, 2);
|
||||
button1.Location = new Point(301, 82);
|
||||
button1.Name = "button1";
|
||||
button1.Size = new Size(71, 24);
|
||||
button1.Size = new Size(112, 34);
|
||||
button1.TabIndex = 0;
|
||||
button1.Text = "验证";
|
||||
button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
textBox1.Location = new Point(143, 24);
|
||||
textBox1.Margin = new Padding(2, 2, 2, 2);
|
||||
textBox1.Location = new Point(224, 34);
|
||||
textBox1.Name = "textBox1";
|
||||
textBox1.Size = new Size(173, 23);
|
||||
textBox1.Size = new Size(269, 30);
|
||||
textBox1.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(58, 24);
|
||||
label1.Margin = new Padding(2, 0, 2, 0);
|
||||
label1.Location = new Point(91, 34);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(68, 17);
|
||||
label1.Size = new Size(100, 24);
|
||||
label1.TabIndex = 2;
|
||||
label1.Text = "输入密码:";
|
||||
label1.Text = "退出密码:";
|
||||
label1.Click += label1_Click;
|
||||
//
|
||||
// Form2
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleDimensions = new SizeF(11F, 24F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(429, 92);
|
||||
ClientSize = new Size(674, 130);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(textBox1);
|
||||
Controls.Add(button1);
|
||||
Margin = new Padding(2, 2, 2, 2);
|
||||
Name = "Form2";
|
||||
Text = "验证身份";
|
||||
Text = "退出验证";
|
||||
Load += Form2_Load;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
|
251
HisenceYoloDetection/MainForm.Designer.cs
generated
251
HisenceYoloDetection/MainForm.Designer.cs
generated
@ -123,8 +123,6 @@
|
||||
panel4 = new Panel();
|
||||
panel5 = new Panel();
|
||||
groupBox9 = new GroupBox();
|
||||
label38 = new Label();
|
||||
statusButton = new Button();
|
||||
DevNameCombo = new ComboBox();
|
||||
ScanDevList = new Button();
|
||||
groupBox2 = new GroupBox();
|
||||
@ -230,11 +228,11 @@
|
||||
// tabPage2
|
||||
//
|
||||
tabPage2.Controls.Add(panel1);
|
||||
tabPage2.Location = new Point(4, 26);
|
||||
tabPage2.Location = new Point(4, 33);
|
||||
tabPage2.Margin = new Padding(4, 2, 4, 2);
|
||||
tabPage2.Name = "tabPage2";
|
||||
tabPage2.Padding = new Padding(4, 2, 4, 2);
|
||||
tabPage2.Size = new Size(1276, 900);
|
||||
tabPage2.Size = new Size(1276, 816);
|
||||
tabPage2.TabIndex = 1;
|
||||
tabPage2.Text = "PLC";
|
||||
tabPage2.UseVisualStyleBackColor = true;
|
||||
@ -260,7 +258,7 @@
|
||||
panel1.Location = new Point(0, 6);
|
||||
panel1.Margin = new Padding(4, 2, 4, 2);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new Size(1514, 921);
|
||||
panel1.Size = new Size(1514, 713);
|
||||
panel1.TabIndex = 4;
|
||||
//
|
||||
// groupBox5
|
||||
@ -282,7 +280,7 @@
|
||||
DistanceShow.Margin = new Padding(4, 2, 4, 2);
|
||||
DistanceShow.Name = "DistanceShow";
|
||||
DistanceShow.ReadOnly = true;
|
||||
DistanceShow.Size = new Size(127, 23);
|
||||
DistanceShow.Size = new Size(127, 31);
|
||||
DistanceShow.TabIndex = 10;
|
||||
//
|
||||
// label21
|
||||
@ -291,7 +289,7 @@
|
||||
label21.Location = new Point(36, 31);
|
||||
label21.Margin = new Padding(4, 0, 4, 0);
|
||||
label21.Name = "label21";
|
||||
label21.Size = new Size(36, 17);
|
||||
label21.Size = new Size(54, 25);
|
||||
label21.TabIndex = 0;
|
||||
label21.Text = "测距";
|
||||
//
|
||||
@ -300,7 +298,7 @@
|
||||
txtSetValue.Location = new Point(738, 73);
|
||||
txtSetValue.Margin = new Padding(4, 2, 4, 2);
|
||||
txtSetValue.Name = "txtSetValue";
|
||||
txtSetValue.Size = new Size(251, 23);
|
||||
txtSetValue.Size = new Size(251, 31);
|
||||
txtSetValue.TabIndex = 14;
|
||||
//
|
||||
// groupBox4
|
||||
@ -369,7 +367,7 @@
|
||||
SetlnEditmiZOP.Location = new Point(526, 296);
|
||||
SetlnEditmiZOP.Margin = new Padding(4, 2, 4, 2);
|
||||
SetlnEditmiZOP.Name = "SetlnEditmiZOP";
|
||||
SetlnEditmiZOP.Size = new Size(127, 23);
|
||||
SetlnEditmiZOP.Size = new Size(127, 31);
|
||||
SetlnEditmiZOP.TabIndex = 27;
|
||||
//
|
||||
// SetlnEditmiYOP
|
||||
@ -377,7 +375,7 @@
|
||||
SetlnEditmiYOP.Location = new Point(329, 296);
|
||||
SetlnEditmiYOP.Margin = new Padding(4, 2, 4, 2);
|
||||
SetlnEditmiYOP.Name = "SetlnEditmiYOP";
|
||||
SetlnEditmiYOP.Size = new Size(127, 23);
|
||||
SetlnEditmiYOP.Size = new Size(127, 31);
|
||||
SetlnEditmiYOP.TabIndex = 26;
|
||||
//
|
||||
// SetlnEditmiXOP
|
||||
@ -385,7 +383,7 @@
|
||||
SetlnEditmiXOP.Location = new Point(138, 296);
|
||||
SetlnEditmiXOP.Margin = new Padding(4, 2, 4, 2);
|
||||
SetlnEditmiXOP.Name = "SetlnEditmiXOP";
|
||||
SetlnEditmiXOP.Size = new Size(127, 23);
|
||||
SetlnEditmiXOP.Size = new Size(127, 31);
|
||||
SetlnEditmiXOP.TabIndex = 25;
|
||||
//
|
||||
// SetlnEditmiZH
|
||||
@ -393,7 +391,7 @@
|
||||
SetlnEditmiZH.Location = new Point(526, 242);
|
||||
SetlnEditmiZH.Margin = new Padding(4, 2, 4, 2);
|
||||
SetlnEditmiZH.Name = "SetlnEditmiZH";
|
||||
SetlnEditmiZH.Size = new Size(127, 23);
|
||||
SetlnEditmiZH.Size = new Size(127, 31);
|
||||
SetlnEditmiZH.TabIndex = 23;
|
||||
//
|
||||
// SetlnEditmiYH
|
||||
@ -401,7 +399,7 @@
|
||||
SetlnEditmiYH.Location = new Point(329, 242);
|
||||
SetlnEditmiYH.Margin = new Padding(4, 2, 4, 2);
|
||||
SetlnEditmiYH.Name = "SetlnEditmiYH";
|
||||
SetlnEditmiYH.Size = new Size(127, 23);
|
||||
SetlnEditmiYH.Size = new Size(127, 31);
|
||||
SetlnEditmiYH.TabIndex = 22;
|
||||
//
|
||||
// SetlnEditmiXH
|
||||
@ -409,7 +407,7 @@
|
||||
SetlnEditmiXH.Location = new Point(138, 242);
|
||||
SetlnEditmiXH.Margin = new Padding(4, 2, 4, 2);
|
||||
SetlnEditmiXH.Name = "SetlnEditmiXH";
|
||||
SetlnEditmiXH.Size = new Size(127, 23);
|
||||
SetlnEditmiXH.Size = new Size(127, 31);
|
||||
SetlnEditmiXH.TabIndex = 21;
|
||||
//
|
||||
// lnEditmiZOP
|
||||
@ -417,7 +415,7 @@
|
||||
lnEditmiZOP.Location = new Point(526, 189);
|
||||
lnEditmiZOP.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiZOP.Name = "lnEditmiZOP";
|
||||
lnEditmiZOP.Size = new Size(127, 23);
|
||||
lnEditmiZOP.Size = new Size(127, 31);
|
||||
lnEditmiZOP.TabIndex = 19;
|
||||
//
|
||||
// lnEditmiYOP
|
||||
@ -425,7 +423,7 @@
|
||||
lnEditmiYOP.Location = new Point(329, 189);
|
||||
lnEditmiYOP.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiYOP.Name = "lnEditmiYOP";
|
||||
lnEditmiYOP.Size = new Size(127, 23);
|
||||
lnEditmiYOP.Size = new Size(127, 31);
|
||||
lnEditmiYOP.TabIndex = 18;
|
||||
//
|
||||
// lnEditmiXOP
|
||||
@ -433,7 +431,7 @@
|
||||
lnEditmiXOP.Location = new Point(138, 189);
|
||||
lnEditmiXOP.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiXOP.Name = "lnEditmiXOP";
|
||||
lnEditmiXOP.Size = new Size(127, 23);
|
||||
lnEditmiXOP.Size = new Size(127, 31);
|
||||
lnEditmiXOP.TabIndex = 17;
|
||||
//
|
||||
// label17
|
||||
@ -442,7 +440,7 @@
|
||||
label17.Location = new Point(41, 191);
|
||||
label17.Margin = new Padding(4, 0, 4, 0);
|
||||
label17.Name = "label17";
|
||||
label17.Size = new Size(64, 17);
|
||||
label17.Size = new Size(96, 25);
|
||||
label17.TabIndex = 16;
|
||||
label17.Text = "定位位置";
|
||||
//
|
||||
@ -452,7 +450,7 @@
|
||||
lnEditmiZS.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiZS.Name = "lnEditmiZS";
|
||||
lnEditmiZS.ReadOnly = true;
|
||||
lnEditmiZS.Size = new Size(127, 23);
|
||||
lnEditmiZS.Size = new Size(127, 31);
|
||||
lnEditmiZS.TabIndex = 15;
|
||||
//
|
||||
// lnEditmiYS
|
||||
@ -461,7 +459,7 @@
|
||||
lnEditmiYS.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiYS.Name = "lnEditmiYS";
|
||||
lnEditmiYS.ReadOnly = true;
|
||||
lnEditmiYS.Size = new Size(127, 23);
|
||||
lnEditmiYS.Size = new Size(127, 31);
|
||||
lnEditmiYS.TabIndex = 14;
|
||||
//
|
||||
// lnEditmiXS
|
||||
@ -470,7 +468,7 @@
|
||||
lnEditmiXS.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiXS.Name = "lnEditmiXS";
|
||||
lnEditmiXS.ReadOnly = true;
|
||||
lnEditmiXS.Size = new Size(127, 23);
|
||||
lnEditmiXS.Size = new Size(127, 31);
|
||||
lnEditmiXS.TabIndex = 13;
|
||||
//
|
||||
// label16
|
||||
@ -479,7 +477,7 @@
|
||||
label16.Location = new Point(10, 138);
|
||||
label16.Margin = new Padding(4, 0, 4, 0);
|
||||
label16.Name = "label16";
|
||||
label16.Size = new Size(92, 17);
|
||||
label16.Size = new Size(138, 25);
|
||||
label16.TabIndex = 12;
|
||||
label16.Text = "当前定位速度";
|
||||
//
|
||||
@ -489,7 +487,7 @@
|
||||
lnEditmiZHS.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiZHS.Name = "lnEditmiZHS";
|
||||
lnEditmiZHS.ReadOnly = true;
|
||||
lnEditmiZHS.Size = new Size(127, 23);
|
||||
lnEditmiZHS.Size = new Size(127, 31);
|
||||
lnEditmiZHS.TabIndex = 11;
|
||||
//
|
||||
// lnEditmiYHS
|
||||
@ -498,7 +496,7 @@
|
||||
lnEditmiYHS.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiYHS.Name = "lnEditmiYHS";
|
||||
lnEditmiYHS.ReadOnly = true;
|
||||
lnEditmiYHS.Size = new Size(127, 23);
|
||||
lnEditmiYHS.Size = new Size(127, 31);
|
||||
lnEditmiYHS.TabIndex = 10;
|
||||
//
|
||||
// lnEditmiXHS
|
||||
@ -507,7 +505,7 @@
|
||||
lnEditmiXHS.Margin = new Padding(4, 2, 4, 2);
|
||||
lnEditmiXHS.Name = "lnEditmiXHS";
|
||||
lnEditmiXHS.ReadOnly = true;
|
||||
lnEditmiXHS.Size = new Size(127, 23);
|
||||
lnEditmiXHS.Size = new Size(127, 31);
|
||||
lnEditmiXHS.TabIndex = 9;
|
||||
//
|
||||
// label15
|
||||
@ -516,7 +514,7 @@
|
||||
label15.Location = new Point(10, 85);
|
||||
label15.Margin = new Padding(4, 0, 4, 0);
|
||||
label15.Name = "label15";
|
||||
label15.Size = new Size(92, 17);
|
||||
label15.Size = new Size(138, 25);
|
||||
label15.TabIndex = 8;
|
||||
label15.Text = "当前手动速度";
|
||||
//
|
||||
@ -526,7 +524,7 @@
|
||||
ZPostion.Location = new Point(580, 42);
|
||||
ZPostion.Margin = new Padding(4, 0, 4, 0);
|
||||
ZPostion.Name = "ZPostion";
|
||||
ZPostion.Size = new Size(16, 17);
|
||||
ZPostion.Size = new Size(24, 25);
|
||||
ZPostion.TabIndex = 7;
|
||||
ZPostion.Text = "0";
|
||||
//
|
||||
@ -536,7 +534,7 @@
|
||||
YPostion.Location = new Point(386, 42);
|
||||
YPostion.Margin = new Padding(4, 0, 4, 0);
|
||||
YPostion.Name = "YPostion";
|
||||
YPostion.Size = new Size(16, 17);
|
||||
YPostion.Size = new Size(24, 25);
|
||||
YPostion.TabIndex = 6;
|
||||
YPostion.Text = "0";
|
||||
//
|
||||
@ -546,7 +544,7 @@
|
||||
XPostion.Location = new Point(185, 42);
|
||||
XPostion.Margin = new Padding(4, 0, 4, 0);
|
||||
XPostion.Name = "XPostion";
|
||||
XPostion.Size = new Size(16, 17);
|
||||
XPostion.Size = new Size(24, 25);
|
||||
XPostion.TabIndex = 5;
|
||||
XPostion.Text = "0";
|
||||
//
|
||||
@ -556,7 +554,7 @@
|
||||
XCurrentPostion.Location = new Point(170, 42);
|
||||
XCurrentPostion.Margin = new Padding(4, 0, 4, 0);
|
||||
XCurrentPostion.Name = "XCurrentPostion";
|
||||
XCurrentPostion.Size = new Size(0, 17);
|
||||
XCurrentPostion.Size = new Size(0, 25);
|
||||
XCurrentPostion.TabIndex = 4;
|
||||
//
|
||||
// label14
|
||||
@ -565,7 +563,7 @@
|
||||
label14.Location = new Point(580, 21);
|
||||
label14.Margin = new Padding(4, 0, 4, 0);
|
||||
label14.Name = "label14";
|
||||
label14.Size = new Size(17, 17);
|
||||
label14.Size = new Size(25, 25);
|
||||
label14.TabIndex = 3;
|
||||
label14.Text = "Z";
|
||||
//
|
||||
@ -575,7 +573,7 @@
|
||||
label13.Location = new Point(386, 18);
|
||||
label13.Margin = new Padding(4, 0, 4, 0);
|
||||
label13.Name = "label13";
|
||||
label13.Size = new Size(17, 17);
|
||||
label13.Size = new Size(27, 25);
|
||||
label13.TabIndex = 2;
|
||||
label13.Text = "Y";
|
||||
//
|
||||
@ -585,7 +583,7 @@
|
||||
label12.Location = new Point(184, 18);
|
||||
label12.Margin = new Padding(4, 0, 4, 0);
|
||||
label12.Name = "label12";
|
||||
label12.Size = new Size(17, 17);
|
||||
label12.Size = new Size(26, 25);
|
||||
label12.TabIndex = 1;
|
||||
label12.Text = "X";
|
||||
//
|
||||
@ -595,7 +593,7 @@
|
||||
label11.Location = new Point(41, 42);
|
||||
label11.Margin = new Padding(4, 0, 4, 0);
|
||||
label11.Name = "label11";
|
||||
label11.Size = new Size(64, 17);
|
||||
label11.Size = new Size(96, 25);
|
||||
label11.TabIndex = 0;
|
||||
label11.Text = "当前位置";
|
||||
//
|
||||
@ -801,7 +799,7 @@
|
||||
writePLCValue.Location = new Point(861, 9);
|
||||
writePLCValue.Margin = new Padding(4, 2, 4, 2);
|
||||
writePLCValue.Name = "writePLCValue";
|
||||
writePLCValue.Size = new Size(127, 23);
|
||||
writePLCValue.Size = new Size(127, 31);
|
||||
writePLCValue.TabIndex = 11;
|
||||
//
|
||||
// label9
|
||||
@ -810,7 +808,7 @@
|
||||
label9.Location = new Point(514, 49);
|
||||
label9.Margin = new Padding(4, 0, 4, 0);
|
||||
label9.Name = "label9";
|
||||
label9.Size = new Size(22, 17);
|
||||
label9.Size = new Size(33, 25);
|
||||
label9.TabIndex = 10;
|
||||
label9.Text = "值";
|
||||
//
|
||||
@ -820,7 +818,7 @@
|
||||
label10.Location = new Point(514, 15);
|
||||
label10.Margin = new Padding(4, 0, 4, 0);
|
||||
label10.Name = "label10";
|
||||
label10.Size = new Size(36, 17);
|
||||
label10.Size = new Size(54, 25);
|
||||
label10.TabIndex = 9;
|
||||
label10.Text = "地址";
|
||||
//
|
||||
@ -840,7 +838,7 @@
|
||||
PLCValue.Location = new Point(577, 43);
|
||||
PLCValue.Margin = new Padding(4, 2, 4, 2);
|
||||
PLCValue.Name = "PLCValue";
|
||||
PLCValue.Size = new Size(127, 23);
|
||||
PLCValue.Size = new Size(127, 31);
|
||||
PLCValue.TabIndex = 8;
|
||||
//
|
||||
// WriteAdress
|
||||
@ -848,7 +846,7 @@
|
||||
WriteAdress.Location = new Point(577, 13);
|
||||
WriteAdress.Margin = new Padding(4, 2, 4, 2);
|
||||
WriteAdress.Name = "WriteAdress";
|
||||
WriteAdress.Size = new Size(127, 23);
|
||||
WriteAdress.Size = new Size(127, 31);
|
||||
WriteAdress.TabIndex = 6;
|
||||
//
|
||||
// label6
|
||||
@ -857,7 +855,7 @@
|
||||
label6.Location = new Point(162, 51);
|
||||
label6.Margin = new Padding(4, 0, 4, 0);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(22, 17);
|
||||
label6.Size = new Size(33, 25);
|
||||
label6.TabIndex = 5;
|
||||
label6.Text = "值";
|
||||
//
|
||||
@ -867,7 +865,7 @@
|
||||
label3.Location = new Point(162, 18);
|
||||
label3.Margin = new Padding(4, 0, 4, 0);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(36, 17);
|
||||
label3.Size = new Size(54, 25);
|
||||
label3.TabIndex = 4;
|
||||
label3.Text = "地址";
|
||||
//
|
||||
@ -898,7 +896,7 @@
|
||||
showPLC.Location = new Point(225, 46);
|
||||
showPLC.Margin = new Padding(4, 2, 4, 2);
|
||||
showPLC.Name = "showPLC";
|
||||
showPLC.Size = new Size(127, 23);
|
||||
showPLC.Size = new Size(127, 31);
|
||||
showPLC.TabIndex = 3;
|
||||
//
|
||||
// readPLc
|
||||
@ -906,18 +904,18 @@
|
||||
readPLc.Location = new Point(225, 15);
|
||||
readPLc.Margin = new Padding(4, 2, 4, 2);
|
||||
readPLc.Name = "readPLc";
|
||||
readPLc.Size = new Size(127, 23);
|
||||
readPLc.Size = new Size(127, 31);
|
||||
readPLc.TabIndex = 1;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
tabPage1.Controls.Add(groupBox3);
|
||||
tabPage1.Controls.Add(groupBox1);
|
||||
tabPage1.Location = new Point(4, 26);
|
||||
tabPage1.Location = new Point(4, 34);
|
||||
tabPage1.Margin = new Padding(4, 2, 4, 2);
|
||||
tabPage1.Name = "tabPage1";
|
||||
tabPage1.Padding = new Padding(4, 2, 4, 2);
|
||||
tabPage1.Size = new Size(1276, 900);
|
||||
tabPage1.Size = new Size(1276, 815);
|
||||
tabPage1.TabIndex = 0;
|
||||
tabPage1.Text = "相机";
|
||||
tabPage1.UseVisualStyleBackColor = true;
|
||||
@ -981,7 +979,7 @@
|
||||
label5.Location = new Point(257, 18);
|
||||
label5.Margin = new Padding(4, 0, 4, 0);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(64, 17);
|
||||
label5.Size = new Size(96, 25);
|
||||
label5.TabIndex = 2;
|
||||
label5.Text = "链接相机";
|
||||
//
|
||||
@ -1012,7 +1010,7 @@
|
||||
tbGain2.Location = new Point(93, 54);
|
||||
tbGain2.Margin = new Padding(4, 2, 4, 2);
|
||||
tbGain2.Name = "tbGain2";
|
||||
tbGain2.Size = new Size(127, 23);
|
||||
tbGain2.Size = new Size(127, 31);
|
||||
tbGain2.TabIndex = 4;
|
||||
//
|
||||
// tbExposure2
|
||||
@ -1020,7 +1018,7 @@
|
||||
tbExposure2.Location = new Point(93, 22);
|
||||
tbExposure2.Margin = new Padding(4, 2, 4, 2);
|
||||
tbExposure2.Name = "tbExposure2";
|
||||
tbExposure2.Size = new Size(127, 23);
|
||||
tbExposure2.Size = new Size(127, 31);
|
||||
tbExposure2.TabIndex = 3;
|
||||
//
|
||||
// label7
|
||||
@ -1029,7 +1027,7 @@
|
||||
label7.Location = new Point(15, 56);
|
||||
label7.Margin = new Padding(4, 0, 4, 0);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(36, 17);
|
||||
label7.Size = new Size(54, 25);
|
||||
label7.TabIndex = 1;
|
||||
label7.Text = "增益";
|
||||
//
|
||||
@ -1039,7 +1037,7 @@
|
||||
label8.Location = new Point(15, 24);
|
||||
label8.Margin = new Padding(4, 0, 4, 0);
|
||||
label8.Name = "label8";
|
||||
label8.Size = new Size(36, 17);
|
||||
label8.Size = new Size(54, 25);
|
||||
label8.TabIndex = 0;
|
||||
label8.Text = "曝光";
|
||||
//
|
||||
@ -1104,7 +1102,7 @@
|
||||
label1.Location = new Point(257, 18);
|
||||
label1.Margin = new Padding(4, 0, 4, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(64, 17);
|
||||
label1.Size = new Size(96, 25);
|
||||
label1.TabIndex = 2;
|
||||
label1.Text = "链接相机";
|
||||
//
|
||||
@ -1135,7 +1133,7 @@
|
||||
tbGain.Location = new Point(93, 54);
|
||||
tbGain.Margin = new Padding(4, 2, 4, 2);
|
||||
tbGain.Name = "tbGain";
|
||||
tbGain.Size = new Size(127, 23);
|
||||
tbGain.Size = new Size(127, 31);
|
||||
tbGain.TabIndex = 4;
|
||||
//
|
||||
// tbExposure
|
||||
@ -1143,7 +1141,7 @@
|
||||
tbExposure.Location = new Point(93, 22);
|
||||
tbExposure.Margin = new Padding(4, 2, 4, 2);
|
||||
tbExposure.Name = "tbExposure";
|
||||
tbExposure.Size = new Size(127, 23);
|
||||
tbExposure.Size = new Size(127, 31);
|
||||
tbExposure.TabIndex = 3;
|
||||
//
|
||||
// label2
|
||||
@ -1152,7 +1150,7 @@
|
||||
label2.Location = new Point(15, 56);
|
||||
label2.Margin = new Padding(4, 0, 4, 0);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(36, 17);
|
||||
label2.Size = new Size(54, 25);
|
||||
label2.TabIndex = 1;
|
||||
label2.Text = "增益";
|
||||
//
|
||||
@ -1162,7 +1160,7 @@
|
||||
label4.Location = new Point(15, 24);
|
||||
label4.Margin = new Padding(4, 0, 4, 0);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(36, 17);
|
||||
label4.Size = new Size(54, 25);
|
||||
label4.TabIndex = 0;
|
||||
label4.Text = "曝光";
|
||||
//
|
||||
@ -1177,17 +1175,17 @@
|
||||
tabControl1.Margin = new Padding(4, 2, 4, 2);
|
||||
tabControl1.Name = "tabControl1";
|
||||
tabControl1.SelectedIndex = 0;
|
||||
tabControl1.Size = new Size(1284, 930);
|
||||
tabControl1.Size = new Size(1284, 853);
|
||||
tabControl1.TabIndex = 0;
|
||||
tabControl1.SelectedIndexChanged += tabControl1_SelectedIndexChanged;
|
||||
//
|
||||
// tabPage5
|
||||
//
|
||||
tabPage5.Controls.Add(panel4);
|
||||
tabPage5.Location = new Point(4, 26);
|
||||
tabPage5.Location = new Point(4, 34);
|
||||
tabPage5.Margin = new Padding(4, 2, 4, 2);
|
||||
tabPage5.Name = "tabPage5";
|
||||
tabPage5.Size = new Size(1276, 900);
|
||||
tabPage5.Size = new Size(1276, 815);
|
||||
tabPage5.TabIndex = 3;
|
||||
tabPage5.Text = "流程";
|
||||
tabPage5.UseVisualStyleBackColor = true;
|
||||
@ -1199,7 +1197,7 @@
|
||||
panel4.Location = new Point(0, 0);
|
||||
panel4.Margin = new Padding(4, 2, 4, 2);
|
||||
panel4.Name = "panel4";
|
||||
panel4.Size = new Size(1276, 900);
|
||||
panel4.Size = new Size(1276, 815);
|
||||
panel4.TabIndex = 0;
|
||||
//
|
||||
// panel5
|
||||
@ -1212,13 +1210,11 @@
|
||||
panel5.Location = new Point(0, 0);
|
||||
panel5.Margin = new Padding(4, 2, 4, 2);
|
||||
panel5.Name = "panel5";
|
||||
panel5.Size = new Size(1276, 820);
|
||||
panel5.Size = new Size(1276, 821);
|
||||
panel5.TabIndex = 0;
|
||||
//
|
||||
// groupBox9
|
||||
//
|
||||
groupBox9.Controls.Add(label38);
|
||||
groupBox9.Controls.Add(statusButton);
|
||||
groupBox9.Controls.Add(DevNameCombo);
|
||||
groupBox9.Controls.Add(ScanDevList);
|
||||
groupBox9.Location = new Point(8, 16);
|
||||
@ -1229,40 +1225,21 @@
|
||||
groupBox9.Text = "设备状态";
|
||||
groupBox9.Enter += groupBox9_Enter;
|
||||
//
|
||||
// label38
|
||||
//
|
||||
label38.AutoSize = true;
|
||||
label38.Location = new Point(272, 36);
|
||||
label38.Margin = new Padding(4, 0, 4, 0);
|
||||
label38.Name = "label38";
|
||||
label38.Size = new Size(64, 17);
|
||||
label38.TabIndex = 26;
|
||||
label38.Text = "设备状态";
|
||||
label38.Click += label38_Click;
|
||||
//
|
||||
// statusButton
|
||||
//
|
||||
statusButton.Location = new Point(367, 22);
|
||||
statusButton.Name = "statusButton";
|
||||
statusButton.Size = new Size(98, 46);
|
||||
statusButton.TabIndex = 3;
|
||||
statusButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// DevNameCombo
|
||||
//
|
||||
DevNameCombo.FormattingEnabled = true;
|
||||
DevNameCombo.Location = new Point(8, 33);
|
||||
DevNameCombo.Margin = new Padding(4, 2, 4, 2);
|
||||
DevNameCombo.Name = "DevNameCombo";
|
||||
DevNameCombo.Size = new Size(161, 25);
|
||||
DevNameCombo.Size = new Size(524, 33);
|
||||
DevNameCombo.TabIndex = 1;
|
||||
//
|
||||
// ScanDevList
|
||||
//
|
||||
ScanDevList.Location = new Point(557, 22);
|
||||
ScanDevList.Location = new Point(557, 33);
|
||||
ScanDevList.Margin = new Padding(4, 2, 4, 2);
|
||||
ScanDevList.Name = "ScanDevList";
|
||||
ScanDevList.Size = new Size(94, 46);
|
||||
ScanDevList.Size = new Size(94, 35);
|
||||
ScanDevList.TabIndex = 2;
|
||||
ScanDevList.Text = "Scan";
|
||||
ScanDevList.UseVisualStyleBackColor = true;
|
||||
@ -1423,19 +1400,19 @@
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
textBox4.Location = new Point(463, 93);
|
||||
textBox4.Location = new Point(529, 93);
|
||||
textBox4.Margin = new Padding(4, 2, 4, 2);
|
||||
textBox4.Name = "textBox4";
|
||||
textBox4.ReadOnly = true;
|
||||
textBox4.Size = new Size(67, 23);
|
||||
textBox4.Size = new Size(67, 31);
|
||||
textBox4.TabIndex = 18;
|
||||
//
|
||||
// label36
|
||||
//
|
||||
label36.AutoSize = true;
|
||||
label36.Location = new Point(392, 93);
|
||||
label36.Location = new Point(426, 99);
|
||||
label36.Name = "label36";
|
||||
label36.Size = new Size(64, 17);
|
||||
label36.Size = new Size(96, 25);
|
||||
label36.TabIndex = 17;
|
||||
label36.Text = "机身倾斜";
|
||||
//
|
||||
@ -1446,7 +1423,7 @@
|
||||
label26.Location = new Point(42, 262);
|
||||
label26.Margin = new Padding(4, 0, 4, 0);
|
||||
label26.Name = "label26";
|
||||
label26.Size = new Size(133, 30);
|
||||
label26.Size = new Size(195, 44);
|
||||
label26.TabIndex = 16;
|
||||
label26.Text = "检测结果";
|
||||
//
|
||||
@ -1456,37 +1433,37 @@
|
||||
label18.Location = new Point(7, 67);
|
||||
label18.Margin = new Padding(4, 0, 4, 0);
|
||||
label18.Name = "label18";
|
||||
label18.Size = new Size(64, 17);
|
||||
label18.Size = new Size(96, 25);
|
||||
label18.TabIndex = 5;
|
||||
label18.Text = "总产量数";
|
||||
label18.Click += label18_Click;
|
||||
//
|
||||
// AllDSum
|
||||
//
|
||||
AllDSum.Location = new Point(86, 64);
|
||||
AllDSum.Location = new Point(111, 64);
|
||||
AllDSum.Margin = new Padding(4, 2, 4, 2);
|
||||
AllDSum.Name = "AllDSum";
|
||||
AllDSum.ReadOnly = true;
|
||||
AllDSum.Size = new Size(64, 23);
|
||||
AllDSum.Size = new Size(74, 31);
|
||||
AllDSum.TabIndex = 6;
|
||||
//
|
||||
// label19
|
||||
//
|
||||
label19.AutoSize = true;
|
||||
label19.Location = new Point(173, 93);
|
||||
label19.Location = new Point(205, 96);
|
||||
label19.Margin = new Padding(4, 0, 4, 0);
|
||||
label19.Name = "label19";
|
||||
label19.Size = new Size(71, 17);
|
||||
label19.Size = new Size(106, 25);
|
||||
label19.TabIndex = 7;
|
||||
label19.Text = "NG产品数";
|
||||
//
|
||||
// NGDNum
|
||||
//
|
||||
NGDNum.Location = new Point(265, 90);
|
||||
NGDNum.Location = new Point(331, 96);
|
||||
NGDNum.Margin = new Padding(4, 2, 4, 2);
|
||||
NGDNum.Name = "NGDNum";
|
||||
NGDNum.ReadOnly = true;
|
||||
NGDNum.Size = new Size(76, 23);
|
||||
NGDNum.Size = new Size(76, 31);
|
||||
NGDNum.TabIndex = 8;
|
||||
//
|
||||
// OKOrNGShow
|
||||
@ -1501,38 +1478,38 @@
|
||||
//
|
||||
// OKDNum
|
||||
//
|
||||
OKDNum.Location = new Point(265, 41);
|
||||
OKDNum.Location = new Point(331, 35);
|
||||
OKDNum.Margin = new Padding(4, 2, 4, 2);
|
||||
OKDNum.Name = "OKDNum";
|
||||
OKDNum.ReadOnly = true;
|
||||
OKDNum.Size = new Size(76, 23);
|
||||
OKDNum.Size = new Size(76, 31);
|
||||
OKDNum.TabIndex = 10;
|
||||
//
|
||||
// label20
|
||||
//
|
||||
label20.AutoSize = true;
|
||||
label20.Location = new Point(173, 41);
|
||||
label20.Location = new Point(206, 41);
|
||||
label20.Margin = new Padding(4, 0, 4, 0);
|
||||
label20.Name = "label20";
|
||||
label20.Size = new Size(70, 17);
|
||||
label20.Size = new Size(105, 25);
|
||||
label20.TabIndex = 9;
|
||||
label20.Text = "OK产品数";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
textBox1.Location = new Point(463, 41);
|
||||
textBox1.Location = new Point(529, 42);
|
||||
textBox1.Margin = new Padding(4, 2, 4, 2);
|
||||
textBox1.Name = "textBox1";
|
||||
textBox1.ReadOnly = true;
|
||||
textBox1.Size = new Size(67, 23);
|
||||
textBox1.Size = new Size(67, 31);
|
||||
textBox1.TabIndex = 15;
|
||||
//
|
||||
// label35
|
||||
//
|
||||
label35.AutoSize = true;
|
||||
label35.Location = new Point(392, 44);
|
||||
label35.Location = new Point(426, 45);
|
||||
label35.Name = "label35";
|
||||
label35.Size = new Size(50, 17);
|
||||
label35.Size = new Size(75, 25);
|
||||
label35.TabIndex = 14;
|
||||
label35.Text = "误检数";
|
||||
//
|
||||
@ -1638,7 +1615,7 @@
|
||||
textBox2.Margin = new Padding(4, 2, 4, 2);
|
||||
textBox2.Name = "textBox2";
|
||||
textBox2.ReadOnly = true;
|
||||
textBox2.Size = new Size(115, 23);
|
||||
textBox2.Size = new Size(115, 31);
|
||||
textBox2.TabIndex = 23;
|
||||
//
|
||||
// label37
|
||||
@ -1647,7 +1624,7 @@
|
||||
label37.Location = new Point(7, 172);
|
||||
label37.Margin = new Padding(4, 0, 4, 0);
|
||||
label37.Name = "label37";
|
||||
label37.Size = new Size(64, 17);
|
||||
label37.Size = new Size(96, 25);
|
||||
label37.TabIndex = 22;
|
||||
label37.Text = "旋钮颜色";
|
||||
label37.Click += label37_Click;
|
||||
@ -1658,7 +1635,7 @@
|
||||
textBox3.Margin = new Padding(4, 2, 4, 2);
|
||||
textBox3.Name = "textBox3";
|
||||
textBox3.ReadOnly = true;
|
||||
textBox3.Size = new Size(279, 23);
|
||||
textBox3.Size = new Size(279, 31);
|
||||
textBox3.TabIndex = 21;
|
||||
//
|
||||
// label25
|
||||
@ -1667,7 +1644,7 @@
|
||||
label25.Location = new Point(7, 110);
|
||||
label25.Margin = new Padding(4, 0, 4, 0);
|
||||
label25.Name = "label25";
|
||||
label25.Size = new Size(64, 17);
|
||||
label25.Size = new Size(96, 25);
|
||||
label25.TabIndex = 20;
|
||||
label25.Text = "产品型号";
|
||||
label25.Click += label25_Click;
|
||||
@ -1678,7 +1655,7 @@
|
||||
label24.Location = new Point(7, 40);
|
||||
label24.Margin = new Padding(4, 0, 4, 0);
|
||||
label24.Name = "label24";
|
||||
label24.Size = new Size(64, 17);
|
||||
label24.Size = new Size(96, 25);
|
||||
label24.TabIndex = 19;
|
||||
label24.Text = "产品条码";
|
||||
label24.Click += label24_Click;
|
||||
@ -1689,7 +1666,7 @@
|
||||
ScannerBox.Margin = new Padding(4, 2, 4, 2);
|
||||
ScannerBox.Name = "ScannerBox";
|
||||
ScannerBox.ReadOnly = true;
|
||||
ScannerBox.Size = new Size(279, 23);
|
||||
ScannerBox.Size = new Size(279, 31);
|
||||
ScannerBox.TabIndex = 18;
|
||||
//
|
||||
// linkLabel1
|
||||
@ -1697,16 +1674,16 @@
|
||||
linkLabel1.AutoSize = true;
|
||||
linkLabel1.Location = new Point(161, 387);
|
||||
linkLabel1.Name = "linkLabel1";
|
||||
linkLabel1.Size = new Size(0, 17);
|
||||
linkLabel1.Size = new Size(0, 25);
|
||||
linkLabel1.TabIndex = 21;
|
||||
//
|
||||
// tabPage3
|
||||
//
|
||||
tabPage3.Controls.Add(panel2);
|
||||
tabPage3.Location = new Point(4, 26);
|
||||
tabPage3.Location = new Point(4, 34);
|
||||
tabPage3.Margin = new Padding(4, 2, 4, 2);
|
||||
tabPage3.Name = "tabPage3";
|
||||
tabPage3.Size = new Size(1276, 900);
|
||||
tabPage3.Size = new Size(1276, 815);
|
||||
tabPage3.TabIndex = 4;
|
||||
tabPage3.Text = "录入新型号";
|
||||
tabPage3.UseVisualStyleBackColor = true;
|
||||
@ -1742,7 +1719,7 @@
|
||||
panel2.Location = new Point(0, 2);
|
||||
panel2.Margin = new Padding(4, 2, 4, 2);
|
||||
panel2.Name = "panel2";
|
||||
panel2.Size = new Size(1630, 925);
|
||||
panel2.Size = new Size(1630, 717);
|
||||
panel2.TabIndex = 1;
|
||||
panel2.Paint += panel2_Paint;
|
||||
//
|
||||
@ -1772,7 +1749,7 @@
|
||||
WhiteBanCbx.Location = new Point(867, 146);
|
||||
WhiteBanCbx.Margin = new Padding(4, 2, 4, 2);
|
||||
WhiteBanCbx.Name = "WhiteBanCbx";
|
||||
WhiteBanCbx.Size = new Size(41, 21);
|
||||
WhiteBanCbx.Size = new Size(59, 29);
|
||||
WhiteBanCbx.TabIndex = 40;
|
||||
WhiteBanCbx.Text = "是";
|
||||
WhiteBanCbx.UseVisualStyleBackColor = true;
|
||||
@ -1783,7 +1760,7 @@
|
||||
label33.Location = new Point(596, 147);
|
||||
label33.Margin = new Padding(4, 0, 4, 0);
|
||||
label33.Name = "label33";
|
||||
label33.Size = new Size(162, 17);
|
||||
label33.Size = new Size(243, 25);
|
||||
label33.TabIndex = 39;
|
||||
label33.Text = "面板第二块区域是白板吗";
|
||||
//
|
||||
@ -1793,7 +1770,7 @@
|
||||
label28.Location = new Point(23, 187);
|
||||
label28.Margin = new Padding(4, 0, 4, 0);
|
||||
label28.Name = "label28";
|
||||
label28.Size = new Size(101, 17);
|
||||
label28.Size = new Size(151, 25);
|
||||
label28.TabIndex = 14;
|
||||
label28.Text = "第一次拍照Z轴";
|
||||
//
|
||||
@ -1813,7 +1790,7 @@
|
||||
modelChangeCbx.Location = new Point(750, 14);
|
||||
modelChangeCbx.Margin = new Padding(4, 2, 4, 2);
|
||||
modelChangeCbx.Name = "modelChangeCbx";
|
||||
modelChangeCbx.Size = new Size(241, 23);
|
||||
modelChangeCbx.Size = new Size(241, 31);
|
||||
modelChangeCbx.TabIndex = 34;
|
||||
modelChangeCbx.Text = "D:\\Hisence\\config\\chinese.json";
|
||||
//
|
||||
@ -1823,7 +1800,7 @@
|
||||
label34.Location = new Point(597, 14);
|
||||
label34.Margin = new Padding(4, 0, 4, 0);
|
||||
label34.Name = "label34";
|
||||
label34.Size = new Size(92, 17);
|
||||
label34.Size = new Size(138, 25);
|
||||
label34.TabIndex = 33;
|
||||
label34.Text = "面板语言选择";
|
||||
//
|
||||
@ -1854,7 +1831,7 @@
|
||||
Cam2MatCbx.Location = new Point(750, 111);
|
||||
Cam2MatCbx.Margin = new Padding(4, 2, 4, 2);
|
||||
Cam2MatCbx.Name = "Cam2MatCbx";
|
||||
Cam2MatCbx.Size = new Size(279, 23);
|
||||
Cam2MatCbx.Size = new Size(279, 31);
|
||||
Cam2MatCbx.TabIndex = 29;
|
||||
Cam2MatCbx.Text = "D:\\Hisence\\类型\\Lp\\002jpg";
|
||||
//
|
||||
@ -1864,7 +1841,7 @@
|
||||
label22.Location = new Point(596, 105);
|
||||
label22.Margin = new Padding(4, 0, 4, 0);
|
||||
label22.Name = "label22";
|
||||
label22.Size = new Size(92, 17);
|
||||
label22.Size = new Size(138, 25);
|
||||
label22.TabIndex = 28;
|
||||
label22.Text = "面板第二张图";
|
||||
//
|
||||
@ -1873,7 +1850,7 @@
|
||||
Cam1MatCbx.Location = new Point(750, 59);
|
||||
Cam1MatCbx.Margin = new Padding(4, 2, 4, 2);
|
||||
Cam1MatCbx.Name = "Cam1MatCbx";
|
||||
Cam1MatCbx.Size = new Size(279, 23);
|
||||
Cam1MatCbx.Size = new Size(279, 31);
|
||||
Cam1MatCbx.TabIndex = 27;
|
||||
Cam1MatCbx.Text = "D:\\Hisence\\类型\\Lp\\001.jpg";
|
||||
//
|
||||
@ -1883,7 +1860,7 @@
|
||||
label23.Location = new Point(597, 62);
|
||||
label23.Margin = new Padding(4, 0, 4, 0);
|
||||
label23.Name = "label23";
|
||||
label23.Size = new Size(92, 17);
|
||||
label23.Size = new Size(138, 25);
|
||||
label23.TabIndex = 26;
|
||||
label23.Text = "面板第一张图";
|
||||
//
|
||||
@ -1914,7 +1891,7 @@
|
||||
moveZbox.Location = new Point(183, 184);
|
||||
moveZbox.Margin = new Padding(4, 2, 4, 2);
|
||||
moveZbox.Name = "moveZbox";
|
||||
moveZbox.Size = new Size(287, 23);
|
||||
moveZbox.Size = new Size(287, 31);
|
||||
moveZbox.TabIndex = 15;
|
||||
moveZbox.Text = "0";
|
||||
//
|
||||
@ -1923,7 +1900,7 @@
|
||||
moveYbox.Location = new Point(183, 141);
|
||||
moveYbox.Margin = new Padding(4, 2, 4, 2);
|
||||
moveYbox.Name = "moveYbox";
|
||||
moveYbox.Size = new Size(287, 23);
|
||||
moveYbox.Size = new Size(287, 31);
|
||||
moveYbox.TabIndex = 13;
|
||||
moveYbox.Text = "0";
|
||||
//
|
||||
@ -1933,7 +1910,7 @@
|
||||
label29.Location = new Point(22, 143);
|
||||
label29.Margin = new Padding(4, 0, 4, 0);
|
||||
label29.Name = "label29";
|
||||
label29.Size = new Size(101, 17);
|
||||
label29.Size = new Size(153, 25);
|
||||
label29.TabIndex = 12;
|
||||
label29.Text = "第一次拍照Y轴";
|
||||
//
|
||||
@ -1942,7 +1919,7 @@
|
||||
moveXbox.Location = new Point(182, 101);
|
||||
moveXbox.Margin = new Padding(4, 2, 4, 2);
|
||||
moveXbox.Name = "moveXbox";
|
||||
moveXbox.Size = new Size(287, 23);
|
||||
moveXbox.Size = new Size(287, 31);
|
||||
moveXbox.TabIndex = 11;
|
||||
moveXbox.Text = "8974";
|
||||
//
|
||||
@ -1952,7 +1929,7 @@
|
||||
label30.Location = new Point(22, 104);
|
||||
label30.Margin = new Padding(4, 0, 4, 0);
|
||||
label30.Name = "label30";
|
||||
label30.Size = new Size(101, 17);
|
||||
label30.Size = new Size(152, 25);
|
||||
label30.TabIndex = 10;
|
||||
label30.Text = "第一次拍照X轴";
|
||||
//
|
||||
@ -1961,7 +1938,7 @@
|
||||
OcrBarBox.Location = new Point(183, 56);
|
||||
OcrBarBox.Margin = new Padding(4, 2, 4, 2);
|
||||
OcrBarBox.Name = "OcrBarBox";
|
||||
OcrBarBox.Size = new Size(287, 23);
|
||||
OcrBarBox.Size = new Size(287, 31);
|
||||
OcrBarBox.TabIndex = 5;
|
||||
OcrBarBox.Text = "1234567890";
|
||||
//
|
||||
@ -1971,7 +1948,7 @@
|
||||
label31.Location = new Point(23, 59);
|
||||
label31.Margin = new Padding(4, 0, 4, 0);
|
||||
label31.Name = "label31";
|
||||
label31.Size = new Size(27, 17);
|
||||
label31.Size = new Size(41, 25);
|
||||
label31.TabIndex = 4;
|
||||
label31.Text = "SN";
|
||||
//
|
||||
@ -1980,7 +1957,7 @@
|
||||
TypeBox.Location = new Point(183, 14);
|
||||
TypeBox.Margin = new Padding(4, 2, 4, 2);
|
||||
TypeBox.Name = "TypeBox";
|
||||
TypeBox.Size = new Size(287, 23);
|
||||
TypeBox.Size = new Size(287, 31);
|
||||
TypeBox.TabIndex = 3;
|
||||
TypeBox.Text = "1";
|
||||
//
|
||||
@ -2001,7 +1978,7 @@
|
||||
label32.Location = new Point(18, 17);
|
||||
label32.Margin = new Padding(4, 0, 4, 0);
|
||||
label32.Name = "label32";
|
||||
label32.Size = new Size(36, 17);
|
||||
label32.Size = new Size(54, 25);
|
||||
label32.TabIndex = 1;
|
||||
label32.Text = "类型";
|
||||
//
|
||||
@ -2022,16 +1999,16 @@
|
||||
richTextBox1.Location = new Point(0, 844);
|
||||
richTextBox1.Margin = new Padding(4, 2, 4, 2);
|
||||
richTextBox1.Name = "richTextBox1";
|
||||
richTextBox1.Size = new Size(1284, 161);
|
||||
richTextBox1.Size = new Size(1284, 109);
|
||||
richTextBox1.TabIndex = 1;
|
||||
richTextBox1.Text = "";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 17F);
|
||||
AutoScaleDimensions = new SizeF(12F, 25F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = SystemColors.ActiveCaption;
|
||||
ClientSize = new Size(1284, 1005);
|
||||
ClientSize = new Size(1284, 953);
|
||||
Controls.Add(richTextBox1);
|
||||
Controls.Add(tabControl1);
|
||||
Font = new Font("Microsoft Sans Serif", 10.5F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
@ -2060,7 +2037,6 @@
|
||||
panel5.ResumeLayout(false);
|
||||
panel5.PerformLayout();
|
||||
groupBox9.ResumeLayout(false);
|
||||
groupBox9.PerformLayout();
|
||||
groupBox2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)originMatShow).EndInit();
|
||||
@ -2266,8 +2242,5 @@
|
||||
private Button button4;
|
||||
private Button button5;
|
||||
private Button button6;
|
||||
private Label label38;
|
||||
private Button button7;
|
||||
private Button statusButton;
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ namespace HisenceYoloDetection
|
||||
ManualResetEvent _runHandleAfter = new ManualResetEvent(false);
|
||||
AutoResetEvent _runThreadFormtype = new AutoResetEvent(false);
|
||||
bool PLC545 = false;
|
||||
private const string CorrectPassword = "628628";
|
||||
private const string CorrectPassword = "12345";
|
||||
|
||||
bool PLC548 = false;
|
||||
string m_sKEYENCEBar;
|
||||
@ -912,8 +912,7 @@ namespace HisenceYoloDetection
|
||||
meachineState = MeachineState.machine_opening;//状态机设置成OPen
|
||||
DataSet dataSet = SQLiteHelper.Query("select * from XK_HisenceDet");
|
||||
//dataGridView1.DataSource = dataSet.Tables[0];
|
||||
statusButton.BackColor = Color.Red; // 设备停止
|
||||
statusButton.Text = "停止"; // 更新文本
|
||||
|
||||
Cam1.Start("Cam1");
|
||||
if (Cam1.IfSuccess)
|
||||
{
|
||||
@ -1316,6 +1315,15 @@ namespace HisenceYoloDetection
|
||||
textBox3.Text = OcrBar;
|
||||
|
||||
}));
|
||||
//myLog("扫码器结果" + m_sKEYENCEBar, DateTime.Now);
|
||||
//#if false
|
||||
//是否给Pos请求加上时间超时
|
||||
|
||||
//#else
|
||||
// OcrBar = "OZ.洗衣机.WF3G7014-NVW001CZA.WSG374A.白";
|
||||
//#endif
|
||||
// if(Oldm_sKEYENCEBar!= m_sKEYENCEBar)
|
||||
|
||||
|
||||
if (OcrBar.IsNullOrEmpty())
|
||||
{
|
||||
@ -1325,8 +1333,18 @@ namespace HisenceYoloDetection
|
||||
xKNow = GetModeFromBar(OcrBar);//从数据库中查询到这个条码的四轴的值
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//if (Regex.IsMatch(xKNow.MoveX.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveY.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveZ.ToString(), @"^[0-9]+$"))
|
||||
//{
|
||||
|
||||
// // myLog("型号匹配成功" + xKNow.OcrBar, DateTime.Now);
|
||||
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
// Thread.Sleep(2);
|
||||
bBar = false;
|
||||
#if true
|
||||
|
||||
@ -1338,7 +1356,7 @@ namespace HisenceYoloDetection
|
||||
|
||||
myLog("第一次采集图像", DateTime.Now);
|
||||
//移动模组 读三次测距的地址 看是否往前移动
|
||||
MoveToP(7815, YPos, ZPos);
|
||||
MoveToP(5815, YPos, ZPos);
|
||||
// Thread.Sleep(2000);//删
|
||||
|
||||
|
||||
@ -1358,15 +1376,34 @@ namespace HisenceYoloDetection
|
||||
double dismove = disreal - 876;
|
||||
if (dismove > -4000 && dismove < 4000)
|
||||
{
|
||||
MoveToP(7815, YPos, ZPos + (int)(dismove));
|
||||
MoveToP(5815, YPos, ZPos + (int)(dismove));
|
||||
}
|
||||
|
||||
Cam1.SnapshotCount = 0;
|
||||
Cam1.Snapshot();
|
||||
|
||||
//Cam2.SnapshotCount = 0;
|
||||
//Cam2.Snapshot();
|
||||
//myLog("第二次采集图像", DateTime.Now);
|
||||
|
||||
MoveToP(7815, YPos, ZPos);
|
||||
//if (xKNow != null)
|
||||
//{
|
||||
// MoveToP(xKNow.MoveTwoX, xKNow.MoveTwoY, xKNow.MoveTwoZ);
|
||||
//}
|
||||
|
||||
// MoveToP(51043, YPos, ZPos + (int)(dismove));
|
||||
//Cam1.Snapshot();
|
||||
MoveToP(5815, YPos, ZPos);
|
||||
//melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||
|
||||
|
||||
|
||||
//Thread.Sleep(1000);//洗衣机可能过不去
|
||||
|
||||
//if (xKNow != null)
|
||||
//{
|
||||
// MoveToP(xKNow.MoveX, xKNow.MoveY, xKNow.MoveZ);
|
||||
//}
|
||||
myLog("采集图像成功", DateTime.Now);
|
||||
//模组复位
|
||||
|
||||
@ -1518,11 +1555,11 @@ namespace HisenceYoloDetection
|
||||
//originMatShow2.Image = cameraMat.ToBitmap();
|
||||
|
||||
}
|
||||
string SN = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 1);
|
||||
string pathfile = fitImageFolder + SN + ".jpg";
|
||||
|
||||
string pathfile = fitImageFolder + m_sKEYENCEBar + ".jpg";
|
||||
//CamShow1.ImaMAt = cameraMat;
|
||||
cameraMat.ImWrite(pathfile);
|
||||
|
||||
CheckDiffSciHelper1.ResizeImage(pathfile, pathfile, 640, 480, 75);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -1552,10 +1589,27 @@ namespace HisenceYoloDetection
|
||||
{
|
||||
//信号量阻塞 使其不在总数增加和闪烁
|
||||
_runHandleAfter.WaitOne();
|
||||
//melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||
//2第一次拍照
|
||||
//if (IfCam2Triger)
|
||||
//{
|
||||
|
||||
//根据条码数据库比对
|
||||
_runHandleAfter.Reset();
|
||||
//if (xKNow == null)
|
||||
//{
|
||||
// myLog("未匹配条码", DateTime.Now);
|
||||
// break;
|
||||
//}
|
||||
|
||||
//if (xKNow.OcrBar == null)
|
||||
//{
|
||||
// myLog("未匹配成功" + xKNow.OcrBar, DateTime.Now);
|
||||
// myLog("开始插入模板", DateTime.Now);
|
||||
// Insert_auto(true, Cam1ImgOne, m_sKEYENCEBar, 8974, 0, 0);
|
||||
|
||||
// break;
|
||||
//}
|
||||
|
||||
|
||||
if (m_sKEYENCEBar != null)
|
||||
@ -1564,44 +1618,15 @@ namespace HisenceYoloDetection
|
||||
{
|
||||
myLog("数据库没有条码匹配" + m_sKEYENCEBar, DateTime.Now);
|
||||
myLog("开始插入模板", DateTime.Now);
|
||||
DialogResult result = MessageBox.Show("是否插入新型号", "选择操作", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
|
||||
//插入提示
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);//红灯
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 1);//报警
|
||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//黄灯
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//绿灯
|
||||
if (result == DialogResult.Yes)
|
||||
Insert_auto(true, Cam1ImgOne, m_sKEYENCEBar, 8974, 0, 0);
|
||||
Thread.Sleep(2000);
|
||||
OcrBar = FormBarType(m_sKEYENCEBar);
|
||||
xKNow = GetModeFromBar(OcrBar); // 重新获取
|
||||
if (xKNow != null)
|
||||
{
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||
Insert_auto(true, Cam1ImgOne, m_sKEYENCEBar, 8974, 0, 0);
|
||||
Thread.Sleep(2000);
|
||||
OcrBar = FormBarType(m_sKEYENCEBar);
|
||||
xKNow = GetModeFromBar(OcrBar); // 重新获取
|
||||
if (xKNow != null)
|
||||
{
|
||||
myLog("插入模板成功!", DateTime.Now);
|
||||
}
|
||||
// 用户选择了“是”
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
myLog("插入模板成功!", DateTime.Now);
|
||||
|
||||
}
|
||||
else if (result == DialogResult.No)
|
||||
{
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||
myLog("这台洗衣机无法当作模板!", DateTime.Now);
|
||||
continue;
|
||||
|
||||
// 用户选择了“否”
|
||||
// 在这里执行相应的操作
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1675,11 +1700,8 @@ namespace HisenceYoloDetection
|
||||
|
||||
if (mL.ResultMap != null)
|
||||
{
|
||||
string SN = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 1);
|
||||
string filepath = "D://rect//" + SN + "result.jpg";
|
||||
mL.ResultMap.Save(filepath);
|
||||
mL.ResultMap.Save("D://cam1//" + m_sKEYENCEBar + "result.jpg");
|
||||
ResultMatShow.Image = mL.ResultMap;
|
||||
CheckDiffSciHelper1.ResizeImage(filepath, filepath, 640, 480, 75);
|
||||
|
||||
}
|
||||
|
||||
@ -1726,11 +1748,8 @@ namespace HisenceYoloDetection
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
bool isSucess= InsertSqlRunDataButton(ref keyValueResult, false, ref mResultCut, mL, mLButton, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListOne, ref strMatFuzzyListOne, ref paddleOcrModel);
|
||||
if(isSucess)
|
||||
{
|
||||
MatchStr = false;
|
||||
}
|
||||
InsertSqlRunDataButton(ref keyValueResult, false, ref mResultCut, mL, mLButton, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListOne, ref strMatFuzzyListOne, ref paddleOcrModel);
|
||||
|
||||
|
||||
// InsertSqlRunData(ref keyValueResult2, false, ref mResultCut2, mL2, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListTwo, ref strMatFuzzyListTwo, ref paddleOcrModel);
|
||||
sw.Stop();
|
||||
@ -1778,48 +1797,48 @@ namespace HisenceYoloDetection
|
||||
else
|
||||
{
|
||||
|
||||
//melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);//红灯
|
||||
//melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//黄灯
|
||||
//melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//绿灯
|
||||
//melsecPLCTCPDriver.WriteInt(WaringAdress, 1);//报警
|
||||
NGDsums++;
|
||||
myLog("匹配失败", DateTime.Now);
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);//红灯
|
||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//黄灯
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//绿灯
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 1);//报警
|
||||
|
||||
this.Invoke(new Action(() =>
|
||||
|
||||
|
||||
//加上人为判断是否是NG洗衣机
|
||||
DialogResult dr = MessageBox.Show("是否误检?", "是否误检", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
OKOrNGShow.Image = NGbitmap;
|
||||
}));
|
||||
|
||||
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||
OKDsums++;
|
||||
WUsums++;
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
double percent = (double)WUsums / AllDsums;
|
||||
string percentText = percent.ToString("0.0%");//最后percentText的值为10.0%
|
||||
textBox1.Text = percentText;
|
||||
OKOrNGShow.Image = OKbitmap;
|
||||
}));
|
||||
myLog("匹配失败", DateTime.Now);
|
||||
}
|
||||
else
|
||||
{
|
||||
NGDsums++;
|
||||
|
||||
////加上人为判断是否是NG洗衣机
|
||||
//DialogResult dr = MessageBox.Show("是否误检?", "是否误检", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
||||
//if (dr == DialogResult.OK)
|
||||
//{
|
||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||
|
||||
// melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||
// melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||
// melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||
// melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||
// OKDsums++;
|
||||
// WUsums++;
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// double percent = (double)WUsums / AllDsums;
|
||||
// string percentText = percent.ToString("0.0%");//最后percentText的值为10.0%
|
||||
// textBox1.Text = percentText;
|
||||
// OKOrNGShow.Image = OKbitmap;
|
||||
// }));
|
||||
// myLog("匹配失败", DateTime.Now);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
|
||||
// myLog("匹配成功", DateTime.Now);
|
||||
//}
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
OKOrNGShow.Image = NGbitmap;
|
||||
}));
|
||||
myLog("匹配成功", DateTime.Now);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1923,7 +1942,6 @@ namespace HisenceYoloDetection
|
||||
{
|
||||
m_sKEYENCEBar = string.Empty;
|
||||
m_sKEYENCEBar = System.Text.Encoding.UTF8.GetString(data);
|
||||
m_sKEYENCEBar = m_sKEYENCEBar.Replace("\r", "");
|
||||
// myLog("型号Ocr" + m_sKEYENCEBar, DateTime.Now);
|
||||
_runHandleBefore.Set();
|
||||
bBar = true;
|
||||
@ -2102,7 +2120,7 @@ namespace HisenceYoloDetection
|
||||
}
|
||||
|
||||
|
||||
int i_start = 0;
|
||||
|
||||
private void StartDecBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -2122,21 +2140,15 @@ namespace HisenceYoloDetection
|
||||
|
||||
//CheckDiffSciHelper1.CheckDiffSci(path2, pathmat, rect2, rect2, false, "D://Hisence//test2");
|
||||
|
||||
statusButton.BackColor = Color.Green; // 设备正常运行
|
||||
statusButton.Text = "运行中"; // 更新文本
|
||||
|
||||
|
||||
// OnGetBar();
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//黄灯
|
||||
|
||||
meachineState = MeachineState.machine_opening;
|
||||
if (i_start == 0)
|
||||
{
|
||||
TriggerCameral2();//光电触发拍照 根据SN获取型号 从数据库中得到块值
|
||||
ReadyDetect();//相机拍照后检测线程
|
||||
i_start = 1;
|
||||
}
|
||||
|
||||
TriggerCameral2();//光电触发拍照 根据SN获取型号 从数据库中得到块值
|
||||
ReadyDetect();//相机拍照后检测线程
|
||||
|
||||
//ThreadPost();//相机拍照后获取当日的型号
|
||||
myLog("开启流程成功", DateTime.Now);
|
||||
@ -3115,115 +3127,113 @@ namespace HisenceYoloDetection
|
||||
/// <param name="strMatList">返回的定位框的结果</param>
|
||||
/// <param name="strMatRefList"></param>
|
||||
/// <param name="IOcrModel"></param>
|
||||
public bool InsertSqlRunDataButton(ref Dictionary<string, bool> keyValueResult, bool saveimage, ref Mat currentMatC, MLResult cam1TwoML, MLResult cam1Button, ref XK_HisenceWord SQlxK_HisenceWord, ref XK_HisenceWord xK_HisenceWord, ref List<string> strMatList, ref List<string> strMatRefList, ref PaddleOcrModel IOcrModel)
|
||||
public void InsertSqlRunDataButton(ref Dictionary<string, bool> keyValueResult, bool saveimage, ref Mat currentMatC, MLResult cam1TwoML, MLResult cam1Button, ref XK_HisenceWord SQlxK_HisenceWord, ref XK_HisenceWord xK_HisenceWord, ref List<string> strMatList, ref List<string> strMatRefList, ref PaddleOcrModel IOcrModel)
|
||||
{
|
||||
#if true
|
||||
try
|
||||
//try
|
||||
//{
|
||||
// 初始化日志记录
|
||||
string filename = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
|
||||
string txtLog = "D://Hisence//" + filename + "logsMatch.log";
|
||||
using (StreamWriter sw = new StreamWriter(txtLog, true))
|
||||
{
|
||||
// 初始化日志记录
|
||||
string filename = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
|
||||
string txtLog = "D://Hisence//" + filename + "logsMatch.log";
|
||||
using (StreamWriter sw = new StreamWriter(txtLog, true))
|
||||
sw.WriteLine(filename + "\n");
|
||||
sw.Flush();
|
||||
}
|
||||
|
||||
// 克隆当前图像
|
||||
Mat mResultCut = currentMatC.Clone();
|
||||
Rect areaBlack = new Rect();
|
||||
|
||||
// 旋钮的位置
|
||||
if (cam1Button.ResultDetails.Count == 1)
|
||||
{
|
||||
int rectsx = cam1Button.ResultDetails[0].Rect.X;
|
||||
int rectsy = cam1Button.ResultDetails[0].Rect.Y;
|
||||
int rectsWidth = cam1Button.ResultDetails[0].Rect.Width;
|
||||
int rectsHeight = cam1Button.ResultDetails[0].Rect.Height;
|
||||
|
||||
// 修正旋钮位置,防止负数
|
||||
rectsx = Math.Max(rectsx, 0);
|
||||
rectsy = Math.Max(rectsy, 0);
|
||||
rectsWidth = Math.Min(rectsWidth, currentMatC.Width - rectsx);
|
||||
rectsHeight = Math.Min(rectsHeight, currentMatC.Height - rectsy);
|
||||
|
||||
areaBlack = new Rect(rectsx, rectsy, rectsWidth, rectsHeight);
|
||||
}
|
||||
|
||||
for (int i = 0; i < cam1TwoML.ResultDetails.Count; i++)
|
||||
{
|
||||
int rectsx = cam1TwoML.ResultDetails[i].Rect.X;
|
||||
int rectsy = cam1TwoML.ResultDetails[i].Rect.Y;
|
||||
int rectsWidth = cam1TwoML.ResultDetails[i].Rect.Width;
|
||||
int rectsHeight = cam1TwoML.ResultDetails[i].Rect.Height;
|
||||
|
||||
// 修正区域位置,防止负数
|
||||
rectsx = Math.Max(rectsx, 0);
|
||||
rectsy = Math.Max(rectsy, 0);
|
||||
rectsWidth = Math.Min(rectsWidth, currentMatC.Width - rectsx);
|
||||
rectsHeight = Math.Min(rectsHeight, currentMatC.Height - rectsy);
|
||||
|
||||
string blockIndex = cam1TwoML.ResultDetails[i].LabelDisplay;
|
||||
//防止按钮在最右边导致定位块识别是2 + 防止定位能效贴和第3块相同,将定位能效贴改成4
|
||||
if (keyValueResult.Keys.Contains(blockIndex))
|
||||
{
|
||||
sw.WriteLine(filename + "\n");
|
||||
sw.Flush();
|
||||
}
|
||||
|
||||
// 克隆当前图像
|
||||
Mat mResultCut = currentMatC.Clone();
|
||||
Rect areaBlack = new Rect();
|
||||
|
||||
// 旋钮的位置
|
||||
if (cam1Button.ResultDetails.Count == 1)
|
||||
{
|
||||
int rectsx = cam1Button.ResultDetails[0].Rect.X;
|
||||
int rectsy = cam1Button.ResultDetails[0].Rect.Y;
|
||||
int rectsWidth = cam1Button.ResultDetails[0].Rect.Width;
|
||||
int rectsHeight = cam1Button.ResultDetails[0].Rect.Height;
|
||||
|
||||
// 修正旋钮位置,防止负数
|
||||
rectsx = Math.Max(rectsx, 0);
|
||||
rectsy = Math.Max(rectsy, 0);
|
||||
rectsWidth = Math.Min(rectsWidth, currentMatC.Width - rectsx);
|
||||
rectsHeight = Math.Min(rectsHeight, currentMatC.Height - rectsy);
|
||||
|
||||
areaBlack = new Rect(rectsx, rectsy, rectsWidth, rectsHeight);
|
||||
}
|
||||
|
||||
for (int i = 0; i < cam1TwoML.ResultDetails.Count; i++)
|
||||
{
|
||||
int rectsx = cam1TwoML.ResultDetails[i].Rect.X;
|
||||
int rectsy = cam1TwoML.ResultDetails[i].Rect.Y;
|
||||
int rectsWidth = cam1TwoML.ResultDetails[i].Rect.Width;
|
||||
int rectsHeight = cam1TwoML.ResultDetails[i].Rect.Height;
|
||||
|
||||
// 修正区域位置,防止负数
|
||||
rectsx = Math.Max(rectsx, 0);
|
||||
rectsy = Math.Max(rectsy, 0);
|
||||
rectsWidth = Math.Min(rectsWidth, currentMatC.Width - rectsx);
|
||||
rectsHeight = Math.Min(rectsHeight, currentMatC.Height - rectsy);
|
||||
|
||||
string blockIndex = cam1TwoML.ResultDetails[i].LabelDisplay;
|
||||
//防止按钮在最右边导致定位块识别是2 + 防止定位能效贴和第3块相同,将定位能效贴改成4
|
||||
if (keyValueResult.Keys.Contains(blockIndex))
|
||||
int indexof = keyValueResult.Keys.ToList().IndexOf(blockIndex);
|
||||
int rectsxof = cam1TwoML.ResultDetails[indexof].Rect.X;
|
||||
int rectsYof = cam1TwoML.ResultDetails[indexof].Rect.Y;
|
||||
if (rectsx > rectsxof)
|
||||
{
|
||||
int indexof = keyValueResult.Keys.ToList().IndexOf(blockIndex);
|
||||
int rectsxof = cam1TwoML.ResultDetails[indexof].Rect.X;
|
||||
int rectsYof = cam1TwoML.ResultDetails[indexof].Rect.Y;
|
||||
if (rectsx > rectsxof)
|
||||
{
|
||||
blockIndex = "3";
|
||||
}
|
||||
if (rectsy > rectsYof)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
blockIndex = "3";
|
||||
}
|
||||
if (rectsy > rectsYof)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Rect area2 = new Rect(0, 0, 0, 0);
|
||||
if (blockIndex == "2") // 根据旋钮扩大范围
|
||||
{
|
||||
if ((areaBlack.X + areaBlack.Width) < (rectsx + rectsWidth))
|
||||
{
|
||||
areaBlack.X = Math.Max(areaBlack.X - rectsx, 0);
|
||||
areaBlack.Y = Math.Max(areaBlack.Y - rectsy, 0);
|
||||
areaBlack.Width = Math.Min(areaBlack.Width, currentMatC.Width - areaBlack.X);
|
||||
areaBlack.Height = Math.Min(areaBlack.Height, currentMatC.Height - areaBlack.Y);
|
||||
area2 = areaBlack;
|
||||
}
|
||||
string TwoRectStr = CheckDiffSciHelper.rectChangeStr(area2);
|
||||
xK_HisenceWord.TwoRect = TwoRectStr;
|
||||
}
|
||||
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
sw.Start();
|
||||
int extendHeight = 50;
|
||||
rectsHeight += extendHeight;
|
||||
rectsHeight = Math.Min(rectsHeight, currentMatC.Height - rectsy);
|
||||
|
||||
Rect area = new Rect(rectsx, rectsy, rectsWidth, rectsHeight);
|
||||
Mat matCut = new Mat(mResultCut, area);
|
||||
|
||||
// OCR识别裁剪图片
|
||||
MLRequest reqcut = new MLRequest();
|
||||
reqcut.currentMat = matCut.Clone();
|
||||
MLResult mLCut = paddleOcrModel.RunInference(reqcut);
|
||||
|
||||
bool blockMatchI = BlockChangeFun(saveimage, blockIndex, ref matCut, ref mLCut, ref SQlxK_HisenceWord, ref xK_HisenceWord);
|
||||
sw.Stop();
|
||||
//myLog("插入每块板需要的时间" + sw.ElapsedMilliseconds, DateTime.Now);
|
||||
|
||||
keyValueResult.Add(blockIndex, blockMatchI);
|
||||
|
||||
}
|
||||
return true;
|
||||
|
||||
Rect area2 = new Rect(0, 0, 0, 0);
|
||||
if (blockIndex == "2") // 根据旋钮扩大范围
|
||||
{
|
||||
if ((areaBlack.X + areaBlack.Width) < (rectsx + rectsWidth))
|
||||
{
|
||||
areaBlack.X = Math.Max(areaBlack.X - rectsx, 0);
|
||||
areaBlack.Y = Math.Max(areaBlack.Y - rectsy, 0);
|
||||
areaBlack.Width = Math.Min(areaBlack.Width, currentMatC.Width - areaBlack.X);
|
||||
areaBlack.Height = Math.Min(areaBlack.Height, currentMatC.Height - areaBlack.Y);
|
||||
area2 = areaBlack;
|
||||
}
|
||||
string TwoRectStr = CheckDiffSciHelper.rectChangeStr(area2);
|
||||
xK_HisenceWord.TwoRect = TwoRectStr;
|
||||
}
|
||||
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
sw.Start();
|
||||
int extendHeight = 50;
|
||||
rectsHeight += extendHeight;
|
||||
rectsHeight = Math.Min(rectsHeight, currentMatC.Height - rectsy);
|
||||
|
||||
Rect area = new Rect(rectsx, rectsy, rectsWidth, rectsHeight);
|
||||
Mat matCut = new Mat(mResultCut, area);
|
||||
|
||||
// OCR识别裁剪图片
|
||||
MLRequest reqcut = new MLRequest();
|
||||
reqcut.currentMat = matCut.Clone();
|
||||
MLResult mLCut = paddleOcrModel.RunInference(reqcut);
|
||||
|
||||
bool blockMatchI = BlockChangeFun(saveimage, blockIndex, ref matCut, ref mLCut, ref SQlxK_HisenceWord, ref xK_HisenceWord);
|
||||
sw.Stop();
|
||||
//myLog("插入每块板需要的时间" + sw.ElapsedMilliseconds, DateTime.Now);
|
||||
|
||||
keyValueResult.Add(blockIndex, blockMatchI);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
|
||||
//}
|
||||
#endif
|
||||
|
||||
|
||||
@ -3336,7 +3346,7 @@ namespace HisenceYoloDetection
|
||||
string TextWoidStr = OcrFuzzyTextInsert.Join("##"); //实际的检测字
|
||||
string SQLStr = "";//日志显示数据库的关键字
|
||||
bool juanjiMatch = false;
|
||||
string SN = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 1);
|
||||
string filenameone = m_sKEYENCEBar;
|
||||
switch (blockIndex)
|
||||
{
|
||||
case "1"://完全匹配 重量信息
|
||||
@ -3359,16 +3369,16 @@ namespace HisenceYoloDetection
|
||||
DisplayResult(mLcut);
|
||||
Defet_OnDetectionDone(mLcut.ResultMap.ToMat(), 1);
|
||||
|
||||
string Path_1 = Path.Combine("D:\\Hisence\\Test\\1\\ng", SN + "_res.png");
|
||||
string Path_1 = Path.Combine("D:\\Hisence\\Test\\1\\ng", filenameone + "_res.png");
|
||||
Cv2.ImWrite(Path_1, mLcut.ResultMap.ToMat());
|
||||
//CheckDiffSciHelper1.ResizeImage(Path_1, Path_1, 640, 480, 75);
|
||||
CheckDiffSciHelper1.ResizeImage(Path_1, Path_1, 640, 480, 75);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
OneIF = true;
|
||||
Defet_OnDetectionDone(OKMat, 1);
|
||||
string Path_2 = Path.Combine("D:\\Hisence\\Test\\1\\ok", SN + "_res.png");
|
||||
string Path_2 = Path.Combine("D:\\Hisence\\Test\\1\\ok", filenameone + "_res.png");
|
||||
Cv2.ImWrite(Path_2, OKMat);
|
||||
}
|
||||
|
||||
@ -3396,10 +3406,8 @@ namespace HisenceYoloDetection
|
||||
|
||||
Mat SqlImg = Cv2.ImRead(PathSql);
|
||||
Mat SqlBtn = GetCroppedImage(SqlImg, rectsql);
|
||||
|
||||
Mat BtnImg = GetCroppedImage(CutBlockMat, rectDet);//截取实时图像旋钮图片
|
||||
Bitmap bitmap = MatToBitmap(BtnImg);
|
||||
|
||||
pictureBox1.Image = bitmap;//展示实时旋钮图片
|
||||
Rect newRect = GetCenterCroppedRect(SqlBtn, 30);
|
||||
string color = BtnColor(SqlBtn, newRect);
|
||||
@ -3410,8 +3418,7 @@ namespace HisenceYoloDetection
|
||||
|
||||
}));
|
||||
Mat matresult = CutBlockMat.Clone();
|
||||
|
||||
juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat, ref matresult, rectsql, rectDet, iswhite, "D://Hisence//Test", SN);
|
||||
juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat, ref matresult, rectsql, rectDet, iswhite, "D://Hisence//Test", m_sKEYENCEBar);
|
||||
// juanjiMatch = true;
|
||||
|
||||
if (!OneIF1 || !juanjiMatch)
|
||||
@ -3420,10 +3427,7 @@ namespace HisenceYoloDetection
|
||||
//DisplayResult(mLcut);
|
||||
//显示错误的板
|
||||
// mLcut.ResultMap;
|
||||
DisplayResult(mLcut);
|
||||
//显示错误的板
|
||||
// mLcut.ResultMap;
|
||||
Defet_OnDetectionDone(mLcut.ResultMap.ToMat(), 2);
|
||||
Defet_OnDetectionDone(matresult, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3776,11 +3780,11 @@ namespace HisenceYoloDetection
|
||||
double averageGray = (r + g + b) / 3;
|
||||
|
||||
// 判断颜色类别
|
||||
if (averageGray < 70)
|
||||
if (averageGray < 60)
|
||||
{
|
||||
return "黑色";
|
||||
}
|
||||
else if (averageGray >= 70 && averageGray <= 150)
|
||||
else if (averageGray >= 60 && averageGray <= 150)
|
||||
{
|
||||
return "银色";
|
||||
}
|
||||
@ -3796,23 +3800,7 @@ namespace HisenceYoloDetection
|
||||
|
||||
private void HandRuningBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var passwordForm = new Form2())
|
||||
{
|
||||
if (passwordForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (passwordForm.EnteredPassword == CorrectPassword)
|
||||
{
|
||||
// 密码正确,执行相关操作
|
||||
meachineState = MeachineState.machine_closing;
|
||||
melsecPLCTCPDriver.WriteInt("550", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("密码错误!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
melsecPLCTCPDriver.WriteInt("550", 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// 软件关闭
|
||||
@ -3865,8 +3853,6 @@ namespace HisenceYoloDetection
|
||||
melsecPLCTCPDriver.WriteInt("550", 0);
|
||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
|
||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
|
||||
statusButton.BackColor = Color.Red; // 设备停止
|
||||
statusButton.Text = "停止"; // 更新文本
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3942,7 +3928,7 @@ namespace HisenceYoloDetection
|
||||
{
|
||||
try
|
||||
{
|
||||
string FolderPath = "D:\\cam1";
|
||||
string FolderPath = "D:\\Hisence\\cam1";
|
||||
// 确保文件夹路径存在
|
||||
if (System.IO.Directory.Exists(FolderPath))
|
||||
{
|
||||
@ -3981,10 +3967,5 @@ namespace HisenceYoloDetection
|
||||
MessageBox.Show($"无法打开文件夹: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void label38_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user