| | |
| | | |
| | | var distance = GetDistance(1050, 1050, listLensnumber1[k].X, listLensnumber1[k].Y); |
| | | |
| | | if (distance <= 539.87) |
| | | if (distance <= 298.022) |
| | | { |
| | | listLensnumber1[k].location = "镜头"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | else if (539.87 < distance && distance <= 777.11) |
| | | else if (298.022 < distance && distance <= 521.171) |
| | | { |
| | | listLensnumber1[k].location = "斜面"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | else if (777.11 < distance && distance <= 919.88) |
| | | { |
| | | listLensnumber1[k].location = "平面"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | //else if (777.11 < distance && distance <= 919.88) |
| | | //{ |
| | | // listLensnumber1[k].location = "平面"; |
| | | // listLensnumber1[k].R = distance; |
| | | //} |
| | | else |
| | | { |
| | | listLensnumber1[k].location = "区域外"; |
| | | listLensnumber1[k].location = "平面"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | |
| | |
| | | } |
| | | listLensnumber2[k].angle = lenAngle; |
| | | var distance = GetDistance(1050, 1050, listLensnumber2[k].X, listLensnumber2[k].Y); |
| | | if (distance <= 400) |
| | | if (distance <= 367.696) |
| | | { |
| | | listLensnumber2[k].location = "镜头"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | else if (400 < distance && distance <= 772.18) |
| | | else if (367.696 < distance && distance <= 653.911) |
| | | { |
| | | listLensnumber2[k].location = "斜面"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | else if (772.18 < distance && distance <= 873.38) |
| | | { |
| | | listLensnumber2[k].location = "平面"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | //else if (772.18 < distance && distance <= 873.38) |
| | | //{ |
| | | // listLensnumber2[k].location = "平面"; |
| | | // listLensnumber2[k].R = distance; |
| | | //} |
| | | else |
| | | { |
| | | listLensnumber2[k].location = "区域外"; |
| | | listLensnumber2[k].location = "平面"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | } |
| | |
| | | } |
| | | listLensnumber3[k].angle = lenAngle; |
| | | var distance = GetDistance(1050, 1050, listLensnumber3[k].X, listLensnumber3[k].Y); |
| | | if (distance <= 105.63) |
| | | if (distance <= 339.246) |
| | | { |
| | | listLensnumber3[k].location = "镜头"; |
| | | listLensnumber3[k].R = distance; |
| | | } |
| | | else |
| | | else if (distance < 339.246&&distance<=520.584) |
| | | { |
| | | listLensnumber3[k].location = "斜面"; |
| | | listLensnumber3[k].R = distance; |
| | | } |
| | | else |
| | | { |
| | | listLensnumber3[k].location = "平面"; |
| | | listLensnumber3[k].R = distance; |
| | | } |
| | | } |
| | |
| | | } |
| | | listLensnumber4[k].angle = lenAngle; |
| | | var distance = GetDistance(1050, 1050, listLensnumber4[k].X, listLensnumber4[k].Y); |
| | | if (distance <= 339.88) |
| | | if (distance <= 104.895) |
| | | { |
| | | listLensnumber4[k].location = "镜头"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | else if (339.88 < distance && distance <= 547.02) |
| | | else if (104.895 < distance && distance <= 239.48) |
| | | { |
| | | listLensnumber4[k].location = "斜面"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | else if (547.02 < distance && distance <= 614.73) |
| | | { |
| | | listLensnumber4[k].location = "平面"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | //else if (547.02 < distance && distance <= 614.73) |
| | | //{ |
| | | // listLensnumber4[k].location = "平面"; |
| | | // listLensnumber4[k].R = distance; |
| | | //} |
| | | else |
| | | { |
| | | listLensnumber4[k].location = "区域外"; |
| | | listLensnumber4[k].location = "平面"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | } |
| | |
| | | listLensnumber1[k].angle = lenAngle; |
| | | |
| | | var distance = GetDistance(1050, 1050, listLensnumber1[k].X, listLensnumber1[k].Y); |
| | | |
| | | if (distance <= 539.87) |
| | | if (distance <= 298.022) |
| | | { |
| | | listLensnumber1[k].location = "镜头"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | else if (539.87 < distance && distance <= 777.11) |
| | | else if (298.022 < distance && distance <= 521.171) |
| | | { |
| | | listLensnumber1[k].location = "斜面"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | else if (777.11 < distance && distance <= 919.88) |
| | | { |
| | | listLensnumber1[k].location = "平面"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | //else if (777.11 < distance && distance <= 919.88) |
| | | //{ |
| | | // listLensnumber1[k].location = "平面"; |
| | | // listLensnumber1[k].R = distance; |
| | | //} |
| | | else |
| | | { |
| | | listLensnumber1[k].location = "区域外"; |
| | | listLensnumber1[k].location = "平面"; |
| | | listLensnumber1[k].R = distance; |
| | | } |
| | | |
| | |
| | | } |
| | | listLensnumber2[k].angle = lenAngle; |
| | | var distance = GetDistance(1050, 1050, listLensnumber2[k].X, listLensnumber2[k].Y); |
| | | if (distance <= 400) |
| | | if (distance <= 367.696) |
| | | { |
| | | listLensnumber2[k].location = "镜头"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | else if (400 < distance && distance <= 772.18) |
| | | else if (367.696 < distance && distance <= 653.911) |
| | | { |
| | | listLensnumber2[k].location = "斜面"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | else if (772.18 < distance && distance <= 873.38) |
| | | { |
| | | listLensnumber2[k].location = "平面"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | //else if (772.18 < distance && distance <= 873.38) |
| | | //{ |
| | | // listLensnumber2[k].location = "平面"; |
| | | // listLensnumber2[k].R = distance; |
| | | //} |
| | | else |
| | | { |
| | | listLensnumber2[k].location = "区域外"; |
| | | listLensnumber2[k].location = "平面"; |
| | | listLensnumber2[k].R = distance; |
| | | } |
| | | } |
| | |
| | | } |
| | | listLensnumber3[k].angle = lenAngle; |
| | | var distance = GetDistance(1050, 1050, listLensnumber3[k].X, listLensnumber3[k].Y); |
| | | if (distance <= 105.63) |
| | | if (distance <= 339.246) |
| | | { |
| | | listLensnumber3[k].location = "镜头"; |
| | | listLensnumber3[k].R = distance; |
| | | } |
| | | else |
| | | else if (distance < 339.246 && distance <= 520.584) |
| | | { |
| | | listLensnumber3[k].location = "斜面"; |
| | | listLensnumber3[k].R = distance; |
| | | } |
| | | else |
| | | { |
| | | listLensnumber3[k].location = "平面"; |
| | | listLensnumber3[k].R = distance; |
| | | } |
| | | } |
| | |
| | | } |
| | | listLensnumber4[k].angle = lenAngle; |
| | | var distance = GetDistance(1050, 1050, listLensnumber4[k].X, listLensnumber4[k].Y); |
| | | if (distance <= 339.88) |
| | | if (distance <= 104.895) |
| | | { |
| | | listLensnumber4[k].location = "镜头"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | else if (339.88 < distance && distance <= 547.02) |
| | | else if (104.895 < distance && distance <= 239.48) |
| | | { |
| | | listLensnumber4[k].location = "斜面"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | else if (547.02 < distance && distance <= 614.73) |
| | | { |
| | | listLensnumber4[k].location = "平面"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | //else if (547.02 < distance && distance <= 614.73) |
| | | //{ |
| | | // listLensnumber4[k].location = "平面"; |
| | | // listLensnumber4[k].R = distance; |
| | | //} |
| | | else |
| | | { |
| | | listLensnumber4[k].location = "区域外"; |
| | | listLensnumber4[k].location = "平面"; |
| | | listLensnumber4[k].R = distance; |
| | | } |
| | | } |
| | |
| | | dataListSum.Sort(); |
| | | var dataList = new List<ResultData>(); |
| | | |
| | | var title12 = $"时间戳,相机序号,设备判断结果,缺陷类型,X,Y,最大尺寸,R,位置,角度"; |
| | | var title12 = $"时间戳,相机序号,设备判断结果,缺陷类型,最大尺寸,位置,X,Y,R,角度"; |
| | | var file12 = $"{directoryInfo1.Parent.FullName}\\{filename+"设备判断结果"}.csv"; |
| | | |
| | | File.AppendAllText(file12, title12, Encoding.UTF8); |
| | |
| | | { |
| | | if (test11[i].DefectType=="刮白") |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test11[i].X},{test11[i].Y},{test11[i].ex},{(int)(test11[i].R)},{test11[i].location},{(int)(test11[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test11[i].ex},{test11[i].location},{test11[i].X},{test11[i].Y},{(int)(test11[i].R)},{(int)(test11[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | | else |
| | | { |
| | | var content111 = $"{""},{""},{""},{test11[i].DefectType},{test11[i].X},{test11[i].Y},{test11[i].ex},{(int)(test11[i].R)},{test11[i].location},{(int)(test11[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{test11[i].DefectType},{test11[i].ex},{test11[i].location},{test11[i].X},{test11[i].Y},{(int)(test11[i].R)},{(int)(test11[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | File.AppendAllText(file12, "\r\n"); |
| | | for (int i = 0; i < test11.Count; i++) |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test11[i].X},{test11[i].Y},{test11[i].ex},{(int)(test11[i].R)},{test11[i].location},{(int)(test11[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test11[i].ex},{test11[i].location},{test11[i].X},{test11[i].Y},{(int)(test11[i].R)},{(int)(test11[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | { |
| | | if (test12[i].DefectType == "刮白") |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test12[i].X},{test12[i].Y},{test12[i].ex},{(int)(test12[i].R)},{test12[i].location},{(int)(test12[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test12[i].ex},{test12[i].location},{test12[i].X},{test12[i].Y},{(int)(test12[i].R)},{(int)(test12[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | | else |
| | | { |
| | | var content111 = $"{""},{""},{""},{test12[i].DefectType},{test12[i].X},{test12[i].Y},{test12[i].ex},{(int)(test12[i].R)},{test12[i].location},{(int)(test12[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{test12[i].DefectType},{test12[i].ex},{test12[i].location},{test12[i].X},{test12[i].Y},{(int)(test12[i].R)},{(int)(test12[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | File.AppendAllText(file12, "\r\n"); |
| | | for (int i = 0; i < test12.Count; i++) |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test12[i].X},{test12[i].Y},{test12[i].ex},{(int)(test12[i].R)},{test12[i].location},{(int)(test12[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test12[i].ex},{test12[i].location},{test12[i].X},{test12[i].Y},{(int)(test12[i].R)},{(int)(test12[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | { |
| | | if (test13[i].DefectType == "刮白") |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test13[i].X},{test13[i].Y},{test13[i].ex},{(int)(test13[i].R)},{test13[i].location},{(int)(test13[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test13[i].ex},{test13[i].location},{test13[i].X},{test13[i].Y},{(int)(test13[i].R)},{(int)(test13[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | | else |
| | | { |
| | | var content111 = $"{""},{""},{""},{test13[i].DefectType},{test13[i].X},{test13[i].Y},{test13[i].ex},{(int)(test13[i].R)},{test13[i].location},{(int)(test13[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{test13[i].DefectType},{test13[i].ex},{test13[i].location},{test13[i].X},{test13[i].Y},{(int)(test13[i].R)},{(int)(test13[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | File.AppendAllText(file12, "\r\n"); |
| | | for (int i = 0; i < test13.Count; i++) |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test13[i].X},{test13[i].Y},{test13[i].ex},{(int)(test13[i].R)},{test13[i].location},{(int)(test13[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test13[i].ex},{test13[i].location},{test13[i].X},{test13[i].Y},{(int)(test13[i].R)},{(int)(test13[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | { |
| | | if (test14[i].DefectType == "刮白") |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test14[i].X},{test14[i].Y},{test14[i].ex},{(int)(test14[i].R)},{test14[i].location},{(int)(test14[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test14[i].ex},{test14[i].location},{test14[i].X},{test14[i].Y},{(int)(test14[i].R)},{(int)(test14[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | | else |
| | | { |
| | | var content111 = $"{""},{""},{""},{test14[i].DefectType},{test14[i].X},{test14[i].Y},{test14[i].ex},{(int)(test14[i].R)},{test14[i].location},{(int)(test14[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{test14[i].DefectType},{test14[i].ex},{test14[i].location},{test14[i].X},{test14[i].Y},{(int)(test14[i].R)},{(int)(test14[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | File.AppendAllText(file12, "\r\n"); |
| | | for (int i = 0; i < test14.Count; i++) |
| | | { |
| | | var content111 = $"{""},{""},{""},{""},{test14[i].X},{test14[i].Y},{test14[i].ex},{(int)(test14[i].R)},{test14[i].location},{(int)(test14[i].angle)}"; |
| | | var content111 = $"{""},{""},{""},{""},{test14[i].ex},{test14[i].location},{test14[i].X},{test14[i].Y},{(int)(test14[i].R)},{(int)(test14[i].angle)}"; |
| | | File.AppendAllText(file12, content111, Encoding.UTF8); |
| | | File.AppendAllText(file12, "\r\n"); |
| | | } |
| | |
| | | var dataList = new List<ResultData>(); |
| | | var nametemp = allLines[1].Split(',')[0]; |
| | | var resulttemp = allLines[1].Split(',')[1]; |
| | | //var Ptr = allLines[1].Split(',')[10]; |
| | | string Ptr = ""; |
| | | //if (allLines[1].Split(',')[10].Length>3) |
| | | //{ |
| | | // Ptr = allLines[1].Split(',')[10]; |
| | | //} |
| | | |
| | | for (int i = 1; i < allLines.Length; i++) |
| | | { |
| | | |
| | | |
| | | var data = allLines[i].Split(','); |
| | | |
| | | if (data.Length>10) |
| | | { |
| | | Ptr = data[10]; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if (data[6]=="-") |
| | | { |
| | |
| | | |
| | | string defectType = ""; |
| | | string bbb = ""; |
| | | string Ptr = ""; |
| | | //string Ptr = ""; |
| | | if (data[0] == "") |
| | | { |
| | | data[0] = nametemp; |
| | |
| | | defectType = "白点"; |
| | | bbb = data[1]; |
| | | |
| | | if (data.Length>10) |
| | | { |
| | | Ptr = data[10]; |
| | | } |
| | | |
| | | } |
| | | var data6 = data[6].Split('#').ToList(); |
| | | data6.Remove(""); |
| | |
| | | |
| | | nametemp = data[0]; |
| | | resulttemp= data[1]; |
| | | //Ptr = data[10]; |
| | | |
| | | } |
| | | |