Compare commits

..

2 Commits

Author SHA1 Message Date
CPL
c4ec0d9ff4 v1.0.2.10 修复缺陷X位置bug 2024-08-09 10:34:23 +08:00
CPL
96034ee3c0 v1.0.2.10 加入模型裁边 2024-08-05 09:39:58 +08:00
38 changed files with 7513 additions and 960 deletions

View File

@ -471,7 +471,7 @@ namespace GeBoShi.SysCtrl
#region #region
#if Online #if Online
//采集图片 //采集图片
Acquisition acq = _LinecamDev1.GetFrames(10); Acquisition acq = _LinecamDev1.GetFrames(1, 10);
if (acq.GrabStatus == "GrabPass") if (acq.GrabStatus == "GrabPass")
{ {
//显示 //显示
@ -568,7 +568,7 @@ namespace GeBoShi.SysCtrl
#region #region
#if Online #if Online
//采集图片 //采集图片
AcquisitionMat acq = _LinecamDev2.GetFrames(10); Acquisition acq = _LinecamDev2.GetFrames(1, 10);
if (acq.GrabStatus == "GrabPass") if (acq.GrabStatus == "GrabPass")
{ {
//显示 //显示

View File

@ -22,12 +22,11 @@ namespace LeatherApp
public static JArray colorNameList;//, materialNameList; public static JArray colorNameList;//, materialNameList;
// //
public static JArray materialNameList;//, materialNameList; public static JArray materialNameList;//, materialNameList;
//CMDProcess目录下的命令JSON文件 //CMDProcess目录下的命令JSON文件
public static Dictionary<CMDName, JObject> CMDProcess; public static Dictionary<CMDName, JObject> CMDProcess;
//剩余N米提示(M) //剩余N米提示(M)
public static int residueWarnningLen = 10; public static int residueWarnningLen = 20;
//瑕疵暂停跳过几张图 //瑕疵暂停跳过几张图
public static int defectPauseSkipPhotoCount=5; public static int defectPauseSkipPhotoCount=5;
@ -86,6 +85,7 @@ namespace LeatherApp
//忽略的等级判断项目 //忽略的等级判断项目
public static string[] SkipLabelGrade = new string[0]; public static string[] SkipLabelGrade = new string[0];
//云端 //云端
public static string cloud_ip, cloud_username, cloud_password, CloudThisName; public static string cloud_ip, cloud_username, cloud_password, CloudThisName;
public static int cloud_port, cloud_open; public static int cloud_port, cloud_open;
@ -176,10 +176,10 @@ namespace LeatherApp
// //
string lsTmp = ini.ReadString("Material", "SuedeList", "").Trim(); string lsTmp = ini.ReadString("Material", "SuedeList", "").Trim();
if(!string.IsNullOrWhiteSpace(lsTmp)) if (!string.IsNullOrWhiteSpace(lsTmp))
SuedeList1=lsTmp.Split(new char[] { ',',';'}); SuedeList1 = lsTmp.Split(new char[] { ',', ';' });
else else
SuedeList1 = new string[1] { ""}; SuedeList1 = new string[1] { "" };
lsTmp = ini.ReadString("Material", "SuedeList2", "").Trim(); lsTmp = ini.ReadString("Material", "SuedeList2", "").Trim();
if (!string.IsNullOrWhiteSpace(lsTmp)) if (!string.IsNullOrWhiteSpace(lsTmp))
@ -188,12 +188,12 @@ namespace LeatherApp
SuedeList2 = new string[1] { "" }; SuedeList2 = new string[1] { "" };
lsTmp = ini.ReadString("Material", "SuedeList3", "").Trim(); lsTmp = ini.ReadString("Material", "SuedeList3", "").Trim();
if (!string.IsNullOrWhiteSpace(lsTmp)) if (!string.IsNullOrWhiteSpace(lsTmp))
SuedeList3= lsTmp.Split(new char[] { ',', ';' }); SuedeList3 = lsTmp.Split(new char[] { ',', ';' });
else else
SuedeList3 = new string[1] { "" }; SuedeList3 = new string[1] { "" };
lsTmp = ini.ReadString("Material", "SuedeList4", "").Trim(); lsTmp = ini.ReadString("Material", "SuedeList4", "").Trim();
if (!string.IsNullOrWhiteSpace(lsTmp)) if (!string.IsNullOrWhiteSpace(lsTmp))
SuedeList4= lsTmp.Split(new char[] { ',', ';' }); SuedeList4 = lsTmp.Split(new char[] { ',', ';' });
else else
SuedeList4 = new string[1] { "" }; SuedeList4 = new string[1] { "" };
lsTmp = ini.ReadString("Material", "SuedeList5", "").Trim(); lsTmp = ini.ReadString("Material", "SuedeList5", "").Trim();
@ -232,38 +232,56 @@ namespace LeatherApp
} }
public static JObject getDefectItem(string code) public static JObject getDefectItem(string code)
{ {
var item=Config.defectItemList.FirstOrDefault(m => m.Value<string>("code")==code); try
if(item==null) {
return null; var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("code") == code);
return (JObject)item; if (item == null)
return null;
return (JObject)item;
}
catch { return null; }
} }
public static JObject getDefectItem(int id) 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) if (item == null)
return null; return null;
return (JObject)item; return (JObject)item;
}
catch { return null; }
} }
public static string getDefectCode(int id) public static string getDefectCode(int id)
{ {
var item = Config.defectItemList.FirstOrDefault(m => m.Value<int>("id") == id); try
if (item == null) {
return ""; var item = Config.defectItemList.FirstOrDefault(m => m.Value<int>("id") == id);
return ((JObject)item).Value<string>("code"); if (item == null)
return "";
return ((JObject)item).Value<string>("code");
}
catch { return ""; }
} }
public static string getDefectName(string code) public static string getDefectName(string code)
{ {
var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("code") == code); try {
if (item == null) var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("code") == code);
return ""; if (item == null)
return ((JObject)item).Value<string>("name"); return "";
return ((JObject)item).Value<string>("name");
}
catch { return ""; }
} }
public static string getDefectCode(string name) public static string getDefectCode(string name)
{ {
var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("name") == name); try {
if (item == null) var item = Config.defectItemList.FirstOrDefault(m => m.Value<string>("name") == name);
return ""; if (item == null)
return ((JObject)item).Value<string>("code"); return "";
return ((JObject)item).Value<string>("code");
}
catch { return ""; }
} }
#endregion #endregion

View File

@ -107,7 +107,7 @@ namespace LeatherApp
if (!Config.StopLight && !devLight.start(int.Parse(Config.Light_PortName.Substring(3)))) throw new Exception("光源设备初始化失败!"); if (!Config.StopLight && !devLight.start(int.Parse(Config.Light_PortName.Substring(3)))) throw new Exception("光源设备初始化失败!");
if (!libPhoto.start()) throw new Exception("图像库初始化失败!"); if (!libPhoto.start()) throw new Exception("图像库初始化失败!");
WarningEvent?.Invoke(DateTime.Now,WarningEnum.Normal, "2"); WarningEvent?.Invoke(DateTime.Now,WarningEnum.Normal, "2");
if(libDefect == null) if (libDefect == null)
{ {
WarningEvent?.Invoke(DateTime.Now, WarningEnum.Normal, "算法库为空,重新初始化"); WarningEvent?.Invoke(DateTime.Now, WarningEnum.Normal, "算法库为空,重新初始化");
libDefect = new DefectLib(); libDefect = new DefectLib();

View File

@ -610,13 +610,14 @@ namespace LeatherApp.Device
CopyMemory(m_pUserBuffer, hPtr, m_nBufferSize); CopyMemory(m_pUserBuffer, hPtr, m_nBufferSize);
m_bUpdateImage = true; m_bUpdateImage = true;
var bmp = hBuffer.toBmp(m_pUserBuffer); Mat mat = new Mat(m_nHeight, m_nWidth, MatType.CV_8UC3, m_pUserBuffer);
Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(bmp); //var bmp = hBuffer.toBmp(m_pUserBuffer);
bmp.Dispose(); //Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(bmp);
bmp = null; //bmp.Dispose();
//bmp = null;
//Monitor.Enter(frameQueue); //Monitor.Enter(frameQueue);
lock (frameQueue) lock (frameQueue)
frameQueue.Enqueue(new MyData(index, mat)); frameQueue.Enqueue(new MyData(index, mat.Clone()));
PhotoNumCacheEvent?.BeginInvoke(frameQueue.Count, null, null); PhotoNumCacheEvent?.BeginInvoke(frameQueue.Count, null, null);
} }
} }

View File

