v1.0.2.10 加入模型裁边
This commit is contained in:
parent
4691fa5919
commit
96034ee3c0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -20,7 +20,8 @@ namespace LeatherApp
|
||||
public static JArray defectItemList;
|
||||
//
|
||||
public static JArray colorNameList;//, materialNameList;
|
||||
|
||||
//
|
||||
public static JArray materialNameList;//, materialNameList;
|
||||
//CMDProcess目录下的命令JSON文件
|
||||
public static Dictionary<CMDName, JObject> CMDProcess;
|
||||
|
||||
@ -68,8 +69,22 @@ namespace LeatherApp
|
||||
public static string ImagePath;
|
||||
public static bool IsSaveAllImage, IsSaveDefectSourceImage, IsSaveDefectCutImage;
|
||||
|
||||
//材质Material
|
||||
public static string[] SuedeList = new string[0];
|
||||
//材质Material 1
|
||||
public static string[] SuedeList1 = new string[0];
|
||||
//材质Material 2
|
||||
public static string[] SuedeList2 = new string[0];
|
||||
//材质Material 3
|
||||
public static string[] SuedeList3 = new string[0];
|
||||
//材质Material 4
|
||||
public static string[] SuedeList4 = new string[0];
|
||||
//材质Material 5
|
||||
public static string[] SuedeList5 = new string[0];
|
||||
//材质Material 6
|
||||
public static string[] SuedeList6 = new string[0];
|
||||
|
||||
//忽略的等级判断项目
|
||||
public static string[] SkipLabelGrade = new string[0];
|
||||
|
||||
|
||||
//云端
|
||||
public static string cloud_ip, cloud_username, cloud_password, CloudThisName;
|
||||
@ -96,7 +111,7 @@ namespace LeatherApp
|
||||
|
||||
LoadDefectItemList();
|
||||
LoadColorNameList();
|
||||
//LoadMaterialNameList();
|
||||
LoadMaterialNameList();
|
||||
//----
|
||||
string lsCmdPath = appBasePath + "\\CMDProcess\\";
|
||||
if (!Directory.Exists(lsCmdPath))
|
||||
@ -161,8 +176,42 @@ namespace LeatherApp
|
||||
|
||||
//
|
||||
string lsTmp = ini.ReadString("Material", "SuedeList", "").Trim();
|
||||
if(!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SuedeList=lsTmp.Split(new char[] { ',',';'});
|
||||
if (!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SuedeList1 = lsTmp.Split(new char[] { ',', ';' });
|
||||
else
|
||||
SuedeList1 = new string[1] { "" };
|
||||
|
||||
lsTmp = ini.ReadString("Material", "SuedeList2", "").Trim();
|
||||
if (!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SuedeList2 = lsTmp.Split(new char[] { ',', ';' });
|
||||
else
|
||||
SuedeList2 = new string[1] { "" };
|
||||
lsTmp = ini.ReadString("Material", "SuedeList3", "").Trim();
|
||||
if (!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SuedeList3 = lsTmp.Split(new char[] { ',', ';' });
|
||||
else
|
||||
SuedeList3 = new string[1] { "" };
|
||||
lsTmp = ini.ReadString("Material", "SuedeList4", "").Trim();
|
||||
if (!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SuedeList4 = lsTmp.Split(new char[] { ',', ';' });
|
||||
else
|
||||
SuedeList4 = new string[1] { "" };
|
||||
lsTmp = ini.ReadString("Material", "SuedeList5", "").Trim();
|
||||
if (!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SuedeList5 = lsTmp.Split(new char[] { ',', ';' });
|
||||
else
|
||||
SuedeList5 = new string[1] { "" };
|
||||
lsTmp = ini.ReadString("Material", "SuedeList6", "").Trim();
|
||||
if (!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SuedeList6 = lsTmp.Split(new char[] { ',', ';' });
|
||||
else
|
||||
SuedeList6 = new string[1] { "" };
|
||||
|
||||
lsTmp = ini.ReadString("SkipLabelGrade", "LabelGradeList", "").Trim();
|
||||
if (!string.IsNullOrWhiteSpace(lsTmp))
|
||||
SkipLabelGrade = lsTmp.Split(new char[] { ',', ';' });
|
||||
else
|
||||
SkipLabelGrade = new string[1] { "" };
|
||||
}
|
||||
|
||||
#region defectItemList <=> DefectItemList.json
|
||||
@ -183,31 +232,56 @@ namespace LeatherApp
|
||||
}
|
||||
public static JObject getDefectItem(string code)
|
||||
{
|
||||
var item=Config.defectItemList.FirstOrDefault(m => m.Value<string>("code")==code);
|
||||
if(item==null)
|
||||
return null;
|
||||
return (JObject)item;
|
||||
try
|
||||
{
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("code") == code);
|
||||
if (item == null)
|
||||
return null;
|
||||
return (JObject)item;
|
||||
}
|
||||
catch { return null; }
|
||||
}
|
||||
public static JObject getDefectItem(int id)
|
||||
{
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<int>("id") == id);
|
||||
try
|
||||
{
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<int>("id") == id);
|
||||
if (item == null)
|
||||
return null;
|
||||
return (JObject)item;
|
||||
}
|
||||
catch { return null; }
|
||||
}
|
||||
public static string getDefectCode(int id)
|
||||
{
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<int>("id") == id);
|
||||
if (item == null)
|
||||
return "";
|
||||
return ((JObject)item).Value<string>("code");
|
||||
try
|
||||
{
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<int>("id") == id);
|
||||
if (item == null)
|
||||
return "";
|
||||
return ((JObject)item).Value<string>("code");
|
||||
}
|
||||
catch { return ""; }
|
||||
}
|
||||
public static string getDefectName(string code)
|
||||
{
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("code") == code);
|
||||
if (item == null)
|
||||
return "";
|
||||
return ((JObject)item).Value<string>("name");
|
||||
try {
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("code") == code);
|
||||
if (item == null)
|
||||
return "";
|
||||
return ((JObject)item).Value<string>("name");
|
||||
}
|
||||
catch { return ""; }
|
||||
}
|
||||
public static string getDefectCode(string name)
|
||||
{
|
||||
try {
|
||||
var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("name") == name);
|
||||
if (item == null)
|
||||
return "";
|
||||
return ((JObject)item).Value<string>("code");
|
||||
}
|
||||
catch { return ""; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -227,14 +301,14 @@ namespace LeatherApp
|
||||
return null;
|
||||
return (JObject)item;
|
||||
}
|
||||
//public static void LoadMaterialNameList()
|
||||
//{
|
||||
// if (string.IsNullOrWhiteSpace(appBasePath))
|
||||
// appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
// string configPath = appBasePath + "\\MaterialName.json";
|
||||
// string lsTmp = File.ReadAllText(configPath);
|
||||
// materialNameList = JArray.Parse(lsTmp);
|
||||
//}
|
||||
public static void LoadMaterialNameList()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(appBasePath))
|
||||
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
string configPath = appBasePath + "\\MaterialName.json";
|
||||
string lsTmp = File.ReadAllText(configPath);
|
||||
materialNameList = JArray.Parse(lsTmp);
|
||||
}
|
||||
//public static JObject getMaterialItem(string code)
|
||||
//{
|
||||
// var item = Config.materialNameList.FirstOrDefault(m => m.Value<string>("code") == code);
|
||||
|
@ -107,6 +107,12 @@ namespace LeatherApp
|
||||
if (!Config.StopLight && !devLight.start(int.Parse(Config.Light_PortName.Substring(3)))) throw new Exception("光源设备初始化失败!");
|
||||
if (!libPhoto.start()) throw new Exception("图像库初始化失败!");
|
||||
WarningEvent?.Invoke(DateTime.Now,WarningEnum.Normal, "2");
|
||||
if (libDefect == null)
|
||||
{
|
||||
WarningEvent?.Invoke(DateTime.Now, WarningEnum.Normal, "算法库为空,重新初始化");
|
||||
libDefect = new DefectLib();
|
||||
libDefect.WarningEvent = WarningEvent;
|
||||
}
|
||||
if (!libDefect.start()) throw new Exception("缺陷库初始化失败!");
|
||||
WarningEvent?.Invoke(DateTime.Now,WarningEnum.Normal, "3");
|
||||
if (!File.Exists(appBasePath+ "\\DevCfg\\" + Config.Carmer1ConfigFilePath) || !File.Exists(appBasePath + "\\DevCfg\\" + Config.Carmer2ConfigFilePath))
|
||||
|
@ -610,13 +610,14 @@ namespace LeatherApp.Device
|
||||
CopyMemory(m_pUserBuffer, hPtr, m_nBufferSize);
|
||||
m_bUpdateImage = true;
|
||||
|
||||
var bmp = hBuffer.toBmp(m_pUserBuffer);
|
||||
Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(bmp);
|
||||
bmp.Dispose();
|
||||
bmp = null;
|
||||
Mat mat = new Mat(m_nHeight, m_nWidth, MatType.CV_8UC3, m_pUserBuffer);
|
||||
//var bmp = hBuffer.toBmp(m_pUserBuffer);
|
||||
//Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(bmp);
|
||||
//bmp.Dispose();
|
||||
//bmp = null;
|
||||
//Monitor.Enter(frameQueue);
|
||||
lock (frameQueue)
|
||||
frameQueue.Enqueue(new MyData(index, mat));
|
||||
frameQueue.Enqueue(new MyData(index, mat.Clone()));
|
||||
PhotoNumCacheEvent?.BeginInvoke(frameQueue.Count, null, null);
|
||||
}
|
||||
}
|
||||
|
@ -98,17 +98,17 @@ namespace LeatherApp.Device
|
||||
}
|
||||
public bool start()
|
||||
{
|
||||
List<DefectLabelInfo> DefectLabelInfoList = new List<DefectLabelInfo>();
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 1953, y = 429, w = 200, h = 200, classId = 1, confidence = 0.8, contrast = 0.9, i = 0, j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() {x = 1953,y = 929,w=900,h = 400,classId = 11,confidence = 0.8, contrast = 0.9, i = 0,j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 3169, y = 1029, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 1, j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 4721, y = 919, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 2, j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 6145, y = 829, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 3, j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 8073, y = 929, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 4, j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 9407, y = 929, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 5, j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 10801, y = 999, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 6, j = 0 });
|
||||
DefectLabelInfoList.Add(new DefectLabelInfo() { x = 12465, y = 629, w = 900, h = 800, classId = 11, confidence = 0.8, contrast = 0.9, i = 7, j = 0 });
|
||||
DefectLabelInfoList = HeBingDefect(16384, DefectLabelInfoList);
|
||||
//List<DefectLabelInfo> DefectLabelInfoList = new List<DefectLabelInfo>();
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 1953, y = 429, w = 200, h = 200, classId = 1, confidence = 0.8, contrast = 0.9, i = 0, j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() {x = 1953,y = 929,w=900,h = 400,classId = 11,confidence = 0.8, contrast = 0.9, i = 0,j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 3169, y = 1029, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 1, j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 4721, y = 919, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 2, j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 6145, y = 829, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 3, j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 8073, y = 929, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 4, j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 9407, y = 929, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 5, j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 10801, y = 999, w = 900, h = 400, classId = 11, confidence = 0.8, contrast = 0.9, i = 6, j = 0 });
|
||||
//DefectLabelInfoList.Add(new DefectLabelInfo() { x = 12465, y = 629, w = 900, h = 800, classId = 11, confidence = 0.8, contrast = 0.9, i = 7, j = 0 });
|
||||
//DefectLabelInfoList = HeBingDefect(16384, DefectLabelInfoList);
|
||||
try
|
||||
{
|
||||
//detector = CreateDetector(Config.model_path, Config.labels_path, true, 6);
|
||||
@ -190,6 +190,7 @@ namespace LeatherApp.Device
|
||||
public int GetWidthForResize(int sumWidth)
|
||||
{
|
||||
int count =(int) Math.Round(sumWidth * 1.0f / image_width, 0);
|
||||
count = 8;
|
||||
return count * image_width;
|
||||
|
||||
//int count = sumWidth / image_width;
|
||||
@ -244,7 +245,7 @@ namespace LeatherApp.Device
|
||||
{
|
||||
if (taskList.Count < 1)
|
||||
{
|
||||
Thread.Sleep(0);
|
||||
Thread.Sleep(20);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -325,7 +326,7 @@ namespace LeatherApp.Device
|
||||
{
|
||||
if (taskOperationList.Count < 1)
|
||||
{
|
||||
Thread.Sleep(0);
|
||||
Thread.Sleep(20);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -454,6 +455,17 @@ namespace LeatherApp.Device
|
||||
List<int> xPos2 = new List<int>();
|
||||
List<double> ZXD2 = new List<double>();
|
||||
|
||||
List<DefectLabelInfo> HeBingList3 = new List<DefectLabelInfo>();
|
||||
List<DefectLabelInfo> XcHeBingList3 = new List<DefectLabelInfo>();
|
||||
List<int> xPos3 = new List<int>();
|
||||
List<double> ZXD3 = new List<double>();
|
||||
|
||||
List<DefectLabelInfo> HeBingList4 = new List<DefectLabelInfo>();
|
||||
List<DefectLabelInfo> XcHeBingList4 = new List<DefectLabelInfo>();
|
||||
List<int> xPos4 = new List<int>();
|
||||
List<double> ZXD4 = new List<double>();
|
||||
|
||||
|
||||
DefectLabelInfo stpoint = DefectLabelInfoList[0];
|
||||
|
||||
int colNum = Width / image_width;
|
||||
@ -467,7 +479,7 @@ namespace LeatherApp.Device
|
||||
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
||||
{
|
||||
HeBingList.Add(DefectLabelInfoList[q]);
|
||||
xPos.Add(DefectLabelInfoList[q].x);
|
||||
xPos.Add((DefectLabelInfoList[q].i % colNum) * image_width + DefectLabelInfoList[q].x);
|
||||
ZXD.Add(DefectLabelInfoList[q].confidence);
|
||||
}
|
||||
else
|
||||
@ -480,29 +492,60 @@ namespace LeatherApp.Device
|
||||
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
||||
{
|
||||
HeBingList2.Add(DefectLabelInfoList[q]);
|
||||
xPos2.Add(DefectLabelInfoList[q].x);
|
||||
xPos2.Add((DefectLabelInfoList[q].i % colNum) * image_width + DefectLabelInfoList[q].x);
|
||||
ZXD2.Add(DefectLabelInfoList[q].confidence);
|
||||
}
|
||||
else
|
||||
XcHeBingList2.Add(DefectLabelInfoList[q]);
|
||||
}
|
||||
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jt")
|
||||
{
|
||||
int max = stpoint.y + 500;
|
||||
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0;
|
||||
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
||||
{
|
||||
HeBingList3.Add(DefectLabelInfoList[q]);
|
||||
xPos3.Add((DefectLabelInfoList[q].i % colNum) * image_width + DefectLabelInfoList[q].x);
|
||||
ZXD3.Add(DefectLabelInfoList[q].confidence);
|
||||
}
|
||||
else
|
||||
XcHeBingList3.Add(DefectLabelInfoList[q]);
|
||||
}
|
||||
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "tcy")
|
||||
{
|
||||
int max = stpoint.y + 500;
|
||||
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0;
|
||||
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
||||
{
|
||||
HeBingList4.Add(DefectLabelInfoList[q]);
|
||||
xPos4.Add((DefectLabelInfoList[q].i % colNum) * image_width + DefectLabelInfoList[q].x);
|
||||
ZXD4.Add(DefectLabelInfoList[q].confidence);
|
||||
}
|
||||
else
|
||||
XcHeBingList4.Add(DefectLabelInfoList[q]);
|
||||
}
|
||||
else
|
||||
outList.Add(DefectLabelInfoList[q]);
|
||||
}
|
||||
//递归下次合并数据
|
||||
List<DefectLabelInfo> dg1 = new List<DefectLabelInfo>();
|
||||
List<DefectLabelInfo> dg2 = new List<DefectLabelInfo>();
|
||||
List<DefectLabelInfo> dg3 = new List<DefectLabelInfo>();
|
||||
List<DefectLabelInfo> dg4 = new List<DefectLabelInfo>();
|
||||
if (XcHeBingList.Count >0)
|
||||
dg1 = HeBingDefect(Width, XcHeBingList);
|
||||
if (XcHeBingList2.Count > 0)
|
||||
dg2 = HeBingDefect(Width, XcHeBingList2);
|
||||
|
||||
if (XcHeBingList3.Count > 0)
|
||||
dg3 = HeBingDefect(Width, XcHeBingList3);
|
||||
if (XcHeBingList4.Count > 0)
|
||||
dg4 = HeBingDefect(Width, XcHeBingList4);
|
||||
|
||||
//多个jietou合并
|
||||
if (HeBingList.Count>0)
|
||||
{
|
||||
var stIt = HeBingList.Find(x => x.x == xPos.Min());
|
||||
var edIt = HeBingList.Find(x => x.x == xPos.Max());
|
||||
var stIt = HeBingList.Find(x => (x.i % colNum) * image_width + x.x == xPos.Min());
|
||||
var edIt = HeBingList.Find(x => (x.i % colNum) * image_width + x.x == xPos.Max());
|
||||
var eZXD = HeBingList.Find(x => x.confidence == ZXD.Max());
|
||||
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
||||
outList.Add(new DefectLabelInfo() {
|
||||
@ -522,8 +565,8 @@ namespace LeatherApp.Device
|
||||
//多个hengdang合并
|
||||
if (HeBingList2.Count > 0)
|
||||
{
|
||||
var stIt = HeBingList2.Find(x => x.x == xPos2.Min());
|
||||
var edIt = HeBingList2.Find(x => x.x == xPos2.Max());
|
||||
var stIt = HeBingList2.Find(x => (x.i % colNum) * image_width + x.x == xPos2.Min());
|
||||
var edIt = HeBingList2.Find(x => (x.i % colNum) * image_width + x.x == xPos2.Max());
|
||||
var eZXD = HeBingList2.Find(x => x.confidence == ZXD2.Max());
|
||||
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
||||
outList.Add(new DefectLabelInfo()
|
||||
@ -541,9 +584,54 @@ namespace LeatherApp.Device
|
||||
j = stIt.j,
|
||||
});
|
||||
}
|
||||
|
||||
//多个jt合并
|
||||
if (HeBingList3.Count > 0)
|
||||
{
|
||||
var stIt = HeBingList3.Find(x => (x.i % colNum) * image_width + x.x == xPos3.Min());
|
||||
var edIt = HeBingList3.Find(x => (x.i % colNum) * image_width + x.x == xPos3.Max());
|
||||
var eZXD = HeBingList3.Find(x => x.confidence == ZXD3.Max());
|
||||
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
||||
outList.Add(new DefectLabelInfo()
|
||||
{
|
||||
x = stIt.x,
|
||||
y = edIt.y,
|
||||
w = newW, //多图叠加
|
||||
h = edIt.h,
|
||||
classId = eZXD.classId,
|
||||
confidence = eZXD.confidence,
|
||||
contrast = eZXD.contrast,
|
||||
cmH = Math.Round(edIt.h * 1.0 / Config.cm2px_y, 2),
|
||||
cmW = Math.Round(newW * 1.0 / Config.cm2px_x, 2),
|
||||
i = stIt.i,
|
||||
j = stIt.j,
|
||||
});
|
||||
}
|
||||
//多个tcy合并
|
||||
if (HeBingList4.Count > 0)
|
||||
{
|
||||
var stIt = HeBingList4.Find(x => (x.i % colNum) * image_width + x.x == xPos4.Min());
|
||||
var edIt = HeBingList4.Find(x => (x.i % colNum) * image_width + x.x == xPos4.Max());
|
||||
var eZXD = HeBingList4.Find(x => x.confidence == ZXD4.Max());
|
||||
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
||||
outList.Add(new DefectLabelInfo()
|
||||
{
|
||||
x = stIt.x,
|
||||
y = edIt.y,
|
||||
w = newW, //多图叠加
|
||||
h = edIt.h,
|
||||
classId = eZXD.classId,
|
||||
confidence = eZXD.confidence,
|
||||
contrast = eZXD.contrast,
|
||||
cmH = Math.Round(edIt.h * 1.0 / Config.cm2px_y, 2),
|
||||
cmW = Math.Round(newW * 1.0 / Config.cm2px_x, 2),
|
||||
i = stIt.i,
|
||||
j = stIt.j,
|
||||
});
|
||||
}
|
||||
outList = outList.Concat(dg1).ToList<DefectLabelInfo>();//保留重复项
|
||||
outList = outList.Concat(dg2).ToList<DefectLabelInfo>();//保留重复项
|
||||
outList = outList.Concat(dg3).ToList<DefectLabelInfo>();//保留重复项
|
||||
outList = outList.Concat(dg4).ToList<DefectLabelInfo>();//保留重复项
|
||||
return outList;
|
||||
}
|
||||
//打标
|
||||
@ -554,7 +642,7 @@ namespace LeatherApp.Device
|
||||
{
|
||||
if (taskMakeTagList.Count < 1)
|
||||
{
|
||||
Thread.Sleep(0);
|
||||
Thread.Sleep(20);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -743,7 +831,7 @@ namespace LeatherApp.Device
|
||||
}
|
||||
|
||||
#region 合并接头横档
|
||||
liStep++;
|
||||
liStep = 3000;
|
||||
if (DefectLabelInfoList.Count >0)
|
||||
DefectLabelInfoList = HeBingDefect(task.bmp.Width, DefectLabelInfoList);
|
||||
liStep++;
|
||||
@ -806,6 +894,11 @@ namespace LeatherApp.Device
|
||||
task.resultInfo += $" 判断为接头处横档,跳过! \n";
|
||||
continue;
|
||||
}
|
||||
if (Config.getDefectCode(DefectLabelInfoListByClassID[q].classId) == "na")
|
||||
{
|
||||
task.resultInfo += $" 判断为正向标签na,跳过! \n";
|
||||
continue;
|
||||
}
|
||||
//WarningEvent?.Invoke(DateTime.Now,WarningEnum.Low, $"判断是瑕疵:类别ID:{classId}; 置信度({confidence},[{qualifiedLimit.ZXD}]); isOr({qualifiedLimit.IsOR}); 面积({cmW * cmH},[{ qualifiedLimit.Area}]); 对比度({contrast},[{qualifiedLimit.ContrastLower}-{qualifiedLimit.ContrastTop}])");
|
||||
}
|
||||
}
|
||||
@ -815,7 +908,7 @@ namespace LeatherApp.Device
|
||||
var point2 = new OpenCvSharp.Point(point1.X + DefectLabelInfoListByClassID[q].w, point1.Y + DefectLabelInfoListByClassID[q].h);
|
||||
liStep++;//2
|
||||
//task.resultInfo += $" 转换到大图坐标(px):p1={point1.X},{point1.Y}; p2={point2.X},{point2.Y}\n";
|
||||
Cv2.Rectangle(task.bmpTag, point1, point2, new Scalar(0.0, 0.0, 255.0), 1);//画打标点
|
||||
Cv2.Rectangle(task.bmpTag, point1, point2, new Scalar(0.0, 0.0, 255.0), 5);//画打标点
|
||||
|
||||
//WarningEvent?.Invoke(DateTime.Now,WarningEnum.Low, $"保存第 {count} 行缺陷信息;");
|
||||
int px = (point1.X - task.xw) > 0 ? (point1.X - task.xw) : 0;
|
||||
|
@ -118,7 +118,10 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="textBox1.Text" xml:space="preserve">
|
||||
<value>v1.0.2.9(2024-05-09)
|
||||
<value>v1.0.2.10(2024-08-05)
|
||||
1、修复bug,优化显示
|
||||
2、加入模型裁边
|
||||
v1.0.2.9(2024-05-09)
|
||||
1、加入实时幅宽
|
||||
2、加入jietou,hengdang标签合并
|
||||
v1.0.2.8(2024-05-06)
|
||||
|
169
LeatherProject/LeatherApp/Page/FHome.Designer.cs
generated
169
LeatherProject/LeatherApp/Page/FHome.Designer.cs
generated
@ -28,14 +28,14 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.uiPanel1 = new Sunny.UI.UIPanel();
|
||||
this.lblLen = new Sunny.UI.UILabel();
|
||||
this.lblSpeed = new Sunny.UI.UISymbolLabel();
|
||||
@ -58,7 +58,6 @@
|
||||
this.btnEnd = new Sunny.UI.UISymbolButton();
|
||||
this.btnStart = new Sunny.UI.UISymbolButton();
|
||||
this.uiTitlePanel2 = new Sunny.UI.UITitlePanel();
|
||||
this.ucColorListDefect = new LeatherApp.UIExtend.UCColorList();
|
||||
this.lineChartDefect = new Sunny.UI.UILineChart();
|
||||
this.uiTitlePanel3 = new Sunny.UI.UITitlePanel();
|
||||
this.uiDataGridView1 = new Sunny.UI.UIDataGridView();
|
||||
@ -81,7 +80,6 @@
|
||||
this.lstboxLog = new Sunny.UI.UIListBox();
|
||||
this.uiTitlePanel6 = new Sunny.UI.UITitlePanel();
|
||||
this.uiPanel3 = new Sunny.UI.UIPanel();
|
||||
this.picDefectImage = new LeatherApp.UIExtend.UCImageView();
|
||||
this.pnlScannerImg = new Sunny.UI.UITitlePanel();
|
||||
this.picScanner2 = new System.Windows.Forms.PictureBox();
|
||||
this.picScanner1 = new System.Windows.Forms.PictureBox();
|
||||
@ -100,6 +98,8 @@
|
||||
this.uiLabel8 = new Sunny.UI.UILabel();
|
||||
this.uiLabel7 = new Sunny.UI.UILabel();
|
||||
this.uiLabel6 = new Sunny.UI.UILabel();
|
||||
this.picDefectImage = new LeatherApp.UIExtend.UCImageView();
|
||||
this.ucColorListDefect = new LeatherApp.UIExtend.UCColorList();
|
||||
this.uiPanel1.SuspendLayout();
|
||||
this.uiTitlePanel1.SuspendLayout();
|
||||
this.uiPanel2.SuspendLayout();
|
||||
@ -448,7 +448,6 @@
|
||||
this.button1.TabIndex = 1;
|
||||
this.button1.Text = "button1";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Visible = false;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// btnPause
|
||||
@ -633,29 +632,6 @@
|
||||
this.uiTitlePanel2.TitleColor = System.Drawing.Color.White;
|
||||
this.uiTitlePanel2.TitleForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138)))));
|
||||
//
|
||||
// ucColorListDefect
|
||||
//
|
||||
this.ucColorListDefect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ucColorListDefect.ColorChanged = null;
|
||||
this.ucColorListDefect.FillColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.FillColor2 = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.FillDisableColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.ucColorListDefect.Location = new System.Drawing.Point(1, 38);
|
||||
this.ucColorListDefect.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.ucColorListDefect.Name = "ucColorListDefect";
|
||||
this.ucColorListDefect.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.ucColorListDefect.RectColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.RectDisableColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom;
|
||||
this.ucColorListDefect.Size = new System.Drawing.Size(121, 42);
|
||||
this.ucColorListDefect.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.ucColorListDefect.StyleCustomMode = true;
|
||||
this.ucColorListDefect.TabIndex = 1;
|
||||
this.ucColorListDefect.Text = "ucColorList1";
|
||||
this.ucColorListDefect.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lineChartDefect
|
||||
//
|
||||
this.lineChartDefect.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
@ -705,21 +681,21 @@
|
||||
//
|
||||
// uiDataGridView1
|
||||
//
|
||||
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250)))));
|
||||
this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250)))));
|
||||
this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.uiDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.uiDataGridView1.BackgroundColor = System.Drawing.Color.White;
|
||||
this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
|
||||
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle10.BackColor = System.Drawing.Color.Blue;
|
||||
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle10.ForeColor = System.Drawing.Color.White;
|
||||
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138)))));
|
||||
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle2.BackColor = System.Drawing.Color.Blue;
|
||||
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
|
||||
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138)))));
|
||||
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.uiDataGridView1.ColumnHeadersHeight = 32;
|
||||
this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||
this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
@ -734,14 +710,14 @@
|
||||
this.colArea,
|
||||
this.colZXD,
|
||||
this.colTarget});
|
||||
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle14.BackColor = System.Drawing.Color.White;
|
||||
dataGridViewCellStyle14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle14.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle14.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238)))));
|
||||
dataGridViewCellStyle14.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle14;
|
||||
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle6.BackColor = System.Drawing.Color.White;
|
||||
dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle6.ForeColor = System.Drawing.Color.White;
|
||||
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238)))));
|
||||
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle6;
|
||||
this.uiDataGridView1.EnableHeadersVisualStyles = false;
|
||||
this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.uiDataGridView1.GridColor = System.Drawing.Color.CornflowerBlue;
|
||||
@ -749,21 +725,21 @@
|
||||
this.uiDataGridView1.MultiSelect = false;
|
||||
this.uiDataGridView1.Name = "uiDataGridView1";
|
||||
this.uiDataGridView1.RectColor = System.Drawing.Color.DodgerBlue;
|
||||
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle15.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250)))));
|
||||
dataGridViewCellStyle15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle15.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138)))));
|
||||
dataGridViewCellStyle15.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle15;
|
||||
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250)))));
|
||||
dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138)))));
|
||||
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle7;
|
||||
this.uiDataGridView1.RowHeadersWidth = 62;
|
||||
dataGridViewCellStyle16.BackColor = System.Drawing.Color.White;
|
||||
dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238)))));
|
||||
dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle16;
|
||||
dataGridViewCellStyle8.BackColor = System.Drawing.Color.White;
|
||||
dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238)))));
|
||||
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle8;
|
||||
this.uiDataGridView1.RowTemplate.Height = 30;
|
||||
this.uiDataGridView1.ScrollBarBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250)))));
|
||||
this.uiDataGridView1.ScrollBarColor = System.Drawing.Color.DodgerBlue;
|
||||
@ -814,9 +790,9 @@
|
||||
// colX
|
||||
//
|
||||
this.colX.DataPropertyName = "X";
|
||||
dataGridViewCellStyle11.Format = "N1";
|
||||
dataGridViewCellStyle11.NullValue = null;
|
||||
this.colX.DefaultCellStyle = dataGridViewCellStyle11;
|
||||
dataGridViewCellStyle3.Format = "N1";
|
||||
dataGridViewCellStyle3.NullValue = null;
|
||||
this.colX.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.colX.HeaderText = "X(cm)";
|
||||
this.colX.MinimumWidth = 8;
|
||||
this.colX.Name = "colX";
|
||||
@ -826,9 +802,9 @@
|
||||
// colY
|
||||
//
|
||||
this.colY.DataPropertyName = "Y";
|
||||
dataGridViewCellStyle12.Format = "N2";
|
||||
dataGridViewCellStyle12.NullValue = null;
|
||||
this.colY.DefaultCellStyle = dataGridViewCellStyle12;
|
||||
dataGridViewCellStyle4.Format = "N2";
|
||||
dataGridViewCellStyle4.NullValue = null;
|
||||
this.colY.DefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.colY.HeaderText = "Y(米)";
|
||||
this.colY.MinimumWidth = 8;
|
||||
this.colY.Name = "colY";
|
||||
@ -851,9 +827,9 @@
|
||||
//
|
||||
// colArea
|
||||
//
|
||||
dataGridViewCellStyle13.Format = "N2";
|
||||
dataGridViewCellStyle13.NullValue = null;
|
||||
this.colArea.DefaultCellStyle = dataGridViewCellStyle13;
|
||||
dataGridViewCellStyle5.Format = "N2";
|
||||
dataGridViewCellStyle5.NullValue = null;
|
||||
this.colArea.DefaultCellStyle = dataGridViewCellStyle5;
|
||||
this.colArea.HeaderText = "面积(mm²)";
|
||||
this.colArea.MinimumWidth = 8;
|
||||
this.colArea.Name = "colArea";
|
||||
@ -1062,15 +1038,6 @@
|
||||
this.uiPanel3.Text = null;
|
||||
this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// picDefectImage
|
||||
//
|
||||
this.picDefectImage.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picDefectImage.Location = new System.Drawing.Point(0, 0);
|
||||
this.picDefectImage.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.picDefectImage.Name = "picDefectImage";
|
||||
this.picDefectImage.Size = new System.Drawing.Size(350, 226);
|
||||
this.picDefectImage.TabIndex = 1;
|
||||
//
|
||||
// pnlScannerImg
|
||||
//
|
||||
this.pnlScannerImg.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
@ -1359,6 +1326,38 @@
|
||||
this.uiLabel6.Text = "光源";
|
||||
this.uiLabel6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// picDefectImage
|
||||
//
|
||||
this.picDefectImage.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picDefectImage.Location = new System.Drawing.Point(0, 0);
|
||||
this.picDefectImage.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.picDefectImage.Name = "picDefectImage";
|
||||
this.picDefectImage.Size = new System.Drawing.Size(350, 226);
|
||||
this.picDefectImage.TabIndex = 1;
|
||||
//
|
||||
// ucColorListDefect
|
||||
//
|
||||
this.ucColorListDefect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ucColorListDefect.ColorChanged = null;
|
||||
this.ucColorListDefect.FillColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.FillColor2 = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.FillDisableColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.ucColorListDefect.Location = new System.Drawing.Point(1, 38);
|
||||
this.ucColorListDefect.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.ucColorListDefect.Name = "ucColorListDefect";
|
||||
this.ucColorListDefect.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.ucColorListDefect.RectColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.RectDisableColor = System.Drawing.Color.White;
|
||||
this.ucColorListDefect.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom;
|
||||
this.ucColorListDefect.Size = new System.Drawing.Size(121, 42);
|
||||
this.ucColorListDefect.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.ucColorListDefect.StyleCustomMode = true;
|
||||
this.ucColorListDefect.TabIndex = 1;
|
||||
this.ucColorListDefect.Text = "ucColorList1";
|
||||
this.ucColorListDefect.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// FHome
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@ -1382,6 +1381,8 @@
|
||||
this.StyleCustomMode = true;
|
||||
this.Load += new System.EventHandler(this.FHome_Load);
|
||||
this.Shown += new System.EventHandler(this.FHome_Shown);
|
||||
this.Paint += new System.Windows.Forms.PaintEventHandler(this.FHome_Paint);
|
||||
this.Resize += new System.EventHandler(this.FHome_Resize);
|
||||
this.uiPanel1.ResumeLayout(false);
|
||||
this.uiTitlePanel1.ResumeLayout(false);
|
||||
this.uiTitlePanel1.PerformLayout();
|
||||
|
@ -54,6 +54,11 @@ namespace LeatherApp.Page
|
||||
//无产品编码时加载
|
||||
FProductInfo frmProduct;
|
||||
|
||||
private double ThnDieLen = 0;
|
||||
|
||||
private Dictionary<int, Mat> defectTag = new Dictionary<int, Mat>();
|
||||
//裁切偏移
|
||||
private double OffsetCut = 0.2;
|
||||
//云端
|
||||
private CloudMgr cloudMgr = new CloudMgr();
|
||||
private bool init_Cloud;
|
||||
@ -439,8 +444,8 @@ namespace LeatherApp.Page
|
||||
}));
|
||||
}
|
||||
|
||||
private delegate void AddTextDelegate(DateTime time,string tag, string msg, WarningEnum level);
|
||||
private void AddTextEvent(DateTime now, string tag, string msg, WarningEnum level = WarningEnum.Normal)
|
||||
private delegate void AddTextDelegate(DateTime time,string tag, string msg, WarningEnum level, bool Show);
|
||||
private void AddTextEvent(DateTime now, string tag, string msg, WarningEnum level = WarningEnum.Normal, bool Show = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -451,7 +456,8 @@ namespace LeatherApp.Page
|
||||
now,
|
||||
tag,
|
||||
msg,
|
||||
level
|
||||
level,
|
||||
Show
|
||||
});
|
||||
}
|
||||
else
|
||||
@ -469,15 +475,17 @@ namespace LeatherApp.Page
|
||||
//
|
||||
//if (type > 0)
|
||||
// cont = $"<color=\"{(type == 1 ? "Yellow" : "Red")}\">{cont}</color>";
|
||||
|
||||
//msg = (level == WarningEnum.Normal ? "B" : level == WarningEnum.Low ? "Y" : "R") + msg;
|
||||
msg = (level == WarningEnum.Normal ? "" : level == WarningEnum.Low ? "Y" : "R") + msg;
|
||||
//this.Invoke(new System.Action(() =>
|
||||
//{
|
||||
if (Show)
|
||||
{
|
||||
//msg = (level == WarningEnum.Normal ? "B" : level == WarningEnum.Low ? "Y" : "R") + msg;
|
||||
msg = (level == WarningEnum.Normal ? "" : level == WarningEnum.Low ? "Y" : "R") + msg;
|
||||
//this.Invoke(new System.Action(() =>
|
||||
//{
|
||||
if (this.lstboxLog.Items.Count > 1000)
|
||||
this.lstboxLog.Items.Clear();
|
||||
lstboxLog.Items.Insert(0, msg);
|
||||
//}));
|
||||
//}));
|
||||
}
|
||||
//日志滚动
|
||||
//lstLog.SelectedIndex = lstLog.Items.Count - 1;
|
||||
|
||||
@ -562,6 +570,8 @@ namespace LeatherApp.Page
|
||||
|
||||
//DefectLib dl = new DefectLib();
|
||||
//dl.start();
|
||||
//加载寻边模型
|
||||
OpenCVUtil.LoadEdgeMode();
|
||||
|
||||
this.btnOpen.Enabled = false;
|
||||
|
||||
@ -675,12 +685,27 @@ namespace LeatherApp.Page
|
||||
errCode = 2;
|
||||
//加载新产品
|
||||
string pcode = "1-" + codes[2];
|
||||
if (codes[1] == "0" || Config.SuedeList.Contains(codes[1]))
|
||||
if (codes[1] == "0" || Config.SuedeList1.Contains(codes[1]))
|
||||
pcode = "0-" + codes[2];
|
||||
else
|
||||
|
||||
#if false
|
||||
else
|
||||
pcode = codes[1] + "-" + codes[2];
|
||||
#elif HX_LOD
|
||||
else
|
||||
pcode = "1-" + codes[2];
|
||||
#else
|
||||
else if (codes[1] == "1" || Config.SuedeList2.Contains(codes[1]))
|
||||
pcode = "1-" + codes[2];
|
||||
else if (codes[1] == "2" || Config.SuedeList3.Contains(codes[1]))
|
||||
pcode = "2-" + codes[2];
|
||||
else if (codes[1] == "3" || Config.SuedeList4.Contains(codes[1]))
|
||||
pcode = "3-" + codes[2];
|
||||
else if (codes[1] == "4" || Config.SuedeList5.Contains(codes[1]))
|
||||
pcode = "4-" + codes[2];
|
||||
else if (codes[1] == "5" || Config.SuedeList6.Contains(codes[1]))
|
||||
pcode = "5-" + codes[2];
|
||||
else
|
||||
pcode = "1-" + codes[2];
|
||||
#endif
|
||||
|
||||
@ -834,7 +859,7 @@ namespace LeatherApp.Page
|
||||
};
|
||||
devContainer.WarningEvent = (now,level, msg) =>
|
||||
{
|
||||
AddTextEvent(DateTime.Now,$"设备事件{Thread.CurrentThread.ManagedThreadId}", msg, level);
|
||||
AddTextEvent(DateTime.Now,$"设备事件{Thread.CurrentThread.ManagedThreadId}", msg, level, false);
|
||||
if (level == WarningEnum.High)
|
||||
Task.Run(() => warning(level, true));
|
||||
};
|
||||
@ -936,7 +961,7 @@ namespace LeatherApp.Page
|
||||
{
|
||||
if (Config.Camer_Name == CamerDevNameEnum.埃科)
|
||||
{
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"采集卡({devIndex}),图像({num})");
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"采集卡({devIndex}),图像({num})", WarningEnum.Low, false);
|
||||
Cv2.Flip(matone, matone, FlipMode.XY);//翻转
|
||||
Bitmap bitmap = BitmapConverter.ToBitmap(matone);
|
||||
this.BeginInvoke(new Action(() =>
|
||||
@ -980,7 +1005,7 @@ namespace LeatherApp.Page
|
||||
Records curRecord = Hashtable.Synchronized(htTask)[currKey] as Records;
|
||||
Device.PhotoLib.PhotoTask task;
|
||||
Mat myMat = matone;//.Clone();
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"(图像{num})-采集卡({devIndex}),size:({myMat.Width}*{myMat.Height})({(myMat == null ? "A" : "B")})");
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"(图像{num})-采集卡({devIndex}),size:({myMat.Width}*{myMat.Height})({(myMat == null ? "A" : "B")})", WarningEnum.Low, false);
|
||||
//AddTextEvent(DateTime.Now,"拍照", $"Dev={devIndex},图像{num}-2");
|
||||
lock (lockScanPhoto)//多线程操作
|
||||
{
|
||||
@ -1056,19 +1081,42 @@ namespace LeatherApp.Page
|
||||
//warning(WarningEnum.Low, true);//暂停
|
||||
}
|
||||
errStep = 6;
|
||||
//厚度检测提示
|
||||
if (curRecord.ProductInfo.OpenThicknessDetection)
|
||||
{
|
||||
if ((curRecord.Len - ThnDieLen) > curRecord.ProductInfo.ThicknessDetectionStopDis)
|
||||
{
|
||||
ThnDieLen = curRecord.Len;
|
||||
AddTextEvent(DateTime.Now, $"厚度检测{Thread.CurrentThread.ManagedThreadId}", $"位置:{curRecord.Len}; 上次位置:{ThnDieLen}");
|
||||
if (!Config.StopPLC)
|
||||
this.devContainer.devPlc.pauseDev();
|
||||
else if (!Config.StopIO && devContainer.devIOCard.IsInit)
|
||||
{
|
||||
//只是设备暂停,APP没暂停
|
||||
//devContainer.io_output(CMDName.绿灯输出, false, true, 0);
|
||||
//devContainer.io_output(CMDName.黄灯输出);
|
||||
devContainer.devIOCard.writeBitState(0, 1, true);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(500);
|
||||
this.devContainer.devIOCard.writeBitState(0, 1, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"待处理图像队列:{curRecord.ScannerPhotoCount - curRecord.ScannerPhotoFinishCount}张");
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"待处理图像队列:{curRecord.ScannerPhotoCount - curRecord.ScannerPhotoFinishCount}张", WarningEnum.Low, false);
|
||||
if (task.scanPhotos0 != null && task.scanPhotos1 != null)
|
||||
{
|
||||
var scanPhoto = task.scanPhotos0 as ScanPhotoInfo;
|
||||
curRecord.dicPhoto_Defect.TryAdd(scanPhoto.photoIndex, false);//加入索引,默认无瑕疵
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"图像索引:{scanPhoto.photoIndex},标识数:{curRecord.dicPhoto_Defect.Count}");
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"图像索引:{scanPhoto.photoIndex},标识数:{curRecord.dicPhoto_Defect.Count}", WarningEnum.Low, false);
|
||||
errStep = 7;
|
||||
//暂停:瑕疵二次判断
|
||||
if (this.defectPauseForUser)
|
||||
{
|
||||
int liPhotoIndex = scanPhoto.photoIndex - Config.defectPauseSkipPhotoCount;
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"Dev={devIndex},图像{scanPhoto.photoIndex} {liPhotoIndex}={scanPhoto.photoIndex}-{Config.defectPauseSkipPhotoCount};{JsonConvert.SerializeObject(curRecord.dicPhoto_Defect)}");
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"Dev={devIndex},图像{scanPhoto.photoIndex} {liPhotoIndex}={scanPhoto.photoIndex}-{Config.defectPauseSkipPhotoCount};{JsonConvert.SerializeObject(curRecord.dicPhoto_Defect)}", WarningEnum.Low, false);
|
||||
if (liPhotoIndex >= 0 && curRecord.dicPhoto_Defect[liPhotoIndex])
|
||||
{
|
||||
List<DefectInfo> lstEditDefect = curRecord.DefectInfoList.Where(m => m.PhotoIndex == liPhotoIndex).ToList();
|
||||
@ -1096,9 +1144,10 @@ namespace LeatherApp.Page
|
||||
this.BeginInvoke(new System.Action(() =>
|
||||
{
|
||||
int liDefectCount = lstEditDefect.Count;
|
||||
FHome_Defect frmDefect = new FHome_Defect(lstEditDefect);
|
||||
FHome_Defect frmDefect = new FHome_Defect(lstEditDefect, defectTag[liPhotoIndex]);
|
||||
if (frmDefect.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
defectTag.Remove(liPhotoIndex);
|
||||
string oldCode;
|
||||
for (int i = 0; i < this.uiDataGridView1.Rows.Count; i++)
|
||||
{
|
||||
@ -1108,7 +1157,7 @@ namespace LeatherApp.Page
|
||||
long uid = (long)this.uiDataGridView1.Rows[i].Cells["colUid"].Value;
|
||||
foreach (var row in lstEditDefect)
|
||||
{
|
||||
AddTextEvent(DateTime.Now, $"暂停{Thread.CurrentThread.ManagedThreadId}", $"修改第({i + 1})行瑕疵名称,{uid} {row.uid}");
|
||||
AddTextEvent(DateTime.Now, $"暂停{Thread.CurrentThread.ManagedThreadId}", $"修改第({i + 1})行瑕疵名称,{uid} {row.uid}", WarningEnum.Low, false);
|
||||
if (row.uid == uid)
|
||||
{
|
||||
oldCode = this.uiDataGridView1.Rows[i].Cells["colCode"].Value.ToString();
|
||||
@ -1170,12 +1219,187 @@ namespace LeatherApp.Page
|
||||
}
|
||||
}
|
||||
errStep = 10;
|
||||
//以下判定放置于二次判定之后,因为二次判定可能会忽略部分检测项!!
|
||||
|
||||
//暂停:缺陷超标
|
||||
//每百米告警判断???在此还是在收到新照片时触发???
|
||||
if (curRecord.ProductInfo.DefectCountLimit > 0 && curRecord.DefectTotalCount >= curRecord.ProductInfo.DefectCountLimit && curRecord.DefectInfoList != null)
|
||||
{
|
||||
int liPhotoIndex = scanPhoto.photoIndex - Config.defectPauseSkipPhotoCount; //二次判定完的图片index
|
||||
int compLen = 100 * 100;//每百米 to cm
|
||||
int compCount = compLen * Config.cm2px_y / scanPhoto.mat.Height; //100m图像张数
|
||||
//从上次告警后重新开始计算长度及数量
|
||||
int defectCount = curRecord.DefectInfoList.Where(m => m.PhotoIndex >= curRecord.preWarningPhotoIndex && m.PhotoIndex >= (liPhotoIndex + 1 - compCount) && m.PhotoIndex <= liPhotoIndex).Count();
|
||||
if (defectCount >= curRecord.ProductInfo.DefectCountLimit)
|
||||
{
|
||||
curRecord.preWarningPhotoIndex = liPhotoIndex + 1;
|
||||
AddTextEvent(DateTime.Now, $"告警{Thread.CurrentThread.ManagedThreadId}", $"每百米瑕疵数量达到阈值!({defectCount}>={curRecord.ProductInfo.DefectCountLimit})", WarningEnum.High);
|
||||
if (!Config.StopPLC)
|
||||
this.devContainer.devPlc.pauseDev();
|
||||
else if (!Config.StopIO && devContainer.devIOCard.IsInit)
|
||||
{
|
||||
//只是设备暂停,APP没暂停
|
||||
devContainer.io_output(CMDName.绿灯输出, false, true, 0);
|
||||
devContainer.io_output(CMDName.黄灯输出);
|
||||
devContainer.devIOCard.writeBitState(0, 1, true);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(500);
|
||||
this.devContainer.devIOCard.writeBitState(0, 1, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
errStep = 11;
|
||||
|
||||
}
|
||||
//暂停:每个缺陷项不同长度检测数量报警
|
||||
if (curRecord.DefectTotalCount > 0 && curRecord.DefectInfoList != null)
|
||||
{
|
||||
#if true
|
||||
//按缺陷计算没X米多少缺陷报警
|
||||
for (int i = 0; i < curRecord.ProductInfo.QualifiedLimitList.Count; i++)
|
||||
{
|
||||
var defectWarn = curRecord.ProductInfo.QualifiedLimitList[i];
|
||||
if (defectWarn.DefectWarnLength > 0 || defectWarn.DefectWarnCnt > 0)
|
||||
{
|
||||
errStep = 12;
|
||||
int liPhotoIndex = scanPhoto.photoIndex - Config.defectPauseSkipPhotoCount; //二次判定完的图片index
|
||||
int warnLen = defectWarn.DefectWarnLength * 100;//每米 to cm
|
||||
int warnCount = warnLen * Config.cm2px_y / scanPhoto.mat.Height; //计算图像张数
|
||||
//从上次告警后重新开始计算长度及数量
|
||||
int warnDefectCount = curRecord.DefectInfoList.Where(m => m.PhotoIndex >= curRecord.preWarningPhotoIndexByLabel[i] && m.PhotoIndex >= (liPhotoIndex + 1 - warnCount) && m.PhotoIndex <= liPhotoIndex).Count();
|
||||
if (warnDefectCount >= defectWarn.DefectWarnCnt)
|
||||
{
|
||||
curRecord.preWarningPhotoIndexByLabel[i] = liPhotoIndex + 1;
|
||||
AddTextEvent(DateTime.Now, $"告警{Thread.CurrentThread.ManagedThreadId}", $"每{defectWarn.DefectWarnLength}米{Config.getDefectName(defectWarn.Code)}瑕疵数量达到阈值!({warnDefectCount}>={defectWarn.DefectWarnCnt})", WarningEnum.High);
|
||||
if (!Config.StopPLC)
|
||||
this.devContainer.devPlc.pauseDev();
|
||||
else if (!Config.StopIO && devContainer.devIOCard.IsInit)
|
||||
{
|
||||
//只是设备暂停,APP没暂停
|
||||
devContainer.io_output(CMDName.绿灯输出, false, true, 0);
|
||||
devContainer.io_output(CMDName.黄灯输出);
|
||||
devContainer.devIOCard.writeBitState(0, 1, true);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(500);
|
||||
this.devContainer.devIOCard.writeBitState(0, 1, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if false
|
||||
//暂停:按等级分卷
|
||||
if (curRecord.DefectTotalCount > 0 && curRecord.ProductInfo.GradeLimitList != null && curRecord.ProductInfo.GradeLimitList.Count > 0 && curRecord.DefectInfoList != null)
|
||||
{
|
||||
errStep = 13;
|
||||
//按缺陷计算每X米多少缺陷分等级
|
||||
for (int i = 0; i < curRecord.ProductInfo.GradeLimitList.Count; i++)
|
||||
{
|
||||
if (curRecord.ProductInfo.GradeLimitList[i].JudgeLength > 0)
|
||||
{
|
||||
errStep = 14;
|
||||
int liPhotoIndex = scanPhoto.photoIndex - Config.defectPauseSkipPhotoCount; //二次判定完的图片index
|
||||
double GrageLen = curRecord.ProductInfo.GradeLimitList[i].JudgeLength * 100;//每米 to cm
|
||||
int warnCount = (int)(GrageLen * Config.cm2px_y) / scanPhoto.mat.Height; //计算图像张数
|
||||
|
||||
if (curRecord.GradeDifferentiateInfoList == null)
|
||||
{
|
||||
curRecord.GradeDifferentiateInfoList = new List<GradeDifferentiateInfo>();
|
||||
}
|
||||
GradeLimit item = curRecord.ProductInfo.GradeLimitList[i];
|
||||
|
||||
GradeDifferentiateInfo differentiateInfo = new GradeDifferentiateInfo();
|
||||
//从上次告警后重新开始计算长度及数量
|
||||
var allFind = curRecord.DefectInfoList.Where(m => m.PhotoIndex >= curRecord.preGradePhotoIndexByGradeIndex && m.PhotoIndex >= (liPhotoIndex + 1 - warnCount) && m.PhotoIndex <= liPhotoIndex).ToList();
|
||||
int warnDefectCount = 0;
|
||||
if (item.Code == "All")
|
||||
warnDefectCount = allFind.Count();
|
||||
else
|
||||
{
|
||||
warnDefectCount = allFind.Where(m => m.Code == item.Code).Count();
|
||||
}
|
||||
int GradeCount = 0;
|
||||
if (item.E > 0 && warnDefectCount > item.E)
|
||||
{
|
||||
GradeCount = item.E;
|
||||
differentiateInfo.GradeCode = "E";
|
||||
}
|
||||
else if (item.D > 0 && warnDefectCount > item.D)
|
||||
{
|
||||
GradeCount = item.D;
|
||||
differentiateInfo.GradeCode = "D";
|
||||
}
|
||||
else if (item.C > 0 && warnDefectCount > item.C)
|
||||
{
|
||||
GradeCount = item.C;
|
||||
differentiateInfo.GradeCode = "C";
|
||||
}
|
||||
else if (item.B > 0 && warnDefectCount > item.B)
|
||||
{
|
||||
GradeCount = item.B;
|
||||
differentiateInfo.GradeCode = "B";
|
||||
}
|
||||
else if (item.A > 0 && warnDefectCount > item.A)
|
||||
{
|
||||
GradeCount = item.A;
|
||||
differentiateInfo.GradeCode = "A";
|
||||
}
|
||||
else
|
||||
{
|
||||
//不需要分级,下一条
|
||||
continue;
|
||||
}
|
||||
|
||||
differentiateInfo.UseGradeLimit = item;
|
||||
differentiateInfo.DefectCnt = warnDefectCount;
|
||||
differentiateInfo.StartPhotoIndex = allFind.Min(x => x.PhotoIndex);
|
||||
differentiateInfo.EndPhotoIndex = allFind.Max(x => x.PhotoIndex);
|
||||
differentiateInfo.StartY = allFind.Min(x => x.CentreY) / 100 - OffsetCut;
|
||||
differentiateInfo.EndY = allFind.Max(x => x.CentreY) / 100 + OffsetCut;
|
||||
differentiateInfo.CutLen = differentiateInfo.EndY - differentiateInfo.StartY;
|
||||
//记录新的判定开始位置
|
||||
curRecord.preGradePhotoIndexByGradeIndex = liPhotoIndex + 1;
|
||||
AddTextEvent(DateTime.Now, $"提示{Thread.CurrentThread.ManagedThreadId}", $"每{curRecord.ProductInfo.GradeLimitList[i].JudgeLength}米,瑕疵数量达到分级阈值!({warnDefectCount}>={GradeCount})", WarningEnum.Low);
|
||||
curRecord.GradeDifferentiateInfoList.Add(differentiateInfo);
|
||||
//标记裁切位置
|
||||
this.BeginInvoke(new System.Action(() =>
|
||||
{
|
||||
reDrawDefectPointsAndCut(differentiateInfo.StartY, differentiateInfo.EndY, differentiateInfo.GradeCode);
|
||||
}));
|
||||
//裁切暂停提示
|
||||
if (curRecord.ProductInfo.IsHintCutting)
|
||||
{
|
||||
AddTextEvent(DateTime.Now, $"提示", $"裁切 起始{differentiateInfo.StartY}-终点{differentiateInfo.EndY}", WarningEnum.Low);
|
||||
if (!Config.StopPLC)
|
||||
this.devContainer.devPlc.pauseDev();
|
||||
else if (!Config.StopIO && devContainer.devIOCard.IsInit)
|
||||
{
|
||||
//只是设备暂停,APP没暂停
|
||||
devContainer.io_output(CMDName.绿灯输出, false, true, 0);
|
||||
devContainer.io_output(CMDName.黄灯输出);
|
||||
devContainer.devIOCard.writeBitState(0, 1, true);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(500);
|
||||
this.devContainer.devIOCard.writeBitState(0, 1, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
task.record = curRecord;
|
||||
task.finishEvent = callBackPhotoEvent;
|
||||
devContainer.libPhoto.add(task);
|
||||
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"Dev={devIndex},图像{scanPhoto.photoIndex},已加入图像处理队列");
|
||||
errStep = 11;
|
||||
Application.DoEvents();
|
||||
errStep = 21;
|
||||
//Application.DoEvents();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1191,7 +1415,7 @@ namespace LeatherApp.Page
|
||||
ScanPhotoInfo scanPhotos1 = task.scanPhotos1 as ScanPhotoInfo;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
|
||||
AddTextEvent(DateTime.Now,$"图像处理{Thread.CurrentThread.ManagedThreadId}", $"图像{scanPhotos0.photoIndex},ThreadId={Thread.CurrentThread.ManagedThreadId}");
|
||||
AddTextEvent(DateTime.Now,$"图像处理{Thread.CurrentThread.ManagedThreadId}", $"图像{scanPhotos0.photoIndex},ThreadId={Thread.CurrentThread.ManagedThreadId}", WarningEnum.Low, false);
|
||||
string time = "";
|
||||
stopWatch.Start();
|
||||
try
|
||||
@ -1245,7 +1469,7 @@ namespace LeatherApp.Page
|
||||
}
|
||||
AddTextEvent(DateTime.Now,$"裁边{Thread.CurrentThread.ManagedThreadId}",
|
||||
$"(图像{scanPhotos0.photoIndex})-左图去重后:{mat0.Width}*{mat0.Height},右图:{mat1.Width}*{mat1.Height}," +
|
||||
$"重复值:{Config.MiddleSuperposition},孔洞:{Config.MarginHoleWidth},cm2px:{Config.cm2px_x},resizeWidth:{resizeWidth}");
|
||||
$"重复值:{Config.MiddleSuperposition},孔洞:{Config.MarginHoleWidth},cm2px:{Config.cm2px_x},resizeWidth:{resizeWidth}", WarningEnum.Low, false);
|
||||
errStep = 4;
|
||||
//mat0 = OpenCVUtil.getMaxInsetRect(mat0);
|
||||
int marginWidth0, marginWidth1;
|
||||
@ -1260,7 +1484,7 @@ namespace LeatherApp.Page
|
||||
time += $"->图2裁边({stopWatch.ElapsedMilliseconds})";
|
||||
//水平合并l
|
||||
Mat mat = OpenCVUtil.mergeImage_sameSize(new Mat[] { mat0, mat1 });//这里相机反装,左右反转下
|
||||
AddTextEvent(DateTime.Now,$"裁边{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-边缘宽度:(左图)={marginWidth0},(右图)={marginWidth1}; 裁边去孔洞后:({mat0.Width}+{mat1.Width}={mat0.Width+ mat1.Width});合并后(去孔洞):{mat.Width}*{mat.Height}");
|
||||
AddTextEvent(DateTime.Now,$"裁边{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-边缘宽度:(左图)={marginWidth0},(右图)={marginWidth1}; 裁边去孔洞后:({mat0.Width}+{mat1.Width}={mat0.Width+ mat1.Width});合并后(去孔洞):{mat.Width}*{mat.Height}", WarningEnum.Low, false);
|
||||
float widthRatio = mat.Width * 1.0f / resize.Width;//宽度比例
|
||||
time += $"->图1+2合并({stopWatch.ElapsedMilliseconds})";
|
||||
|
||||
@ -1274,7 +1498,7 @@ namespace LeatherApp.Page
|
||||
if (curRecord.FaceWidthMax < faceWidthY_cm)
|
||||
curRecord.FaceWidthMax = faceWidthY_cm;
|
||||
var point = new float[] { faceWidthX_cm, faceWidthY_cm };// new System.Drawing.PointF(faceWidthX_cm, faceWidthY_cm);
|
||||
AddTextEvent(DateTime.Now,$"门幅{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-({scanPhotos0.photoIndex})位置:{point[0]}; 幅宽:{point[1]}");
|
||||
AddTextEvent(DateTime.Now,$"门幅{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-({scanPhotos0.photoIndex})位置:{point[0]}; 幅宽:{point[1]}", WarningEnum.Low, false);
|
||||
curRecord.FacePointList.Add(point);
|
||||
reDrawFaceWidth(curRecord.FacePointList,
|
||||
new double[] { 0, Math.Round(point[0] + 0.005f, 2) },
|
||||
@ -1302,7 +1526,7 @@ namespace LeatherApp.Page
|
||||
//----缺陷队列
|
||||
int oxw, oxh;
|
||||
mat = OpenCVUtil.resize(mat, resize.Width, resize.Height, out oxw, out oxh);
|
||||
AddTextEvent(DateTime.Now,$"图像处理{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-合成图resize后:{mat.Width}*{mat.Height}");
|
||||
AddTextEvent(DateTime.Now,$"图像处理{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-合成图resize后:{mat.Width}*{mat.Height}", WarningEnum.Low, false);
|
||||
devContainer.libDefect.add(new Device.DefectLib.DefectTask()
|
||||
{
|
||||
modelName= curRecord.ProductInfo.ModelName,
|
||||
@ -1328,12 +1552,12 @@ namespace LeatherApp.Page
|
||||
}
|
||||
finally
|
||||
{
|
||||
AddTextEvent(DateTime.Now,$"图像处理{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-进度计时:{time}");
|
||||
AddTextEvent(DateTime.Now,$"图像处理{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-进度计时:{time}", WarningEnum.Low, false);
|
||||
scanPhotos0.mat.Dispose();
|
||||
scanPhotos1.mat.Dispose();
|
||||
scanPhotos0 = scanPhotos1 = null;
|
||||
task = null;
|
||||
System.GC.Collect();
|
||||
//System.GC.Collect();
|
||||
}
|
||||
}
|
||||
private void callBackDefectEvent(Device.DefectLib.DefectTask res)
|
||||
@ -1342,7 +1566,7 @@ namespace LeatherApp.Page
|
||||
int step = 0;
|
||||
try
|
||||
{
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", $"图像队列:{res.record.ScannerPhotoFinishCount+1}/{res.record.ScannerPhotoCount} (图像{res.photoIndex})检测结果:{res.isSucceed}");
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", $"图像队列:{res.record.ScannerPhotoFinishCount+1}/{res.record.ScannerPhotoCount} (图像{res.photoIndex})检测结果:{res.isSucceed}", WarningEnum.Low, false);
|
||||
string dirPath = FileUtil.initFolder($"{Config.ImagePath}{res.record.BatchId}_{res.record.ReelId}\\");
|
||||
string dirSourcePath = FileUtil.initFolder($"{Config.ImagePath}{res.record.BatchId}_{res.record.ReelId}\\源图\\");
|
||||
//Cv2.Flip(res.bmp, res.bmp, FlipMode.XY);//翻转
|
||||
@ -1352,10 +1576,10 @@ namespace LeatherApp.Page
|
||||
if (res.isSucceed)
|
||||
{
|
||||
step = 1;
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", $"(图像{res.photoIndex})-瑕疵检测完成,共{res.excelTable.Rows.Count}个瑕疵!各环节用时:{string.Join(",",res.stopwatch)}");
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", $"(图像{res.photoIndex})-瑕疵检测完成,共{res.excelTable.Rows.Count}个瑕疵!各环节用时:{string.Join(",",res.stopwatch)}", WarningEnum.Low, false);
|
||||
//AddTextEvent(DateTime.Now,$"打标完成", $"第 ({res.photoIndex}) 张照片,计算过程:{res.resultInfo}");
|
||||
if (!Config.IsSaveAllImage && Config.IsSaveDefectSourceImage)
|
||||
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save($"{dirSourcePath}{res.photoIndex}.bmp", ImageFormat.Bmp);
|
||||
//if (!Config.IsSaveAllImage && Config.IsSaveDefectSourceImage)
|
||||
// OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save($"{dirSourcePath}{res.photoIndex}.bmp", ImageFormat.Bmp);
|
||||
|
||||
step = 2;
|
||||
if (res.excelTable.Rows.Count > 0)
|
||||
@ -1363,6 +1587,8 @@ namespace LeatherApp.Page
|
||||
res.record.dicPhoto_Defect[res.photoIndex] = true;//改为此图有瑕疵
|
||||
//有瑕疵打标图必需保存 Jpeg
|
||||
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmpTag).Save($"{dirPath}{res.photoIndex}_tag.jpg", ImageFormat.Jpeg);
|
||||
if (!Config.IsSaveAllImage && Config.IsSaveDefectSourceImage)
|
||||
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save($"{dirSourcePath}{res.photoIndex}.bmp", ImageFormat.Bmp);
|
||||
step = 3;
|
||||
res.record.DefectTotalCount += res.excelTable.Rows.Count;
|
||||
if (res.record.DefectInfoList == null)
|
||||
@ -1398,6 +1624,11 @@ namespace LeatherApp.Page
|
||||
defectInfo.uid = preTicks++;// res.record.DefectInfoList.Count;//程序中的唯一索引,用于移除用索引
|
||||
//AddTextEvent(DateTime.Now,$"打标完成", $"第{i}个缺陷:{ JsonConvert.SerializeObject(defectInfo)}; Y={res.photoIndex * res.bmp.Height * 1.0d / Config.cm2px_y}+{res.excelTable.Rows[i]["Y"].ToString()}");
|
||||
step = 7 + i * 10;
|
||||
|
||||
if (!defectTag.ContainsKey(res.photoIndex))
|
||||
{
|
||||
defectTag.Add(res.photoIndex, res.bmpTag.Clone());
|
||||
}
|
||||
//保存打标小图
|
||||
if (Config.IsSaveDefectCutImage)
|
||||
{
|
||||
@ -1424,9 +1655,23 @@ namespace LeatherApp.Page
|
||||
if (res.record.ProductInfo.DefectAreaLimit > 0 && defectInfo.Area>=res.record.ProductInfo.DefectAreaLimit)
|
||||
{
|
||||
AddTextEvent(DateTime.Now,$"告警{Thread.CurrentThread.ManagedThreadId}", $"瑕疵面积达到阈值!({defectInfo.Area}>={res.record.ProductInfo.DefectAreaLimit})", WarningEnum.High);
|
||||
if (!Config.StopPLC)
|
||||
this.devContainer.devPlc.pauseDev();
|
||||
else if (!Config.StopIO && devContainer.devIOCard.IsInit)
|
||||
{
|
||||
//只是设备暂停,APP没暂停
|
||||
devContainer.io_output(CMDName.绿灯输出, false, true, 0);
|
||||
devContainer.io_output(CMDName.黄灯输出);
|
||||
devContainer.devIOCard.writeBitState(0, 1, true);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(500);
|
||||
this.devContainer.devIOCard.writeBitState(0, 1, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", "更新UI");
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", "更新UI", WarningEnum.Low, false);
|
||||
//更新UI
|
||||
int bmpHeight = res.bmp.Height;
|
||||
this.BeginInvoke(new System.Action(() =>
|
||||
@ -1444,12 +1689,12 @@ namespace LeatherApp.Page
|
||||
this.reDrawDefectPoints(res.record.DefectInfoList, new double[] { 0, Math.Round(res.record.FaceWidthMax+ 0.005f, 2) }, new double[] { 0, len });
|
||||
}));
|
||||
step = 9;
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", "保存CSV");
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", "保存CSV", WarningEnum.Low, false);
|
||||
//保存CSV
|
||||
bool b = Utils.ExcelUtil.DataTable2CSV($"{dirPath}{res.photoIndex}.csv", res.excelTable);
|
||||
//AddTextEvent(DateTime.Now,$"打标完成", $"{res.tag}.xlsx {(b ? "保存成功!" : "保存失败!")}");
|
||||
step = 10;
|
||||
|
||||
#if 转移判定位置
|
||||
//每百米告警判断???在此还是在收到新照片时触发???
|
||||
if (res.record.ProductInfo.DefectCountLimit > 0 && res.record.DefectTotalCount >= res.record.ProductInfo.DefectCountLimit)
|
||||
{
|
||||
@ -1484,6 +1729,7 @@ namespace LeatherApp.Page
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@ -1505,7 +1751,7 @@ namespace LeatherApp.Page
|
||||
res.record.ScannerPhotoFinishCount++;
|
||||
int liScannerPhotoFinishCount = res.record.ScannerPhotoFinishCount;
|
||||
int liScannerPhotoCount = res.record.ScannerPhotoCount;
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", $"{liScannerPhotoFinishCount}/{liScannerPhotoCount}");
|
||||
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", $"{liScannerPhotoFinishCount}/{liScannerPhotoCount}", WarningEnum.Low, false);
|
||||
//this.BeginInvoke(new System.Action(() =>
|
||||
//{
|
||||
// this.lblWaitImageCount.Text = $"{liScannerPhotoCount - liScannerPhotoFinishCount}";
|
||||
@ -1693,6 +1939,8 @@ namespace LeatherApp.Page
|
||||
resetUIValue();
|
||||
AddTextEvent(DateTime.Now,"启动", "等待扫码...");
|
||||
currentState = CurrentStateEnum.运行中;
|
||||
defectTag.Clear();
|
||||
ThnDieLen = 0;
|
||||
}
|
||||
|
||||
this.Invoke(new System.Action(() =>
|
||||
@ -1901,14 +2149,55 @@ namespace LeatherApp.Page
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<DefectInfo> lstEditDefect = new List<DefectInfo>();
|
||||
DefectInfo dt = new DefectInfo();
|
||||
dt.Name = "123";
|
||||
dt.Code = "jb";
|
||||
dt.image = Image.FromFile("C:\\Users\\fang\\Desktop\\123.png");
|
||||
lstEditDefect.Add(dt);
|
||||
FHome_Defect frmDefect = new FHome_Defect(lstEditDefect);
|
||||
frmDefect.ShowDialog();
|
||||
//List<DefectInfo> lstEditDefect = new List<DefectInfo>();
|
||||
//DefectInfo dt = new DefectInfo();
|
||||
//dt.Name = "123";
|
||||
//dt.Code = "wuyin";
|
||||
//dt.image = Image.FromFile("C:\\Users\\fang\\Desktop\\123.png");
|
||||
//lstEditDefect.Add(dt);
|
||||
//Mat mtt = new Mat("C:\\Users\\fang\\Desktop\\新建文件夹\\mx\\636.bmp");
|
||||
//FHome_Defect frmDefect = new FHome_Defect(lstEditDefect, mtt);
|
||||
//frmDefect.ShowDialog();
|
||||
|
||||
Config.LoadAllConfig();
|
||||
//设置程序最小/大线程池
|
||||
// Get the current settings.
|
||||
int minWorker, minIOC;
|
||||
ThreadPool.GetMinThreads(out minWorker, out minIOC);
|
||||
ThreadPool.SetMinThreads(25, minIOC);
|
||||
Mat matt = new Mat("C:\\Users\\fang\\Desktop\\新建文件夹\\287.bmp");
|
||||
|
||||
//OpenCVUtil.LoadEdgeMode();
|
||||
//int tt = 0;
|
||||
//var mty = OpenCVUtil.getMaxInsetRect2(matt, false, 0,out tt);
|
||||
//mty.SaveImage("edge.bmp");
|
||||
|
||||
List<QualifiedLimit> qlist = new List<QualifiedLimit>();
|
||||
|
||||
qlist.Add(new QualifiedLimit() { Code = "laji", ZXD = 0.3, Area = 0.04, ContrastLower = 0.98, ContrastTop = 1.02 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "wuyin", ZXD = 0.3, Area = 0.09, ContrastLower = 0.93, ContrastTop = 1.07 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "jiangyin", ZXD = 0.3, Area = 0.04, ContrastLower = 0.96, ContrastTop = 1.04 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "zhouyin", ZXD = 0.3, Area = 0.09, ContrastLower = 0.94, ContrastTop = 1.06 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "hengdang", ZXD = 0.3, Area = 0.08, ContrastLower = 0.99, ContrastTop = 1.01 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "jietou", ZXD = 0.3, Area = 0.04, ContrastLower = 0.99, ContrastTop = 1.01 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "chongying", ZXD = 0.3, Area = 2, ContrastLower = 0.99, ContrastTop = 1.01 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "aokeng", ZXD = 0.3, Area = 0.05, ContrastLower = 0.99, ContrastTop = 1.01 });
|
||||
qlist.Add(new QualifiedLimit() { Code = "bmss", ZXD = 0.3, Area = 2, ContrastLower = 0.99, ContrastTop = 1.01 });
|
||||
|
||||
DefectLib dlt = new DefectLib();
|
||||
dlt.start();
|
||||
dlt.add(new Device.DefectLib.DefectTask()
|
||||
{
|
||||
modelName = "CYG_0706.trt",
|
||||
record = null,
|
||||
bmp = matt,
|
||||
bmpTag = matt.Clone(),
|
||||
photoIndex = 0,//0-n 首张必需为0,因下面计算长度是从0开始
|
||||
widthRatio = 1,
|
||||
qualifiedLimitList = qlist,
|
||||
finishEvent = callBackDefectEvent,
|
||||
xw = 0,
|
||||
});
|
||||
return;
|
||||
Config.LoadAllConfig();
|
||||
DefectLib dl = new DefectLib();
|
||||
@ -2104,5 +2393,15 @@ namespace LeatherApp.Page
|
||||
record.ErpLen = val;
|
||||
}
|
||||
}
|
||||
|
||||
private void FHome_Resize(object sender, EventArgs e)
|
||||
{
|
||||
uilbKF.Top = 8;
|
||||
}
|
||||
|
||||
private void FHome_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
uilbKF.Top = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,25 +29,35 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.uiPanel1 = new Sunny.UI.UIPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnOK = new Sunny.UI.UIButton();
|
||||
this.btnCancel = new Sunny.UI.UIButton();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.uiPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// uiPanel1
|
||||
//
|
||||
this.uiPanel1.Controls.Add(this.flowLayoutPanel1);
|
||||
this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.uiPanel1.Location = new System.Drawing.Point(4, 39);
|
||||
this.uiPanel1.Location = new System.Drawing.Point(4, 221);
|
||||
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiPanel1.Name = "uiPanel1";
|
||||
this.uiPanel1.Size = new System.Drawing.Size(1242, 919);
|
||||
this.uiPanel1.Size = new System.Drawing.Size(1242, 737);
|
||||
this.uiPanel1.TabIndex = 0;
|
||||
this.uiPanel1.Text = "uiPanel1";
|
||||
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoScroll = true;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(1236, 731);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
@ -75,19 +85,24 @@
|
||||
this.btnCancel.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
// pictureBox1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoScroll = true;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(1236, 913);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pictureBox1.Location = new System.Drawing.Point(4, 38);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(1242, 180);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox1.TabIndex = 2;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// FHome_Defect
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(1250, 1014);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.uiPanel1);
|
||||
@ -99,6 +114,7 @@
|
||||
this.ZoomScaleRect = new System.Drawing.Rectangle(22, 22, 800, 450);
|
||||
this.Load += new System.EventHandler(this.FHome_Defect_Load);
|
||||
this.uiPanel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@ -109,5 +125,6 @@
|
||||
private Sunny.UI.UIButton btnOK;
|
||||
private Sunny.UI.UIButton btnCancel;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
using LeatherApp.UIExtend;
|
||||
using Models;
|
||||
using OpenCvSharp;
|
||||
using OpenCvSharp.Extensions;
|
||||
using Sunny.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -17,10 +19,13 @@ namespace LeatherApp.Page
|
||||
{
|
||||
private List<DefectInfo> list;
|
||||
public List<DefectInfo> lstDel = new List<DefectInfo>();
|
||||
public FHome_Defect(List<DefectInfo> lst)
|
||||
private Mat Image;
|
||||
public FHome_Defect(List<DefectInfo> lst, Mat img)
|
||||
{
|
||||
InitializeComponent();
|
||||
list = lst;
|
||||
Image = img;
|
||||
pictureBox1.Image = Image.ToBitmap();
|
||||
init();
|
||||
}
|
||||
|
||||
|
179
LeatherProject/LeatherApp/Page/FProductInfo.Designer.cs
generated
179
LeatherProject/LeatherApp/Page/FProductInfo.Designer.cs
generated
@ -33,12 +33,12 @@
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.uiTitlePanel2 = new Sunny.UI.UITitlePanel();
|
||||
this.tcbarTensionValue = new Sunny.UI.UITrackBar();
|
||||
this.tcbarGain = new Sunny.UI.UITrackBar();
|
||||
@ -65,6 +65,14 @@
|
||||
this.uiLabel7 = new Sunny.UI.UILabel();
|
||||
this.uiTitlePanel5 = new Sunny.UI.UITitlePanel();
|
||||
this.uiDataGridView1 = new Sunny.UI.UIDataGridView();
|
||||
this.col_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_zxd = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_area = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_contrast_lower = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_contrast_top = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_IsOR = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.col_Len = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_Cnt = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.uiTitlePanel6 = new Sunny.UI.UITitlePanel();
|
||||
this.uiDataGridView2 = new Sunny.UI.UIDataGridView();
|
||||
this.col2_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@ -88,14 +96,9 @@
|
||||
this.cmbColor = new Sunny.UI.UIComboBox();
|
||||
this.uiLabel3 = new Sunny.UI.UILabel();
|
||||
this.uiLabel2 = new Sunny.UI.UILabel();
|
||||
this.col_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_zxd = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_area = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_contrast_lower = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_contrast_top = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_IsOR = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.col_Len = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.col_Cnt = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.uiSwitch1 = new Sunny.UI.UISwitch();
|
||||
this.uiLabel11 = new Sunny.UI.UILabel();
|
||||
this.uiNumPadTextBox1 = new Sunny.UI.UINumPadTextBox();
|
||||
this.uiTitlePanel2.SuspendLayout();
|
||||
this.uiTitlePanel3.SuspendLayout();
|
||||
this.uiTitlePanel4.SuspendLayout();
|
||||
@ -373,6 +376,9 @@
|
||||
// uiTitlePanel4
|
||||
//
|
||||
this.uiTitlePanel4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.uiTitlePanel4.Controls.Add(this.uiNumPadTextBox1);
|
||||
this.uiTitlePanel4.Controls.Add(this.uiLabel11);
|
||||
this.uiTitlePanel4.Controls.Add(this.uiSwitch1);
|
||||
this.uiTitlePanel4.Controls.Add(this.btnDefectOption);
|
||||
this.uiTitlePanel4.Controls.Add(this.swcDefectPauseForUser);
|
||||
this.uiTitlePanel4.Controls.Add(this.numDefectCountLimit);
|
||||
@ -579,6 +585,68 @@
|
||||
this.uiDataGridView1.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiDataGridView1.TabIndex = 21;
|
||||
//
|
||||
// col_code
|
||||
//
|
||||
this.col_code.DataPropertyName = "Code";
|
||||
this.col_code.HeaderText = "code";
|
||||
this.col_code.MinimumWidth = 8;
|
||||
this.col_code.Name = "col_code";
|
||||
this.col_code.ReadOnly = true;
|
||||
this.col_code.Visible = false;
|
||||
this.col_code.Width = 150;
|
||||
//
|
||||
// col_zxd
|
||||
//
|
||||
this.col_zxd.DataPropertyName = "ZXD";
|
||||
dataGridViewCellStyle3.NullValue = null;
|
||||
this.col_zxd.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.col_zxd.HeaderText = "置信度";
|
||||
this.col_zxd.MinimumWidth = 20;
|
||||
this.col_zxd.Name = "col_zxd";
|
||||
this.col_zxd.Width = 150;
|
||||
//
|
||||
// col_area
|
||||
//
|
||||
this.col_area.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.col_area.DataPropertyName = "Area";
|
||||
this.col_area.HeaderText = "面积(mm^2)";
|
||||
this.col_area.MinimumWidth = 20;
|
||||
this.col_area.Name = "col_area";
|
||||
//
|
||||
// col_contrast_lower
|
||||
//
|
||||
this.col_contrast_lower.DataPropertyName = "Contrast";
|
||||
this.col_contrast_lower.HeaderText = "对比度(下限)";
|
||||
this.col_contrast_lower.MinimumWidth = 80;
|
||||
this.col_contrast_lower.Name = "col_contrast_lower";
|
||||
this.col_contrast_lower.Width = 120;
|
||||
//
|
||||
// col_contrast_top
|
||||
//
|
||||
this.col_contrast_top.HeaderText = "对比度(上限)";
|
||||
this.col_contrast_top.MinimumWidth = 80;
|
||||
this.col_contrast_top.Name = "col_contrast_top";
|
||||
this.col_contrast_top.Width = 120;
|
||||
//
|
||||
// col_IsOR
|
||||
//
|
||||
this.col_IsOR.HeaderText = "或向选择";
|
||||
this.col_IsOR.MinimumWidth = 8;
|
||||
this.col_IsOR.Name = "col_IsOR";
|
||||
this.col_IsOR.Width = 150;
|
||||
//
|
||||
// col_Len
|
||||
//
|
||||
this.col_Len.HeaderText = "报警长度(m)";
|
||||
this.col_Len.Name = "col_Len";
|
||||
this.col_Len.Visible = false;
|
||||
//
|
||||
// col_Cnt
|
||||
//
|
||||
this.col_Cnt.HeaderText = "报警数量";
|
||||
this.col_Cnt.Name = "col_Cnt";
|
||||
this.col_Cnt.Visible = false;
|
||||
//
|
||||
// uiTitlePanel6
|
||||
//
|
||||
this.uiTitlePanel6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
@ -957,67 +1025,45 @@
|
||||
this.uiLabel2.Text = "产品颜色";
|
||||
this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// col_code
|
||||
// uiSwitch1
|
||||
//
|
||||
this.col_code.DataPropertyName = "Code";
|
||||
this.col_code.HeaderText = "code";
|
||||
this.col_code.MinimumWidth = 8;
|
||||
this.col_code.Name = "col_code";
|
||||
this.col_code.ReadOnly = true;
|
||||
this.col_code.Visible = false;
|
||||
this.col_code.Width = 150;
|
||||
this.uiSwitch1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.uiSwitch1.Location = new System.Drawing.Point(9, 294);
|
||||
this.uiSwitch1.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSwitch1.Name = "uiSwitch1";
|
||||
this.uiSwitch1.Size = new System.Drawing.Size(80, 29);
|
||||
this.uiSwitch1.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiSwitch1.TabIndex = 15;
|
||||
this.uiSwitch1.Text = "uiSwitch1";
|
||||
//
|
||||
// col_zxd
|
||||
// uiLabel11
|
||||
//
|
||||
this.col_zxd.DataPropertyName = "ZXD";
|
||||
dataGridViewCellStyle3.NullValue = null;
|
||||
this.col_zxd.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.col_zxd.HeaderText = "置信度";
|
||||
this.col_zxd.MinimumWidth = 20;
|
||||
this.col_zxd.Name = "col_zxd";
|
||||
this.col_zxd.Width = 150;
|
||||
this.uiLabel11.AutoSize = true;
|
||||
this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.uiLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
||||
this.uiLabel11.Location = new System.Drawing.Point(5, 268);
|
||||
this.uiLabel11.Name = "uiLabel11";
|
||||
this.uiLabel11.Size = new System.Drawing.Size(106, 21);
|
||||
this.uiLabel11.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiLabel11.TabIndex = 16;
|
||||
this.uiLabel11.Text = "厚度检测判断";
|
||||
this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// col_area
|
||||
// uiNumPadTextBox1
|
||||
//
|
||||
this.col_area.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.col_area.DataPropertyName = "Area";
|
||||
this.col_area.HeaderText = "面积(mm^2)";
|
||||
this.col_area.MinimumWidth = 20;
|
||||
this.col_area.Name = "col_area";
|
||||
//
|
||||
// col_contrast_lower
|
||||
//
|
||||
this.col_contrast_lower.DataPropertyName = "Contrast";
|
||||
this.col_contrast_lower.HeaderText = "对比度(下限)";
|
||||
this.col_contrast_lower.MinimumWidth = 80;
|
||||
this.col_contrast_lower.Name = "col_contrast_lower";
|
||||
this.col_contrast_lower.Width = 120;
|
||||
//
|
||||
// col_contrast_top
|
||||
//
|
||||
this.col_contrast_top.HeaderText = "对比度(上限)";
|
||||
this.col_contrast_top.MinimumWidth = 80;
|
||||
this.col_contrast_top.Name = "col_contrast_top";
|
||||
this.col_contrast_top.Width = 120;
|
||||
//
|
||||
// col_IsOR
|
||||
//
|
||||
this.col_IsOR.HeaderText = "或向选择";
|
||||
this.col_IsOR.MinimumWidth = 8;
|
||||
this.col_IsOR.Name = "col_IsOR";
|
||||
this.col_IsOR.Width = 150;
|
||||
//
|
||||
// col_Len
|
||||
//
|
||||
this.col_Len.HeaderText = "报警长度(m)";
|
||||
this.col_Len.Name = "col_Len";
|
||||
this.col_Len.Visible = false;
|
||||
//
|
||||
// col_Cnt
|
||||
//
|
||||
this.col_Cnt.HeaderText = "报警数量";
|
||||
this.col_Cnt.Name = "col_Cnt";
|
||||
this.col_Cnt.Visible = false;
|
||||
this.uiNumPadTextBox1.FillColor = System.Drawing.Color.White;
|
||||
this.uiNumPadTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.uiNumPadTextBox1.Location = new System.Drawing.Point(96, 294);
|
||||
this.uiNumPadTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.uiNumPadTextBox1.MinimumSize = new System.Drawing.Size(63, 0);
|
||||
this.uiNumPadTextBox1.Name = "uiNumPadTextBox1";
|
||||
this.uiNumPadTextBox1.NumPadType = Sunny.UI.NumPadType.Integer;
|
||||
this.uiNumPadTextBox1.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2);
|
||||
this.uiNumPadTextBox1.Size = new System.Drawing.Size(132, 29);
|
||||
this.uiNumPadTextBox1.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiNumPadTextBox1.TabIndex = 17;
|
||||
this.uiNumPadTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.uiNumPadTextBox1.Watermark = "";
|
||||
//
|
||||
// FProductInfo
|
||||
//
|
||||
@ -1111,5 +1157,8 @@
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn col_IsOR;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn col_Len;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn col_Cnt;
|
||||
private Sunny.UI.UINumPadTextBox uiNumPadTextBox1;
|
||||
private Sunny.UI.UILabel uiLabel11;
|
||||
private Sunny.UI.UISwitch uiSwitch1;
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,13 @@ namespace LeatherApp.Page
|
||||
//if (dataGridView1.RowHeadersVisible) dataGridView1.TopLeftHeaderCell.Value = "SPH/CYL";
|
||||
#endregion
|
||||
|
||||
this.rbMaterial0.Text = Config.materialNameList.FirstOrDefault(x => x.Value<int>("code") == 0).Value<string>("name");
|
||||
this.rbMaterial1.Text = Config.materialNameList.FirstOrDefault(x => x.Value<int>("code") == 1).Value<string>("name");
|
||||
this.rbMaterial2.Text = Config.materialNameList.FirstOrDefault(x => x.Value<int>("code") == 2).Value<string>("name");
|
||||
this.rbMaterial3.Text = Config.materialNameList.FirstOrDefault(x => x.Value<int>("code") == 3).Value<string>("name");
|
||||
this.rbMaterial4.Text = Config.materialNameList.FirstOrDefault(x => x.Value<int>("code") == 4).Value<string>("name");
|
||||
this.rbMaterial5.Text = Config.materialNameList.FirstOrDefault(x => x.Value<int>("code") == 5).Value<string>("name");
|
||||
|
||||
initData();
|
||||
}
|
||||
private void initData()
|
||||
@ -112,7 +119,7 @@ namespace LeatherApp.Page
|
||||
{
|
||||
clear(resetAll);
|
||||
string[] codes= pcode.Split('-');
|
||||
if (codes[0]=="0" || Config.SuedeList.Contains(codes[0]))
|
||||
if (codes[0]=="0" || Config.SuedeList1.Contains(codes[0]))
|
||||
this.rbMaterial0.Checked = true;
|
||||
else if (codes[0] == "1")
|
||||
this.rbMaterial1.Checked = true;
|
||||
@ -124,6 +131,9 @@ namespace LeatherApp.Page
|
||||
this.rbMaterial4.Checked = true;
|
||||
else if (codes[0] == "5")
|
||||
this.rbMaterial5.Checked = true;
|
||||
else
|
||||
this.rbMaterial1.Checked = true;
|
||||
|
||||
this.cmbColor.SelectedValue = int.Parse(codes[1]);
|
||||
}
|
||||
else
|
||||
@ -327,6 +337,12 @@ namespace LeatherApp.Page
|
||||
model.DefectCountLimit = int.Parse(numDefectCountLimit.Text.Trim());
|
||||
model.DefectPauseForUser = swcDefectPauseForUser.Active;
|
||||
|
||||
model.OpenThicknessDetection = uiSwitch1.Active;
|
||||
int ival;
|
||||
if (int.TryParse(uiNumPadTextBox1.Text, out ival))
|
||||
model.ThicknessDetectionStopDis = int.Parse(uiNumPadTextBox1.Text.Trim());
|
||||
else
|
||||
model.ThicknessDetectionStopDis = 0;
|
||||
//datagrid
|
||||
if (model.QualifiedLimitList == null)
|
||||
model.QualifiedLimitList = new List<Models.QualifiedLimit>();
|
||||
@ -344,8 +360,8 @@ namespace LeatherApp.Page
|
||||
ContrastTop = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_contrast_top"].Value) ? PercentToContrast(Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_contrast_top"].Value)) : 0,
|
||||
IsOR = Convert.ToBoolean(uiDataGridView1.Rows[i].Cells["col_IsOR"].Value),
|
||||
|
||||
//DefectWarnLength = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_Len"].Value) ? (int)Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_Len"].Value) : 0,
|
||||
//DefectWarnCnt = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_Cnt"].Value) ? (int)Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_Cnt"].Value) : 0,
|
||||
DefectWarnLength = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_Len"].Value) ? (int)Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_Len"].Value) : 0,
|
||||
DefectWarnCnt = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_Cnt"].Value) ? (int)Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_Cnt"].Value) : 0,
|
||||
|
||||
ModifyUserCode = Config.loginUser.Code,
|
||||
CreateUserCode = Config.loginUser.Code
|
||||
|
@ -127,8 +127,10 @@ namespace LeatherApp.Page
|
||||
|
||||
private void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
int err = 0;
|
||||
try
|
||||
{
|
||||
|
||||
if (this.uiDataGridView1.CurrentRow == null)
|
||||
return;
|
||||
|
||||
@ -140,6 +142,7 @@ namespace LeatherApp.Page
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
return;
|
||||
|
||||
err = 1;
|
||||
//var list = uiDataGridView1.DataSource as List<Records>;
|
||||
//var table = ExcelUtil.ConvertToDataTable<Records>(list);
|
||||
|
||||
@ -149,6 +152,7 @@ namespace LeatherApp.Page
|
||||
//绘图1
|
||||
double len = Math.Round(record.Len*100, 2);//cm
|
||||
this.reDrawDefectPoints(record.DefectInfoList, new double[] { 0, Math.Round(record.FaceWidthMax + 0.005f, 2) }, new double[] { 0, len });
|
||||
err = 2;
|
||||
//绘图2
|
||||
//var points = Array.ConvertAll(record.FaceWidthListStr.Split(new[] { ',', }, StringSplitOptions.RemoveEmptyEntries),Double.Parse).ToList();
|
||||
//reDrawFaceWidth(record.FacePointList,
|
||||
@ -157,13 +161,13 @@ namespace LeatherApp.Page
|
||||
reDrawFaceWidth(record.FacePointList,
|
||||
new double[] { 0, Math.Round(len + 0.005f, 2) },
|
||||
new double[] { 130, 160 });
|
||||
|
||||
err = 3;
|
||||
//
|
||||
foreach (var item in list) {
|
||||
item.Name = Config.getDefectName(item.Code);
|
||||
//item.Height = item.Height / 100; //单位错误,保证单位一致
|
||||
}
|
||||
|
||||
err = 4;
|
||||
//
|
||||
string Grade = "";
|
||||
if (record.Grade < 1) Grade = "";
|
||||
@ -179,18 +183,21 @@ namespace LeatherApp.Page
|
||||
Grade= Grade,
|
||||
DateTime = record.CreateTime.ToString("yyyy年MM月dd日 HH:mm")
|
||||
};
|
||||
err = 5;
|
||||
data.DefectTotal = record.DefectInfoList.GroupBy(x => x.Name).Select(g => new JDefectTotal { Name = g.Key,Count=g.Count() }).ToList();
|
||||
data.DefectDetail = record.DefectInfoList.Select(x => new JDefectDetail {
|
||||
Index=x.PhotoIndex,Name=x.Name, X=x.X,Y=Math.Round(x.Y/100.0d,2),Width=x.Width * 10,Height=x.Height * 10,ZXD=x.ZXD,Area=x.Area * 100,Contrast=x.Contrast })
|
||||
.OrderBy(x=>x.Index).ThenBy(x=>x.Y).ToList();
|
||||
|
||||
err = 6;
|
||||
data.Pdt = productService.GetModelNav(record.ProductId);
|
||||
data.xyPix = $"X:{Config.cm2px_x},Y:{Config.cm2px_y}";
|
||||
|
||||
err = 7;
|
||||
var image1 = captureControl(this.lineChartDefect);
|
||||
var image2 = captureControl(this.lineChartFaceWidth);
|
||||
var filePath = $"{path}缺陷列表_{record.BatchId}_{record.ReelId}.xlsx";
|
||||
exportTabel(data, image1, image2, filePath);
|
||||
err = 8;
|
||||
exportTabel(data, image1, image2, filePath);
|
||||
//if (!res)
|
||||
// throw new Exception("导出失败!");
|
||||
UIMessageTip.ShowOk("导出成功!", 1000);
|
||||
@ -199,7 +206,7 @@ namespace LeatherApp.Page
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
UIMessageTip.ShowError(ex.Message, 2000);
|
||||
UIMessageTip.ShowError($"err:{err} + {ex.Message}", 2000);
|
||||
API.OutputDebugString(ex.StackTrace);
|
||||
}
|
||||
}
|
||||
@ -819,7 +826,8 @@ namespace LeatherApp.Page
|
||||
|
||||
//series.Smooth = false;
|
||||
}
|
||||
series.Add(item.CentreX, item.CentreY / 100); //cm -> m
|
||||
if(series != null)
|
||||
series.Add(item.CentreX, item.CentreY / 100); //cm -> m
|
||||
}
|
||||
|
||||
//====
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.2.9")]
|
||||
[assembly: AssemblyFileVersion("1.0.2.9")]
|
||||
[assembly: AssemblyVersion("1.0.2.10")]
|
||||
[assembly: AssemblyFileVersion("1.0.2.10")]
|
||||
|
@ -6,16 +6,166 @@ using System.Threading.Tasks;
|
||||
using System.Xaml;
|
||||
using DocumentFormat.OpenXml.Vml;
|
||||
using OpenCvSharp;
|
||||
using OpenCvSharp.XImgProc;
|
||||
namespace LeatherApp.Utils
|
||||
{
|
||||
public class OpenCVUtil
|
||||
{
|
||||
#region 模型寻边
|
||||
private static StructuredEdgeDetection _edgeDetect;
|
||||
public static void LoadEdgeMode()
|
||||
{
|
||||
if (_edgeDetect == null)
|
||||
_edgeDetect = OpenCvSharp.XImgProc.CvXImgProc.CreateStructuredEdgeDetection("model.yml");
|
||||
}
|
||||
/// <summary>
|
||||
/// 模型寻边
|
||||
/// </summary>
|
||||
/// <param name="image"></param>
|
||||
/// <param name="FindType"></param>
|
||||
/// <param name="Roi"></param>
|
||||
/// <param name="IsLeft"></param>
|
||||
/// <returns></returns>
|
||||
private static int EdgeClipping3(Mat image, int FindType, Rect Roi, bool IsLeft)
|
||||
{
|
||||
Mat mat_rgb = image.Clone(Roi);
|
||||
|
||||
int height = mat_rgb.Rows;
|
||||
int width = mat_rgb.Cols;
|
||||
int sf = 10; //缩放比例
|
||||
int pix = 5; //获取均值区域长宽像素
|
||||
int pointNum = 15; //获取找遍点数
|
||||
int offsetGray = 5; //二值化偏差
|
||||
|
||||
int length_t = 0;
|
||||
List<int> lines = new List<int>();
|
||||
List<int> total_t = new List<int>();
|
||||
//按比例缩放
|
||||
double sf_height = height / sf;
|
||||
double sf_width = width / sf;
|
||||
Cv2.Resize(mat_rgb, mat_rgb, new Size(sf_width, sf_height), 0, 0, InterpolationFlags.Linear);
|
||||
Mat himg = new Mat();
|
||||
|
||||
Mat edgeimg = new Mat();
|
||||
Cv2.CvtColor(mat_rgb, edgeimg, ColorConversionCodes.BGR2RGB);
|
||||
|
||||
Mat edges = new Mat();
|
||||
edgeimg.ConvertTo(edgeimg, MatType.CV_32F, 1 / 255.0);
|
||||
|
||||
if (_edgeDetect == null)
|
||||
LoadEdgeMode();
|
||||
//Cv2.Normalize(edgeimg, edgeimg, 1.0, 0, NormTypes.L2, -1);
|
||||
_edgeDetect.DetectEdges(edgeimg, edges);
|
||||
|
||||
|
||||
Mat image_Otsu = new Mat();
|
||||
int hDis = (int)sf_height / (pointNum + 2); //去除边缘两点
|
||||
|
||||
edges.ConvertTo(image_Otsu, MatType.CV_8U, 255.0);
|
||||
Cv2.Threshold(image_Otsu, image_Otsu, 0, 255, ThresholdTypes.Otsu);
|
||||
|
||||
// 定义空数组保存结果
|
||||
int[] total = new int[pointNum];
|
||||
|
||||
// 平均截取pointNum行数据并处理图像
|
||||
for (int i = 0; i < pointNum; i++)
|
||||
{
|
||||
// 截取当前行的图像
|
||||
Rect roi = new Rect(0, hDis + hDis * i, (int)sf_width, 1);
|
||||
Mat current_segment = image_Otsu.Clone(roi);
|
||||
|
||||
//Mat filled_image3 = current_segment.Clone();
|
||||
Mat filled_image3 = current_segment;
|
||||
|
||||
#if true
|
||||
//从左到右判断边和从右到左判断边
|
||||
int numX = 0;
|
||||
int tm = 0;
|
||||
byte tempVal = 0;
|
||||
bool findOne = false;
|
||||
if (!IsLeft)
|
||||
{
|
||||
tempVal = filled_image3.At<byte>(0, 0);
|
||||
//filled_image3.
|
||||
for (int j = 0; j < filled_image3.Cols; j++)
|
||||
{
|
||||
if (filled_image3.At<byte>(0, j) != tempVal)
|
||||
{
|
||||
if (!findOne)
|
||||
{
|
||||
tm = j;
|
||||
findOne = true;
|
||||
tempVal = filled_image3.At<byte>(0, j);
|
||||
}
|
||||
else
|
||||
{
|
||||
//numX = j;
|
||||
numX = (tm + j) / 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tempVal = filled_image3.At<byte>(0, filled_image3.Cols - 1);
|
||||
for (int j = filled_image3.Cols - 1; j >= 0; j--)
|
||||
{
|
||||
if (filled_image3.At<byte>(0, j) != tempVal)
|
||||
{
|
||||
if (!findOne)
|
||||
{
|
||||
tm = j;
|
||||
findOne = true;
|
||||
tempVal = filled_image3.At<byte>(0, j);
|
||||
}
|
||||
else
|
||||
{
|
||||
//numX = j;
|
||||
numX = (tm + j) / 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
int numX = Cv2.CountNonZero(filled_image3);
|
||||
#endif
|
||||
//length_t = (numX > (sf_width / 2)) ? numX :(int)(sf_width - numX);
|
||||
length_t = numX;
|
||||
total[i] = (length_t);
|
||||
if (length_t > 0)
|
||||
total_t.Add(length_t);
|
||||
}
|
||||
|
||||
|
||||
// 取平均值作为宽度
|
||||
int length = 0;
|
||||
if (total_t.Count > 0)
|
||||
{
|
||||
length = (int)total_t.Average();
|
||||
if (IsLeft)
|
||||
length = length - 0;
|
||||
else
|
||||
length = length + 0;
|
||||
}
|
||||
|
||||
//乘上换算系数还原
|
||||
length = length * sf + Roi.X;
|
||||
return length;
|
||||
}
|
||||
#endregion
|
||||
public static Mat resize(Mat mat, int width, int height, out int xw, out int xh)
|
||||
{
|
||||
OpenCvSharp.Size dsize = new OpenCvSharp.Size(width, height);
|
||||
Mat mat2 = new Mat();
|
||||
//Mat mat2 = new Mat();
|
||||
//Cv2.Resize(mat, mat2, dsize);
|
||||
ResizeUniform(mat, dsize, out mat2, out xw, out xh);
|
||||
//ResizeUniform(mat, dsize, out mat2, out xw, out xh);
|
||||
|
||||
xw = xh = 0;
|
||||
Mat mat2 = new Mat(height, width, MatType.CV_8UC3, new Scalar(114, 114, 114));
|
||||
Rect roi = new Rect((width - mat.Cols) / 2, (height - mat.Rows) / 2, mat.Cols, mat.Rows);
|
||||
mat.CopyTo(new Mat(mat2, roi));
|
||||
return mat2;
|
||||
}
|
||||
public static int ResizeUniform(Mat src, Size dst_size, out Mat dst, out int xw, out int xh)
|
||||
@ -368,7 +518,7 @@ namespace LeatherApp.Utils
|
||||
else
|
||||
Roi = new Rect(0, 0, bian, mat_rgb.Height);
|
||||
int type = isLeft ? 1 : 0;
|
||||
int len = EdgeClipping2(mat_rgb, type, Roi, isLeft);
|
||||
int len = EdgeClipping3(mat_rgb, type, Roi, isLeft);
|
||||
#if false
|
||||
//Mat mat_rgb = new Mat("E:\\CPL\\测试代码\\边缘检测\\test\\test\\test\\img\\19.bmp");
|
||||
Mat image_gray = new Mat();
|
||||
@ -445,9 +595,13 @@ namespace LeatherApp.Utils
|
||||
|
||||
API.OutputDebugString($"getMaxInsetRect2:margin={marginWidth},length={length}({marginHoleWidth}),isLeft={isLeft},mat_rgb={mat_rgb.Width}*{mat_rgb.Height},w={length - marginHoleWidth},h={mat_rgb.Height}");
|
||||
if (isLeft)
|
||||
return cutImage(mat_rgb, mat_rgb.Width - length+ marginHoleWidth, 0, length- marginHoleWidth, mat_rgb.Height);
|
||||
return cutImage(mat_rgb, mat_rgb.Width - length + marginHoleWidth, 0, length - marginHoleWidth, mat_rgb.Height);
|
||||
else
|
||||
return cutImage(mat_rgb, 0, 0, length- marginHoleWidth, mat_rgb.Height);
|
||||
return cutImage(mat_rgb, 0, 0, length - marginHoleWidth, mat_rgb.Height);
|
||||
//if (isLeft)
|
||||
// return cutImage(mat_rgb, length + marginHoleWidth, 0, length - marginHoleWidth, mat_rgb.Height);
|
||||
//else
|
||||
// return cutImage(mat_rgb, 0, 0, length - marginHoleWidth, mat_rgb.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
68
LeatherProject/LeatherApp/bin/Debug/DefectItemList-mx2.json
Normal file
68
LeatherProject/LeatherApp/bin/Debug/DefectItemList-mx2.json
Normal file
@ -0,0 +1,68 @@
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"code": "laji",
|
||||
"name": "垃圾",
|
||||
"color": "#0080FF"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"code": "liangdian",
|
||||
"name": "亮点",
|
||||
"color": "Lime"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"code": "wuyin",
|
||||
"name": "污印",
|
||||
"color": "DarkViolet"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"code": "jietou",
|
||||
"name": "接头",
|
||||
"color": "Magenta"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"code": "bmss",
|
||||
"name": "表面损伤",
|
||||
"color": "Orange"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"code": "qipi",
|
||||
"name": "起皮",
|
||||
"color": "Blue"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"code": "tiaohen",
|
||||
"name": "条痕",
|
||||
"color": "Red"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"code": "yayin",
|
||||
"name": "压印",
|
||||
"color": "Green"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"code": "zhouyin",
|
||||
"name": "皱印",
|
||||
"color": "Yellow"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"code": "yisesi",
|
||||
"name": "异色丝",
|
||||
"color": "CadetBlue"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"code": "chongying",
|
||||
"name": "重影",
|
||||
"color": "Salmon"
|
||||
}
|
||||
]
|
@ -1,86 +1,80 @@
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"code": "jiangbban",
|
||||
"code": "jb",
|
||||
"name": "浆斑",
|
||||
"color": "Red"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"code": "wuyin",
|
||||
"code": "wy",
|
||||
"name": "污印",
|
||||
"color": "Lime"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"code": "mianjie",
|
||||
"code": "mj",
|
||||
"name": "棉结",
|
||||
"color": "DarkViolet"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"code": "huangyin",
|
||||
"code": "hy",
|
||||
"name": "黄印",
|
||||
"color": "Magenta"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"code": "laji",
|
||||
"code": "lj",
|
||||
"name": "垃圾",
|
||||
"color": "Orange"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"code": "yisesi",
|
||||
"code": "yss",
|
||||
"name": "异色丝",
|
||||
"color": "Brown"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"code": "zhouyin",
|
||||
"code": "zy",
|
||||
"name": "皱印",
|
||||
"color": "Olive"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"code": "wenchong",
|
||||
"code": "wc",
|
||||
"name": "蚊虫",
|
||||
"color": "PaleGreen"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"code": "cashang",
|
||||
"code": "cs",
|
||||
"name": "擦伤",
|
||||
"color": "CadetBlue"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"code": "chongying",
|
||||
"code": "cy",
|
||||
"name": "重影",
|
||||
"color": "Aqua"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"code": "tingcheyin",
|
||||
"code": "tcy",
|
||||
"name": "停车印",
|
||||
"color": "YellowGreen"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"code": "jietou",
|
||||
"code": "jt",
|
||||
"name": "接头",
|
||||
"color": "Blue"
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"code": "hengdang",
|
||||
"name": "横档",
|
||||
"color": "Blue"
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"code": "jiangyin",
|
||||
"name": "浆印",
|
||||
"color": "Blue"
|
||||
"code": "na",
|
||||
"name": "荆条",
|
||||
"color": "pink"
|
||||
}
|
||||
]
|
68
LeatherProject/LeatherApp/bin/Debug/DefectItemList0803.json
Normal file
68
LeatherProject/LeatherApp/bin/Debug/DefectItemList0803.json
Normal file
@ -0,0 +1,68 @@
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"code": "laji",
|
||||
"name": "垃圾",
|
||||
"color": "#0080FF"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"code": "liangdian",
|
||||
"name": "亮点",
|
||||
"color": "Lime"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"code": "wuyin",
|
||||
"name": "污印",
|
||||
"color": "DarkViolet"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"code": "jietou",
|
||||
"name": "接头",
|
||||
"color": "Magenta"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"code": "bmss",
|
||||
"name": "表面损伤",
|
||||
"color": "Orange"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"code": "qipi",
|
||||
"name": "起皮",
|
||||
"color": "Blue"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"code": "tiaohen",
|
||||
"name": "条痕",
|
||||
"color": "Red"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"code": "yayin",
|
||||
"name": "压印",
|
||||
"color": "Green"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"code": "zhouyin",
|
||||
"name": "皱印",
|
||||
"color": "Yellow"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"code": "yisesi",
|
||||
"name": "异色丝",
|
||||
"color": "CadetBlue"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"code": "chongying",
|
||||
"name": "重影",
|
||||
"color": "Salmon"
|
||||
},
|
||||
]
|
56
LeatherProject/LeatherApp/bin/Debug/DefectItemList77.json
Normal file
56
LeatherProject/LeatherApp/bin/Debug/DefectItemList77.json
Normal file
@ -0,0 +1,56 @@
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"code": "laji",
|
||||
"name": "垃圾",
|
||||
"color": "#0080FF"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"code": "wuyin",
|
||||
"name": "污印",
|
||||
"color": "Lime"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"code": "jiangyin",
|
||||
"name": "浆印",
|
||||
"color": "DarkViolet"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"code": "zhouyin",
|
||||
"name": "皱印",
|
||||
"color": "Magenta"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"code": "hengdang",
|
||||
"name": "横档",
|
||||
"color": "Orange"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"code": "jietou",
|
||||
"name": "接头",
|
||||
"color": "Blue"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"code": "chongying",
|
||||
"name": "重影",
|
||||
"color": "Lime"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"code": "aokeng",
|
||||
"name": "凹坑",
|
||||
"color": "Lime"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"code": "bmss",
|
||||
"name": "表面损伤",
|
||||
"color": "Lime"
|
||||
}
|
||||
]
|
@ -44,3 +44,93 @@ Global捕获到未处理异常:System.ArgumentException
|
||||
在 System.Windows.Forms.Control.WndProc(Message& m)
|
||||
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
||||
|
||||
2024-07-25 10:08:02
|
||||
Global捕获到未处理异常:System.NullReferenceException
|
||||
异常信息:未将对象引用设置到对象的实例。
|
||||
异常堆栈: 在 LeatherApp.UIExtend.UIDefectImage.uiComboBox1_SelectedIndexChanged(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 60
|
||||
在 Sunny.UI.UIComboBox.Box_SelectedIndexChanged(Object sender, EventArgs e)
|
||||
在 System.EventHandler.Invoke(Object sender, EventArgs e)
|
||||
在 System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
|
||||
在 Sunny.UI.ListBoxEx.OnSelectedIndexChanged(EventArgs e)
|
||||
在 System.Windows.Forms.ListBox.ClearSelected()
|
||||
在 System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
|
||||
在 System.Windows.Forms.ListControl.set_SelectedValue(Object value)
|
||||
在 Sunny.UI.UIComboBox.set_SelectedValue(Object value)
|
||||
在 LeatherApp.UIExtend.UIDefectImage.set_Code(String value) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 45
|
||||
在 LeatherApp.Page.FHome_Defect.<init>b__4_0(DefectInfo item) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 36
|
||||
在 System.Collections.Generic.List`1.ForEach(Action`1 action)
|
||||
在 LeatherApp.Page.FHome_Defect.init() 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 35
|
||||
在 LeatherApp.Page.FHome_Defect..ctor(List`1 lst, Mat img) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 29
|
||||
在 LeatherApp.Page.FHome.button1_Click(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome.cs:行号 2157
|
||||
在 System.Windows.Forms.Control.OnClick(EventArgs e)
|
||||
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
|
||||
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
|
||||
在 System.Windows.Forms.Control.WndProc(Message& m)
|
||||
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
|
||||
在 System.Windows.Forms.Button.WndProc(Message& m)
|
||||
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
||||
|
||||
2024-07-25 10:08:55
|
||||
Global捕获到未处理异常:System.NullReferenceException
|
||||
异常信息:未将对象引用设置到对象的实例。
|
||||
异常堆栈: 在 LeatherApp.UIExtend.UIDefectImage.uiComboBox1_SelectedIndexChanged(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 60
|
||||
在 Sunny.UI.UIComboBox.Box_SelectedIndexChanged(Object sender, EventArgs e)
|
||||
在 System.EventHandler.Invoke(Object sender, EventArgs e)
|
||||
在 System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
|
||||
在 Sunny.UI.ListBoxEx.OnSelectedIndexChanged(EventArgs e)
|
||||
在 System.Windows.Forms.ListBox.ClearSelected()
|
||||
在 System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
|
||||
在 System.Windows.Forms.ListControl.set_SelectedValue(Object value)
|
||||
在 Sunny.UI.UIComboBox.set_SelectedValue(Object value)
|
||||
在 LeatherApp.UIExtend.UIDefectImage.set_Code(String value) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 45
|
||||
在 LeatherApp.Page.FHome_Defect.<init>b__4_0(DefectInfo item) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 36
|
||||
在 System.Collections.Generic.List`1.ForEach(Action`1 action)
|
||||
在 LeatherApp.Page.FHome_Defect.init() 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 35
|
||||
在 LeatherApp.Page.FHome_Defect..ctor(List`1 lst, Mat img) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 29
|
||||
在 LeatherApp.Page.FHome.button1_Click(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome.cs:行号 2157
|
||||
在 System.Windows.Forms.Control.OnClick(EventArgs e)
|
||||
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
|
||||
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
|
||||
在 System.Windows.Forms.Control.WndProc(Message& m)
|
||||
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
|
||||
在 System.Windows.Forms.Button.WndProc(Message& m)
|
||||
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
||||
|
||||
2024-07-25 10:10:27
|
||||
Global捕获到未处理异常:System.NullReferenceException
|
||||
异常信息:未将对象引用设置到对象的实例。
|
||||
异常堆栈: 在 LeatherApp.UIExtend.UIDefectImage.uiComboBox1_SelectedIndexChanged(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 60
|
||||
在 Sunny.UI.UIComboBox.Box_SelectedIndexChanged(Object sender, EventArgs e)
|
||||
在 System.EventHandler.Invoke(Object sender, EventArgs e)
|
||||
在 System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
|
||||
在 Sunny.UI.ListBoxEx.OnSelectedIndexChanged(EventArgs e)
|
||||
在 System.Windows.Forms.ListBox.ClearSelected()
|
||||
在 System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
|
||||
在 System.Windows.Forms.ListControl.set_SelectedValue(Object value)
|
||||
在 Sunny.UI.UIComboBox.set_SelectedValue(Object value)
|
||||
在 LeatherApp.UIExtend.UIDefectImage.set_Code(String value) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 45
|
||||
在 LeatherApp.Page.FHome_Defect.<init>b__4_0(DefectInfo item) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 36
|
||||
在 System.Collections.Generic.List`1.ForEach(Action`1 action)
|
||||
在 LeatherApp.Page.FHome_Defect.init() 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 35
|
||||
在 LeatherApp.Page.FHome_Defect..ctor(List`1 lst, Mat img) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 29
|
||||
在 LeatherApp.Page.FHome.button1_Click(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome.cs:行号 2157
|
||||
在 System.Windows.Forms.Control.OnClick(EventArgs e)
|
||||
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
|
||||
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
|
||||
在 System.Windows.Forms.Control.WndProc(Message& m)
|
||||
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
|
||||
在 System.Windows.Forms.Button.WndProc(Message& m)
|
||||
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
||||
|
||||
2024-07-25 10:49:30
|
||||
Global捕获到未处理异常:System.NullReferenceException
|
||||
异常信息:未将对象引用设置到对象的实例。
|
||||
异常堆栈: 在 LeatherApp.Page.FHome.button1_Click(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome.cs:行号 2174
|
||||
在 System.Windows.Forms.Control.OnClick(EventArgs e)
|
||||
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
|
||||
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
|
||||
在 System.Windows.Forms.Control.WndProc(Message& m)
|
||||
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
|
||||
在 System.Windows.Forms.Button.WndProc(Message& m)
|
||||
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
||||
|
||||
|
@ -1,14 +1,26 @@
|
||||
[
|
||||
{
|
||||
"code": "SHNY-PX",
|
||||
"code": 0,
|
||||
"name": "超纤皮"
|
||||
},
|
||||
{
|
||||
"code": "AGNY-ST",
|
||||
"code": 1,
|
||||
"name": "纤皮"
|
||||
},
|
||||
{
|
||||
"code": "",
|
||||
"code": 2,
|
||||
"name": "未知"
|
||||
},
|
||||
{
|
||||
"code": 3,
|
||||
"name": "未知"
|
||||
},
|
||||
{
|
||||
"code": 4,
|
||||
"name": "未知"
|
||||
},
|
||||
{
|
||||
"code": 5,
|
||||
"name": "未知"
|
||||
}
|
||||
]
|
@ -34,6 +34,13 @@ ImagePath=F:\LeatherApp\images\
|
||||
SaveAllImage=False
|
||||
SaveDefectSourceImage=False
|
||||
SaveDefectCutImage=False
|
||||
cm2px_x=90
|
||||
cm2px_y=90
|
||||
MarginHoleWidth=0
|
||||
MiddleSuperposition=0
|
||||
IsSaveAllImage=False
|
||||
IsSaveDefectSourceImage=False
|
||||
IsSaveDefectCutImage=False
|
||||
[DB]
|
||||
DBConStr=server=localhost;Database=LeatherDB;Uid=root;Pwd=123456; AllowLoadLocalInfile=true
|
||||
[ErpDB]
|
||||
|
BIN
LeatherProject/LeatherApp/bin/Debug/edge.bmp
Normal file
BIN
LeatherProject/LeatherApp/bin/Debug/edge.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 MiB |
6617
LeatherProject/LeatherApp/bin/Debug/model.yml
Normal file
6617
LeatherProject/LeatherApp/bin/Debug/model.yml
Normal file
File diff suppressed because one or more lines are too long
BIN
LeatherProject/LeatherApp/bin/Debug/models/CYG_0706.trt
Normal file
BIN
LeatherProject/LeatherApp/bin/Debug/models/CYG_0706.trt
Normal file
Binary file not shown.
BIN
LeatherProject/LeatherApp/bin/Debug/models/best_0720.trt
Normal file
BIN
LeatherProject/LeatherApp/bin/Debug/models/best_0720.trt
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user