@ -190,6 +190,7 @@ namespace LeatherApp.Device
public int GetWidthForResize(int sumWidth) public int GetWidthForResize(int sumWidth)
{ {
int count =(int) Math.Round(sumWidth * 1.0f / image_width, 0); int count =(int) Math.Round(sumWidth * 1.0f / image_width, 0);
count = 8;
return count * image_width; return count * image_width;
//int count = sumWidth / image_width; //int count = sumWidth / image_width;
@ -464,6 +465,7 @@ namespace LeatherApp.Device
List<int> xPos4 = new List<int>(); List<int> xPos4 = new List<int>();
List<double> ZXD4 = new List<double>(); List<double> ZXD4 = new List<double>();
DefectLabelInfo stpoint = DefectLabelInfoList[0]; DefectLabelInfo stpoint = DefectLabelInfoList[0];
int colNum = Width / image_width; int colNum = Width / image_width;
@ -472,8 +474,8 @@ namespace LeatherApp.Device
{ {
if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jietou") if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jietou")
{ {
int max = stpoint.y + 500; int max = stpoint.y + 2000;
int min = stpoint.y - 500 > 0? stpoint.y - 500:0; int min = stpoint.y - 2000 > 0? stpoint.y - 2000 : 0;
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max) if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
{ {
HeBingList.Add(DefectLabelInfoList[q]); HeBingList.Add(DefectLabelInfoList[q]);
@ -485,8 +487,8 @@ namespace LeatherApp.Device
} }
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "hengdang") else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "hengdang")
{ {
int max = stpoint.y + 500; int max = stpoint.y + 2000;
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0; int min = stpoint.y - 2000 > 0 ? stpoint.y - 2000 : 0;
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max) if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
{ {
HeBingList2.Add(DefectLabelInfoList[q]); HeBingList2.Add(DefectLabelInfoList[q]);
@ -498,8 +500,8 @@ namespace LeatherApp.Device
} }
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jt") else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jt")
{ {
int max = stpoint.y + 500; int max = stpoint.y + 2000;
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0; int min = stpoint.y - 2000 > 0 ? stpoint.y - 2000 : 0;
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max) if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
{ {
HeBingList3.Add(DefectLabelInfoList[q]); HeBingList3.Add(DefectLabelInfoList[q]);
@ -511,8 +513,8 @@ namespace LeatherApp.Device
} }
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "tcy") else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "tcy")
{ {
int max = stpoint.y + 500; int max = stpoint.y + 2000;
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0; int min = stpoint.y - 2000 > 0 ? stpoint.y - 2000 : 0;
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max) if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
{ {
HeBingList4.Add(DefectLabelInfoList[q]); HeBingList4.Add(DefectLabelInfoList[q]);
@ -539,7 +541,6 @@ namespace LeatherApp.Device
if (XcHeBingList4.Count > 0) if (XcHeBingList4.Count > 0)
dg4 = HeBingDefect(Width, XcHeBingList4); dg4 = HeBingDefect(Width, XcHeBingList4);
//多个jietou合并 //多个jietou合并
if (HeBingList.Count>0) if (HeBingList.Count>0)
{ {
@ -547,11 +548,12 @@ namespace LeatherApp.Device
var edIt = HeBingList.Find(x => (x.i % colNum) * image_width + x.x == xPos.Max()); var edIt = HeBingList.Find(x => (x.i % colNum) * image_width + x.x == xPos.Max());
var eZXD = HeBingList.Find(x => x.confidence == ZXD.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; int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
outList.Add(new DefectLabelInfo() { outList.Add(new DefectLabelInfo() {
x=stIt.x, x=stIt.x,
y=edIt.y, y=edIt.y,
w = newW, //多图叠加 w = newW, //多图叠加
h = edIt.h, h = newh,
classId = eZXD.classId, classId = eZXD.classId,
confidence = eZXD.confidence, confidence = eZXD.confidence,
contrast = eZXD.contrast, contrast = eZXD.contrast,
@ -568,12 +570,13 @@ namespace LeatherApp.Device
var edIt = HeBingList2.Find(x => (x.i % colNum) * image_width + x.x == xPos2.Max()); var edIt = HeBingList2.Find(x => (x.i % colNum) * image_width + x.x == xPos2.Max());
var eZXD = HeBingList2.Find(x => x.confidence == ZXD2.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; int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
outList.Add(new DefectLabelInfo() outList.Add(new DefectLabelInfo()
{ {
x = stIt.x, x = stIt.x,
y = edIt.y, y = edIt.y,
w = newW, //多图叠加 w = newW, //多图叠加
h = edIt.h, h = newh,
classId = eZXD.classId, classId = eZXD.classId,
confidence = eZXD.confidence, confidence = eZXD.confidence,
contrast = eZXD.contrast, contrast = eZXD.contrast,
@ -590,12 +593,13 @@ namespace LeatherApp.Device
var edIt = HeBingList3.Find(x => (x.i % colNum) * image_width + x.x == xPos3.Max()); var edIt = HeBingList3.Find(x => (x.i % colNum) * image_width + x.x == xPos3.Max());
var eZXD = HeBingList3.Find(x => x.confidence == ZXD3.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; int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
outList.Add(new DefectLabelInfo() outList.Add(new DefectLabelInfo()
{ {
x = stIt.x, x = stIt.x,
y = edIt.y, y = edIt.y,
w = newW, //多图叠加 w = newW, //多图叠加
h = edIt.h, h = newh,
classId = eZXD.classId, classId = eZXD.classId,
confidence = eZXD.confidence, confidence = eZXD.confidence,
contrast = eZXD.contrast, contrast = eZXD.contrast,
@ -612,12 +616,13 @@ namespace LeatherApp.Device
var edIt = HeBingList4.Find(x => (x.i % colNum) * image_width + x.x == xPos4.Max()); var edIt = HeBingList4.Find(x => (x.i % colNum) * image_width + x.x == xPos4.Max());
var eZXD = HeBingList4.Find(x => x.confidence == ZXD4.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; int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
outList.Add(new DefectLabelInfo() outList.Add(new DefectLabelInfo()
{ {
x = stIt.x, x = stIt.x,
y = edIt.y, y = edIt.y,
w = newW, //多图叠加 w = newW, //多图叠加
h = edIt.h, h = newh,
classId = eZXD.classId, classId = eZXD.classId,
confidence = eZXD.confidence, confidence = eZXD.confidence,
contrast = eZXD.contrast, contrast = eZXD.contrast,
@ -830,7 +835,7 @@ namespace LeatherApp.Device
} }
#region #region
liStep++; liStep = 3000;
if (DefectLabelInfoList.Count >0) if (DefectLabelInfoList.Count >0)
DefectLabelInfoList = HeBingDefect(task.bmp.Width, DefectLabelInfoList); DefectLabelInfoList = HeBingDefect(task.bmp.Width, DefectLabelInfoList);
liStep++; liStep++;
@ -893,7 +898,6 @@ namespace LeatherApp.Device
task.resultInfo += $" 判断为接头处横档,跳过! \n"; task.resultInfo += $" 判断为接头处横档,跳过! \n";
continue; continue;
} }
if (Config.getDefectCode(DefectLabelInfoListByClassID[q].classId) == "na") if (Config.getDefectCode(DefectLabelInfoListByClassID[q].classId) == "na")
{ {
task.resultInfo += $" 判断为正向标签na跳过 \n"; task.resultInfo += $" 判断为正向标签na跳过 \n";
@ -904,18 +908,6 @@ namespace LeatherApp.Device
} }
liStep++;//1 liStep++;//1
//打标 //打标
//计算打标框大小,进行调整
//int dw = 0;
//int dh = 0;
//if (DefectLabelInfoListByClassID[q].w / DefectLabelInfoListByClassID[q].h > 4)
//{
// dh = DefectLabelInfoListByClassID[q].w / 4;
//}
//if (DefectLabelInfoListByClassID[q].h / DefectLabelInfoListByClassID[q].w > 4)
//{
// dw = DefectLabelInfoListByClassID[q].h / 4;
//}
var point1 = new OpenCvSharp.Point((DefectLabelInfoListByClassID[q].i % colNum) * image_width + DefectLabelInfoListByClassID[q].x, (DefectLabelInfoListByClassID[q].i / colNum) * image_hight + DefectLabelInfoListByClassID[q].y); var point1 = new OpenCvSharp.Point((DefectLabelInfoListByClassID[q].i % colNum) * image_width + DefectLabelInfoListByClassID[q].x, (DefectLabelInfoListByClassID[q].i / colNum) * image_hight + DefectLabelInfoListByClassID[q].y);
var point2 = new OpenCvSharp.Point(point1.X + DefectLabelInfoListByClassID[q].w, point1.Y + DefectLabelInfoListByClassID[q].h); var point2 = new OpenCvSharp.Point(point1.X + DefectLabelInfoListByClassID[q].w, point1.Y + DefectLabelInfoListByClassID[q].h);
liStep++;//2 liStep++;//2

View File

@ -118,11 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="textBox1.Text" xml:space="preserve"> <data name="textBox1.Text" xml:space="preserve">
<value>v1.0.2.10(2024-06-25) <value>v1.0.2.10(2024-08-05)
1、更新等比例缩放算法提速降内存 1、修复bug优化显示
2、等级缺陷判断可以设置忽略项 2、加入模型裁边
v1.0.2.10(2024-06-18)
1、加入总和缺陷判定等级
v1.0.2.9(2024-05-09) v1.0.2.9(2024-05-09)
1、加入实时幅宽 1、加入实时幅宽
2、加入jietouhengdang标签合并 2、加入jietouhengdang标签合并

View File

@ -171,7 +171,6 @@
</Reference> </Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xaml" /> <Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />

View File

@ -1,4 +1,5 @@
using IKapC.NET; 
using IKapC.NET;
using LeatherApp.Device; using LeatherApp.Device;
using LeatherApp.Device.CamerUtil; using LeatherApp.Device.CamerUtil;
using LeatherApp.Interface; using LeatherApp.Interface;
@ -26,8 +27,6 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using static System.Windows.Forms.AxHost;
namespace LeatherApp.Page namespace LeatherApp.Page
{ {
@ -57,13 +56,14 @@ namespace LeatherApp.Page
private double ThnDieLen = 0; private double ThnDieLen = 0;
private Dictionary<int, Mat> defectTag = new Dictionary<int, Mat> (); private Dictionary<int, Mat> defectTag = new Dictionary<int, Mat>();
//裁切偏移
private double OffsetCut = 0.2;
//云端 //云端
private CloudMgr cloudMgr = new CloudMgr(); private CloudMgr cloudMgr = new CloudMgr();
private bool init_Cloud; private bool init_Cloud;
//
//裁切偏移 private bool _residueWarnningLenStop;
private double OffsetCut = 0.2;
public FHome(FProductInfo frm) public FHome(FProductInfo frm)
{ {
InitializeComponent(); InitializeComponent();
@ -269,7 +269,7 @@ namespace LeatherApp.Page
/// <param name="lstDefectInfo">Records.DefectInfoList</param> /// <param name="lstDefectInfo">Records.DefectInfoList</param>
/// <param name="XSizeRange">幅宽</param> /// <param name="XSizeRange">幅宽</param>
/// <param name="YSizeRange">卷长度</param> /// <param name="YSizeRange">卷长度</param>
private void reDrawDefectPoints(List<DefectInfo> lstDefectInfo, List<GradeDifferentiateInfo> listGrade, double[] XSizeRange=null, double[] YSizeRange=null,bool addSelRect=true) private void reDrawDefectPoints(List<DefectInfo> lstDefectInfo, double[] XSizeRange=null, double[] YSizeRange=null,bool addSelRect=true)
{ {
UILineOption option; UILineOption option;
//AddTextEvent(DateTime.Now,$"绘图", $"缺陷分布, W={string.Join(", ", XSizeRange)},H={string.Join(", ", YSizeRange)}, LastData={JsonConvert.SerializeObject(lstDefectInfo[lstDefectInfo.Count - 1])}"); //AddTextEvent(DateTime.Now,$"绘图", $"缺陷分布, W={string.Join(", ", XSizeRange)},H={string.Join(", ", YSizeRange)}, LastData={JsonConvert.SerializeObject(lstDefectInfo[lstDefectInfo.Count - 1])}");
@ -360,18 +360,6 @@ namespace LeatherApp.Page
//series.Add(1, 1); //series.Add(1, 1);
} }
if (listGrade != null)
{
//option = lineChartDefect.Option;
foreach (var item in listGrade)
{
// 设置裁切提示线
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.DarkRed, Name = $"{item.GradeCode}-裁切起点-{item.StartY}", Value = item.StartY });
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.DarkRed, Name = $"{item.GradeCode}-裁切终点-{item.EndY}", Value = item.EndY });
}
}
//==== //====
//option.GreaterWarningArea = new UILineWarningArea(3.5); //option.GreaterWarningArea = new UILineWarningArea(3.5);
//option.LessWarningArea = new UILineWarningArea(2.2, Color.Gold); //option.LessWarningArea = new UILineWarningArea(2.2, Color.Gold);
@ -382,31 +370,6 @@ namespace LeatherApp.Page
})); }));
} }
/// <summary>
/// 重新生成缺陷分布(cm2M在内部转换) 加入裁切位置
/// </summary>
/// <param name="lstDefectInfo"></param>
/// <param name="XSizeRange"></param>
/// <param name="YSizeRange"></param>
/// <param name="addSelRect"></param>
private void reDrawDefectPointsAndCut(double startY, double endY, string code)
{
if (lineChartDefect.Option != null )
{
UILineOption option;
option = lineChartDefect.Option;
// 设置裁切提示线
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.DarkRed, Name = $"{code}-裁切起点-{startY}", Value = startY });
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.DarkRed, Name = $"{code}-裁切终点-{endY}", Value = endY });
this.BeginInvoke(new System.Action(() =>
{
this.lineChartDefect.SetOption(option);
//series.UpdateYData();//按序号更新Y轴值(可设置值超出范围用于闪烁)
}));
}
}
/// <summary> /// <summary>
/// 重新门幅宽度 /// 重新门幅宽度
/// </summary> /// </summary>
@ -514,18 +477,17 @@ namespace LeatherApp.Page
// //
//if (type > 0) //if (type > 0)
// cont = $"<color=\"{(type == 1 ? "Yellow" : "Red")}\">{cont}</color>"; // cont = $"<color=\"{(type == 1 ? "Yellow" : "Red")}\">{cont}</color>";
//msg = (level == WarningEnum.Normal ? "B" : level == WarningEnum.Low ? "Y" : "R") + msg;
if (Show) if (Show)
{ {
//msg = (level == WarningEnum.Normal ? "B" : level == WarningEnum.Low ? "Y" : "R") + msg;
msg = (level == WarningEnum.Normal ? "" : level == WarningEnum.Low ? "Y" : "R") + msg; msg = (level == WarningEnum.Normal ? "" : level == WarningEnum.Low ? "Y" : "R") + msg;
//this.Invoke(new System.Action(() => //this.Invoke(new System.Action(() =>
//{ //{
if (this.lstboxLog.Items.Count > 1000) if (this.lstboxLog.Items.Count > 1000)
this.lstboxLog.Items.Clear(); this.lstboxLog.Items.Clear();
lstboxLog.Items.Insert(0, msg); lstboxLog.Items.Insert(0, msg);
//}));
} }
//}));
//日志滚动 //日志滚动
//lstLog.SelectedIndex = lstLog.Items.Count - 1; //lstLog.SelectedIndex = lstLog.Items.Count - 1;
@ -586,31 +548,6 @@ namespace LeatherApp.Page
else else
AddTextEvent(DateTime.Now, "云端数据", "云端连接失败!", WarningEnum.Low); AddTextEvent(DateTime.Now, "云端数据", "云端连接失败!", WarningEnum.Low);
} }
////标记裁切位置
//this.BeginInvoke(new System.Action(() =>
//{
// List<DefectInfo> list = new List<DefectInfo>();
// list.Add(new DefectInfo()
// {
// X = 1,
// Y = 100,
// Width = 1,
// Height = 1,
// Code = "jiangbban"
// });
// list.Add(new DefectInfo()
// {
// X = 10,
// Y = 10000,
// Width = 1,
// Height = 1,
// Code = "jiangbban"
// });
// reDrawDefectPoints(list, new double[2] { 0, 160 });
// reDrawDefectPointsAndCut(10, 20);
//}));
} }
private void FHome_Shown(object sender, EventArgs e) private void FHome_Shown(object sender, EventArgs e)
{ {
@ -635,6 +572,8 @@ namespace LeatherApp.Page
//DefectLib dl = new DefectLib(); //DefectLib dl = new DefectLib();
//dl.start(); //dl.start();
//加载寻边模型
OpenCVUtil.LoadEdgeMode();
this.btnOpen.Enabled = false; this.btnOpen.Enabled = false;
@ -750,6 +689,7 @@ namespace LeatherApp.Page
string pcode = "1-" + codes[2]; string pcode = "1-" + codes[2];
if (codes[1] == "0" || Config.SuedeList1.Contains(codes[1])) if (codes[1] == "0" || Config.SuedeList1.Contains(codes[1]))
pcode = "0-" + codes[2]; pcode = "0-" + codes[2];
#if false #if false
else else
pcode = codes[1] + "-" + codes[2]; pcode = codes[1] + "-" + codes[2];
@ -804,6 +744,8 @@ namespace LeatherApp.Page
errCode = 4; errCode = 4;
var now = DateTime.Now; var now = DateTime.Now;
currKey = now.Hour * 10000 + now.Minute * 100 + now.Second; currKey = now.Hour * 10000 + now.Minute * 100 + now.Second;
_residueWarnningLenStop = false;
//var materialItem = codes[0]+"-"+ codes[1]; //var materialItem = codes[0]+"-"+ codes[1];
var colorItem = Config.getColorItem(int.Parse(codes[2])); var colorItem = Config.getColorItem(int.Parse(codes[2]));
record = new Records() record = new Records()
@ -1140,7 +1082,33 @@ namespace LeatherApp.Page
if (Config.residueWarnningLen > 0 && curRecord.ErpLen > 0 && Config.residueWarnningLen >= curRecord.ErpLen - curRecord.Len) if (Config.residueWarnningLen > 0 && curRecord.ErpLen > 0 && Config.residueWarnningLen >= curRecord.ErpLen - curRecord.Len)
{ {
AddTextEvent(DateTime.Now, $"告警{Thread.CurrentThread.ManagedThreadId}", $"已达剩余长度不足提醒!({curRecord.ErpLen - curRecord.Len}<={Config.residueWarnningLen})", WarningEnum.High); AddTextEvent(DateTime.Now, $"告警{Thread.CurrentThread.ManagedThreadId}", $"已达剩余长度不足提醒!({curRecord.ErpLen - curRecord.Len}<={Config.residueWarnningLen})", WarningEnum.High);
//warning(WarningEnum.Low, true);//暂停
#region
if (!_residueWarnningLenStop)
{
_residueWarnningLenStop = true;
AddTextEvent(DateTime.Now, $"暂停{Thread.CurrentThread.ManagedThreadId}", $"已达剩余长度不足提醒!({curRecord.ErpLen - curRecord.Len}<={Config.residueWarnningLen}),进入暂停。");
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);
});
}
this.BeginInvoke(new System.Action(() =>
{
//warning(WarningEnum.Low, true);//暂停
MessageBox.Show($"已达剩余长度不足提醒!({curRecord.ErpLen - curRecord.Len}<={Config.residueWarnningLen}),进入暂停。", "警告",MessageBoxButtons.OK, MessageBoxIcon.Warning);
}));
}
#endregion
} }
errStep = 6; errStep = 6;
//厚度检测提示 //厚度检测提示
@ -1174,7 +1142,6 @@ namespace LeatherApp.Page
curRecord.dicPhoto_Defect.TryAdd(scanPhoto.photoIndex, false);//加入索引,默认无瑕疵 curRecord.dicPhoto_Defect.TryAdd(scanPhoto.photoIndex, false);//加入索引,默认无瑕疵
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"图像索引:{scanPhoto.photoIndex},标识数:{curRecord.dicPhoto_Defect.Count}", WarningEnum.Low, false); AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"图像索引:{scanPhoto.photoIndex},标识数:{curRecord.dicPhoto_Defect.Count}", WarningEnum.Low, false);
errStep = 7; errStep = 7;
//暂停:瑕疵二次判断 //暂停:瑕疵二次判断
if (this.defectPauseForUser) if (this.defectPauseForUser)
{ {
@ -1258,7 +1225,7 @@ namespace LeatherApp.Page
this.uiMiniPagination1.TotalCount = curRecord.DefectTotalCount = curRecord.DefectInfoList.Count; this.uiMiniPagination1.TotalCount = curRecord.DefectTotalCount = curRecord.DefectInfoList.Count;
// //
//double len = Math.Round((res.photoIndex + 1) * bmpHeight * 1.0d / Config.cm2px_y + 0.005f, 2); //double len = Math.Round((res.photoIndex + 1) * bmpHeight * 1.0d / Config.cm2px_y + 0.005f, 2);
this.reDrawDefectPoints(curRecord.DefectInfoList, curRecord.GradeDifferentiateInfoList); this.reDrawDefectPoints(curRecord.DefectInfoList);
errStep = 9; errStep = 9;
//自动继续运行设备(这里临时暂停后不能再急停,否则无法继续) //自动继续运行设备(这里临时暂停后不能再急停,否则无法继续)
if (!Config.StopPLC) if (!Config.StopPLC)
@ -1282,7 +1249,6 @@ namespace LeatherApp.Page
} }
} }
errStep = 10; errStep = 10;
//以下判定放置于二次判定之后,因为二次判定可能会忽略部分检测项!! //以下判定放置于二次判定之后,因为二次判定可能会忽略部分检测项!!
//暂停:缺陷超标 //暂停:缺陷超标
@ -1355,7 +1321,7 @@ namespace LeatherApp.Page
} }
#endif #endif
} }
#if false
//暂停:按等级分卷 //暂停:按等级分卷
if (curRecord.DefectTotalCount > 0 && curRecord.ProductInfo.GradeLimitList != null && curRecord.ProductInfo.GradeLimitList.Count > 0 && curRecord.DefectInfoList != null) if (curRecord.DefectTotalCount > 0 && curRecord.ProductInfo.GradeLimitList != null && curRecord.ProductInfo.GradeLimitList.Count > 0 && curRecord.DefectInfoList != null)
{ {
@ -1363,12 +1329,12 @@ namespace LeatherApp.Page
//按缺陷计算每X米多少缺陷分等级 //按缺陷计算每X米多少缺陷分等级
for (int i = 0; i < curRecord.ProductInfo.GradeLimitList.Count; i++) for (int i = 0; i < curRecord.ProductInfo.GradeLimitList.Count; i++)
{ {
if (curRecord.ProductInfo.GradeLimitList[i].JudgeLength > 0 ) if (curRecord.ProductInfo.GradeLimitList[i].JudgeLength > 0)
{ {
errStep = 14; errStep = 14;
int liPhotoIndex = scanPhoto.photoIndex - Config.defectPauseSkipPhotoCount; //二次判定完的图片index int liPhotoIndex = scanPhoto.photoIndex - Config.defectPauseSkipPhotoCount; //二次判定完的图片index
double GrageLen = curRecord.ProductInfo.GradeLimitList[i].JudgeLength * 100;//每米 to cm double GrageLen = curRecord.ProductInfo.GradeLimitList[i].JudgeLength * 100;//每米 to cm
int warnCount =(int)(GrageLen * Config.cm2px_y) / scanPhoto.mat.Height; //计算图像张数 int warnCount = (int)(GrageLen * Config.cm2px_y) / scanPhoto.mat.Height; //计算图像张数
if (curRecord.GradeDifferentiateInfoList == null) if (curRecord.GradeDifferentiateInfoList == null)
{ {
@ -1380,14 +1346,14 @@ namespace LeatherApp.Page
//从上次告警后重新开始计算长度及数量 //从上次告警后重新开始计算长度及数量
var allFind = curRecord.DefectInfoList.Where(m => m.PhotoIndex >= curRecord.preGradePhotoIndexByGradeIndex && m.PhotoIndex >= (liPhotoIndex + 1 - warnCount) && m.PhotoIndex <= liPhotoIndex).ToList(); var allFind = curRecord.DefectInfoList.Where(m => m.PhotoIndex >= curRecord.preGradePhotoIndexByGradeIndex && m.PhotoIndex >= (liPhotoIndex + 1 - warnCount) && m.PhotoIndex <= liPhotoIndex).ToList();
int warnDefectCount = 0; int warnDefectCount = 0;
if(item.Code == "All") if (item.Code == "All")
warnDefectCount = allFind.Count(); warnDefectCount = allFind.Count();
else else
{ {
warnDefectCount = allFind.Where(m => m.Code == item.Code).Count(); warnDefectCount = allFind.Where(m => m.Code == item.Code).Count();
} }
int GradeCount = 0; int GradeCount = 0;
if(item.E >0 && warnDefectCount > item.E) if (item.E > 0 && warnDefectCount > item.E)
{ {
GradeCount = item.E; GradeCount = item.E;
differentiateInfo.GradeCode = "E"; differentiateInfo.GradeCode = "E";
@ -1420,9 +1386,9 @@ namespace LeatherApp.Page
differentiateInfo.UseGradeLimit = item; differentiateInfo.UseGradeLimit = item;
differentiateInfo.DefectCnt = warnDefectCount; differentiateInfo.DefectCnt = warnDefectCount;
differentiateInfo.StartPhotoIndex = allFind.Min(x=>x.PhotoIndex); differentiateInfo.StartPhotoIndex = allFind.Min(x => x.PhotoIndex);
differentiateInfo.EndPhotoIndex = allFind.Max(x => x.PhotoIndex); differentiateInfo.EndPhotoIndex = allFind.Max(x => x.PhotoIndex);
differentiateInfo.StartY = allFind.Min(x=>x.CentreY) / 100 - OffsetCut; differentiateInfo.StartY = allFind.Min(x => x.CentreY) / 100 - OffsetCut;
differentiateInfo.EndY = allFind.Max(x => x.CentreY) / 100 + OffsetCut; differentiateInfo.EndY = allFind.Max(x => x.CentreY) / 100 + OffsetCut;
differentiateInfo.CutLen = differentiateInfo.EndY - differentiateInfo.StartY; differentiateInfo.CutLen = differentiateInfo.EndY - differentiateInfo.StartY;
//记录新的判定开始位置 //记录新的判定开始位置
@ -1457,12 +1423,13 @@ namespace LeatherApp.Page
} }
} }
} }
#endif
task.record = curRecord; task.record = curRecord;
task.finishEvent = callBackPhotoEvent; task.finishEvent = callBackPhotoEvent;
devContainer.libPhoto.add(task); devContainer.libPhoto.add(task);
AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"Dev={devIndex},图像{scanPhoto.photoIndex},已加入图像处理队列", WarningEnum.Low, false); AddTextEvent(DateTime.Now, $"拍照{Thread.CurrentThread.ManagedThreadId}", $"Dev={devIndex},图像{scanPhoto.photoIndex},已加入图像处理队列");
errStep = 21; errStep = 21;
Application.DoEvents(); //Application.DoEvents();
} }
} }
catch (Exception e) catch (Exception e)
@ -1589,7 +1556,7 @@ namespace LeatherApp.Page
//----缺陷队列 //----缺陷队列
int oxw, oxh; int oxw, oxh;
mat = OpenCVUtil.resize(mat, resize.Width, resize.Height, out oxw, out 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}", WarningEnum.Low, false); AddTextEvent(DateTime.Now,$"图像处理{Thread.CurrentThread.ManagedThreadId}", $"(图像{scanPhotos0.photoIndex})-合成图resize后:{mat.Width}*{mat.Height}-{oxw}*{oxh}", WarningEnum.Low, false);
devContainer.libDefect.add(new Device.DefectLib.DefectTask() devContainer.libDefect.add(new Device.DefectLib.DefectTask()
{ {
modelName= curRecord.ProductInfo.ModelName, modelName= curRecord.ProductInfo.ModelName,
@ -1620,7 +1587,7 @@ namespace LeatherApp.Page
scanPhotos1.mat.Dispose(); scanPhotos1.mat.Dispose();
scanPhotos0 = scanPhotos1 = null; scanPhotos0 = scanPhotos1 = null;
task = null; task = null;
System.GC.Collect(); //System.GC.Collect();
} }
} }
private void callBackDefectEvent(Device.DefectLib.DefectTask res) private void callBackDefectEvent(Device.DefectLib.DefectTask res)
@ -1652,7 +1619,6 @@ namespace LeatherApp.Page
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmpTag).Save($"{dirPath}{res.photoIndex}_tag.jpg", ImageFormat.Jpeg); OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmpTag).Save($"{dirPath}{res.photoIndex}_tag.jpg", ImageFormat.Jpeg);
if (!Config.IsSaveAllImage && Config.IsSaveDefectSourceImage) if (!Config.IsSaveAllImage && Config.IsSaveDefectSourceImage)
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save($"{dirSourcePath}{res.photoIndex}.bmp", ImageFormat.Bmp); OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save($"{dirSourcePath}{res.photoIndex}.bmp", ImageFormat.Bmp);
step = 3; step = 3;
res.record.DefectTotalCount += res.excelTable.Rows.Count; res.record.DefectTotalCount += res.excelTable.Rows.Count;
if (res.record.DefectInfoList == null) if (res.record.DefectInfoList == null)
@ -1689,11 +1655,10 @@ namespace LeatherApp.Page
//AddTextEvent(DateTime.Now,$"打标完成", $"第{i}个缺陷:{ JsonConvert.SerializeObject(defectInfo)}; Y={res.photoIndex * res.bmp.Height * 1.0d / Config.cm2px_y}+{res.excelTable.Rows[i]["Y"].ToString()}"); //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; step = 7 + i * 10;
if(!defectTag.ContainsKey(res.photoIndex)) if (!defectTag.ContainsKey(res.photoIndex))
{ {
defectTag.Add(res.photoIndex, res.bmpTag.Clone()); defectTag.Add(res.photoIndex, res.bmpTag.Clone());
} }
//保存打标小图 //保存打标小图
if (Config.IsSaveDefectCutImage) if (Config.IsSaveDefectCutImage)
{ {
@ -1751,7 +1716,7 @@ namespace LeatherApp.Page
// //
double len = Math.Round((res.photoIndex + 1) * bmpHeight * 1.0d / Config.cm2px_y+0.005f, 2); double len = Math.Round((res.photoIndex + 1) * bmpHeight * 1.0d / Config.cm2px_y+0.005f, 2);
this.reDrawDefectPoints(res.record.DefectInfoList, res.record.GradeDifferentiateInfoList, new double[] { 0, Math.Round(res.record.FaceWidthMax+ 0.005f, 2) }, new double[] { 0, len + OffsetCut * 100}); this.reDrawDefectPoints(res.record.DefectInfoList, new double[] { 0, Math.Round(res.record.FaceWidthMax+ 0.005f, 2) }, new double[] { 0, len });
})); }));
step = 9; step = 9;
AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", "保存CSV", WarningEnum.Low, false); AddTextEvent(DateTime.Now,$"检测完成{Thread.CurrentThread.ManagedThreadId}", "保存CSV", WarningEnum.Low, false);
@ -1759,7 +1724,6 @@ namespace LeatherApp.Page
bool b = Utils.ExcelUtil.DataTable2CSV($"{dirPath}{res.photoIndex}.csv", res.excelTable); bool b = Utils.ExcelUtil.DataTable2CSV($"{dirPath}{res.photoIndex}.csv", res.excelTable);
//AddTextEvent(DateTime.Now,$"打标完成", $"{res.tag}.xlsx {(b ? "保存成功!" : "保存失败!")}"); //AddTextEvent(DateTime.Now,$"打标完成", $"{res.tag}.xlsx {(b ? "保存成功!" : "保存失败!")}");
step = 10; step = 10;
#if #if
//每百米告警判断???在此还是在收到新照片时触发??? //每百米告警判断???在此还是在收到新照片时触发???
if (res.record.ProductInfo.DefectCountLimit > 0 && res.record.DefectTotalCount >= res.record.ProductInfo.DefectCountLimit) if (res.record.ProductInfo.DefectCountLimit > 0 && res.record.DefectTotalCount >= res.record.ProductInfo.DefectCountLimit)
@ -1772,23 +1736,9 @@ namespace LeatherApp.Page
{ {
res.record.preWarningPhotoIndex = res.photoIndex + 1; res.record.preWarningPhotoIndex = res.photoIndex + 1;
AddTextEvent(DateTime.Now,$"告警{Thread.CurrentThread.ManagedThreadId}", $"每百米瑕疵数量达到阈值!({defectCount}>={res.record.ProductInfo.DefectCountLimit})", WarningEnum.High); AddTextEvent(DateTime.Now,$"告警{Thread.CurrentThread.ManagedThreadId}", $"每百米瑕疵数量达到阈值!({defectCount}>={res.record.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);
});
}
} }
step = 11; step = 11;
#if true #if false
//按缺陷计算没X米多少缺陷报警 //按缺陷计算没X米多少缺陷报警
for (int i = 0; i < res.record.ProductInfo.QualifiedLimitList.Count; i++) for (int i = 0; i < res.record.ProductInfo.QualifiedLimitList.Count; i++)
{ {
@ -1804,26 +1754,11 @@ namespace LeatherApp.Page
{ {
res.record.preWarningPhotoIndexByLabel[i] = res.photoIndex + 1; res.record.preWarningPhotoIndexByLabel[i] = res.photoIndex + 1;
AddTextEvent(DateTime.Now, $"告警{Thread.CurrentThread.ManagedThreadId}", $"每{defectWarn.DefectWarnLength}米{Config.getDefectName(defectWarn.Code)}瑕疵数量达到阈值!({warnDefectCount}>={defectWarn.DefectWarnCnt})", WarningEnum.High); 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 #endif
} }
#endif #endif
} }
@ -1891,52 +1826,21 @@ namespace LeatherApp.Page
{ {
step = 4; step = 4;
int count; int count;
//if (model.ProductInfo.IsAllDefectGetGradeLimit) foreach(GradeLimit item in gradeLimitList)
//{
// step = 5;
// if ((model.DefectInfoList != null) && (model.DefectInfoList.Count > 0))
// count = model.DefectInfoList.Count();
// else
// count = 0;
// step = 6;
// GradeLimit item = gradeLimitList.Find(x => x.Code == "All");
// if (item != null)
// {
// if (count <= item.A && model.Grade <= 1) model.Grade = 1;
// else if (count <= item.B && item.B > 0 && model.Grade <= 2) model.Grade = 2;
// else if (count <= item.C && item.C > 0 && model.Grade <= 3) model.Grade = 3;
// else if (count <= item.D && item.D > 0 && model.Grade <= 4) model.Grade = 4;
// else if (count <= item.E && item.E > 0 && model.Grade <= 5) model.Grade = 5;
// else if (count > 0) model.Grade = 6;//不合格
// AddTextEvent(DateTime.Now, "标准判断-总和缺陷", $"({key}) 批号({model.BatchId}),标准={(char)(model.Grade + 64)} [{item.Code}:{count};A<={item.A};B<={item.B};C<={item.C};D<={item.D};E<={item.E}]");
// }
//}
//else
//{
// foreach (GradeLimit item in gradeLimitList)
// {
// if ((model.DefectInfoList != null) && (model.DefectInfoList.Count > 0))
// count = model.DefectInfoList.Where(m => m.Code == item.Code).Count();
// else
// count = 0;
// if (count <= item.A && model.Grade <= 1) model.Grade = 1;
// else if (count <= item.B && item.B > 0 && model.Grade <= 2) model.Grade = 2;
// else if (count <= item.C && item.C > 0 && model.Grade <= 3) model.Grade = 3;
// else if (count <= item.D && item.D > 0 && model.Grade <= 4) model.Grade = 4;
// else if (count <= item.E && item.E > 0 && model.Grade <= 5) model.Grade = 5;
// else if (count > 0) model.Grade = 6;//不合格
// AddTextEvent(DateTime.Now, "标准判断-分缺陷", $"({key}) 批号({model.BatchId}),标准={(char)(model.Grade + 64)} [{item.Code}:{count};A<={item.A};B<={item.B};C<={item.C};D<={item.D};E<={item.E}]");
// }
//}
if (model.GradeDifferentiateInfoList != null)
{ {
foreach (var item in model.GradeDifferentiateInfoList) if((model.DefectInfoList != null)&&(model.DefectInfoList.Count >0))
{ count = model.DefectInfoList.Where(m => m.Code == item.Code).Count();
AddTextEvent(DateTime.Now, "分卷判断", $"({key}) 批号({model.BatchId}),等级={item.GradeCode} 位置[{item.StartY}-{item.EndY}],长度={item.CutLen},瑕疵数={item.DefectCnt}"); else
} count = 0;
if (count <= item.A && model.Grade <= 1) model.Grade = 1;
else if (count <= item.B && item.B > 0 && model.Grade <= 2) model.Grade = 2;
else if (count <= item.C && item.C > 0 && model.Grade <= 3) model.Grade = 3;
else if (count <= item.D && item.D > 0 && model.Grade <= 4) model.Grade = 4;
else if (count <= item.E && item.E > 0 && model.Grade <= 5) model.Grade = 5;
else if (count>0) model.Grade = 6;//不合格
AddTextEvent(DateTime.Now,"标准判断", $"({key}) 批号({model.BatchId}),标准={(char)(model.Grade + 64)} [{item.Code}:{count};A<={item.A};B<={item.B};C<={item.C};D<={item.D};E<={item.E}]");
} }
step = 7; step = 5;
} }
model.Qualified = (model.Grade < 6);//是否合格 model.Qualified = (model.Grade < 6);//是否合格
if (!svcRecord.InsertNav(model)) if (!svcRecord.InsertNav(model))
@ -1989,7 +1893,6 @@ namespace LeatherApp.Page
private void btnStart_Click(object sender, EventArgs e) private void btnStart_Click(object sender, EventArgs e)
{ {
AddTextEvent(DateTime.Now,"启动", "下发启动指令..."); AddTextEvent(DateTime.Now,"启动", "下发启动指令...");
//ThnDieLen = 0;
if (!Config.StopPLC) if (!Config.StopPLC)
this.devContainer.devPlc.runDev(); this.devContainer.devPlc.runDev();
else if (!Config.StopIO && devContainer.devIOCard.IsInit) else if (!Config.StopIO && devContainer.devIOCard.IsInit)
@ -2276,14 +2179,55 @@ namespace LeatherApp.Page
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
List<DefectInfo> lstEditDefect = new List<DefectInfo>(); //List<DefectInfo> lstEditDefect = new List<DefectInfo>();
DefectInfo dt = new DefectInfo(); //DefectInfo dt = new DefectInfo();
dt.Name = "123"; //dt.Name = "123";
dt.Code = "jb"; //dt.Code = "wuyin";
dt.image = Image.FromFile("C:\\Users\\fang\\Desktop\\123.png"); //dt.image = Image.FromFile("C:\\Users\\fang\\Desktop\\123.png");
lstEditDefect.Add(dt); //lstEditDefect.Add(dt);
FHome_Defect frmDefect = new FHome_Defect(lstEditDefect, null); //Mat mtt = new Mat("C:\\Users\\fang\\Desktop\\新建文件夹\\mx\\636.bmp");
frmDefect.ShowDialog(); //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; return;
Config.LoadAllConfig(); Config.LoadAllConfig();
DefectLib dl = new DefectLib(); DefectLib dl = new DefectLib();

View File

@ -39,27 +39,23 @@
// //
// uiPanel1 // uiPanel1
// //
this.uiPanel1.Controls.Add(this.pictureBox1);
this.uiPanel1.Controls.Add(this.flowLayoutPanel1); 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.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.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1); this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1"; 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.TabIndex = 0;
this.uiPanel1.Text = "uiPanel1"; this.uiPanel1.Text = "uiPanel1";
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
// //
// flowLayoutPanel1 // flowLayoutPanel1
// //
this.flowLayoutPanel1.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.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 303); this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1236, 613); this.flowLayoutPanel1.Size = new System.Drawing.Size(1236, 731);
this.flowLayoutPanel1.TabIndex = 0; this.flowLayoutPanel1.TabIndex = 0;
// //
// btnOK // btnOK
@ -94,11 +90,11 @@
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 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.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.Location = new System.Drawing.Point(3, 3); this.pictureBox1.Location = new System.Drawing.Point(4, 38);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(1236, 294); this.pictureBox1.Size = new System.Drawing.Size(1242, 180);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 1; this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// FHome_Defect // FHome_Defect
@ -106,6 +102,7 @@
this.AcceptButton = this.btnOK; this.AcceptButton = this.btnOK;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1250, 1014); this.ClientSize = new System.Drawing.Size(1250, 1014);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK); this.Controls.Add(this.btnOK);
this.Controls.Add(this.uiPanel1); this.Controls.Add(this.uiPanel1);

View File

@ -19,7 +19,6 @@ namespace LeatherApp.Page
{ {
private List<DefectInfo> list; private List<DefectInfo> list;
public List<DefectInfo> lstDel = new List<DefectInfo>(); public List<DefectInfo> lstDel = new List<DefectInfo>();
private Mat Image; private Mat Image;
public FHome_Defect(List<DefectInfo> lst, Mat img) public FHome_Defect(List<DefectInfo> lst, Mat img)
{ {

View File

@ -28,18 +28,17 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FProductInfo));
this.uiTitlePanel2 = new Sunny.UI.UITitlePanel(); this.uiTitlePanel2 = new Sunny.UI.UITitlePanel();
this.tcbarTensionValue = new Sunny.UI.UITrackBar(); this.tcbarTensionValue = new Sunny.UI.UITrackBar();
this.tcbarGain = new Sunny.UI.UITrackBar(); this.tcbarGain = new Sunny.UI.UITrackBar();
@ -57,9 +56,6 @@
this.cmbModelName = new Sunny.UI.UIComboBox(); this.cmbModelName = new Sunny.UI.UIComboBox();
this.uiLabel1 = new Sunny.UI.UILabel(); this.uiLabel1 = new Sunny.UI.UILabel();
this.uiTitlePanel4 = new Sunny.UI.UITitlePanel(); this.uiTitlePanel4 = new Sunny.UI.UITitlePanel();
this.uiNumPadTextBox1 = new Sunny.UI.UINumPadTextBox();
this.uiSwitch1 = new Sunny.UI.UISwitch();
this.uiLabel11 = new Sunny.UI.UILabel();
this.btnDefectOption = new Sunny.UI.UISymbolButton(); this.btnDefectOption = new Sunny.UI.UISymbolButton();
this.swcDefectPauseForUser = new Sunny.UI.UISwitch(); this.swcDefectPauseForUser = new Sunny.UI.UISwitch();
this.numDefectCountLimit = new Sunny.UI.UINumPadTextBox(); this.numDefectCountLimit = new Sunny.UI.UINumPadTextBox();
@ -79,6 +75,12 @@
this.col_Cnt = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.col_Cnt = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uiTitlePanel6 = new Sunny.UI.UITitlePanel(); this.uiTitlePanel6 = new Sunny.UI.UITitlePanel();
this.uiDataGridView2 = new Sunny.UI.UIDataGridView(); this.uiDataGridView2 = new Sunny.UI.UIDataGridView();
this.col2_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uiPanel1 = new Sunny.UI.UIPanel(); this.uiPanel1 = new Sunny.UI.UIPanel();
this.uiFlowLayoutPanel1 = new Sunny.UI.UIFlowLayoutPanel(); this.uiFlowLayoutPanel1 = new Sunny.UI.UIFlowLayoutPanel();
this.btnSave = new Sunny.UI.UISymbolButton(); this.btnSave = new Sunny.UI.UISymbolButton();
@ -94,17 +96,9 @@
this.cmbColor = new Sunny.UI.UIComboBox(); this.cmbColor = new Sunny.UI.UIComboBox();
this.uiLabel3 = new Sunny.UI.UILabel(); this.uiLabel3 = new Sunny.UI.UILabel();
this.uiLabel2 = new Sunny.UI.UILabel(); this.uiLabel2 = new Sunny.UI.UILabel();
this.ckIsCut = new Sunny.UI.UICheckBox(); this.uiSwitch1 = new Sunny.UI.UISwitch();
this.btnAddGrade = new Sunny.UI.UISymbolButton(); this.uiLabel11 = new Sunny.UI.UILabel();
this.btnDelGrade = new Sunny.UI.UISymbolButton(); this.uiNumPadTextBox1 = new Sunny.UI.UINumPadTextBox();
this.col2_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_Item = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.col2_1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col2_6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uiTitlePanel2.SuspendLayout(); this.uiTitlePanel2.SuspendLayout();
this.uiTitlePanel3.SuspendLayout(); this.uiTitlePanel3.SuspendLayout();
this.uiTitlePanel4.SuspendLayout(); this.uiTitlePanel4.SuspendLayout();
@ -383,8 +377,8 @@
// //
this.uiTitlePanel4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 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.uiNumPadTextBox1);
this.uiTitlePanel4.Controls.Add(this.uiSwitch1);
this.uiTitlePanel4.Controls.Add(this.uiLabel11); this.uiTitlePanel4.Controls.Add(this.uiLabel11);
this.uiTitlePanel4.Controls.Add(this.uiSwitch1);
this.uiTitlePanel4.Controls.Add(this.btnDefectOption); this.uiTitlePanel4.Controls.Add(this.btnDefectOption);
this.uiTitlePanel4.Controls.Add(this.swcDefectPauseForUser); this.uiTitlePanel4.Controls.Add(this.swcDefectPauseForUser);
this.uiTitlePanel4.Controls.Add(this.numDefectCountLimit); this.uiTitlePanel4.Controls.Add(this.numDefectCountLimit);
@ -408,46 +402,6 @@
this.uiTitlePanel4.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiTitlePanel4.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
this.uiTitlePanel4.TitleColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); this.uiTitlePanel4.TitleColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
// //
// uiNumPadTextBox1
//
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, 300);
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(119, 29);
this.uiNumPadTextBox1.Style = Sunny.UI.UIStyle.Custom;
this.uiNumPadTextBox1.TabIndex = 17;
this.uiNumPadTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
this.uiNumPadTextBox1.Watermark = "";
//
// uiSwitch1
//
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, 300);
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 = 16;
this.uiSwitch1.Text = "uiSwitch1";
//
// uiLabel11
//
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(3, 263);
this.uiLabel11.Name = "uiLabel11";
this.uiLabel11.Size = new System.Drawing.Size(131, 21);
this.uiLabel11.Style = Sunny.UI.UIStyle.Custom;
this.uiLabel11.TabIndex = 15;
this.uiLabel11.Text = "固定距离暂停(m)";
this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// btnDefectOption // btnDefectOption
// //
this.btnDefectOption.Cursor = System.Windows.Forms.Cursors.Hand; this.btnDefectOption.Cursor = System.Windows.Forms.Cursors.Hand;
@ -570,21 +524,21 @@
// //
// uiDataGridView1 // uiDataGridView1
// //
dataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle12; this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.uiDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 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.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.uiDataGridView1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); this.uiDataGridView1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle13.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle13; this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.uiDataGridView1.ColumnHeadersHeight = 32; this.uiDataGridView1.ColumnHeadersHeight = 32;
this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@ -596,35 +550,35 @@
this.col_IsOR, this.col_IsOR,
this.col_Len, this.col_Len,
this.col_Cnt}); this.col_Cnt});
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle15.BackColor = System.Drawing.Color.White; dataGridViewCellStyle4.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle4.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))))); dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
dataGridViewCellStyle15.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle15; this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle4;
this.uiDataGridView1.EnableHeadersVisualStyles = false; this.uiDataGridView1.EnableHeadersVisualStyles = false;
this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(173)))), ((int)(((byte)(255))))); this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(173)))), ((int)(((byte)(255)))));
this.uiDataGridView1.Location = new System.Drawing.Point(3, 41); this.uiDataGridView1.Location = new System.Drawing.Point(3, 41);
this.uiDataGridView1.MultiSelect = false; this.uiDataGridView1.MultiSelect = false;
this.uiDataGridView1.Name = "uiDataGridView1"; this.uiDataGridView1.Name = "uiDataGridView1";
dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle5.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))))); dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle16; this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.uiDataGridView1.RowHeadersWidth = 62; this.uiDataGridView1.RowHeadersWidth = 62;
dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; dataGridViewCellStyle6.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle17.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle17; this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.uiDataGridView1.RowTemplate.Height = 30; this.uiDataGridView1.RowTemplate.Height = 30;
this.uiDataGridView1.SelectedIndex = -1; this.uiDataGridView1.SelectedIndex = -1;
this.uiDataGridView1.Size = new System.Drawing.Size(581, 308); this.uiDataGridView1.Size = new System.Drawing.Size(581, 308);
@ -644,8 +598,8 @@
// col_zxd // col_zxd
// //
this.col_zxd.DataPropertyName = "ZXD"; this.col_zxd.DataPropertyName = "ZXD";
dataGridViewCellStyle14.NullValue = null; dataGridViewCellStyle3.NullValue = null;
this.col_zxd.DefaultCellStyle = dataGridViewCellStyle14; this.col_zxd.DefaultCellStyle = dataGridViewCellStyle3;
this.col_zxd.HeaderText = "置信度"; this.col_zxd.HeaderText = "置信度";
this.col_zxd.MinimumWidth = 20; this.col_zxd.MinimumWidth = 20;
this.col_zxd.Name = "col_zxd"; this.col_zxd.Name = "col_zxd";
@ -684,22 +638,19 @@
// col_Len // col_Len
// //
this.col_Len.HeaderText = "报警长度(m)"; this.col_Len.HeaderText = "报警长度(m)";
this.col_Len.MinimumWidth = 80;
this.col_Len.Name = "col_Len"; this.col_Len.Name = "col_Len";
this.col_Len.Visible = false;
// //
// col_Cnt // col_Cnt
// //
this.col_Cnt.HeaderText = "报警数量"; this.col_Cnt.HeaderText = "报警数量";
this.col_Cnt.MinimumWidth = 80;
this.col_Cnt.Name = "col_Cnt"; this.col_Cnt.Name = "col_Cnt";
this.col_Cnt.Visible = false;
// //
// uiTitlePanel6 // uiTitlePanel6
// //
this.uiTitlePanel6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.uiTitlePanel6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.uiTitlePanel6.Controls.Add(this.btnDelGrade);
this.uiTitlePanel6.Controls.Add(this.btnAddGrade);
this.uiTitlePanel6.Controls.Add(this.ckIsCut);
this.uiTitlePanel6.Controls.Add(this.uiDataGridView2); this.uiTitlePanel6.Controls.Add(this.uiDataGridView2);
this.uiTitlePanel6.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); this.uiTitlePanel6.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250)))));
this.uiTitlePanel6.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); this.uiTitlePanel6.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250)))));
@ -719,68 +670,108 @@
// //
// uiDataGridView2 // uiDataGridView2
// //
dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
this.uiDataGridView2.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; this.uiDataGridView2.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
this.uiDataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.uiDataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.uiDataGridView2.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); this.uiDataGridView2.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
this.uiDataGridView2.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.uiDataGridView2.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle19.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle19.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle19.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19; this.uiDataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.uiDataGridView2.ColumnHeadersHeight = 32; this.uiDataGridView2.ColumnHeadersHeight = 32;
this.uiDataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.uiDataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uiDataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uiDataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.col2_code, this.col2_code,
this.col2_Item,
this.col2_1, this.col2_1,
this.col2_2, this.col2_2,
this.col2_3, this.col2_3,
this.col2_4, this.col2_4,
this.col2_5, this.col2_5});
this.col2_6}); dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle9.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle20.BackColor = System.Drawing.Color.White; dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); dataGridViewCellStyle9.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.False; this.uiDataGridView2.DefaultCellStyle = dataGridViewCellStyle9;
this.uiDataGridView2.DefaultCellStyle = dataGridViewCellStyle20;
this.uiDataGridView2.EnableHeadersVisualStyles = false; this.uiDataGridView2.EnableHeadersVisualStyles = false;
this.uiDataGridView2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiDataGridView2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView2.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(173)))), ((int)(((byte)(255))))); this.uiDataGridView2.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(173)))), ((int)(((byte)(255)))));
this.uiDataGridView2.Location = new System.Drawing.Point(3, 41); this.uiDataGridView2.Location = new System.Drawing.Point(3, 41);
this.uiDataGridView2.MultiSelect = false; this.uiDataGridView2.MultiSelect = false;
this.uiDataGridView2.Name = "uiDataGridView2"; this.uiDataGridView2.Name = "uiDataGridView2";
dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
dataGridViewCellStyle21.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle21.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle21.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle21; this.uiDataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle10;
this.uiDataGridView2.RowHeadersWidth = 62; this.uiDataGridView2.RowHeadersWidth = 62;
dataGridViewCellStyle22.BackColor = System.Drawing.Color.White; dataGridViewCellStyle11.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle22.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle22.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle22.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
dataGridViewCellStyle22.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); dataGridViewCellStyle11.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiDataGridView2.RowsDefaultCellStyle = dataGridViewCellStyle22; this.uiDataGridView2.RowsDefaultCellStyle = dataGridViewCellStyle11;
this.uiDataGridView2.RowTemplate.Height = 30; this.uiDataGridView2.RowTemplate.Height = 30;
this.uiDataGridView2.SelectedIndex = -1; this.uiDataGridView2.SelectedIndex = -1;
this.uiDataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uiDataGridView2.Size = new System.Drawing.Size(488, 308); this.uiDataGridView2.Size = new System.Drawing.Size(488, 308);
this.uiDataGridView2.Style = Sunny.UI.UIStyle.Custom; this.uiDataGridView2.Style = Sunny.UI.UIStyle.Custom;
this.uiDataGridView2.TabIndex = 22; this.uiDataGridView2.TabIndex = 22;
// //
// col2_code
//
this.col2_code.HeaderText = "code";
this.col2_code.MinimumWidth = 8;
this.col2_code.Name = "col2_code";
this.col2_code.Visible = false;
this.col2_code.Width = 150;
//
// col2_1
//
this.col2_1.HeaderText = "A";
this.col2_1.MinimumWidth = 8;
this.col2_1.Name = "col2_1";
this.col2_1.Width = 80;
//
// col2_2
//
this.col2_2.HeaderText = "B";
this.col2_2.MinimumWidth = 8;
this.col2_2.Name = "col2_2";
this.col2_2.Width = 80;
//
// col2_3
//
this.col2_3.HeaderText = "C";
this.col2_3.MinimumWidth = 8;
this.col2_3.Name = "col2_3";
this.col2_3.Width = 80;
//
// col2_4
//
this.col2_4.HeaderText = "D";
this.col2_4.MinimumWidth = 8;
this.col2_4.Name = "col2_4";
this.col2_4.Width = 80;
//
// col2_5
//
this.col2_5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.col2_5.HeaderText = "E";
this.col2_5.MinimumWidth = 8;
this.col2_5.Name = "col2_5";
//
// uiPanel1 // uiPanel1
// //
this.uiPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.uiPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -1034,110 +1025,45 @@
this.uiLabel2.Text = "产品颜色"; this.uiLabel2.Text = "产品颜色";
this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// ckIsCut // uiSwitch1
// //
this.ckIsCut.BackColor = System.Drawing.Color.Transparent; this.uiSwitch1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ckIsCut.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSwitch1.Location = new System.Drawing.Point(9, 294);
this.ckIsCut.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiSwitch1.MinimumSize = new System.Drawing.Size(1, 1);
this.ckIsCut.ForeColor = System.Drawing.Color.White; this.uiSwitch1.Name = "uiSwitch1";
this.ckIsCut.Location = new System.Drawing.Point(347, 2); this.uiSwitch1.Size = new System.Drawing.Size(80, 29);
this.ckIsCut.MinimumSize = new System.Drawing.Size(1, 1); this.uiSwitch1.Style = Sunny.UI.UIStyle.Custom;
this.ckIsCut.Name = "ckIsCut"; this.uiSwitch1.TabIndex = 15;
this.ckIsCut.Size = new System.Drawing.Size(132, 33); this.uiSwitch1.Text = "uiSwitch1";
this.ckIsCut.Style = Sunny.UI.UIStyle.Custom;
this.ckIsCut.TabIndex = 44;
this.ckIsCut.Text = "使用裁切提示";
this.ckIsCut.CheckedChanged += new System.EventHandler(this.ckGradeLimeIsAllDefectCnt_CheckedChanged);
// //
// btnAddGrade // uiLabel11
// //
this.btnAddGrade.BackColor = System.Drawing.Color.Transparent; this.uiLabel11.AutoSize = true;
this.btnAddGrade.Cursor = System.Windows.Forms.Cursors.Hand; this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddGrade.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.btnAddGrade.Image = ((System.Drawing.Image)(resources.GetObject("btnAddGrade.Image"))); this.uiLabel11.Location = new System.Drawing.Point(5, 268);
this.btnAddGrade.LightColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(30)))), ((int)(((byte)(63))))); this.uiLabel11.Name = "uiLabel11";
this.btnAddGrade.Location = new System.Drawing.Point(105, 3); this.uiLabel11.Size = new System.Drawing.Size(106, 21);
this.btnAddGrade.MinimumSize = new System.Drawing.Size(1, 1); this.uiLabel11.Style = Sunny.UI.UIStyle.Custom;
this.btnAddGrade.Name = "btnAddGrade"; this.uiLabel11.TabIndex = 16;
this.btnAddGrade.Size = new System.Drawing.Size(86, 29); this.uiLabel11.Text = "厚度检测判断";
this.btnAddGrade.Style = Sunny.UI.UIStyle.Custom; this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnAddGrade.Symbol = 61459;
this.btnAddGrade.TabIndex = 18;
this.btnAddGrade.Text = "新增";
this.btnAddGrade.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddGrade.Click += new System.EventHandler(this.btnAddGrade_Click);
// //
// btnDelGrade // uiNumPadTextBox1
// //
this.btnDelGrade.BackColor = System.Drawing.Color.Transparent; this.uiNumPadTextBox1.FillColor = System.Drawing.Color.White;
this.btnDelGrade.Cursor = System.Windows.Forms.Cursors.Hand; this.uiNumPadTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelGrade.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.btnDelGrade.Image = ((System.Drawing.Image)(resources.GetObject("btnDelGrade.Image"))); this.uiNumPadTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btnDelGrade.LightColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(30)))), ((int)(((byte)(63))))); this.uiNumPadTextBox1.MinimumSize = new System.Drawing.Size(63, 0);
this.btnDelGrade.Location = new System.Drawing.Point(213, 3); this.uiNumPadTextBox1.Name = "uiNumPadTextBox1";
this.btnDelGrade.MinimumSize = new System.Drawing.Size(1, 1); this.uiNumPadTextBox1.NumPadType = Sunny.UI.NumPadType.Integer;
this.btnDelGrade.Name = "btnDelGrade"; this.uiNumPadTextBox1.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2);
this.btnDelGrade.Size = new System.Drawing.Size(86, 29); this.uiNumPadTextBox1.Size = new System.Drawing.Size(132, 29);
this.btnDelGrade.Style = Sunny.UI.UIStyle.Custom; this.uiNumPadTextBox1.Style = Sunny.UI.UIStyle.Custom;
this.btnDelGrade.Symbol = 61459; this.uiNumPadTextBox1.TabIndex = 17;
this.btnDelGrade.TabIndex = 45; this.uiNumPadTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
this.btnDelGrade.Text = "删除"; this.uiNumPadTextBox1.Watermark = "";
this.btnDelGrade.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelGrade.Click += new System.EventHandler(this.btnDelGrade_Click);
//
// col2_code
//
this.col2_code.HeaderText = "code";
this.col2_code.MinimumWidth = 8;
this.col2_code.Name = "col2_code";
this.col2_code.Visible = false;
this.col2_code.Width = 120;
//
// col2_Item
//
this.col2_Item.HeaderText = "名称";
this.col2_Item.Name = "col2_Item";
//
// col2_1
//
this.col2_1.HeaderText = "A";
this.col2_1.MinimumWidth = 8;
this.col2_1.Name = "col2_1";
this.col2_1.Width = 60;
//
// col2_2
//
this.col2_2.HeaderText = "B";
this.col2_2.MinimumWidth = 8;
this.col2_2.Name = "col2_2";
this.col2_2.Width = 60;
//
// col2_3
//
this.col2_3.HeaderText = "C";
this.col2_3.MinimumWidth = 8;
this.col2_3.Name = "col2_3";
this.col2_3.Width = 60;
//
// col2_4
//
this.col2_4.HeaderText = "D";
this.col2_4.MinimumWidth = 8;
this.col2_4.Name = "col2_4";
this.col2_4.Width = 60;
//
// col2_5
//
this.col2_5.HeaderText = "E";
this.col2_5.MinimumWidth = 8;
this.col2_5.Name = "col2_5";
this.col2_5.Width = 60;
//
// col2_6
//
this.col2_6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.col2_6.HeaderText = "统计长度";
this.col2_6.Name = "col2_6";
// //
// FProductInfo // FProductInfo
// //
@ -1155,8 +1081,6 @@
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.Style = Sunny.UI.UIStyle.Custom; this.Style = Sunny.UI.UIStyle.Custom;
this.Initialize += new System.EventHandler(this.FProductInfo_Initialize); this.Initialize += new System.EventHandler(this.FProductInfo_Initialize);
this.Shown += new System.EventHandler(this.FProductInfo_Shown);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.FProductInfo_Paint);
this.uiTitlePanel2.ResumeLayout(false); this.uiTitlePanel2.ResumeLayout(false);
this.uiTitlePanel2.PerformLayout(); this.uiTitlePanel2.PerformLayout();
this.uiTitlePanel3.ResumeLayout(false); this.uiTitlePanel3.ResumeLayout(false);
@ -1202,6 +1126,12 @@
private Sunny.UI.UIFlowLayoutPanel uiFlowLayoutPanel1; private Sunny.UI.UIFlowLayoutPanel uiFlowLayoutPanel1;
private Sunny.UI.UIDataGridView uiDataGridView1; private Sunny.UI.UIDataGridView uiDataGridView1;
private Sunny.UI.UIDataGridView uiDataGridView2; private Sunny.UI.UIDataGridView uiDataGridView2;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_code;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_1;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_2;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_3;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_4;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_5;
private Sunny.UI.UITitlePanel uiTitlePanel1; private Sunny.UI.UITitlePanel uiTitlePanel1;
private Sunny.UI.UIComboBox cmbColor; private Sunny.UI.UIComboBox cmbColor;
private Sunny.UI.UILabel uiLabel3; private Sunny.UI.UILabel uiLabel3;
@ -1219,9 +1149,6 @@
private Sunny.UI.UIRadioButton rbMaterial4; private Sunny.UI.UIRadioButton rbMaterial4;
private Sunny.UI.UIRadioButton rbMaterial3; private Sunny.UI.UIRadioButton rbMaterial3;
private Sunny.UI.UIRadioButton rbMaterial2; private Sunny.UI.UIRadioButton rbMaterial2;
private Sunny.UI.UINumPadTextBox uiNumPadTextBox1;
private Sunny.UI.UISwitch uiSwitch1;
private Sunny.UI.UILabel uiLabel11;
private System.Windows.Forms.DataGridViewTextBoxColumn col_code; private System.Windows.Forms.DataGridViewTextBoxColumn col_code;
private System.Windows.Forms.DataGridViewTextBoxColumn col_zxd; private System.Windows.Forms.DataGridViewTextBoxColumn col_zxd;
private System.Windows.Forms.DataGridViewTextBoxColumn col_area; private System.Windows.Forms.DataGridViewTextBoxColumn col_area;
@ -1230,16 +1157,8 @@
private System.Windows.Forms.DataGridViewCheckBoxColumn col_IsOR; private System.Windows.Forms.DataGridViewCheckBoxColumn col_IsOR;
private System.Windows.Forms.DataGridViewTextBoxColumn col_Len; private System.Windows.Forms.DataGridViewTextBoxColumn col_Len;
private System.Windows.Forms.DataGridViewTextBoxColumn col_Cnt; private System.Windows.Forms.DataGridViewTextBoxColumn col_Cnt;
private Sunny.UI.UICheckBox ckIsCut; private Sunny.UI.UINumPadTextBox uiNumPadTextBox1;
private Sunny.UI.UISymbolButton btnAddGrade; private Sunny.UI.UILabel uiLabel11;
private Sunny.UI.UISymbolButton btnDelGrade; private Sunny.UI.UISwitch uiSwitch1;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_code;
private System.Windows.Forms.DataGridViewComboBoxColumn col2_Item;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_1;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_2;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_3;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_4;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_5;
private System.Windows.Forms.DataGridViewTextBoxColumn col2_6;
} }
} }

View File

@ -1,7 +1,4 @@
using DocumentFormat.OpenXml.EMMA; using LeatherApp.Device;
using DocumentFormat.OpenXml.Spreadsheet;
using DocumentFormat.OpenXml.Wordprocessing;
using LeatherApp.Device;
using LeatherApp.Interface; using LeatherApp.Interface;
using Models; using Models;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -13,11 +10,9 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Security.Policy;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml.Linq;
namespace LeatherApp.Page namespace LeatherApp.Page
{ {
@ -35,10 +30,7 @@ namespace LeatherApp.Page
uiDataGridView1.AllowUserToResizeRows = uiDataGridView2.AllowUserToResizeRows=false;//用户调整行大小 uiDataGridView1.AllowUserToResizeRows = uiDataGridView2.AllowUserToResizeRows=false;//用户调整行大小
//dataGridView1.AllowUserToResizeColumns = false;//用户调整列大小 //dataGridView1.AllowUserToResizeColumns = false;//用户调整列大小
//显示行号与列宽度自动调整 //显示行号与列宽度自动调整
uiDataGridView1.RowHeadersVisible = true; uiDataGridView1.RowHeadersVisible = uiDataGridView2.RowHeadersVisible = true;
uiDataGridView2.RowHeadersVisible = false;
uiDataGridView1.RowHeadersWidth = uiDataGridView2.RowHeadersWidth = 50; uiDataGridView1.RowHeadersWidth = uiDataGridView2.RowHeadersWidth = 50;
uiDataGridView1.ColumnHeadersHeightSizeMode = uiDataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; uiDataGridView1.ColumnHeadersHeightSizeMode = uiDataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
uiDataGridView1.RowHeadersWidthSizeMode = uiDataGridView2.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;//数据量过百绑定太变 uiDataGridView1.RowHeadersWidthSizeMode = uiDataGridView2.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;//数据量过百绑定太变
@ -141,6 +133,7 @@ namespace LeatherApp.Page
this.rbMaterial5.Checked = true; this.rbMaterial5.Checked = true;
else else
this.rbMaterial1.Checked = true; this.rbMaterial1.Checked = true;
this.cmbColor.SelectedValue = int.Parse(codes[1]); this.cmbColor.SelectedValue = int.Parse(codes[1]);
} }
else else
@ -178,7 +171,7 @@ namespace LeatherApp.Page
private void loadProduct() private void loadProduct()
{ {
if (model == null) return; if (model == null) return;
if (model.Material == "0") if(model.Material=="0")
this.rbMaterial0.Checked = true; this.rbMaterial0.Checked = true;
else if (model.Material == "1") else if (model.Material == "1")
this.rbMaterial1.Checked = true; this.rbMaterial1.Checked = true;
@ -193,8 +186,6 @@ namespace LeatherApp.Page
this.cmbColor.SelectedValue = model.Color; this.cmbColor.SelectedValue = model.Color;
this.ckIsCut.Checked = model.IsHintCutting;
tcbarLightValue.Value = model.LightValue; tcbarLightValue.Value = model.LightValue;
tcbarExposureTime.Value = (int)model.ExposureTime; tcbarExposureTime.Value = (int)model.ExposureTime;
tcbarGain.Value = (int)model.Gain; tcbarGain.Value = (int)model.Gain;
@ -205,7 +196,7 @@ namespace LeatherApp.Page
numDefectCountLimit.Text = model.DefectCountLimit.ToString(); numDefectCountLimit.Text = model.DefectCountLimit.ToString();
swcDefectPauseForUser.Active = model.DefectPauseForUser; swcDefectPauseForUser.Active = model.DefectPauseForUser;
uiSwitch1.Active = model.OpenThicknessDetection; this.uiSwitch1.Active = model.OpenThicknessDetection;
uiNumPadTextBox1.Text = model.ThicknessDetectionStopDis.ToString(); uiNumPadTextBox1.Text = model.ThicknessDetectionStopDis.ToString();
//uiDataGridView fill //uiDataGridView fill
string code; string code;
@ -213,73 +204,33 @@ namespace LeatherApp.Page
for (int i = 0; i < uiDataGridView1.Rows.Count; i++) for (int i = 0; i < uiDataGridView1.Rows.Count; i++)
{ {
code = uiDataGridView1.Rows[i].Cells["col_code"].Value.ToString(); code = uiDataGridView1.Rows[i].Cells["col_code"].Value.ToString();
item1 = model.QualifiedLimitList.FirstOrDefault(m => m.Code == code); item1 = model.QualifiedLimitList.FirstOrDefault(m=>m.Code == code);
if (item1 != null) if (item1 != null)
{ {
uiDataGridView1.Rows[i].Cells["col_zxd"].Value = item1.ZXD; uiDataGridView1.Rows[i].Cells["col_zxd"].Value=item1.ZXD;
uiDataGridView1.Rows[i].Cells["col_area"].Value = item1.Area * 100; uiDataGridView1.Rows[i].Cells["col_area"].Value = item1.Area * 100;
uiDataGridView1.Rows[i].Cells["col_contrast_top"].Value = ContrastToPercent(item1.ContrastTop); uiDataGridView1.Rows[i].Cells["col_contrast_top"].Value = ContrastToPercent(item1.ContrastTop);
uiDataGridView1.Rows[i].Cells["col_contrast_lower"].Value = ContrastToPercent(item1.ContrastLower); uiDataGridView1.Rows[i].Cells["col_contrast_lower"].Value = ContrastToPercent(item1.ContrastLower);
uiDataGridView1.Rows[i].Cells["col_IsOR"].Value = item1.IsOR; uiDataGridView1.Rows[i].Cells["col_IsOR"].Value = item1.IsOR;
uiDataGridView1.Rows[i].Cells["col_Len"].Value = item1.DefectWarnLength; //uiDataGridView1.Rows[i].Cells["col_Len"].Value = item1.DefectWarnLength;
uiDataGridView1.Rows[i].Cells["col_Cnt"].Value = item1.DefectWarnCnt; //uiDataGridView1.Rows[i].Cells["col_Cnt"].Value = item1.DefectWarnCnt;
} }
} }
GradeLimit item2;
if (model.GradeLimitList != null) for (int i = 0; i < uiDataGridView2.Rows.Count; i++)
{ {
uiDataGridView2.Rows.Clear(); code = uiDataGridView2.Rows[i].Cells["col2_code"].Value.ToString();
for (int i = 0; i < model.GradeLimitList.Count; i++) item2 = model.GradeLimitList.FirstOrDefault(m => m.Code == code);
if (item2 != null)
{ {
code = model.GradeLimitList[i].Code; uiDataGridView2.Rows[i].Cells["col2_1"].Value = item2.A;
string name = model.GradeLimitList[i].CodeName; uiDataGridView2.Rows[i].Cells["col2_2"].Value = item2.B;
//color = item.Value<string>("color"); uiDataGridView2.Rows[i].Cells["col2_3"].Value = item2.C;
int rpwIndex = uiDataGridView2.Rows.Add(); uiDataGridView2.Rows[i].Cells["col2_4"].Value = item2.D;
List<string> a1 = new List<string>(); uiDataGridView2.Rows[i].Cells["col2_5"].Value = item2.E;
int index = 0;
a1.Add("所有缺陷");
foreach (JObject item in Config.defectItemList)
{
if(!Config.SkipLabelGrade.Contains(item.Value<string>("code")))
a1.Add(item.Value<string>("name"));
}
DataGridViewComboBoxCell boxCell = uiDataGridView2.Rows[rpwIndex].Cells[1] as DataGridViewComboBoxCell;
boxCell.DataSource = null;
boxCell.Items.Clear();
boxCell.DataSource = a1;
//boxCell.DisplayMember = "Value";
//boxCell.ValueMember = "Value";
boxCell.Value = a1.FirstOrDefault();
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
uiDataGridView2[1, uiDataGridView2.RowCount - 1].Value = name;
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].Cells["col2_1"].Value = model.GradeLimitList[i].A;
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].Cells["col2_2"].Value = model.GradeLimitList[i].B;
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].Cells["col2_3"].Value = model.GradeLimitList[i].C;
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].Cells["col2_4"].Value = model.GradeLimitList[i].D;
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].Cells["col2_5"].Value = model.GradeLimitList[i].E;
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].Cells["col2_6"].Value = model.GradeLimitList[i].JudgeLength;
} }
} }
//GradeLimit item2;
//for (int i = 0; i < uiDataGridView2.Rows.Count; i++)
//{
// string codeName = uiDataGridView2.Rows[i].Cells["col2_Item"].Value.ToString();
// item2 = model.GradeLimitList[i];
// if (item2 != null)
// {
// uiDataGridView2.Rows[i].Cells["col2_1"].Value = item2.A;
// uiDataGridView2.Rows[i].Cells["col2_2"].Value = item2.B;
// uiDataGridView2.Rows[i].Cells["col2_3"].Value = item2.C;
// uiDataGridView2.Rows[i].Cells["col2_4"].Value = item2.D;
// uiDataGridView2.Rows[i].Cells["col2_5"].Value = item2.E;
// uiDataGridView2.Rows[i].Cells["col2_6"].Value = item2.JudgeLength;
// }
//}
// //
this.btnSave.Visible = this.btnReload.Visible = true; this.btnSave.Visible = this.btnReload.Visible = true;
} }
@ -299,7 +250,6 @@ namespace LeatherApp.Page
this.btnSave.Visible = true; this.btnSave.Visible = true;
this.btnReload.Visible = false; this.btnReload.Visible = false;
this.ckIsCut.Checked = false;
// //
uiDataGridView1.Rows.Clear(); uiDataGridView1.Rows.Clear();
uiDataGridView2.Rows.Clear(); uiDataGridView2.Rows.Clear();
@ -335,38 +285,14 @@ namespace LeatherApp.Page
//uiDataGridView2.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable; //uiDataGridView2.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
uiDataGridView2.Columns[0].Visible = false; uiDataGridView2.Columns[0].Visible = false;
//加行 //加行
//if (!model.IsAllDefectGetGradeLimit) foreach (JObject item in Config.defectItemList)
//{
// foreach (JObject item in Config.defectItemList)
// {
// code = item.Value<string>("code");
// name = item.Value<string>("name");
// //color = item.Value<string>("color");
// uiDataGridView2.Rows.Add();
// uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
// uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
// }
//}
//else
//{
// code = "All";
// name = "全部缺陷";
// //color = item.Value<string>("color");
// uiDataGridView2.Rows.Add();
// uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
// uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
//}
if(model.GradeLimitList != null)
{ {
for (int i = 0; i < model.GradeLimitList.Count; i++) code = item.Value<string>("code");
{ name = item.Value<string>("name");
code = model.GradeLimitList[i].Code; //color = item.Value<string>("color");
name = model.GradeLimitList[i].CodeName; uiDataGridView2.Rows.Add();
//color = item.Value<string>("color"); uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
uiDataGridView2.Rows.Add(); uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
}
} }
} }
private void FProductInfo_Initialize(object sender, EventArgs e) private void FProductInfo_Initialize(object sender, EventArgs e)
@ -414,8 +340,6 @@ namespace LeatherApp.Page
model.DefectPauseForUser = swcDefectPauseForUser.Active; model.DefectPauseForUser = swcDefectPauseForUser.Active;
model.OpenThicknessDetection = uiSwitch1.Active; model.OpenThicknessDetection = uiSwitch1.Active;
model.IsHintCutting = ckIsCut.Checked;
int ival; int ival;
if (int.TryParse(uiNumPadTextBox1.Text, out ival)) if (int.TryParse(uiNumPadTextBox1.Text, out ival))
model.ThicknessDetectionStopDis = int.Parse(uiNumPadTextBox1.Text.Trim()); model.ThicknessDetectionStopDis = int.Parse(uiNumPadTextBox1.Text.Trim());
@ -458,15 +382,12 @@ namespace LeatherApp.Page
model.GradeLimitList.Add( model.GradeLimitList.Add(
new Models.GradeLimit() new Models.GradeLimit()
{ {
Code = uiDataGridView2.Rows[i].Cells["col2_Item"].Value.ToString() == "所有缺陷"? "All": Config.getDefectCode(uiDataGridView2.Rows[i].Cells["col2_Item"].Value.ToString()), Code = uiDataGridView2.Rows[i].Cells["col2_code"].Value.ToString(),
CodeName = uiDataGridView2.Rows[i].Cells["col2_Item"].Value.ToString(),
A = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_1"].Value)? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_1"].Value) : 0, A = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_1"].Value)? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_1"].Value) : 0,
B = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_2"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_2"].Value) : 0, B = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_2"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_2"].Value) : 0,
C = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_3"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_3"].Value) : 0, C = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_3"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_3"].Value) : 0,
D = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_4"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_4"].Value) : 0, D = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_4"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_4"].Value) : 0,
E = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_5"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_5"].Value) : 0, E = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_5"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_5"].Value) : 0,
JudgeLength = Utils.Util.IsDecimal(uiDataGridView2.Rows[i].Cells["col2_6"].Value) ? Convert.ToDouble(uiDataGridView2.Rows[i].Cells["col2_6"].Value) : 0,
ModifyUserCode = Config.loginUser.Code, ModifyUserCode = Config.loginUser.Code,
CreateUserCode = Config.loginUser.Code CreateUserCode = Config.loginUser.Code
}); });
@ -565,114 +486,5 @@ namespace LeatherApp.Page
{ {
btnDefectOption.Enabled = swcDefectPauseForUser.Active; btnDefectOption.Enabled = swcDefectPauseForUser.Active;
} }
private void ckGradeLimeIsAllDefectCnt_CheckedChanged(object sender, EventArgs e)
{
#if false
if(ckIsCut.Checked)
{
uiDataGridView2.Rows.Clear();
string code = "All";
string name = "全部缺陷";
//color = item.Value<string>("color");
uiDataGridView2.Rows.Add();
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
}
else
{
uiDataGridView2.Rows.Clear();
foreach (JObject item in Config.defectItemList)
{
string code = item.Value<string>("code");
string name = item.Value<string>("name");
//color = item.Value<string>("color");
uiDataGridView2.Rows.Add();
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
}
}
GradeLimit item2;
if (model != null && model.GradeLimitList!=null)
{
for (int i = 0; i < uiDataGridView2.Rows.Count; i++)
{
string code = uiDataGridView2.Rows[i].Cells["col2_code"].Value.ToString();
item2 = model.GradeLimitList.FirstOrDefault(m => m.Code == code);
if (item2 != null)
{
uiDataGridView2.Rows[i].Cells["col2_1"].Value = item2.A;
uiDataGridView2.Rows[i].Cells["col2_2"].Value = item2.B;
uiDataGridView2.Rows[i].Cells["col2_3"].Value = item2.C;
uiDataGridView2.Rows[i].Cells["col2_4"].Value = item2.D;
uiDataGridView2.Rows[i].Cells["col2_5"].Value = item2.E;
}
}
}
#endif
}
private void FProductInfo_Shown(object sender, EventArgs e)
{
ckIsCut.Top = 2;
btnAddGrade.Top = 3;
btnDelGrade.Top = 3;
}
/// <summary>
/// 新增判定条件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnAddGrade_Click(object sender, EventArgs e)
{
int rpwIndex = uiDataGridView2.AddRow();
List<string> a1 = new List<string>();
int index = 0;
a1.Add("所有缺陷");
foreach (JObject item in Config.defectItemList)
{
if (!Config.SkipLabelGrade.Contains(item.Value<string>("code")))
a1.Add(item.Value<string>("name"));
}
DataGridViewComboBoxCell boxCell = uiDataGridView2.Rows[rpwIndex].Cells[1] as DataGridViewComboBoxCell;
boxCell.DataSource = null;
boxCell.Items.Clear();
boxCell.DataSource = a1;
//boxCell.DisplayMember = "Value";
//boxCell.ValueMember = "Value";
boxCell.Value = a1.FirstOrDefault();
}
/// <summary>
/// 删除判断条件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="Exception"></exception>
private void btnDelGrade_Click(object sender, EventArgs e)
{
try
{
if (this.uiDataGridView2.SelectedRows.Count != 1)
throw new Exception("请选择要删除的判断条件!");
int liRowIndex = this.uiDataGridView2.SelectedRows[0].Index;
uiDataGridView2.Rows.RemoveAt(liRowIndex);
}
catch (Exception ex)
{
UIMessageTip.ShowError(ex.Message, 2000);
}
}
private void FProductInfo_Paint(object sender, PaintEventArgs e)
{
ckIsCut.Top = 2;
btnAddGrade.Top = 3;
btnDelGrade.Top = 3;
}
} }
} }

View File

@ -144,9 +144,6 @@
<metadata name="col2_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="col2_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="col2_Item.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="col2_1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="col2_1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
@ -162,69 +159,4 @@
<metadata name="col2_5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="col2_5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="col2_6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnAddGrade.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAL2SURBVFhHvZfLTxNBHMd7MBSiAWw1Hkg8ocZ4qSZejBdjTAwxRgwXTYyRqFgL8rS8Ke+HvORV
ihXFt140SjiJJhrDG1pqKUX/mJ/zm91ZhmUGJqbdSb4Hkp1+PvPb3/52samuPbk2UA25PJtkH92YqIU/
7At7d40u4CFBicQtJjDxNwjjfwIwtjEM/vgADMZ6oH+tC7qjbbxAP4mLbkzUYgLBDT8E4kMwsv6Ywnuj
HfDodyt0RJqsERiND8Lweh8MxLoNePtqIzSH66wRGIr10pL3RNuhK9ICrasN0BSuhYaVSmsE+tY66ak7
I80U7gtVQ/2KF6qXy6wR2FJyAq9droCqpVKoWCyyRqBt1WeUHOHepWIoX/BAybzbGgG+5AgvW7gPD+YK
wDN7+/8EcINqEMCXvHTBDUVzd8E9mw8FMzcNAdUQfPbmyRSDp65YLKQlL5y7A+6ZW3B5+gKcnjwhvF4W
XcBjCLDBgl2OU411eWOoRlryS9PnwfX5CBx6vxcOvkvbOW/T4MCbNHC+SOUF+g0B82BpCdfT+1238tAo
OcKx5LnfLsLJL8fEIHMImMJfa3DHuF0swAYL63JfqMroclbyGz/z4MyUC7I+ZIhhonDw/U/tkDkqETCX
vGa53Ch58fw9yPl6Do5+zBJDZKHwVHBOMHgKpA+liAVkJc//dR3OTp1Su898eHjQDhl+DZ4+KBFgJa9c
KjFKfu3HFdpkQsBOQfgrDj6yCc8YlgiYS371ew4c/3RYDJAFwaTTEe54TuBPdPiAFoRnBiQ9oBohWI/o
elm2CKgGN4rAGDw5+2HVUAGy8NsNv+HwD2lwg0yAlZ072SRJkN8vCXLp1ytK4MtDGqEAu+cvtXvOCSA8
j98vifqH6zYBU8NljpmaSwMkbm0RIHD2qDmeafBtj1cyBYyTc3B8zKwRYCfXy87g2yZcsgToiwUnHA4Z
hBMwnXBk4Fgi4CQdjy8WOts5OApZIrBbkiqgGnJ54gXIUpqYehT/O7bZ/gFBYsFOotAh6wAAAABJRU5E
rkJggg==
</value>
</data>
<data name="btnDelGrade.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAhdSURBVFhHtZd5WNVlFsevcrlw4XLvBS6gXuGiKOXomAtuiBgolKW5IYqoCLlh7pa5lWVqzqNO
OWNazqO5pVJZimu5g47oTJbkPowLsuOIoNIT+fSd73nhIsii/tF5ns/jz9/9ved7znnPu6D5Iy3W19fE
fxpU8GwWb7OB/MLHAOKqXj6DjbbZTo9t0QJNnJ3b8b9G8vRBULjo7u59yPx8E5hFIV91IS7qx6cwiu85
MH0mSg8dhQTRyNn5Nb62V6Nuo3BDyVzEi1Z9iuJNW5G5bgNG+PqW8OfO5IlBUPzwfoqXJO1A3hvTUfr9
YYwLDESgwTCSP7uT2oOgsDbB3x+/nDqNO6vWoHDhhyh8fwnufr4Z+V8kgY5/42fdiEENqMX4zYWjs2aj
ZPtXyJs4DbkTpiB33CQ8OHAQE1u3RkuDIY6feZKaQUjmIn77g6Xl4u8tRuGCRSh89wMUffIZ7u37DnF+
fhJEMKnRExQ/+9PCxSjZsh25iVORO34ycse+gdwxE5GTMAEP9h7AGE6Hl5PTIH7+qBIU1pHS+weP4H/L
PlZZ24UL31mIgnnvoWDuAtxdux7XV6/FcF/f2xxWrScovnvv5Gkqc3vWSpzCOaPHIXvk68iOjceD5L1I
CAiAv6vrMA4zkwaahObNP90yIRGlh489ylqE57+vhAvmvIuCt+ejYNY83P1sHTJWrkJM06bSmEHEJc5m
27lr4mTc45xXzTo7fjyyR41RwlnDRuHWkFjcYYLHJk/FwMaNszm2BzFogj09A+JbtMi68NHfULL1y2pZ
F8x+RwnnvzUX+TNnI38G55ffpMyZh8FWa0aU1bprY1w87n+bXJ61lJvClVnHxOHW0JHIHBSDnMQpuLls
BUYFBj7kqthP8RHEm2j03k5OoSMCArLPr/gYxVu2Vcs6/805Sjh/+tvIm/oW8qa8iZLN23CczbYhbnS5
uGT9emK5cEXWSnhwDG72j0b2mETcWPIXRDdrVubh6HiMmh+SMCL7g2oGNzZH+KiAgIIMroDijV9Uyzp/
2iwlnDd5plpa0mTFG7bg/je7KptMxHMk6+GjcSt6BDIHDsPNfoORJRVhYlH+/g/dy8WXkkjiRRoSZRKE
gWt1YHzLlkU/L12G4vWbHmVdIVx1aVVmXaXkWVLyqOHI7D8E1/sMQFbcWGQsWIghzZr97q3TpVFjGXmJ
yFKsFLebBGFs7Ozcd7i/f046S1a8eSvyJs2ozPrxpaWEY0YjM7Ifrnfqgf8EtsWlxs2QbvLB1c49cHZw
NCIsljIPnS6VvpeTvkTmvYa43SQIs7tO1yvGZss+MXe+KvXjWd/qF4XrnUOR4d8KVwzeuKhxwXmNHufI
WY0zLrfpiP2hYQj38CgzarVH6VPK3of4EAdSr6mecNNqQ9jl11Jnz0Xxuo0q0xshvZFhex6XHU24RFE7
F0g6xX/UOOHynztiX0hPdDebSw1a7SH6Wkx6EwupM/PHTYKQ3S5IdsgSnglXLb7VRO1I9hLAOWb+bwaQ
N2Umwt3dYXBwkMwXkXBS65w/yRqM8vPb8ffgEBSyGWsTF0T8Z2b/EwP4FwO42LEb1rRqjfZubkX0kUCa
ii9x+EzG7TV5edt29YoL9vmXAM5odEjVOCK9TXt81PI5dHBzk237qU7RasbtdffqDp1QyPUvGVZFBAV7
AOeJVECa77QKQIfDDOKH51pjbas2CDIaJQi1bSvnTzKW/YdV7Toin0uu3LngrEQk03KqB2VvwDMkleIH
NVrsI2l+zTkdbRBsNP5K13KA1X+z4u3nQnJouFrj0lRS1h+JZCfIs7yX5XYzoi9yYhMq5l/PBiyvwHEG
8D3F92gcsIuctPohLSwSwSaT/Siv/T4xzGo9urZ9kNpCpZslm9MkjZyi4zQiAtJo13pGYGfPcKzh93LS
SWDy/p9VAkim+DfkK01DHDJ5Yk9QVwSbzfcpJZea6pUYarXuX966LU+tYUroBEmho2PkKJ0dIfIs764E
BSOpa3dEenndC7NYbq98oT1uDRiqgpUA5LvvVABaijtgOwNIIsd9rNjctgNCPTzuUPLRfWJokybLxnOt
54yfhJMVDg5xsDg5QAf7yT4i/z/jbUVKr0j0tlh+5SYjR+pfI7y8cv7BSmT0jKwcLxXYzTE7SJKiIb4m
517ohEUtAhHu6XmdYzsSveZFi6V7X29v/Jcn2ElXkxosguJAypjMgfKcarbgSEgoeri7lxkdHWWTWUgi
XR0cIhhQ1no27pWg7qpKh+lDAt/JsTIFX/L5W3IjKgZh3KRser2cDbFE3Qdc/FxcRorjS31ewyEnVwo2
ZAMJ5UEcM3riYJdgdDYay7hFi/gS0ovI3c5g0mpDmVXWOu4blzp0ZRW0KhEJQoIXP9cGDEE3oxE8Fc9y
zEryasV4tUVaGjs5TenCD25Ex6og9nKQkMoGOhP+EkLM5t/Njo4n+K0cLBHEvr3KLmfw0ukiIy2WO193
6oLL7BNpRqmETN1N+uRShI+TUzq/XUWiiOyQWqJMBeGr18/tZjIh/ZV+SNG74ZSHD1Je7I0Qd/eHlvLz
fAWRU+3xg0UdYBw/mEEUbOwQhKtdeqg9ISt+HHqazfIX0kV+s5pEk2ridhOHPk2dnWfwGP3t8tARSHu1
P3p7epbxJnOcv8llQs5zOVKrittNgjCxSi/38fbO2dK5K/J5ML3s5QXeMSRzEZfbsI3UELebnNU+bJLE
AY0aYSBh5il8J2WXm4w0TX3nuQRhZBDh/Rs1KhrE8U31eplzKbtkLuKOpF5T09HOZJrT0tV1G5/lPK+t
7HWZ6onnDYaYP7m5JfFZLqA15vxJJkKSrexasn3WVfa6TIKQPzzak+6kDnGN5v99JuudP3lCrAAAAABJ
RU5ErkJggg==
</value>
</data>
</root> </root>

View File

@ -17,7 +17,6 @@ using System.Linq.Expressions;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using static System.Windows.Forms.AxHost;
namespace LeatherApp.Page namespace LeatherApp.Page
{ {
@ -128,8 +127,10 @@ namespace LeatherApp.Page
private void btnExport_Click(object sender, EventArgs e) private void btnExport_Click(object sender, EventArgs e)
{ {
int err = 0;
try try
{ {
if (this.uiDataGridView1.CurrentRow == null) if (this.uiDataGridView1.CurrentRow == null)
return; return;
@ -141,6 +142,7 @@ namespace LeatherApp.Page
if (string.IsNullOrWhiteSpace(path)) if (string.IsNullOrWhiteSpace(path))
return; return;
err = 1;
//var list = uiDataGridView1.DataSource as List<Records>; //var list = uiDataGridView1.DataSource as List<Records>;
//var table = ExcelUtil.ConvertToDataTable<Records>(list); //var table = ExcelUtil.ConvertToDataTable<Records>(list);
@ -149,7 +151,8 @@ namespace LeatherApp.Page
//绘图1 //绘图1
double len = Math.Round(record.Len*100, 2);//cm 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 + 20 }, record.GradeDifferentiateInfoList); this.reDrawDefectPoints(record.DefectInfoList, new double[] { 0, Math.Round(record.FaceWidthMax + 0.005f, 2) }, new double[] { 0, len });
err = 2;
//绘图2 //绘图2
//var points = Array.ConvertAll(record.FaceWidthListStr.Split(new[] { ',', }, StringSplitOptions.RemoveEmptyEntries),Double.Parse).ToList(); //var points = Array.ConvertAll(record.FaceWidthListStr.Split(new[] { ',', }, StringSplitOptions.RemoveEmptyEntries),Double.Parse).ToList();
//reDrawFaceWidth(record.FacePointList, //reDrawFaceWidth(record.FacePointList,
@ -158,13 +161,13 @@ namespace LeatherApp.Page
reDrawFaceWidth(record.FacePointList, reDrawFaceWidth(record.FacePointList,
new double[] { 0, Math.Round(len + 0.005f, 2) }, new double[] { 0, Math.Round(len + 0.005f, 2) },
new double[] { 130, 160 }); new double[] { 130, 160 });
err = 3;
// //
foreach (var item in list) { foreach (var item in list) {
item.Name = Config.getDefectName(item.Code); item.Name = Config.getDefectName(item.Code);
//item.Height = item.Height / 100; //单位错误,保证单位一致 //item.Height = item.Height / 100; //单位错误,保证单位一致
} }
err = 4;
// //
string Grade = ""; string Grade = "";
if (record.Grade < 1) Grade = ""; if (record.Grade < 1) Grade = "";
@ -180,18 +183,21 @@ namespace LeatherApp.Page
Grade= Grade, Grade= Grade,
DateTime = record.CreateTime.ToString("yyyy年MM月dd日 HH:mm") 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.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 { 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 }) 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(); .OrderBy(x=>x.Index).ThenBy(x=>x.Y).ToList();
err = 6;
data.Pdt = productService.GetModelNav(record.ProductId); data.Pdt = productService.GetModelNav(record.ProductId);
data.xyPix = $"X:{Config.cm2px_x},Y:{Config.cm2px_y}"; data.xyPix = $"X:{Config.cm2px_x},Y:{Config.cm2px_y}";
err = 7;
var image1 = captureControl(this.lineChartDefect); var image1 = captureControl(this.lineChartDefect);
var image2 = captureControl(this.lineChartFaceWidth); var image2 = captureControl(this.lineChartFaceWidth);
var filePath = $"{path}缺陷列表_{record.BatchId}_{record.ReelId}.xlsx"; var filePath = $"{path}缺陷列表_{record.BatchId}_{record.ReelId}.xlsx";
exportTabel(data, image1, image2, filePath); err = 8;
exportTabel(data, image1, image2, filePath);
//if (!res) //if (!res)
// throw new Exception("导出失败!"); // throw new Exception("导出失败!");
UIMessageTip.ShowOk("导出成功!", 1000); UIMessageTip.ShowOk("导出成功!", 1000);
@ -200,7 +206,7 @@ namespace LeatherApp.Page
} }
catch (Exception ex) catch (Exception ex)
{ {
UIMessageTip.ShowError(ex.Message, 2000); UIMessageTip.ShowError($"err:{err} + {ex.Message}", 2000);
API.OutputDebugString(ex.StackTrace); API.OutputDebugString(ex.StackTrace);
} }
} }
@ -748,7 +754,7 @@ namespace LeatherApp.Page
/// <param name="lstDefectInfo">Records.DefectInfoList</param> /// <param name="lstDefectInfo">Records.DefectInfoList</param>
/// <param name="XSizeRange">幅宽</param> /// <param name="XSizeRange">幅宽</param>
/// <param name="YSizeRange">卷长度</param> /// <param name="YSizeRange">卷长度</param>
private void reDrawDefectPoints(List<DefectInfo> lstDefectInfo, double[] XSizeRange, double[] YSizeRange, List<GradeDifferentiateInfo> listGrade) private void reDrawDefectPoints(List<DefectInfo> lstDefectInfo, double[] XSizeRange, double[] YSizeRange)
{ {
UILineOption option; UILineOption option;
//AddTextEvent($"绘图", $"缺陷分布, W={string.Join(", ", XSizeRange)},H={string.Join(", ", YSizeRange)}, LastData={JsonConvert.SerializeObject(lstDefectInfo[lstDefectInfo.Count - 1])}"); //AddTextEvent($"绘图", $"缺陷分布, W={string.Join(", ", XSizeRange)},H={string.Join(", ", YSizeRange)}, LastData={JsonConvert.SerializeObject(lstDefectInfo[lstDefectInfo.Count - 1])}");
@ -820,18 +826,10 @@ namespace LeatherApp.Page
//series.Smooth = false; //series.Smooth = false;
} }
series.Add(item.CentreX, item.CentreY / 100); //cm -> m if(series != null)
series.Add(item.CentreX, item.CentreY / 100); //cm -> m
} }
if (listGrade != null)
{
foreach (var item in listGrade)
{
// 设置裁切提示线
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.DarkRed, Name = $"{item.GradeCode}-裁切起点-{item.StartY}", Value = item.StartY });
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.DarkRed, Name = $"{item.GradeCode}-裁切终点-{item.EndY}", Value = item.EndY });
}
}
//==== //====
//option.GreaterWarningArea = new UILineWarningArea(3.5); //option.GreaterWarningArea = new UILineWarningArea(3.5);
//option.LessWarningArea = new UILineWarningArea(2.2, Color.Gold); //option.LessWarningArea = new UILineWarningArea(2.2, Color.Gold);

View File

@ -1,17 +1,160 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xaml; using System.Xaml;
using DocumentFormat.OpenXml.EMMA;
using DocumentFormat.OpenXml.Vml; using DocumentFormat.OpenXml.Vml;
using OpenCvSharp; using OpenCvSharp;
using OpenCvSharp.XImgProc;
namespace LeatherApp.Utils namespace LeatherApp.Utils
{ {
public class OpenCVUtil 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) public static Mat resize(Mat mat, int width, int height, out int xw, out int xh)
{ {
OpenCvSharp.Size dsize = new OpenCvSharp.Size(width, height); OpenCvSharp.Size dsize = new OpenCvSharp.Size(width, height);
@ -19,7 +162,8 @@ namespace LeatherApp.Utils
//Cv2.Resize(mat, mat2, dsize); //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; xw = (width - mat.Cols) / 2;
xh = (height - mat.Rows) / 2;
Mat mat2 = new Mat(height, width, MatType.CV_8UC3, new Scalar(114, 114, 114)); 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); Rect roi = new Rect((width - mat.Cols) / 2, (height - mat.Rows) / 2, mat.Cols, mat.Rows);
mat.CopyTo(new Mat(mat2, roi)); mat.CopyTo(new Mat(mat2, roi));
@ -375,7 +519,7 @@ namespace LeatherApp.Utils
else else
Roi = new Rect(0, 0, bian, mat_rgb.Height); Roi = new Rect(0, 0, bian, mat_rgb.Height);
int type = isLeft ? 1 : 0; int type = isLeft ? 1 : 0;
int len = EdgeClipping2(mat_rgb, type, Roi, isLeft); int len = EdgeClipping3(mat_rgb, type, Roi, isLeft);
#if false #if false
//Mat mat_rgb = new Mat("E:\\CPL\\测试代码\\边缘检测\\test\\test\\test\\img\\19.bmp"); //Mat mat_rgb = new Mat("E:\\CPL\\测试代码\\边缘检测\\test\\test\\test\\img\\19.bmp");
Mat image_gray = new Mat(); Mat image_gray = new Mat();
@ -452,9 +596,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}"); 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) 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 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> /// <summary>

View 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"
}
]

View File

@ -1,86 +1,80 @@
[ [
{ {
"id": 0, "id": 0,
"code": "jiangbban", "code": "jb",
"name": "浆斑", "name": "浆斑",
"color": "Red" "color": "Red"
}, },
{ {
"id": 1, "id": 1,
"code": "wuyin", "code": "wy",
"name": "污印", "name": "污印",
"color": "Lime" "color": "Lime"
}, },
{ {
"id": 2, "id": 2,
"code": "mianjie", "code": "mj",
"name": "棉结", "name": "棉结",
"color": "DarkViolet" "color": "DarkViolet"
}, },
{ {
"id": 3, "id": 3,
"code": "huangyin", "code": "hy",
"name": "黄印", "name": "黄印",
"color": "Magenta" "color": "Magenta"
}, },
{ {
"id": 4, "id": 4,
"code": "laji", "code": "lj",
"name": "垃圾", "name": "垃圾",
"color": "Orange" "color": "Orange"
}, },
{ {
"id": 5, "id": 5,
"code": "yisesi", "code": "yss",
"name": "异色丝", "name": "异色丝",
"color": "Brown" "color": "Brown"
}, },
{ {
"id": 6, "id": 6,
"code": "zhouyin", "code": "zy",
"name": "皱印", "name": "皱印",
"color": "Olive" "color": "Olive"
}, },
{ {
"id": 7, "id": 7,
"code": "wenchong", "code": "wc",
"name": "蚊虫", "name": "蚊虫",
"color": "PaleGreen" "color": "PaleGreen"
}, },
{ {
"id": 8, "id": 8,
"code": "cashang", "code": "cs",
"name": "擦伤", "name": "擦伤",
"color": "CadetBlue" "color": "CadetBlue"
}, },
{ {
"id": 9, "id": 9,
"code": "chongying", "code": "cy",
"name": "重影", "name": "重影",
"color": "Aqua" "color": "Aqua"
}, },
{ {
"id": 10, "id": 10,
"code": "tingcheyin", "code": "tcy",
"name": "停车印", "name": "停车印",
"color": "YellowGreen" "color": "YellowGreen"
}, },
{ {
"id": 11, "id": 11,
"code": "jietou", "code": "jt",
"name": "接头", "name": "接头",
"color": "Blue" "color": "Blue"
}, },
{ {
"id": 12, "id": 12,
"code": "hengdang", "code": "na",
"name": "横档", "name": "荆条",
"color": "Blue" "color": "pink"
},
{
"id": 13,
"code": "jiangyin",
"name": "浆印",
"color": "Blue"
} }
] ]

View 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"
},
]

View 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"
}
]

View File

@ -44,23 +44,93 @@ Global捕获到未处理异常System.ArgumentException
在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
2024-06-19 16:06:47 2024-07-25 10:08:02
Global捕获到未处理异常System.Threading.ThreadAbortException Global捕获到未处理异常System.NullReferenceException
异常信息:正在中止线程。 异常信息:未将对象引用设置到对象的实例。
异常堆栈: 在 System.Windows.Forms.SafeNativeMethods.MessageBox(HandleRef hWnd, String text, String caption, Int32 type) 异常堆栈: 在 LeatherApp.UIExtend.UIDefectImage.uiComboBox1_SelectedIndexChanged(Object sender, EventArgs e) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 60
在 System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp) 在 Sunny.UI.UIComboBox.Box_SelectedIndexChanged(Object sender, EventArgs e)
在 System.Windows.Forms.DataGridView.OnDataError(Boolean displayErrorDialogIfNoHandler, DataGridViewDataErrorEventArgs e) 在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Windows.Forms.DataGridViewComboBoxCell.GetFormattedValue(Object value, Int32 rowIndex, DataGridViewCellStyle& cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context) 在 System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
在 System.Windows.Forms.DataGridViewCell.GetEditedFormattedValue(Object value, Int32 rowIndex, DataGridViewCellStyle& dataGridViewCellStyle, DataGridViewDataErrorContexts context) 在 Sunny.UI.ListBoxEx.OnSelectedIndexChanged(EventArgs e)
在 System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) 在 System.Windows.Forms.ListBox.ClearSelected()
在 System.Windows.Forms.DataGridViewRow.PaintCells(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow, DataGridViewPaintParts paintParts) 在 System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
在 System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow) 在 System.Windows.Forms.ListControl.set_SelectedValue(Object value)
在 System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded) 在 Sunny.UI.UIComboBox.set_SelectedValue(Object value)
在 System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded) 在 LeatherApp.UIExtend.UIDefectImage.set_Code(String value) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\UIExtend\UIDefectImage.cs:行号 45
在 System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e) 在 LeatherApp.Page.FHome_Defect.<init>b__4_0(DefectInfo item) 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 36
在 Sunny.UI.UIDataGridView.OnPaint(PaintEventArgs e) 在 System.Collections.Generic.List`1.ForEach(Action`1 action)
在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) 在 LeatherApp.Page.FHome_Defect.init() 位置 E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\Page\FHome_Defect.cs:行号 35
在 System.Windows.Forms.Control.WmPaint(Message& m) 在 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.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) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

View File

@ -1,26 +1,26 @@
[ [
{ {
"code": 0, "code": 0,
"name": "绒面" "name": "超纤皮"
}, },
{ {
"code": 1, "code": 1,
"name": "非绒面" "name": "纤皮"
}, },
{ {
"code": 2, "code": 2,
"name": "未知1" "name": "未知"
}, },
{ {
"code": 3, "code": 3,
"name": "未知2" "name": "未知"
}, },
{ {
"code": 4, "code": 4,
"name": "未知3" "name": "未知"
}, },
{ {
"code": 5, "code": 5,
"name": "未知4" "name": "未知"
} }
] ]

View File

@ -25,11 +25,6 @@ ScannerReversalX=false
ScannerReversalY=true ScannerReversalY=true
[Material] [Material]
SuedeList=BSF,SF,SL,SD SuedeList=BSF,SF,SL,SD
SuedeList2=
SuedeList3=
SuedeList4=
SuedeList5=
SuedeList6=
[LIB] [LIB]
model_path=./models/best_0805_bs8.onnx model_path=./models/best_0805_bs8.onnx
labels_path=./models/hexin.names labels_path=./models/hexin.names
@ -39,6 +34,13 @@ ImagePath=F:\LeatherApp\images\
SaveAllImage=False SaveAllImage=False
SaveDefectSourceImage=False SaveDefectSourceImage=False
SaveDefectCutImage=False SaveDefectCutImage=False
cm2px_x=90
cm2px_y=90
MarginHoleWidth=0
MiddleSuperposition=0
IsSaveAllImage=False
IsSaveDefectSourceImage=False
IsSaveDefectCutImage=False
[DB] [DB]
DBConStr=server=localhost;Database=LeatherDB;Uid=root;Pwd=123456; AllowLoadLocalInfile=true DBConStr=server=localhost;Database=LeatherDB;Uid=root;Pwd=123456; AllowLoadLocalInfile=true
[ErpDB] [ErpDB]
@ -48,5 +50,3 @@ ErpDBConStr=connectionString="Server=127.0.0.1;Database=testDB;User Id=sa;Passwo
ErpSql=select * from t2 where 1=1 ErpSql=select * from t2 where 1=1
[LOG] [LOG]
LogPath=F:\LeatherApp\log\ LogPath=F:\LeatherApp\log\
[SkipLabelGrade]
LabelGradeList=laji,wenchong,chongying

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 MiB

File diff suppressed because one or more lines are too long

View File

@ -106,12 +106,6 @@ namespace Models
/// </summary> /// </summary>
[SugarColumn(IsNullable = true)] [SugarColumn(IsNullable = true)]
public double residueWarnningLen { get; set; } public double residueWarnningLen { get; set; }
/// <summary>
/// 等级判断提示裁切
/// </summary>
[SugarColumn(IsNullable = true)]
public bool IsHintCutting { get; set; }
} }
/// <summary> /// <summary>
@ -148,8 +142,9 @@ namespace Models
/// <summary> /// <summary>
/// 等级划分标准 /// 等级划分标准
/// </summary> /// </summary>
[SugarIndex("index_{table}_Pid", [SugarIndex("index_{table}_Pid_Code",
nameof(GradeLimit.Pid), OrderByType.Asc, isUnique: true)] nameof(GradeLimit.Pid), OrderByType.Asc,
nameof(GradeLimit.Code), OrderByType.Asc, isUnique: true)]
public class GradeLimit : BaseTable public class GradeLimit : BaseTable
{ {
public int Pid { get; set; } public int Pid { get; set; }
@ -158,12 +153,6 @@ namespace Models
/// </summary> /// </summary>
public string Code { get; set; } public string Code { get; set; }
public string CodeName { get; set; }
/// <summary>
/// 等级判定长度 0no do
/// </summary>
public double JudgeLength { get; set; }
//此等级上限缺陷数 //此等级上限缺陷数
public int A { get; set; } public int A { get; set; }
public int B { get; set; } public int B { get; set; }

View File

@ -144,19 +144,6 @@ namespace Models
/// </summary> /// </summary>
[SugarColumn(IsIgnore = true)] [SugarColumn(IsIgnore = true)]
public int[] preWarningPhotoIndexByLabel { get; set; } = new int[50]; public int[] preWarningPhotoIndexByLabel { get; set; } = new int[50];
/// <summary>
/// 等级判定位置记录
/// </summary>
[SugarColumn(IsIgnore = true)]
public int preGradePhotoIndexByGradeIndex { get; set; } = 0;
/// <summary>
/// 整卷分级
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(GradeDifferentiateInfo.Pid))]
public List<GradeDifferentiateInfo> GradeDifferentiateInfoList { get; set; }
} }
/// <summary> /// <summary>
@ -223,52 +210,4 @@ namespace Models
[SugarColumn(IsIgnore = true)] [SugarColumn(IsIgnore = true)]
public string TagFilePath { get; set; }//打标小图路径,用于二次瑕疵检测修改和忽略时的改名/删除 public string TagFilePath { get; set; }//打标小图路径,用于二次瑕疵检测修改和忽略时的改名/删除
} }
/// <summary>
/// 产品分级明细表
/// </summary>
[SugarIndex("index_{table}_pid", nameof(GradeDifferentiateInfo.Pid), OrderByType.Asc,
nameof(GradeDifferentiateInfo.GradeCode), OrderByType.Asc,
isUnique: false)]
public class GradeDifferentiateInfo : BaseTable
{
public int Pid { get; set; }
/// <summary>
/// 开始拍照id
/// </summary>
public int StartPhotoIndex { get; set; }//原图索引/文件名 0-n
/// <summary>
/// 结束拍照id
/// </summary>
public int EndPhotoIndex { get; set; }//原图索引/文件名 0-n
/// <summary>
/// 等级Code
/// </summary>
public string GradeCode { get; set; }
/// <summary>
/// 使用的区分规则
/// </summary>
public GradeLimit UseGradeLimit { get; set; }
/// <summary>
/// 缺陷数量
/// </summary>
public int DefectCnt { get; set; }
/// <summary>
/// 长度
/// </summary>
public double CutLen { get; set; }
/// <summary>
/// 开始截取位置
/// </summary>
public double StartY { get; set; }
/// <summary>
/// 结束截取位置
/// </summary>
public double EndY { get; set; }
}
} }

View File

@ -42,7 +42,6 @@ namespace Service
if (dropTable && db.DbMaintenance.IsAnyTable("GradeLimit", false)) db.DbMaintenance.DropTable("GradeLimit"); if (dropTable && db.DbMaintenance.IsAnyTable("GradeLimit", false)) db.DbMaintenance.DropTable("GradeLimit");
if (dropTable && db.DbMaintenance.IsAnyTable("Records", false)) db.DbMaintenance.DropTable("Records"); if (dropTable && db.DbMaintenance.IsAnyTable("Records", false)) db.DbMaintenance.DropTable("Records");
if (dropTable && db.DbMaintenance.IsAnyTable("DefectInfo", false)) db.DbMaintenance.DropTable("DefectInfo"); if (dropTable && db.DbMaintenance.IsAnyTable("DefectInfo", false)) db.DbMaintenance.DropTable("DefectInfo");
if (dropTable && db.DbMaintenance.IsAnyTable("GradeDifferentiateInfo", false)) db.DbMaintenance.DropTable("GradeDifferentiateInfo");
//===添加与更新表 //===添加与更新表
db.CodeFirst.InitTables<Models.Right>(); db.CodeFirst.InitTables<Models.Right>();
@ -55,7 +54,6 @@ namespace Service
db.CodeFirst.InitTables<Models.GradeLimit>(); db.CodeFirst.InitTables<Models.GradeLimit>();
db.CodeFirst.InitTables<Models.Records>(); db.CodeFirst.InitTables<Models.Records>();
db.CodeFirst.InitTables<Models.DefectInfo>(); db.CodeFirst.InitTables<Models.DefectInfo>();
db.CodeFirst.InitTables<Models.GradeDifferentiateInfo>();
//更改表数据 //更改表数据
try try

View File

@ -53,7 +53,6 @@ namespace Service
//.Includes(m => m.ProductInfo.ToList(x => new Product() { Code = x.Code, Name = x.Name }))//,n=>n.ClassesInfo) //.Includes(m => m.ProductInfo.ToList(x => new Product() { Code = x.Code, Name = x.Name }))//,n=>n.ClassesInfo)
//.Includes(m => m.ProductInfo) //.Includes(m => m.ProductInfo)
.Includes(m => m.DefectInfoList) .Includes(m => m.DefectInfoList)
.Includes(m => m.GradeDifferentiateInfoList)
.First(m => m.Id == id); .First(m => m.Id == id);
} }
public List<Records> GetListNav(int pageNum, int pageSize, ref int totalCount, Expression<Func<Records, bool>> exp) public List<Records> GetListNav(int pageNum, int pageSize, ref int totalCount, Expression<Func<Records, bool>> exp)
@ -68,14 +67,12 @@ namespace Service
{ {
return base.AsSugarClient().InsertNav(model) return base.AsSugarClient().InsertNav(model)
.Include(m => m.DefectInfoList) .Include(m => m.DefectInfoList)
.Include(m => m.GradeDifferentiateInfoList)
.ExecuteCommand(); .ExecuteCommand();
} }
public bool DelNav(Models.Records model) public bool DelNav(Models.Records model)
{ {
return base.AsSugarClient().DeleteNav(model) return base.AsSugarClient().DeleteNav(model)
.Include(a => a.DefectInfoList)//.ThenInclude(z1 => z1.RoomList) //插入2层 Root->ShoolA->RoomList .Include(a => a.DefectInfoList)//.ThenInclude(z1 => z1.RoomList) //插入2层 Root->ShoolA->RoomList
.Include(m => m.GradeDifferentiateInfoList)
.ExecuteCommand(); .ExecuteCommand();
} }