版本-v1.2.1 修复新建产品bug,新增张力补偿,新增缺陷分布启用

This commit is contained in:
CPL 2023-11-27 16:44:10 +08:00
parent 8e78cdd0ba
commit e6bd2d06ce
16 changed files with 5409 additions and 5322 deletions

BIN
halftoneproject-master.rar Normal file

Binary file not shown.

View File

@ -1,101 +1,103 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using ProductionControl.Utils;
namespace ProductionControl
{
public class Config
{
public static Models.User loginUser;
public static bool HeightDevIOState;
public static Dictionary<string, string> dicDevType = new Dictionary<string, string>();
//
public static string appBasePath = "";
public static string CustomerVer = "A";
//跳过检测设备
public static bool SkipAxis0, SkipAxis1, SkipAxis2, SkipAxis3;
public static bool SkipTension, SkipHeight, SkipLight, SkipScannerGL, SkipScannerCC, SkipSmallAxis;
//启用功能 2023-1023
public static bool OpenMarkErrorStop;
//DEV
public static int[] Axis_PulseOutMode=new int[4];
public static int[] Axis_MM2PulseNum = new int[4] { 5000, 5000, 5000, 1000};//1mm对应脉冲数
public static int[] Axis_HomeMode = new int[4];
public static int[] Axis_HomeDir = new int[4];//回Home方向
//回HOME速度
public static JArray Axis_HomeVelLow = new JArray();
public static JArray Axis_HomeVelHigh = new JArray();
public static JArray Axis_HomeAcc = new JArray();
public static JArray Axis_HomeDec = new JArray();
public static string IOCard_DeviceNum = "PCI-1730,BID#0";
public static LightDevNameEnum Light_Name= LightDevNameEnum.;
public static int Light_PortNum = 1;//COM端口号
public static int Tension_PortNum = 7;//COM端口号
public static string SmallAxis_ComName = "COM2";//COM端口号
public static string HeightDev_IP = "192.168.3.35";
public static int HeightDev_Port = 64000;
public static decimal HeightDev_SafeValue = 0;//厚度传感器安全值(axis移动前的前提条件)
public static string Scanner_GENTL_CTI = "ScannerRuntime\\Win64_x64\\MvFGProducerCXP.cti";//板卡相机
//public static string Scanner_GENTL_CTI = "ScannerRuntime\\Win64_x64\\MvFGProducerCML.cti";//GE相机
public static string SizeEnginePath;
public static string SizeBmp_SavePath, SizeBmp_Compare_SavePath, SizeBmp_Zoom_Image_SavePath;
public static double SizeBmp_SavePath_AutoClear = -1, SizeBmp_Compare_SavePath_AutoClear = -1, SizeBmp_Zoom_Image_SavePath_AutoClear = -1;
//缺陷配置
public static Size Defect_CutSize, Defect_ReSize;
public static float Defect_Thresholds;
public static string Defect_SavePath, Defect_Compress_SavePath, Defect_Small_SavePath;
public static double Defect_SavePath_AutoClear =-1,Defect_Compress_SavePath_AutoClear=-1,Defect_Small_SavePath_AutoClear=-1;
public static bool SaveAllDefectImg, MakeTag;
//尺寸配置
//public static string Size_LoadPath, Size_FileName;
//
public static Dictionary<CMDName, JObject> CMDProcess;
//DB
//有些服务器防火墙有问题需要加上 min pool size=1 避免认为是恶意请求
//如果用到bulkCopy需要加 AllowLoadLocalInfile=true
//public static string dbMysqlCon = "server=localhost;Database=ProductionDB;Uid=root;Pwd=123456;";
public static string DBConStr = "server=localhost;Database=ProductionDB;Uid=root;Pwd=123456; AllowLoadLocalInfile=true";
//LOG
public static string LogPath;
//WEBService
public static string LocalIp="";
public static int LocalHttpPort=18082, LocalSocketPort;
public static int timeout_http_wait = -1;//webapi超时限制,-1为无限制一直等待
//==========位置 初始位 上料位 下料位(下料位不存在时使用上料位)
public static JObject joPTSetting = new JObject()
{
{ "initPT", null },
{ "upPT", null},
{ "downPT", null}
};
//=========全局按钮
//public static JObject joGButtonSetting = new JObject() {
// { "start", null },
// { "pause", null},
// { "reset", null},
// { "warning", null},
// { "iodefault", null}
//};
public static void DelectPictureFile()
{
//删除文件
Task.Factory.StartNew(() =>
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using ProductionControl.Utils;
namespace ProductionControl
{
public class Config
{
public static Models.User loginUser;
public static bool HeightDevIOState;
public static Dictionary<string, string> dicDevType = new Dictionary<string, string>();
//
public static string appBasePath = "";
public static string CustomerVer = "A";
//跳过检测设备
public static bool SkipAxis0, SkipAxis1, SkipAxis2, SkipAxis3;
public static bool SkipTension, SkipHeight, SkipLight, SkipScannerGL, SkipScannerCC, SkipSmallAxis;
//启用功能 2023-1023
public static bool OpenMarkErrorStop;
//启用缺陷分布功能
public static bool OpenFlawDistribution;
//DEV
public static int[] Axis_PulseOutMode=new int[4];
public static int[] Axis_MM2PulseNum = new int[4] { 5000, 5000, 5000, 1000};//1mm对应脉冲数
public static int[] Axis_HomeMode = new int[4];
public static int[] Axis_HomeDir = new int[4];//回Home方向
//回HOME速度
public static JArray Axis_HomeVelLow = new JArray();
public static JArray Axis_HomeVelHigh = new JArray();
public static JArray Axis_HomeAcc = new JArray();
public static JArray Axis_HomeDec = new JArray();
public static string IOCard_DeviceNum = "PCI-1730,BID#0";
public static LightDevNameEnum Light_Name= LightDevNameEnum.;
public static int Light_PortNum = 1;//COM端口号
public static int Tension_PortNum = 7;//COM端口号
public static double Tension_Offset = 0;//张力偏移值
public static string SmallAxis_ComName = "COM2";//COM端口号
public static string HeightDev_IP = "192.168.3.35";
public static int HeightDev_Port = 64000;
public static decimal HeightDev_SafeValue = 0;//厚度传感器安全值(axis移动前的前提条件)
public static string Scanner_GENTL_CTI = "ScannerRuntime\\Win64_x64\\MvFGProducerCXP.cti";//板卡相机
//public static string Scanner_GENTL_CTI = "ScannerRuntime\\Win64_x64\\MvFGProducerCML.cti";//GE相机
public static string SizeEnginePath;
public static string SizeBmp_SavePath, SizeBmp_Compare_SavePath, SizeBmp_Zoom_Image_SavePath;
public static double SizeBmp_SavePath_AutoClear = -1, SizeBmp_Compare_SavePath_AutoClear = -1, SizeBmp_Zoom_Image_SavePath_AutoClear = -1;
//缺陷配置
public static Size Defect_CutSize, Defect_ReSize;
public static float Defect_Thresholds;
public static string Defect_SavePath, Defect_Compress_SavePath, Defect_Small_SavePath;
public static double Defect_SavePath_AutoClear =-1,Defect_Compress_SavePath_AutoClear=-1,Defect_Small_SavePath_AutoClear=-1;
public static bool SaveAllDefectImg, MakeTag;
//尺寸配置
//public static string Size_LoadPath, Size_FileName;
//
public static Dictionary<CMDName, JObject> CMDProcess;
//DB
//有些服务器防火墙有问题需要加上 min pool size=1 避免认为是恶意请求
//如果用到bulkCopy需要加 AllowLoadLocalInfile=true
//public static string dbMysqlCon = "server=localhost;Database=ProductionDB;Uid=root;Pwd=123456;";
public static string DBConStr = "server=localhost;Database=ProductionDB;Uid=root;Pwd=123456; AllowLoadLocalInfile=true";
//LOG
public static string LogPath;
//WEBService
public static string LocalIp="";
public static int LocalHttpPort=18082, LocalSocketPort;
public static int timeout_http_wait = -1;//webapi超时限制,-1为无限制一直等待
//==========位置 初始位 上料位 下料位(下料位不存在时使用上料位)
public static JObject joPTSetting = new JObject()
{
{ "initPT", null },
{ "upPT", null},
{ "downPT", null}
};
//=========全局按钮
//public static JObject joGButtonSetting = new JObject() {
// { "start", null },
// { "pause", null},
// { "reset", null},
// { "warning", null},
// { "iodefault", null}
//};
public static void DelectPictureFile()
{
//删除文件
Task.Factory.StartNew(() =>
{
// CreateSysFolder();
@ -103,284 +105,291 @@ namespace ProductionControl
//DeleteFiles(appBasePath + "\\temp\\");
//
if (Defect_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_SavePath, Defect_SavePath_AutoClear, false);
if (Defect_Compress_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_Compress_SavePath, Defect_Compress_SavePath_AutoClear, false);
if (Defect_Small_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_Small_SavePath, Defect_Small_SavePath_AutoClear, false);
//
if (SizeBmp_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_SavePath, SizeBmp_SavePath_AutoClear, false);
if (SizeBmp_Compare_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Compare_SavePath, SizeBmp_Compare_SavePath_AutoClear, false);
if (SizeBmp_Zoom_Image_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Zoom_Image_SavePath, SizeBmp_Zoom_Image_SavePath_AutoClear, false);
});
}
public static void LoadAllConfig()
{
if (string.IsNullOrWhiteSpace(appBasePath))
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
//删除文件
Task.Factory.StartNew(() =>
{
CreateSysFolder();
//
DeleteFiles(appBasePath+"\\temp\\");
//
if (Defect_SavePath_AutoClear>=0)
DeleteFiles(Config.Defect_SavePath, Defect_SavePath_AutoClear,true);
if (Defect_Compress_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_Compress_SavePath, Defect_Compress_SavePath_AutoClear, true);
if (Defect_Small_SavePath_AutoClear>=0)
DeleteFiles(Config.Defect_Small_SavePath, Defect_Small_SavePath_AutoClear, true);
//
if (SizeBmp_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_SavePath, SizeBmp_SavePath_AutoClear, true);
if (SizeBmp_Compare_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Compare_SavePath, SizeBmp_Compare_SavePath_AutoClear, true);
if (SizeBmp_Zoom_Image_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Zoom_Image_SavePath, SizeBmp_Zoom_Image_SavePath_AutoClear, true);
});
InitDevDic();
LoadSysConfig();
LoadPTConfig();
//
string lsCmdPath = appBasePath + "\\CMDProcess\\";
if(!Directory.Exists(lsCmdPath))
Directory.CreateDirectory(lsCmdPath);
string fileName;
CMDProcess = new Dictionary<CMDName, JObject>();
foreach (int item in Enum.GetValues(typeof(CMDName)))//item为key值
{
//string name = Enum.GetName(typeof(CMDName), item);//获取名称
fileName = lsCmdPath + item + ".json";
if (File.Exists(fileName))
CMDProcess.Add((CMDName)item, JObject.Parse(File.ReadAllText(fileName)));
//else
// CMDProcess.Add((CMDName)item, null);
}
}
public static void LoadSysConfig()
{
if (string.IsNullOrWhiteSpace(appBasePath))
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string configPath = appBasePath + "\\SysConfig.ini";
string lsTmp = "";
CustomerVer = Util.ReadIniValue(configPath, "VER", "CustomerVer");
if (string.IsNullOrWhiteSpace(CustomerVer))
CustomerVer = "A";
//Skip
SkipAxis0 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis0") =="1";
SkipAxis1 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis1") == "1";
SkipAxis2 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis2") == "1";
SkipAxis3 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis3") == "1";
SkipTension = Util.ReadIniValue(configPath, "SKIP", "SkipTension") == "1";
SkipHeight = Util.ReadIniValue(configPath, "SKIP", "SkipHeight") == "1";
SkipLight = Util.ReadIniValue(configPath, "SKIP", "SkipLight") == "1";
SkipScannerGL = Util.ReadIniValue(configPath, "SKIP", "SkipScannerGL") == "1";
SkipScannerCC = Util.ReadIniValue(configPath, "SKIP", "SkipScannerCC") == "1";
SkipSmallAxis = Util.ReadIniValue(configPath, "SKIP", "SkipSmallAxis") == "1";
OpenMarkErrorStop = Util.ReadIniValue(configPath, "SKIP", "MarkErrorStop") == "1";
//DEV
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[0] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[1] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[2] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[3] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[0] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[1] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[2] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[3] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[0] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[1] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[2] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[3] = Convert.ToInt32(lsTmp);
//
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelLow");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeVelLow = JArray.Parse(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelHigh");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeVelHigh = JArray.Parse(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeAcc");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeAcc = JArray.Parse(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeDec");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeDec = JArray.Parse(lsTmp);
//
lsTmp = Util.ReadIniValue(configPath, "DEV", "Light_Name");
if (Util.IsNumber(lsTmp)) Config.Light_Name = (LightDevNameEnum)Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Light_PortNum");
if (Util.IsNumber(lsTmp)) Config.Light_PortNum = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Tension_PortNum");
if (Util.IsNumber(lsTmp)) Config.Tension_PortNum = Convert.ToInt32(lsTmp);
Config.SmallAxis_ComName = Util.ReadIniValue(configPath, "DEV", "SmallAxis_ComName");
HeightDev_IP = Util.ReadIniValue(configPath, "DEV", "HeightDev_IP");
lsTmp = Util.ReadIniValue(configPath, "DEV", "HeightDev_Port");
if (Util.IsNumber(lsTmp)) Config.HeightDev_Port = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "HeightDev_SafeValue");
if (Util.IsNumber(lsTmp)) Config.HeightDev_SafeValue = Convert.ToDecimal(lsTmp);
IOCard_DeviceNum = Util.ReadIniValue(configPath, "DEV", "IOCard_DeviceNum");
Defect_SavePath = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) Defect_SavePath_AutoClear = Convert.ToDouble(lsTmp);
Defect_Compress_SavePath = Util.ReadIniValue(configPath, "DEV", "Defect_Compress_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_Compress_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) Defect_Compress_SavePath_AutoClear = Convert.ToDouble(lsTmp);
Defect_Small_SavePath = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) Defect_Small_SavePath_AutoClear = Convert.ToDouble(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "SaveAllDefectImg");
SaveAllDefectImg = (lsTmp == "1");
MakeTag = Util.ReadIniValue(configPath, "DEV", "MakeTag") == "1";
SizeEnginePath = Util.ReadIniValue(configPath, "DEV", "SizeEnginePath");
SizeBmp_SavePath = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) SizeBmp_SavePath_AutoClear = Convert.ToDouble(lsTmp);
SizeBmp_Compare_SavePath = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) SizeBmp_Compare_SavePath_AutoClear = Convert.ToDouble(lsTmp);
SizeBmp_Zoom_Image_SavePath = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) SizeBmp_Zoom_Image_SavePath_AutoClear = Convert.ToDouble(lsTmp);
//DB
DBConStr = Util.ReadIniValue(configPath, "DB", "DBConStr");
//HTTP
LocalIp= Util.ReadIniValue(configPath, "HTTP", "LocalIp");
lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalHttpPort");
if (Util.IsNumber(lsTmp)) Config.LocalHttpPort = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalSocketPort");
if (Util.IsNumber(lsTmp)) Config.LocalSocketPort = Convert.ToInt32(lsTmp);
//LOG
LogPath = Util.ReadIniValue(configPath, "LOG", "LogPath");
//缺陷配置
Defect_CutSize = new Size(592, 532);
Defect_ReSize = new Size(224, 224);
Defect_Thresholds = 0.4f;
}
public static void LoadPTConfig()
{
if (string.IsNullOrWhiteSpace(appBasePath))
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string configPath = appBasePath + "\\PTConfig.json";
string lsTmp = File.ReadAllText(configPath);
joPTSetting = JObject.Parse(lsTmp);
}
private static void InitDevDic()
{
//dicDevType.Add("CodeScanner", "扫码枪");//固定为必有开始
if(!dicDevType.ContainsKey("IOCard")) dicDevType.Add("IOCard", "I/O控制");
if (!dicDevType.ContainsKey("Tension")) dicDevType.Add("Tension", "张力测量");
if (!dicDevType.ContainsKey("Height")) dicDevType.Add("Height", "厚度测量");
if (!dicDevType.ContainsKey("Axis")) dicDevType.Add("Axis", "滑台电机");
if (!dicDevType.ContainsKey("AxisTag")) dicDevType.Add("AxisTag", "滑台&测量");
if (!dicDevType.ContainsKey("Light")) dicDevType.Add("Light", "光源");
if (!dicDevType.ContainsKey("Scanner_GENTL")) dicDevType.Add("Scanner_GENTL", "相机GENTL");
if (!dicDevType.ContainsKey("Scanner_CC")) dicDevType.Add("Scanner_CC", "相机CC");
if (!dicDevType.ContainsKey("SmallAxis")) dicDevType.Add("SmallAxis", "镜头电机");
if (!dicDevType.ContainsKey("Defect")) dicDevType.Add("Defect", "缺陷检测");
if (!dicDevType.ContainsKey("Size")) dicDevType.Add("Size", "尺寸测量");
if (!dicDevType.ContainsKey("For")) dicDevType.Add("For", "For循环");
if (!dicDevType.ContainsKey("If")) dicDevType.Add("If", "If条件");
}
private static void CreateSysFolder()
{
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string dirPath = appBasePath + "\\Attachment\\";
if(!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath);
dirPath = appBasePath + "\\Temp\\";
if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath);
}
/// <summary>
///
/// </summary>
/// <param name="dirPath"></param>
/// <param name="days"></param>
/// <param name="delDir">把日期文件夹也按days进行删除格式:yyyyMMdd</param>
private static void DeleteFiles(string dirPath,double days=0,bool delDir=false)
{
if (!Directory.Exists(dirPath)) return;
DateTime delDate = DateTime.Now.AddDays(-days);
API.OutputDebugString($"清除{delDate.ToString("yyyyMMdd")}前记录:{dirPath}。");
string[] file_list = Directory.GetFiles(dirPath);
if(days>0)
file_list = file_list.Select(file => new FileInfo(file))
.Where(f=>f.CreationTime<= delDate)
.Select(x => x.FullName)
.ToArray();
foreach (string file in file_list)
{
try {
API.OutputDebugString($"清除文件:{file}...");
File.Delete(file);
} catch(Exception ex) {
API.OutputDebugString($"Ex1:{ex.Message}");
}
}
//
if (delDir)
{
int dateNum = Convert.ToInt32(delDate.ToString("yyyyMMdd"));
string floderName;
string[] dirList = Directory.GetDirectories(dirPath,"20*");
foreach (string dir in dirList)
{
floderName= dir.Trim('\\');
floderName = floderName.Substring(floderName.LastIndexOf('\\') + 1);
if (floderName.Length == 8 && Util.IsNumber(floderName) && Convert.ToInt32(floderName) <= dateNum)
{
try
{
API.OutputDebugString($"清除目录:{dir}...");
Directory.Delete(dir,true);
}
catch (Exception ex)
{
API.OutputDebugString($"Ex2:{ex.Message}");
}
}
}
}
}
}
}
if (Defect_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_SavePath, Defect_SavePath_AutoClear, false);
if (Defect_Compress_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_Compress_SavePath, Defect_Compress_SavePath_AutoClear, false);
if (Defect_Small_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_Small_SavePath, Defect_Small_SavePath_AutoClear, false);
//
if (SizeBmp_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_SavePath, SizeBmp_SavePath_AutoClear, false);
if (SizeBmp_Compare_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Compare_SavePath, SizeBmp_Compare_SavePath_AutoClear, false);
if (SizeBmp_Zoom_Image_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Zoom_Image_SavePath, SizeBmp_Zoom_Image_SavePath_AutoClear, false);
});
}
public static void LoadAllConfig()
{
if (string.IsNullOrWhiteSpace(appBasePath))
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
//删除文件
Task.Factory.StartNew(() =>
{
CreateSysFolder();
//
DeleteFiles(appBasePath+"\\temp\\");
//
if (Defect_SavePath_AutoClear>=0)
DeleteFiles(Config.Defect_SavePath, Defect_SavePath_AutoClear,true);
if (Defect_Compress_SavePath_AutoClear >= 0)
DeleteFiles(Config.Defect_Compress_SavePath, Defect_Compress_SavePath_AutoClear, true);
if (Defect_Small_SavePath_AutoClear>=0)
DeleteFiles(Config.Defect_Small_SavePath, Defect_Small_SavePath_AutoClear, true);
//
if (SizeBmp_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_SavePath, SizeBmp_SavePath_AutoClear, true);
if (SizeBmp_Compare_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Compare_SavePath, SizeBmp_Compare_SavePath_AutoClear, true);
if (SizeBmp_Zoom_Image_SavePath_AutoClear >= 0)
DeleteFiles(Config.SizeBmp_Zoom_Image_SavePath, SizeBmp_Zoom_Image_SavePath_AutoClear, true);
});
InitDevDic();
LoadSysConfig();
LoadPTConfig();
//
string lsCmdPath = appBasePath + "\\CMDProcess\\";
if(!Directory.Exists(lsCmdPath))
Directory.CreateDirectory(lsCmdPath);
string fileName;
CMDProcess = new Dictionary<CMDName, JObject>();
foreach (int item in Enum.GetValues(typeof(CMDName)))//item为key值
{
//string name = Enum.GetName(typeof(CMDName), item);//获取名称
fileName = lsCmdPath + item + ".json";
if (File.Exists(fileName))
CMDProcess.Add((CMDName)item, JObject.Parse(File.ReadAllText(fileName)));
//else
// CMDProcess.Add((CMDName)item, null);
}
}
public static void LoadSysConfig()
{
if (string.IsNullOrWhiteSpace(appBasePath))
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string configPath = appBasePath + "\\SysConfig.ini";
string lsTmp = "";
CustomerVer = Util.ReadIniValue(configPath, "VER", "CustomerVer");
if (string.IsNullOrWhiteSpace(CustomerVer))
CustomerVer = "A";
//Skip
SkipAxis0 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis0") =="1";
SkipAxis1 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis1") == "1";
SkipAxis2 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis2") == "1";
SkipAxis3 = Util.ReadIniValue(configPath, "SKIP", "SkipAxis3") == "1";
SkipTension = Util.ReadIniValue(configPath, "SKIP", "SkipTension") == "1";
SkipHeight = Util.ReadIniValue(configPath, "SKIP", "SkipHeight") == "1";
SkipLight = Util.ReadIniValue(configPath, "SKIP", "SkipLight") == "1";
SkipScannerGL = Util.ReadIniValue(configPath, "SKIP", "SkipScannerGL") == "1";
SkipScannerCC = Util.ReadIniValue(configPath, "SKIP", "SkipScannerCC") == "1";
SkipSmallAxis = Util.ReadIniValue(configPath, "SKIP", "SkipSmallAxis") == "1";
OpenMarkErrorStop = Util.ReadIniValue(configPath, "SKIP", "MarkErrorStop") == "1";
OpenFlawDistribution = Util.ReadIniValue(configPath, "SKIP", "OpenFlawDistribution") == "1";
//DEV
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[0] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[1] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[2] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_PulseOutMode");
if (Util.IsNumber(lsTmp)) Config.Axis_PulseOutMode[3] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[0] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[1] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[2] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_HomeMode");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeMode[3] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[0] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[1] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[2] = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_HomeDir");
if (Util.IsNumber(lsTmp)) Config.Axis_HomeDir[3] = Convert.ToInt32(lsTmp);
//
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelLow");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeVelLow = JArray.Parse(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelHigh");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeVelHigh = JArray.Parse(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeAcc");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeAcc = JArray.Parse(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeDec");
if (!string.IsNullOrWhiteSpace(lsTmp)) Axis_HomeDec = JArray.Parse(lsTmp);
//
lsTmp = Util.ReadIniValue(configPath, "DEV", "Light_Name");
if (Util.IsNumber(lsTmp)) Config.Light_Name = (LightDevNameEnum)Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Light_PortNum");
if (Util.IsNumber(lsTmp)) Config.Light_PortNum = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Tension_PortNum");
if (Util.IsNumber(lsTmp)) Config.Tension_PortNum = Convert.ToInt32(lsTmp);
Config.SmallAxis_ComName = Util.ReadIniValue(configPath, "DEV", "SmallAxis_ComName");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Tension_Offset");
if (string.IsNullOrEmpty(lsTmp))
Config.Tension_Offset = 0;
else
Config.Tension_Offset = double.Parse(lsTmp);
HeightDev_IP = Util.ReadIniValue(configPath, "DEV", "HeightDev_IP");
lsTmp = Util.ReadIniValue(configPath, "DEV", "HeightDev_Port");
if (Util.IsNumber(lsTmp)) Config.HeightDev_Port = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "HeightDev_SafeValue");
if (Util.IsNumber(lsTmp)) Config.HeightDev_SafeValue = Convert.ToDecimal(lsTmp);
IOCard_DeviceNum = Util.ReadIniValue(configPath, "DEV", "IOCard_DeviceNum");
Defect_SavePath = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) Defect_SavePath_AutoClear = Convert.ToDouble(lsTmp);
Defect_Compress_SavePath = Util.ReadIniValue(configPath, "DEV", "Defect_Compress_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_Compress_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) Defect_Compress_SavePath_AutoClear = Convert.ToDouble(lsTmp);
Defect_Small_SavePath = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) Defect_Small_SavePath_AutoClear = Convert.ToDouble(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "DEV", "SaveAllDefectImg");
SaveAllDefectImg = (lsTmp == "1");
MakeTag = Util.ReadIniValue(configPath, "DEV", "MakeTag") == "1";
SizeEnginePath = Util.ReadIniValue(configPath, "DEV", "SizeEnginePath");
SizeBmp_SavePath = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) SizeBmp_SavePath_AutoClear = Convert.ToDouble(lsTmp);
SizeBmp_Compare_SavePath = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) SizeBmp_Compare_SavePath_AutoClear = Convert.ToDouble(lsTmp);
SizeBmp_Zoom_Image_SavePath = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath_AutoClear");
if (Util.IsNumber(lsTmp)) SizeBmp_Zoom_Image_SavePath_AutoClear = Convert.ToDouble(lsTmp);
//DB
DBConStr = Util.ReadIniValue(configPath, "DB", "DBConStr");
//HTTP
LocalIp= Util.ReadIniValue(configPath, "HTTP", "LocalIp");
lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalHttpPort");
if (Util.IsNumber(lsTmp)) Config.LocalHttpPort = Convert.ToInt32(lsTmp);
lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalSocketPort");
if (Util.IsNumber(lsTmp)) Config.LocalSocketPort = Convert.ToInt32(lsTmp);
//LOG
LogPath = Util.ReadIniValue(configPath, "LOG", "LogPath");
//缺陷配置
Defect_CutSize = new Size(592, 532);
Defect_ReSize = new Size(224, 224);
Defect_Thresholds = 0.4f;
}
public static void LoadPTConfig()
{
if (string.IsNullOrWhiteSpace(appBasePath))
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string configPath = appBasePath + "\\PTConfig.json";
string lsTmp = File.ReadAllText(configPath);
joPTSetting = JObject.Parse(lsTmp);
}
private static void InitDevDic()
{
//dicDevType.Add("CodeScanner", "扫码枪");//固定为必有开始
if(!dicDevType.ContainsKey("IOCard")) dicDevType.Add("IOCard", "I/O控制");
if (!dicDevType.ContainsKey("Tension")) dicDevType.Add("Tension", "张力测量");
if (!dicDevType.ContainsKey("Height")) dicDevType.Add("Height", "厚度测量");
if (!dicDevType.ContainsKey("Axis")) dicDevType.Add("Axis", "滑台电机");
if (!dicDevType.ContainsKey("AxisTag")) dicDevType.Add("AxisTag", "滑台&测量");
if (!dicDevType.ContainsKey("Light")) dicDevType.Add("Light", "光源");
if (!dicDevType.ContainsKey("Scanner_GENTL")) dicDevType.Add("Scanner_GENTL", "相机GENTL");
if (!dicDevType.ContainsKey("Scanner_CC")) dicDevType.Add("Scanner_CC", "相机CC");
if (!dicDevType.ContainsKey("SmallAxis")) dicDevType.Add("SmallAxis", "镜头电机");
if (!dicDevType.ContainsKey("Defect")) dicDevType.Add("Defect", "缺陷检测");
if (!dicDevType.ContainsKey("Size")) dicDevType.Add("Size", "尺寸测量");
if (!dicDevType.ContainsKey("For")) dicDevType.Add("For", "For循环");
if (!dicDevType.ContainsKey("If")) dicDevType.Add("If", "If条件");
}
private static void CreateSysFolder()
{
appBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string dirPath = appBasePath + "\\Attachment\\";
if(!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath);
dirPath = appBasePath + "\\Temp\\";
if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath);
}
/// <summary>
///
/// </summary>
/// <param name="dirPath"></param>
/// <param name="days"></param>
/// <param name="delDir">把日期文件夹也按days进行删除格式:yyyyMMdd</param>
private static void DeleteFiles(string dirPath,double days=0,bool delDir=false)
{
if (!Directory.Exists(dirPath)) return;
DateTime delDate = DateTime.Now.AddDays(-days);
API.OutputDebugString($"清除{delDate.ToString("yyyyMMdd")}前记录:{dirPath}。");
string[] file_list = Directory.GetFiles(dirPath);
if(days>0)
file_list = file_list.Select(file => new FileInfo(file))
.Where(f=>f.CreationTime<= delDate)
.Select(x => x.FullName)
.ToArray();
foreach (string file in file_list)
{
try {
API.OutputDebugString($"清除文件:{file}...");
File.Delete(file);
} catch(Exception ex) {
API.OutputDebugString($"Ex1:{ex.Message}");
}
}
//
if (delDir)
{
int dateNum = Convert.ToInt32(delDate.ToString("yyyyMMdd"));
string floderName;
string[] dirList = Directory.GetDirectories(dirPath,"20*");
foreach (string dir in dirList)
{
floderName= dir.Trim('\\');
floderName = floderName.Substring(floderName.LastIndexOf('\\') + 1);
if (floderName.Length == 8 && Util.IsNumber(floderName) && Convert.ToInt32(floderName) <= dateNum)
{
try
{
API.OutputDebugString($"清除目录:{dir}...");
Directory.Delete(dir,true);
}
catch (Exception ex)
{
API.OutputDebugString($"Ex2:{ex.Message}");
}
}
}
}
}
}
}

View File

@ -279,9 +279,12 @@ namespace ProductionControl.Device
task.Xmm, task.Ymm, out task.defectInfor2RestorationDesk);
liStep = 5;
//大图缺陷坐标转换到图纸坐标
if (!string.IsNullOrWhiteSpace(task.drawingPagePath) && task.defectInfor2RestorationDesk != null && task.defectInfor2RestorationDesk.Count > 0)
task.defectInfor2RestorationDeskPage = yolo1.DefectDrawGerberImage(task.drawingPagePath, task.defectInfor2RestorationDesk);
if (Config.OpenFlawDistribution)
{
//大图缺陷坐标转换到图纸坐标
if (!string.IsNullOrWhiteSpace(task.drawingPagePath) && task.defectInfor2RestorationDesk != null && task.defectInfor2RestorationDesk.Count > 0)
task.defectInfor2RestorationDeskPage = yolo1.DefectDrawGerberImage(task.drawingPagePath, task.defectInfor2RestorationDesk);
}
stopwatch.Stop();
task.stopwatch[4] = stopwatch.ElapsedMilliseconds;

View File

@ -1,391 +1,395 @@
using HalconDotNet;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Yolo5;
namespace ProductionControl.Device
{
public class SizeLib : IDisposable
{
public Action<WarningEnum, string> WarningEvent;
/// <summary>
/// 检测结果JSON(原图,结果)
/// </summary>
public Action<SizeTask> finishEvent;
/// <summary>
/// 是否打开设备成功
/// </summary>
public bool IsInit { get; private set; } = false;
//private System.Timers.Timer timer = new System.Timers.Timer();
//配置
HDevEngine MyEngine = new HDevEngine();
//777时用
Yolo_Class yolo5 =new Yolo_Class();
private Thread t_task;
public SizeLib()
{
}
public bool start(string enginePath)
{
try
{
IsInit = true;
taskList.Clear();
MyEngine.SetProcedurePath(enginePath);
t_task = new System.Threading.Thread(run);
t_task.IsBackground = true;
t_task.Start();
return true;
}
catch (Exception ex)
{
WarningEvent?.Invoke(WarningEnum.High,ex.Message);
return false;
}
}
public void stop()
{
if (!IsInit) return;
try
{
IsInit = false;
//timer.Elapsed -= Timer_Elapsed;
MyEngine.Dispose();
}
catch { }
}
private bool _debug = false;
public bool setDebug {
get { return _debug; }
set {
if (!IsInit) return;
_debug=value;
if (_debug)
MyEngine.StartDebugServer();
else
MyEngine.StopDebugServer();
}
}
//流程111222444333777777777。。。
private void run()
{
int taskCount;
while (IsInit)
{
lock (taskList)
{
taskCount = taskList.Count;
}
if (taskCount < 1)
{
Thread.Sleep(10);
continue;
}
////
int step = 0;
var task = pop();
try
{
if (task != null)
{
var Program1 = new HDevProcedure(task.engineName);
HDevProcedureCall ProcCall1_PI_PT = new HDevProcedureCall(Program1);
step = 1;
//
HObject image;
if (task.bmp != null)
Bitmap2HObjectBpp24(out image, task.bmp);
else
HOperatorSet.ReadImage(out image, task.file_path);
step = 2;
//设置外部函数输入
//if (task.index < 100)
{
ProcCall1_PI_PT.SetInputIconicParamObject("Image1", image.Clone());
ProcCall1_PI_PT.SetInputCtrlParamTuple("index", task.index);//参数1-9
ProcCall1_PI_PT.SetInputCtrlParamTuple("posX", task.posX);
ProcCall1_PI_PT.SetInputCtrlParamTuple("posY", task.posY);
ProcCall1_PI_PT.SetInputCtrlParamTuple("GerberPath",new HTuple( task.drawingPagePath));//美尚没有
//设置外部函数输入
if ((task.PTandLinePos != null) && (task.PTandLinePos[0] != 0))
{
double[] posarray = new double[23];
posarray[0] = task.PTandLinePos[0];
posarray[1] = task.PTandLinePos[2];
posarray[2] = task.PTandLinePos[4];
posarray[3] = task.PTandLinePos[6];
posarray[4] = task.PTandLinePos[8];
for (int i = 0; i < 18; i++)
{
posarray[5 + i] = task.PTandLinePos[10 + i];
using HalconDotNet;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Yolo5;
namespace ProductionControl.Device
{
public class SizeLib : IDisposable
{
public Action<WarningEnum, string> WarningEvent;
/// <summary>
/// 检测结果JSON(原图,结果)
/// </summary>
public Action<SizeTask> finishEvent;
/// <summary>
/// 是否打开设备成功
/// </summary>
public bool IsInit { get; private set; } = false;
//private System.Timers.Timer timer = new System.Timers.Timer();
//配置
HDevEngine MyEngine = new HDevEngine();
//777时用
Yolo_Class yolo5 =new Yolo_Class();
private Thread t_task;
public SizeLib()
{
}
public bool start(string enginePath)
{
try
{
IsInit = true;
taskList.Clear();
MyEngine.SetProcedurePath(enginePath);
t_task = new System.Threading.Thread(run);
t_task.IsBackground = true;
t_task.Start();
return true;
}
catch (Exception ex)
{
WarningEvent?.Invoke(WarningEnum.High,ex.Message);
return false;
}
}
public void stop()
{
if (!IsInit) return;
try
{
IsInit = false;
//timer.Elapsed -= Timer_Elapsed;
MyEngine.Dispose();
}
catch { }
}
private bool _debug = false;
public bool setDebug {
get { return _debug; }
set {
if (!IsInit) return;
_debug=value;
if (_debug)
MyEngine.StartDebugServer();
else
MyEngine.StopDebugServer();
}
}
//流程111222444333777777777。。。
private void run()
{
int taskCount;
while (IsInit)
{
lock (taskList)
{
taskCount = taskList.Count;
}
if (taskCount < 1)
{
Thread.Sleep(10);
continue;
}
////
int step = 0;
var task = pop();
try
{
if (task != null)
{
var Program1 = new HDevProcedure(task.engineName);
HDevProcedureCall ProcCall1_PI_PT = new HDevProcedureCall(Program1);
step = 1;
//
HObject image;
if (task.bmp != null)
Bitmap2HObjectBpp24(out image, task.bmp);
else
HOperatorSet.ReadImage(out image, task.file_path);
step = 2;
//设置外部函数输入
//if (task.index < 100)
{
ProcCall1_PI_PT.SetInputIconicParamObject("Image1", image.Clone());
ProcCall1_PI_PT.SetInputCtrlParamTuple("index", task.index);//参数1-9
ProcCall1_PI_PT.SetInputCtrlParamTuple("posX", task.posX);
ProcCall1_PI_PT.SetInputCtrlParamTuple("posY", task.posY);
ProcCall1_PI_PT.SetInputCtrlParamTuple("GerberPath",new HTuple( task.drawingPagePath));//美尚没有
//设置外部函数输入
if ((task.PTandLinePos != null) && (task.PTandLinePos[0] != 0))
{
double[] posarray = new double[23];
posarray[0] = task.PTandLinePos[0];
posarray[1] = task.PTandLinePos[2];
posarray[2] = task.PTandLinePos[4];
posarray[3] = task.PTandLinePos[6];
posarray[4] = task.PTandLinePos[8];
for (int i = 0; i < 18; i++)
{
posarray[5 + i] = task.PTandLinePos[10 + i];
}
ProcCall1_PI_PT.SetInputCtrlParamTuple("UserPose", posarray);
/////
///
//string directory = Config.LogPath + "\\" + DateTime.Now.ToString("yyyyMM") + "\\";
//if (!System.IO.Directory.Exists(directory))
// System.IO.Directory.CreateDirectory(directory);
//File.AppendAllText(directory + "sizeData.log", "data:" + string.Join(",", posarray) + "\r\n");
}
else
{
double[] posarray = new double[23];
ProcCall1_PI_PT.SetInputCtrlParamTuple("UserPose", posarray);
}
}
if (task.index == 777)
{
ProcCall1_PI_PT.SetInputIconicParamObject("ContoursAffineTrans1", task.ContoursAffineTrans1_Out);
}
else
{
HObject ContoursAffineTrans1;
HOperatorSet.GenEmptyObj(out ContoursAffineTrans1);
ProcCall1_PI_PT.SetInputIconicParamObject("ContoursAffineTrans1", ContoursAffineTrans1);
}
step = 3;
ProcCall1_PI_PT.Execute();//执行外部函数
step = 4;
//获取外部函数输出
switch (task.index)
{
case 777://比对结果
step = 10;
task.CompResult = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("RES") == 1;//结果1为true0为false
step = 11;
if (!task.CompResult)
{
var Defects_X = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_X");
var Defects_Y = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_Y");
var Defects_LeftTop_X = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_LeftTop_X");
var Defects_LeftTop_Y = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_LeftTop_Y");
var Defects_RightBottom_X = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_RightBottom_X");
var Defects_RightBottom_Y = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_RightBottom_Y");
var Contour_Image = ProcCall1_PI_PT.GetOutputIconicParamObject("Contour_Image");
//var Zoom_Image = ProcCall1_PI_PT.GetOutputIconicParamObject("Zoom_Image");
var Defects_Type = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_Type");
var Defects_Index = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_Index");
step = 12;
//对比打标图显示在UI上以后修复台用
//task.Zoom_Image_mat = yolo5.DrawContour_Opencv(Contour_Image, Zoom_Image, Defects_LeftTop_X, Defects_LeftTop_Y, Defects_RightBottom_X, Defects_RightBottom_Y);
//新YOLO.DLL
task.defectInfor2RestorationDesk = new List<List<string>>();
task.Zoom_Image_mat = yolo5.DrawContour_Opencv(Contour_Image, image, Defects_LeftTop_X, Defects_LeftTop_Y,
Defects_RightBottom_X, Defects_RightBottom_Y, Defects_Type, Defects_Index, Defects_X, Defects_Y, out task.defectInfor2RestorationDesk);
//WarningEvent?.Invoke(WarningEnum.Normal, $"SizeLib 777 call DrawContour_Opencv(),Defects_LeftTop_X={Defects_LeftTop_X}," +
// $"Defects_LeftTop_Y={Defects_LeftTop_Y},Defects_RightBottom_X={Defects_RightBottom_X},Defects_RightBottom_Y={Defects_RightBottom_Y}," +
// $"Defects_Type={Defects_Type},Defects_Index={Defects_Index},Defects_X={Defects_X},Defects_Y={Defects_Y}," +
// $"defectInfor2RestorationDesk={JsonConvert.SerializeObject(task.defectInfor2RestorationDesk)}");
step = 13;
task.Zoom_Image_mat = yolo5.ResizesMat_4(task.Zoom_Image_mat);
//大图缺陷坐标转换到图纸坐标
step = 14;
if (!string.IsNullOrWhiteSpace(task.drawingPagePath) && task.defectInfor2RestorationDesk != null && task.defectInfor2RestorationDesk.Count > 0)
task.defectInfor2RestorationDeskPage = yolo5.DefectDrawGerberImage(task.drawingPagePath, task.defectInfor2RestorationDesk);
}
break;
case 111:
task.MarkPointList[0] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_1");
task.MarkPointList[1] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_1");
break;
case 222:
task.MarkPointList[2] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_2");
task.MarkPointList[3] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_2");
break;
case 333:
task.MarkPointList[4] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_3");
task.MarkPointList[5] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_3");//ContoursAffineTrans1
task.ContoursAffineTrans1_Out = ProcCall1_PI_PT.GetOutputIconicParamObject("ContoursAffineTrans1_Out");
break;
case 444:
task.MarkPointList[6] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_4");
task.MarkPointList[7] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_4");
break;
case 3333: //Tag使用同时继续获取使用default时时校正和其它值
step = 80;
if (!string.IsNullOrWhiteSpace( task.sizeTag))
task.posePT= ProcCall1_PI_PT.GetOutputCtrlParamTuple("posePT").DArr;
goto default;
default:
step = 90;
task.PT1 = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("DistancePT1");//index=8 PT1=PT2
task.PT2 = ProcCall1_PI_PT.GetOutputCtrlParamTuple("DistancePT2");
task.Shanxian = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("Distance3Median");
//task.RowP = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("RowP");
task.Circle_Ymm = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("Circle_Ymm");
task.Circle_Xmm = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("Circle_Xmm");
task.offsetX = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("offsetX");
task.offsetY = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("offsetY");
break;
}
step = 100;
ProcCall1_PI_PT.Dispose();
Program1.Dispose();
step = 101;
task.isSucceed = true;
task.resultInfo = "成功";
callback(task);
step = 102;
}
Thread.Sleep(5);
}
catch (Exception ex)
{
WarningEvent?.Invoke(WarningEnum.Low, $"SizeLib task err({step}) index({task.index}):"+ ex.Message);
task.isSucceed = false;
task.resultInfo = $"(errcode:{step}):{ex.Message}";
callback(task);
}
}
}
private void callback(SizeTask task)
{
//返回成功/失败,异步调用
if (task.finishEvent != null || (task.finishEvent = finishEvent) != null)
//task.finishEvent.BeginInvoke(result, errInfo, res => task.finishEvent.EndInvoke(res), null);
System.Threading.ThreadPool.QueueUserWorkItem(waitCallback, task);
}
//异步回调
WaitCallback waitCallback = new WaitCallback(o => {
var task = (SizeTask)o;
task.finishEvent(task);
});
//=======task list
private List<SizeTask> taskList = new List<SizeTask>();
public class SizeTask
{
public int stepIndex;//只为回调记录当前工序信息
public string processName;//只为回调记录当前工序信息
public string engineName,sizeTag;
/// <summary>
/// 源文件
/// </summary>
public string file_path;
public double posX,posY;
public Bitmap bmp;
ProcCall1_PI_PT.SetInputCtrlParamTuple("UserPose", posarray);
/////
///
//string directory = Config.LogPath + "\\" + DateTime.Now.ToString("yyyyMM") + "\\";
//if (!System.IO.Directory.Exists(directory))
// System.IO.Directory.CreateDirectory(directory);
//File.AppendAllText(directory + "sizeData.log", "data:" + string.Join(",", posarray) + "\r\n");
}
else
{
double[] posarray = new double[23];
ProcCall1_PI_PT.SetInputCtrlParamTuple("UserPose", posarray);
}
}
if (task.index == 777)
{
ProcCall1_PI_PT.SetInputIconicParamObject("ContoursAffineTrans1", task.ContoursAffineTrans1_Out);
}
else
{
HObject ContoursAffineTrans1;
HOperatorSet.GenEmptyObj(out ContoursAffineTrans1);
ProcCall1_PI_PT.SetInputIconicParamObject("ContoursAffineTrans1", ContoursAffineTrans1);
}
step = 3;
ProcCall1_PI_PT.Execute();//执行外部函数
step = 4;
//获取外部函数输出
switch (task.index)
{
case 777://比对结果
step = 10;
task.CompResult = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("RES") == 1;//结果1为true0为false
step = 11;
if (!task.CompResult)
{
var Defects_X = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_X");
var Defects_Y = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_Y");
var Defects_LeftTop_X = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_LeftTop_X");
var Defects_LeftTop_Y = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_LeftTop_Y");
var Defects_RightBottom_X = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_RightBottom_X");
var Defects_RightBottom_Y = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_RightBottom_Y");
var Contour_Image = ProcCall1_PI_PT.GetOutputIconicParamObject("Contour_Image");
//var Zoom_Image = ProcCall1_PI_PT.GetOutputIconicParamObject("Zoom_Image");
var Defects_Type = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_Type");
var Defects_Index = ProcCall1_PI_PT.GetOutputCtrlParamTuple("Defects_Index");
step = 12;
//对比打标图显示在UI上以后修复台用
//task.Zoom_Image_mat = yolo5.DrawContour_Opencv(Contour_Image, Zoom_Image, Defects_LeftTop_X, Defects_LeftTop_Y, Defects_RightBottom_X, Defects_RightBottom_Y);
//新YOLO.DLL
task.defectInfor2RestorationDesk = new List<List<string>>();
task.Zoom_Image_mat = yolo5.DrawContour_Opencv(Contour_Image, image, Defects_LeftTop_X, Defects_LeftTop_Y,
Defects_RightBottom_X, Defects_RightBottom_Y, Defects_Type, Defects_Index, Defects_X, Defects_Y, out task.defectInfor2RestorationDesk);
//WarningEvent?.Invoke(WarningEnum.Normal, $"SizeLib 777 call DrawContour_Opencv(),Defects_LeftTop_X={Defects_LeftTop_X}," +
// $"Defects_LeftTop_Y={Defects_LeftTop_Y},Defects_RightBottom_X={Defects_RightBottom_X},Defects_RightBottom_Y={Defects_RightBottom_Y}," +
// $"Defects_Type={Defects_Type},Defects_Index={Defects_Index},Defects_X={Defects_X},Defects_Y={Defects_Y}," +
// $"defectInfor2RestorationDesk={JsonConvert.SerializeObject(task.defectInfor2RestorationDesk)}");
step = 13;
task.Zoom_Image_mat = yolo5.ResizesMat_4(task.Zoom_Image_mat);
//大图缺陷坐标转换到图纸坐标
step = 14;
if (Config.OpenFlawDistribution)
{
if (!string.IsNullOrWhiteSpace(task.drawingPagePath) && task.defectInfor2RestorationDesk != null && task.defectInfor2RestorationDesk.Count > 0)
task.defectInfor2RestorationDeskPage = yolo5.DefectDrawGerberImage(task.drawingPagePath, task.defectInfor2RestorationDesk);
}
}
break;
case 111:
task.MarkPointList[0] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_1");
task.MarkPointList[1] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_1");
break;
case 222:
task.MarkPointList[2] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_2");
task.MarkPointList[3] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_2");
break;
case 333:
task.MarkPointList[4] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_3");
task.MarkPointList[5] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_3");//ContoursAffineTrans1
task.ContoursAffineTrans1_Out = ProcCall1_PI_PT.GetOutputIconicParamObject("ContoursAffineTrans1_Out");
break;
case 444:
task.MarkPointList[6] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkX_4");
task.MarkPointList[7] = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("PoseMarkY_4");
break;
case 3333: //Tag使用同时继续获取使用default时时校正和其它值
step = 80;
if (!string.IsNullOrWhiteSpace( task.sizeTag))
task.posePT= ProcCall1_PI_PT.GetOutputCtrlParamTuple("posePT").DArr;
goto default;
default:
step = 90;
task.PT1 = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("DistancePT1");//index=8 PT1=PT2
task.PT2 = ProcCall1_PI_PT.GetOutputCtrlParamTuple("DistancePT2");
task.Shanxian = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("Distance3Median");
//task.RowP = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("RowP");
task.Circle_Ymm = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("Circle_Ymm");
task.Circle_Xmm = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("Circle_Xmm");
task.offsetX = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("offsetX");
task.offsetY = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("offsetY");
break;
}
step = 100;
ProcCall1_PI_PT.Dispose();
Program1.Dispose();
step = 101;
task.isSucceed = true;
task.resultInfo = "成功";
callback(task);
step = 102;
}
Thread.Sleep(5);
}
catch (Exception ex)
{
WarningEvent?.Invoke(WarningEnum.Low, $"SizeLib task err({step}) index({task.index}):"+ ex.Message);
task.isSucceed = false;
task.resultInfo = $"(errcode:{step}):{ex.Message}";
callback(task);
}
}
}
private void callback(SizeTask task)
{
//返回成功/失败,异步调用
if (task.finishEvent != null || (task.finishEvent = finishEvent) != null)
//task.finishEvent.BeginInvoke(result, errInfo, res => task.finishEvent.EndInvoke(res), null);
System.Threading.ThreadPool.QueueUserWorkItem(waitCallback, task);
}
//异步回调
WaitCallback waitCallback = new WaitCallback(o => {
var task = (SizeTask)o;
task.finishEvent(task);
});
//=======task list
private List<SizeTask> taskList = new List<SizeTask>();
public class SizeTask
{
public int stepIndex;//只为回调记录当前工序信息
public string processName;//只为回调记录当前工序信息
public string engineName,sizeTag;
/// <summary>
/// 源文件
/// </summary>
public string file_path;
public double posX,posY;
public Bitmap bmp;
public string drawingPagePath = "";//.gbx图纸路径
//2023-10-27 新增图纸选择pt点位与线宽点位
public double[] PTandLinePos;
/// <summary>
/// 比对(index=777); 计算Mark(111/222/333/444); 尺寸(1-9); 轴偏移调整(10,20,30...)
/// </summary>
public int index; //index=8 PT1=PT2
/// <summary>
/// 完成后回调
/// </summary>
public Action<SizeTask> finishEvent;
public long createTime = DateTime.Now.Ticks;
//==结果返回
/// <summary>
/// 比对结果(index=777)
/// </summary>
public bool CompResult;
public Mat Zoom_Image_mat;//对比打标图:777比对失败时计算得出后面显示到UI 以后修复台用
public List<List<string>> defectInfor2RestorationDesk, defectInfor2RestorationDeskPage;//对比未通过坐标信息,合并到缺陷检测中的 //打标缺陷转为图纸的坐标;
//MARK点
public double[] MarkPointList = { 0, 0, 0, 0, 0, 0, 0, 0 };
public HObject ContoursAffineTrans1_Out;//index=333时输出供后面多个777比对时输入使用
public double[] posePT;//index=3333 && !isEmpty(sizeTag) 才取此数组值len为0时急停
//
public double PT1,PT2, Shanxian, Circle_Ymm, Circle_Xmm, offsetX, offsetY;
public bool isSucceed;//转换是否成功
public string resultInfo = "";//成功或失败信息
}
public void add(SizeTask task)
{
lock (taskList)
taskList.Add(task);
}
private SizeTask pop()
{
lock (taskList)
{
if (taskList.Count < 1)
return null;
var task = taskList[0];
taskList.RemoveAt(0);
return task;
}
}
public void Dispose()
{
stop();
}
/// <summary>
/// Bitmap转HObject灰度图
/// </summary>
/// <param name="bmp">Bitmap图像</param>
/// <param name="image">HObject图像</param>
private void Bitmap2HObjectBpp8( out HObject image,Bitmap bmp)
{
try
{
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
BitmapData srcBmpData = bmp.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed);
HOperatorSet.GenImage1(out image, "byte", bmp.Width, bmp.Height, srcBmpData.Scan0);
bmp.UnlockBits(srcBmpData);
}
catch (Exception)
{
image = null;
}
}
public void Bitmap2HObjectBpp24( out HObject image, Bitmap bmp)
{
try
{
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
BitmapData srcBmpData = bmp.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
HOperatorSet.GenImageInterleaved(out image, srcBmpData.Scan0, "bgr", bmp.Width, bmp.Height, 0, "byte", 0, 0, 0, 0, -1, 0);
bmp.UnlockBits(srcBmpData);
}
catch (Exception ex)
{
image = null;
}
}
}
}
public double[] PTandLinePos;
/// <summary>
/// 比对(index=777); 计算Mark(111/222/333/444); 尺寸(1-9); 轴偏移调整(10,20,30...)
/// </summary>
public int index; //index=8 PT1=PT2
/// <summary>
/// 完成后回调
/// </summary>
public Action<SizeTask> finishEvent;
public long createTime = DateTime.Now.Ticks;
//==结果返回
/// <summary>
/// 比对结果(index=777)
/// </summary>
public bool CompResult;
public Mat Zoom_Image_mat;//对比打标图:777比对失败时计算得出后面显示到UI 以后修复台用
public List<List<string>> defectInfor2RestorationDesk, defectInfor2RestorationDeskPage;//对比未通过坐标信息,合并到缺陷检测中的 //打标缺陷转为图纸的坐标;
//MARK点
public double[] MarkPointList = { 0, 0, 0, 0, 0, 0, 0, 0 };
public HObject ContoursAffineTrans1_Out;//index=333时输出供后面多个777比对时输入使用
public double[] posePT;//index=3333 && !isEmpty(sizeTag) 才取此数组值len为0时急停
//
public double PT1,PT2, Shanxian, Circle_Ymm, Circle_Xmm, offsetX, offsetY;
public bool isSucceed;//转换是否成功
public string resultInfo = "";//成功或失败信息
}
public void add(SizeTask task)
{
lock (taskList)
taskList.Add(task);
}
private SizeTask pop()
{
lock (taskList)
{
if (taskList.Count < 1)
return null;
var task = taskList[0];
taskList.RemoveAt(0);
return task;
}
}
public void Dispose()
{
stop();
}
/// <summary>
/// Bitmap转HObject灰度图
/// </summary>
/// <param name="bmp">Bitmap图像</param>
/// <param name="image">HObject图像</param>
private void Bitmap2HObjectBpp8( out HObject image,Bitmap bmp)
{
try
{
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
BitmapData srcBmpData = bmp.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed);
HOperatorSet.GenImage1(out image, "byte", bmp.Width, bmp.Height, srcBmpData.Scan0);
bmp.UnlockBits(srcBmpData);
}
catch (Exception)
{
image = null;
}
}
public void Bitmap2HObjectBpp24( out HObject image, Bitmap bmp)
{
try
{
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
BitmapData srcBmpData = bmp.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
HOperatorSet.GenImageInterleaved(out image, srcBmpData.Scan0, "bgr", bmp.Width, bmp.Height, 0, "byte", 0, 0, 0, 0, -1, 0);
bmp.UnlockBits(srcBmpData);
}
catch (Exception ex)
{
image = null;
}
}
}
}

View File

@ -28,75 +28,80 @@
/// </summary>
private void InitializeComponent()
{
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.cobList = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(358, 85);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(80, 30);
this.btnOK.TabIndex = 0;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(454, 85);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(80, 30);
this.btnCancel.TabIndex = 0;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
//
// textBox1
//
this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.textBox1.ImeMode = System.Windows.Forms.ImeMode.Disable;
this.textBox1.Location = new System.Drawing.Point(12, 22);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(524, 28);
this.textBox1.TabIndex = 1;
//
// cobList
//
this.cobList.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.cobList.FormattingEnabled = true;
this.cobList.Location = new System.Drawing.Point(12, 22);
this.cobList.Name = "cobList";
this.cobList.Size = new System.Drawing.Size(522, 26);
this.cobList.TabIndex = 2;
//
// FrmInput
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(548, 123);
this.Controls.Add(this.cobList);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmInput";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "请输入";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmInput_Load);
this.Shown += new System.EventHandler(this.FrmInput_Shown);
this.ResumeLayout(false);
this.PerformLayout();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.cobList = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(239, 57);
this.btnOK.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(53, 20);
this.btnOK.TabIndex = 0;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(303, 57);
this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(53, 20);
this.btnCancel.TabIndex = 0;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
//
// textBox1
//
this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.textBox1.ImeMode = System.Windows.Forms.ImeMode.Disable;
this.textBox1.Location = new System.Drawing.Point(8, 15);
this.textBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(351, 21);
this.textBox1.TabIndex = 1;
//
// cobList
//
this.cobList.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.cobList.FormattingEnabled = true;
this.cobList.Location = new System.Drawing.Point(8, 15);
this.cobList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cobList.Name = "cobList";
this.cobList.Size = new System.Drawing.Size(349, 20);
this.cobList.TabIndex = 2;
//
// FrmInput
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(365, 82);
this.Controls.Add(this.cobList);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmInput";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "请输入";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmInput_Load);
this.Shown += new System.EventHandler(this.FrmInput_Shown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion

View File

@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -44,7 +44,7 @@
// btnLogin
//
this.btnLogin.Location = new System.Drawing.Point(131, 181);
this.btnLogin.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnLogin.Margin = new System.Windows.Forms.Padding(2);
this.btnLogin.Name = "btnLogin";
this.btnLogin.Size = new System.Drawing.Size(75, 23);
this.btnLogin.TabIndex = 5;
@ -56,7 +56,7 @@
//
this.chkRememberPw.AutoSize = true;
this.chkRememberPw.Location = new System.Drawing.Point(203, 155);
this.chkRememberPw.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chkRememberPw.Margin = new System.Windows.Forms.Padding(2);
this.chkRememberPw.Name = "chkRememberPw";
this.chkRememberPw.Size = new System.Drawing.Size(72, 16);
this.chkRememberPw.TabIndex = 3;
@ -68,7 +68,7 @@
//
this.chkRememberUserCode.AutoSize = true;
this.chkRememberUserCode.Location = new System.Drawing.Point(90, 155);
this.chkRememberUserCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chkRememberUserCode.Margin = new System.Windows.Forms.Padding(2);
this.chkRememberUserCode.Name = "chkRememberUserCode";
this.chkRememberUserCode.Size = new System.Drawing.Size(84, 16);
this.chkRememberUserCode.TabIndex = 4;
@ -80,7 +80,7 @@
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(0, 1);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(359, 95);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@ -90,7 +90,7 @@
// txtUserPw
//
this.txtUserPw.Location = new System.Drawing.Point(90, 133);
this.txtUserPw.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtUserPw.Margin = new System.Windows.Forms.Padding(2);
this.txtUserPw.MaxLength = 16;
this.txtUserPw.Name = "txtUserPw";
this.txtUserPw.PasswordChar = '*';
@ -110,7 +110,7 @@
// txtUserCode
//
this.txtUserCode.Location = new System.Drawing.Point(90, 105);
this.txtUserCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtUserCode.Margin = new System.Windows.Forms.Padding(2);
this.txtUserCode.Name = "txtUserCode";
this.txtUserCode.Size = new System.Drawing.Size(185, 21);
this.txtUserCode.TabIndex = 1;
@ -128,7 +128,7 @@
// button2
//
this.button2.Location = new System.Drawing.Point(281, 181);
this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button2.Margin = new System.Windows.Forms.Padding(2);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(56, 23);
this.button2.TabIndex = 9;
@ -153,13 +153,13 @@
this.Controls.Add(this.button2);
this.Controls.Add(this.btnLogin);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Margin = new System.Windows.Forms.Padding(2);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmLogin";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "自动化视觉检测系统 - v1.2";
this.Text = "自动化视觉检测系统 - v1.2.1";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmLogin_FormClosed);
this.Load += new System.EventHandler(this.FrmLogin_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();

View File

@ -30,11 +30,11 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.HToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -700,7 +700,7 @@
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 80);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(2);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
@ -730,9 +730,9 @@
this.gpbProcessList.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.gpbProcessList.Controls.Add(this.dgvProcess);
this.gpbProcessList.Location = new System.Drawing.Point(2, 202);
this.gpbProcessList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gpbProcessList.Margin = new System.Windows.Forms.Padding(2);
this.gpbProcessList.Name = "gpbProcessList";
this.gpbProcessList.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gpbProcessList.Padding = new System.Windows.Forms.Padding(2);
this.gpbProcessList.Size = new System.Drawing.Size(504, 159);
this.gpbProcessList.TabIndex = 3;
this.gpbProcessList.TabStop = false;
@ -742,37 +742,37 @@
//
this.dgvProcess.AllowUserToAddRows = false;
this.dgvProcess.AllowUserToDeleteRows = false;
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvProcess.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvProcess.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dgvProcess.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvProcess.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCode,
this.colProcessName,
this.colValue});
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvProcess.DefaultCellStyle = dataGridViewCellStyle14;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvProcess.DefaultCellStyle = dataGridViewCellStyle4;
this.dgvProcess.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvProcess.Location = new System.Drawing.Point(2, 16);
this.dgvProcess.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.dgvProcess.Margin = new System.Windows.Forms.Padding(2);
this.dgvProcess.MultiSelect = false;
this.dgvProcess.Name = "dgvProcess";
this.dgvProcess.ReadOnly = true;
this.dgvProcess.RowHeadersVisible = false;
this.dgvProcess.RowHeadersWidth = 62;
dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dgvProcess.RowsDefaultCellStyle = dataGridViewCellStyle15;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dgvProcess.RowsDefaultCellStyle = dataGridViewCellStyle5;
this.dgvProcess.RowTemplate.Height = 30;
this.dgvProcess.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvProcess.Size = new System.Drawing.Size(500, 141);
@ -792,9 +792,9 @@
// colProcessName
//
this.colProcessName.DataPropertyName = "ProcessName";
dataGridViewCellStyle12.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.colProcessName.DefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.colProcessName.DefaultCellStyle = dataGridViewCellStyle2;
this.colProcessName.HeaderText = "工序名称";
this.colProcessName.MinimumWidth = 8;
this.colProcessName.Name = "colProcessName";
@ -805,8 +805,8 @@
// colValue
//
this.colValue.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
dataGridViewCellStyle13.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
this.colValue.DefaultCellStyle = dataGridViewCellStyle13;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
this.colValue.DefaultCellStyle = dataGridViewCellStyle3;
this.colValue.HeaderText = "内容";
this.colValue.MinimumWidth = 8;
this.colValue.Name = "colValue";
@ -822,7 +822,7 @@
this.flpnlResultData.Controls.Add(this.kanban5);
this.flpnlResultData.Controls.Add(this.kanban6);
this.flpnlResultData.Location = new System.Drawing.Point(2, 102);
this.flpnlResultData.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.flpnlResultData.Margin = new System.Windows.Forms.Padding(2);
this.flpnlResultData.Name = "flpnlResultData";
this.flpnlResultData.Size = new System.Drawing.Size(335, 108);
this.flpnlResultData.TabIndex = 5;
@ -838,7 +838,7 @@
this.kanban1.Controls.Add(this.label4);
this.kanban1.Controls.Add(this.label6);
this.kanban1.Location = new System.Drawing.Point(2, 2);
this.kanban1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kanban1.Margin = new System.Windows.Forms.Padding(2);
this.kanban1.Name = "kanban1";
this.kanban1.Size = new System.Drawing.Size(53, 94);
this.kanban1.TabIndex = 14;
@ -943,7 +943,7 @@
this.kanban2.Controls.Add(this.label7);
this.kanban2.Controls.Add(this.label12);
this.kanban2.Location = new System.Drawing.Point(59, 2);
this.kanban2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kanban2.Margin = new System.Windows.Forms.Padding(2);
this.kanban2.Name = "kanban2";
this.kanban2.Size = new System.Drawing.Size(53, 94);
this.kanban2.TabIndex = 17;
@ -1048,7 +1048,7 @@
this.kanban3.Controls.Add(this.label9);
this.kanban3.Controls.Add(this.label15);
this.kanban3.Location = new System.Drawing.Point(116, 2);
this.kanban3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kanban3.Margin = new System.Windows.Forms.Padding(2);
this.kanban3.Name = "kanban3";
this.kanban3.Size = new System.Drawing.Size(53, 94);
this.kanban3.TabIndex = 16;
@ -1153,7 +1153,7 @@
this.kanban4.Controls.Add(this.lblPT);
this.kanban4.Controls.Add(this.label18);
this.kanban4.Location = new System.Drawing.Point(173, 2);
this.kanban4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kanban4.Margin = new System.Windows.Forms.Padding(2);
this.kanban4.Name = "kanban4";
this.kanban4.Size = new System.Drawing.Size(53, 94);
this.kanban4.TabIndex = 15;
@ -1256,7 +1256,7 @@
this.kanban5.Controls.Add(this.lblCompareResult);
this.kanban5.Controls.Add(this.label8);
this.kanban5.Location = new System.Drawing.Point(230, 2);
this.kanban5.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kanban5.Margin = new System.Windows.Forms.Padding(2);
this.kanban5.Name = "kanban5";
this.kanban5.Size = new System.Drawing.Size(53, 94);
this.kanban5.TabIndex = 18;
@ -1335,7 +1335,7 @@
this.kanban6.Controls.Add(this.lblDefectResult);
this.kanban6.Controls.Add(this.label13);
this.kanban6.Location = new System.Drawing.Point(287, 2);
this.kanban6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kanban6.Margin = new System.Windows.Forms.Padding(2);
this.kanban6.Name = "kanban6";
this.kanban6.Size = new System.Drawing.Size(40, 94);
this.kanban6.TabIndex = 19;
@ -1392,9 +1392,9 @@
this.gpbLog.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.gpbLog.Controls.Add(this.lstLog);
this.gpbLog.Location = new System.Drawing.Point(2, 365);
this.gpbLog.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gpbLog.Margin = new System.Windows.Forms.Padding(2);
this.gpbLog.Name = "gpbLog";
this.gpbLog.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gpbLog.Padding = new System.Windows.Forms.Padding(2);
this.gpbLog.Size = new System.Drawing.Size(502, 161);
this.gpbLog.TabIndex = 4;
this.gpbLog.TabStop = false;
@ -1421,9 +1421,9 @@
this.gpbProductInfo.Controls.Add(this.panel1);
this.gpbProductInfo.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.gpbProductInfo.Location = new System.Drawing.Point(2, 2);
this.gpbProductInfo.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gpbProductInfo.Margin = new System.Windows.Forms.Padding(2);
this.gpbProductInfo.Name = "gpbProductInfo";
this.gpbProductInfo.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gpbProductInfo.Padding = new System.Windows.Forms.Padding(2);
this.gpbProductInfo.Size = new System.Drawing.Size(504, 98);
this.gpbProductInfo.TabIndex = 2;
this.gpbProductInfo.TabStop = false;
@ -1442,7 +1442,7 @@
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(2, 16);
this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.panel1.Margin = new System.Windows.Forms.Padding(2);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(500, 80);
this.panel1.TabIndex = 0;
@ -1452,7 +1452,7 @@
this.txtBatchId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtBatchId.Location = new System.Drawing.Point(216, 58);
this.txtBatchId.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtBatchId.Margin = new System.Windows.Forms.Padding(2);
this.txtBatchId.Name = "txtBatchId";
this.txtBatchId.ReadOnly = true;
this.txtBatchId.Size = new System.Drawing.Size(282, 21);
@ -1473,7 +1473,7 @@
this.txtProductCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtProductCode.Location = new System.Drawing.Point(55, 33);
this.txtProductCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtProductCode.Margin = new System.Windows.Forms.Padding(2);
this.txtProductCode.Name = "txtProductCode";
this.txtProductCode.ReadOnly = true;
this.txtProductCode.Size = new System.Drawing.Size(444, 21);
@ -1495,7 +1495,7 @@
this.txtProductSN.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtProductSN.Location = new System.Drawing.Point(55, 58);
this.txtProductSN.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtProductSN.Margin = new System.Windows.Forms.Padding(2);
this.txtProductSN.Name = "txtProductSN";
this.txtProductSN.ReadOnly = true;
this.txtProductSN.Size = new System.Drawing.Size(282, 21);
@ -1516,7 +1516,7 @@
this.txtProductName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtProductName.Location = new System.Drawing.Point(55, 9);
this.txtProductName.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtProductName.Margin = new System.Windows.Forms.Padding(2);
this.txtProductName.Name = "txtProductName";
this.txtProductName.ReadOnly = true;
this.txtProductName.Size = new System.Drawing.Size(444, 21);
@ -1540,7 +1540,7 @@
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer2.IsSplitterFixed = true;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.splitContainer2.Margin = new System.Windows.Forms.Padding(2);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
@ -1552,7 +1552,7 @@
this.splitContainer2.Panel2.Controls.Add(this.gboxDefectList);
this.splitContainer2.Panel2MinSize = 400;
this.splitContainer2.Size = new System.Drawing.Size(463, 523);
this.splitContainer2.SplitterDistance = 25;
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.SplitterWidth = 3;
this.splitContainer2.TabIndex = 10;
//
@ -1561,7 +1561,7 @@
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.splitContainer3.Margin = new System.Windows.Forms.Padding(2);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
@ -1572,7 +1572,7 @@
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.picScanner2);
this.splitContainer3.Size = new System.Drawing.Size(25, 523);
this.splitContainer3.Size = new System.Drawing.Size(26, 523);
this.splitContainer3.SplitterDistance = 226;
this.splitContainer3.SplitterWidth = 3;
this.splitContainer3.TabIndex = 11;
@ -1584,9 +1584,9 @@
this.picScanner1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picScanner1.Dock = System.Windows.Forms.DockStyle.Fill;
this.picScanner1.Location = new System.Drawing.Point(0, 0);
this.picScanner1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.picScanner1.Margin = new System.Windows.Forms.Padding(2);
this.picScanner1.Name = "picScanner1";
this.picScanner1.Size = new System.Drawing.Size(25, 226);
this.picScanner1.Size = new System.Drawing.Size(26, 226);
this.picScanner1.TabIndex = 7;
this.picScanner1.TabStop = false;
//
@ -1596,9 +1596,9 @@
this.picScanner2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picScanner2.Dock = System.Windows.Forms.DockStyle.Fill;
this.picScanner2.Location = new System.Drawing.Point(0, 0);
this.picScanner2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.picScanner2.Margin = new System.Windows.Forms.Padding(2);
this.picScanner2.Name = "picScanner2";
this.picScanner2.Size = new System.Drawing.Size(25, 294);
this.picScanner2.Size = new System.Drawing.Size(26, 294);
this.picScanner2.TabIndex = 9;
this.picScanner2.TabStop = false;
//
@ -1609,10 +1609,10 @@
this.gboxDefectList.Controls.Add(this.pnlBmpList);
this.gboxDefectList.Dock = System.Windows.Forms.DockStyle.Fill;
this.gboxDefectList.Location = new System.Drawing.Point(0, 0);
this.gboxDefectList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gboxDefectList.Margin = new System.Windows.Forms.Padding(2);
this.gboxDefectList.Name = "gboxDefectList";
this.gboxDefectList.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gboxDefectList.Size = new System.Drawing.Size(435, 523);
this.gboxDefectList.Padding = new System.Windows.Forms.Padding(2);
this.gboxDefectList.Size = new System.Drawing.Size(434, 523);
this.gboxDefectList.TabIndex = 3;
this.gboxDefectList.TabStop = false;
this.gboxDefectList.Tag = "0";
@ -1624,7 +1624,7 @@
this.lblDefectAddTag.AutoSize = true;
this.lblDefectAddTag.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblDefectAddTag.ForeColor = System.Drawing.Color.Blue;
this.lblDefectAddTag.Location = new System.Drawing.Point(284, 2);
this.lblDefectAddTag.Location = new System.Drawing.Point(283, 2);
this.lblDefectAddTag.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDefectAddTag.Name = "lblDefectAddTag";
this.lblDefectAddTag.Size = new System.Drawing.Size(0, 12);
@ -1637,16 +1637,16 @@
this.pnlBmpList.AutoSize = true;
this.pnlBmpList.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlBmpList.Location = new System.Drawing.Point(2, 16);
this.pnlBmpList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlBmpList.Margin = new System.Windows.Forms.Padding(2);
this.pnlBmpList.Name = "pnlBmpList";
this.pnlBmpList.Size = new System.Drawing.Size(431, 505);
this.pnlBmpList.Size = new System.Drawing.Size(430, 505);
this.pnlBmpList.TabIndex = 0;
//
// chkBuzzer
//
this.chkBuzzer.AutoSize = true;
this.chkBuzzer.Location = new System.Drawing.Point(677, 27);
this.chkBuzzer.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chkBuzzer.Margin = new System.Windows.Forms.Padding(2);
this.chkBuzzer.Name = "chkBuzzer";
this.chkBuzzer.Size = new System.Drawing.Size(84, 16);
this.chkBuzzer.TabIndex = 13;
@ -1658,7 +1658,7 @@
//
this.chkDoorSensor.AutoSize = true;
this.chkDoorSensor.Location = new System.Drawing.Point(677, 47);
this.chkDoorSensor.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chkDoorSensor.Margin = new System.Windows.Forms.Padding(2);
this.chkDoorSensor.Name = "chkDoorSensor";
this.chkDoorSensor.Size = new System.Drawing.Size(96, 16);
this.chkDoorSensor.TabIndex = 14;
@ -1673,7 +1673,7 @@
this.btnMakeTags.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnMakeTags.ForeColor = System.Drawing.Color.Blue;
this.btnMakeTags.Location = new System.Drawing.Point(881, 29);
this.btnMakeTags.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnMakeTags.Margin = new System.Windows.Forms.Padding(2);
this.btnMakeTags.Name = "btnMakeTags";
this.btnMakeTags.Size = new System.Drawing.Size(65, 34);
this.btnMakeTags.TabIndex = 15;
@ -1685,7 +1685,7 @@
//
this.chkHttpLog.AutoSize = true;
this.chkHttpLog.Location = new System.Drawing.Point(800, 27);
this.chkHttpLog.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chkHttpLog.Margin = new System.Windows.Forms.Padding(2);
this.chkHttpLog.Name = "chkHttpLog";
this.chkHttpLog.Size = new System.Drawing.Size(96, 16);
this.chkHttpLog.TabIndex = 16;
@ -1724,10 +1724,10 @@
this.Controls.Add(this.menuStrip1);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "FrmMain";
this.ShowIcon = false;
this.Text = "自动化视觉检测系统 - v1.2";
this.Text = "自动化视觉检测系统 - v1.2.1";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMian_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmMian_FormClosed);

File diff suppressed because it is too large Load Diff

View File

@ -642,21 +642,21 @@
<data name="toolStripButton3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAANSSURBVFhHtVdbS1RRGF1GGF2hwqdIIughKe2hp3rwIRHq
JYgGFcJbOV7KTAJ77Kkg8ldEVA8F/YRSijC7SRBUUEFJmne7mTrTWvbtmTO6nTnHxgWLc87e37e+tS9n
zxmsFK2oLa1EZZV4FvX7rXn1cQ4NZS04c68Z9YN1qJsWda+2NtQdsLDVQRsaaprRNBdHPOljOcrnW9BY
beH5hUYeR5O3cJAyoeWxtPyhGacf+Ar6qFhLi4b7wMHLQKE9ptCOhiKNzFdsGSY6UbvD0lNoB9aphj1m
4gdw/TeQ/AX0PQG2WPMCKlCxtwmNCZkIQ27IZCtOHbL0BUhT2jOsoVrWnMYUG5PsFBn49A2w2boQQ0lh
B47v6kBVaMYQS82ktKTp9Fmr27rS4NSv+Q7cTqRN9L0GNln3iiENaUlT2qxxR7Wseylkwjn9A7xg8rX/
oTScnrStTHYEZyIftJGHKy5witbS/ahPzHEImOGGGhJ174txlJY0TT43uG6FEvaJOc4Bjziy9aLufTGO
0pKmyefGY4rylRz2iTmy6EMLh+59MY7SkqaF50ZIA70WLgO9vhjHyAaIghBLENqAtBhW8C/ag0lgOwOL
uZ47RTreQ44sFgoy4gyMSNPps614Ati2kPwNuMJdOs5NMid+AGZ15TuTWCwUZBQD0gpqi6pJE90y0ONL
ysUoBpYjZ/4lOCUbfwI1vHYaL/D06uIPxpQvyTGKAWlJU9qujmp+ATaYxFJw43z0iTlGMUCtTxYaHrPA
M5+YYxQD1HpuoeHBTXLTJ+YYxQDfgBsWGh7coTGulVdQDGtAGuPACQuNhmxnQVgDnP53FhYN3LlX9d76
RMWwBrgBB3mN9n+BIz/vpl8/tb6lyGVAOS5Phw6/B8osPDu49tXzlsh3dWIQKJkGLur0ChZg0R5LkYGM
w0yxPGQ6mdcRMDE2CmT/C8dT8YgrpCsTDlsXvgKlFLnLkUxLlEUHrEsGBmRaRdh/i7GpQnzucgNi/+gY
dawrEyyoj8dxBaoAv1xPWlcG3gJFI0AlzR2zJvD+KNsq6GirNWWAJi65meDyDquWdaXRz2ORU/5KI+QG
jFtz3kDNdnKSR3K/allzJt4D+3g+19hj3vGZZwvP5N32SAB/AYFT8UsGgCOBAAAAAElFTkSuQmCC
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAANRSURBVFhHtVdbS1RRGF1GGF2hwqdIIughKe2hp3rwIRHq
JYgGFcJbOV7KTAJ77Kkg8ldEWA8F/YRSijC7SRBUUEFJmne7mTrTWvbtmTO6nTnHpgWLc87e37e+tS9n
zxmsFq2oLa1EZZV4FvX7rfn/4xwaylpw5m4z6ofqUDcj6l5tbag7YGH/B21oqGlG03wc8aSP5ShfaEFj
tYXnFxp5HE3ewkHKhJbH0vKHZpy+7yvoo2ItLRruAQcvA4X2mEI7Goo0Ml+xFZjoRO0OS0+hHVinGvaY
ie/A9V9A8ifQ/xjYYs2LqEDF3iY0JmQiDLkhk604dcjSFyFNac+yhmpZcxrTbEyyU2Tgk9fAZutCDCWF
HTi+qwNVoRlDLDWT0pKm02etbutKg1O/5htwK5E20f8K2GTdq4Y0pCVNabPGbdWy7uWQCef0N/Ccydf+
hdJwetK2MtkRnIl80EYerrjAKVpL92M+McdhYJYbaljUvS/GUVrSNPnc4LoVStgn5jgPPOTI1ou698U4
SkuaJp8bjyjKV3LEJ+bIog8sHLr3xThKS5oWnhshDfRZuAz0+WIcIxsgCkIsQWgD0mJYwd9oD6aA7Qws
5nruFOl4Dzm6VCjIiDMwKk2nz7biSWDbYvJX4Ap36QQ3ybz4HpjTtQdILBUKMooBaQW1RdWkiW4Z6PUl
5WIUAyuRM/8CnJKNP4AaXjuNF3h6dfEHY9qX5BjFgLSkKW1XRzU/AxtMYjm4cT74xByjGKDWRwsNjzng
qU/MMYoBaj2z0PDgJrnpE3OMYoBvwA0LDQ/u0BjXyisohjUgjQnghIVGQ7azIKwBTv9bC4sG7tyrem99
omJYA9yAQ7xG+7/AkZ9306+fWt9S5DKgHJenQ4ffA2UWnh1c++oFS+S7OjkElMwAF3V6BQuwaK+lyEDG
YaZYHjKdzOsImBgfA7L/heOpeMQV0pUJh60LX4BSitzhSGYkyqKD1iUDgzKtIuzvYWyqEJ+73IDYPzZO
HevKBAvq43FCgSrAL9eT1pWBN0DRKFBJc8esCbw/yrYKOtpqTRmgiUtuJri8I6plXWkM8FjklL/UCLkB
49acN1CznZzikTygWtaciXfAPp7PNfaYd3zi2cIzebc9EsAfcrPxSTnKeRsAAAAASUVORK5CYII=
</value>
</data>
<data name="tsbtnDefectImage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -665,11 +665,11 @@
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAG9SURBVFhHYxgS4F+GuvqvFGVjKJf24KW9KM+nEJnk3+kq
x/7nqf//l632H+iA/1+i5f6/DpC89MJVpOiRhQwnVDl1wbH6wmUPAjT/fwyV+Q90wH90B7wLkPr/wlX0
/0MbgRv3THjVodqoBx6Y8f1/7iRC0AFPbAT/3zfl+nzflCcQqhUveOkm2gtl4gekOOChOf9/kPpHFgIz
gdEmATUCBfzLUlb5Fiu/EeiA/1Ah/IAsB1gK/L/vwPX5pbvo3vfBUu1f4xXSfqcpN/7NUVv3Nlftz7dY
gdEmATUCBfzLUlb5Fiu/EeiA/1Ah/IAsB1gK/L/vwPX5pbvo3vfBUu1f4xXSfqcpN/7NUVv3Jlftz7dY
hf80d8AzB+H/rz3F/38Ilv7/LU4BrPdfrhoYjzpg1AGjDhh1wNB3wM9s1ee/UhSv0s0BT92k/l8uDfkP
LM89/tdrsUGlGP6HarG9CZAxA7YHJgMd8JMmDrgU7/Z/44o1/+es34NXwxMrfoOH5tz3qO6A9QdO/1+x
8yhBB4DAXWNB/vumvDMJOeBLrDyopoyFasMPSHEADDyyEPR4Ziv8BN0BH5LVvv3NUZ32PUZOEaqUMCDH
ATDwzkdS7l2glB/QwuRfmcrG/wrJaDdS4gCqgFEHjDpg3YFT9WAHrNtTDxUaBcMZMDAAAJbA3z1DE0Zi
ATDwzkdS7l2glB/QwuRfmcrG/wrJaDdS4gCqgFEHjDpg3YFT9WAHrNtTDxUaBcMZMDAAAIoH3zw7A9x2
AAAAAElFTkSuQmCC
</value>
</data>
@ -677,61 +677,61 @@
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALjSURBVFhH7ZbpS1RRHIZvTU0mQgRFEPSHBAUVbVhkm1pp
mWZm6jjjMs64t0JfIooyx9z3ZVxzGTUbTdOEchlnXx0N+tRXIRDezj3Mhekyls7cSYheeL6dw/Ne7uF3
mWZmOjrjMs64t0JfIooyx9z3ZVxzGTUbTdOEchlnXx0N+tRXIRDezj3Mhekyls7cSYheeL6dw/Ne7uF3
DvPPpGj6AAqn96Pg0z7kT+1B3tRu5E7ugvJjGJQToVBMhCBnfAeyx8QqzxbhQuQr65HLP4hJgW3wbBMm
G5VnjYqEK+CPPFO7VZgC/sozhCgg0e79sZZcMR7aVqxlwor1jFg+Ji7hy2XvtwRW4Hdy8uWrrNyzlGFL
ZGlF373lspEACvxBDoUmZCWylRF5ltMQ+VdvufQd418Bvnxk+Ynvfz62/alnCytX8uXpw34U4MuHlx9j
eOkRhpYe+jxw0lHRNyJ3+5JLhjZYgJz2VW/54NIDDLrvQ+O+B81iMaFwzdPuS542uIECfPmAuwgDRNi/
eOkRhpYe+jxw0lHRNyJ3+5KnDW2wADntq97ywaUHGHTfh8Z9D5rFYkLhmqfdl1wyuIECfPmAuwgDRNi/
WIB+Vz4hD32uXPQ5leuWp2rWWYAv71vMQy+R9boU6HXm4K1TTulxZBOy0G3PDJ68xyVHtzObkIluRwa6
HDJ02aXoZLGlo8MmQbs1jSK4vNMpQ6dDig67hEAk9lS021Kgtt2F2pqMNksyWi13KC3mJIpgcjWRqe0p
aLMRkTUJrdbblBZLIuEWms0JaDLFUxpZjPEByX+5z1tsRGRNRLM1Ac0WIrHEockch0bzDTSYrqPBGIt6
Qh2LIYbit5yNt7zRehMNFiIyxxJiUG++hjrTVSK7glpjNGoMUajRR6GaUKWPRNVCZGBydnxycm681pqi
iYyIjJdRzWK4RGQXUam/gMqF86gglOsiKAHJubAl+LO90hCBCv05SvnCWbzRnaGUEVTz4VDNhQsj58Le
XvzZXqY7DZXuFErnT6J07gReE0pmj1MElXNhS/Bne8ncMbyaPYqXLDNHKEGRc6GPCd5sfzFzGM+/HKIE
Vc6FPiZ4s/3Z54N/R84lY5LZKchsDyRsiU2Tc2FLbJqcSwp5bG6a/H+CF4b5CTYAGhE50nekAAAAAElF
HDJ02aXoZLGlo8OWhnarhCK4vNMpQ6dDig57GoFI7Klot6VAbbsLtTUZbZZktFruUFrMSRTB5GoiU9tT
0GYjImsSWq23KS2WRMItNJsT0GSKpzSyGOMDkv9yn7fYiMiaiGZrApotRGKJQ5M5Do3mG2gwXUeDMRb1
hDoWQwzFbzkbb3mj9SYaLERkjiXEoN58DXWmq0R2BbXGaNQYolCjj0I1oUofiaqFyMDk7Pjk5Nx4rTVF
ExkRGS+jmsVwicguolJ/AZUL51FBKNdFUAKSc2FL8Gd7pSECFfpzlPKFs3ijO0MpI6jmw6GaCxdGzoW9
vfizvUx3GirdKZTOn0Tp3Am8JpTMHqcIKufCluDP9pK5Y3g1exQvWWaOUIIi50IfE7zZ/mLmMJ5/OUQJ
qpwLfUzwZvuzzwf/jpxLxiSzU5DZHkjYEpsm58KW2DQ5lxTy2Nw0+f8ELwzzE/paGgzH1hR8AAAAAElF
TkSuQmCC
</value>
</data>
<data name="tsbtnSizeImage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHLSURBVFhH7dY9SAJhGMBxJyEIWpuCIGiNLDOXBhssMmyw
ITAHLTTIqEEiB6ulqSkIguaoISUKItM+SE/OtK64vpTLMg/D8vSwAsF6sngbKjixNDDuP9299z4vv+Hg
TlASRYbY2mtDUoRuix/ZQpaf99BaShfD6IEURAcf4UbPQrD3Fg6UgWOXjBjBJFgZ2l7YVi34AtZNQhYA
IV0cvgIIJQVu2RHYmzzn6w2uWjRWuOxiDLxtpzkBzmYc1hqxlEOCd6FRznyKwDS65C4fwNveLakXsFZi
jlSFKtERnwoPJ2tC2viKXxEAtMTdzwDHgLdTqQs17QwbElPxsUw/O/48ETOlrZTxPhPqY6DoAKKLggt1
FMKGJDDmDLDjAHemNNDGB+ABPIAH8IDSB0QGH6M3+sTJnwFwxQnsjZ5B9iMiJ1UgRI8EpIoUHiopsVtG
zDibd9NFAaxrPLC85IF5m4NzYFuK19nr3ZcFB9h29mFxw50T8NamyFfhkOJzOQEaJuXvCKrRGHf5AD7C
ZIQ8+25EvgPYpyxg9kqXqEZbc/cTwEeUmq661jOd9+aMNjkJovDwS/7/jb8BFCQewAOsO17LO8DqsKAl
vv+cQPAK+g31RrDqJzoAAAAASUVORK5CYII=
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHLSURBVFhH7dY9SAJhGMBxpyAIWpuCIGiN7NOlwQaLDB1s
CKxBCw00bJCowWppagoCoTlqyIiCyLSE8uQs64qzD+uyzMPQPE/MQLCeNN6GCk4sDYz7T3fvvc/Lbzi4
E5REwZF43Z2WFaLb4ke2kxUXfbSKUocxejgBIV0S7jVxuOp/gCOZ73RfTIxirVg52l7Y1k34ItZLQgYA
fnUUvgIIGQVO8QlYW1wXm437dWiscFmbMXB3nuUE2Ntw2GjCErZWXI5GOTuU+mbRJXf5ALJ7d0RuwDoI
M6nwV6EjPhUwsLV+VXTNI/UBWuLuZ4BTwLuoxKWStge0sZnoeHooPvkyFTamLNf6SNo/yEDRAYScgktl
CAJaFpiJNMQnASLGFND6J+ABPIAH8IDSBwR1ydC9Jub9MwAu9cLe2DlkPiISUgFl6JGAVJBlxzKq2Skm
5uxtjlRRAJsDLlhZdsHCqo1zYFeE11sbnDcFB6w6DmBpy5kTkG1beFhpE+HmnIABJuHpvlKiMe7yAXyE
iQlJ5t0IfgewzxnA/K06VoO25u4ngI8oJV19p2F6HifSKnYahAHDa/7/jb8BFCQewAMsDrfpHWCxmdAS
339OIHgD1J71QoDsMyIAAAAASUVORK5CYII=
</value>
</data>
<data name="tsbtnLight.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAURSURBVFhH7VV7TNVlGH7JRjNbtS7L1uZWs7m12tzc2qpV
W6vW5qq15bTW1tZlNqgGQzAs5ICYXAK5CUPuxxBQQA4YCAIhKHfFEFDuCErCRDJIiXHO0/N2Php/0cGO
/eWzffvt9/u+93mf7739ZDlAlmywWyVy3irNc1a5BKtAn/qu33XfHHUvHAdknT3L4whyVgEH7wd+vAfI
9gCsK5zPbPln2bOlSM8b0/8OR5a8M523agZHXwAqXgOOv8XFZ/nzQOk6wPY0ULQGyHuYAigoUzCTKdNq
ZyhuHY7Mu7aggE5qNgGtAUBnBNAdCZzbCZz2AhreB2pfB6pfAY5tAI6sBXIeBNIZDS5Hhmw2VMsH9sv6
qYMP3EQVnXTQ8UgxMH4CmKgBLhUAAwlAVyCFfAI0bwFOvQtUvQqUPMs0PQKkCn5LlRvKYyiXh/k0z5Mo
fpHk/nRuA37vAWbHgT+GgakW4EoRMBwP9HzLyHwNtH8ONG1mNBgR23OsD0YiRTCfJPWG0nU4kuUNpJOg
lGQdDPl4ndO5Ym4SmO4CJo8DY9kUwf2+IOA8U3SWaWlkNCpZI4dZGymeQBJTsU82GmrXYI8XK1IpoGwj
8/0DBfzsvLk6nx0DZs4B1yhgPAcYjaWIPUxJKEVsB85sBereo3gWafZjQCI7I1HyDLVrmI2SCSSy1Y6+
ydBamIJCOmTYp7u56Pz6KeBqKdOQxXqI434URYQDvSzODh8W50fsEkYh5ykgTqB8hvrfgUhZjRhWcTwF
FL3EkH5F4iSGm0V4tYqhrzbOefvLyXQe41zDFNHPKHSyZppYmBVs19xnnDzkc8TJo8bF0nBEy1pEUUDc
vSRgMdV8APzCmw3so8MDwK90PKY3X+T84oKAMKaMtdD0GQUwfWqvPORTXuNiaSBc1nBR9UpOPBKUk6iJ
ee0KpohoOmPljzDs6nTxGqKA3l1MAQU0fOq0U/sYCiCfY7eLEUCweHYGyzz23A1kcAiVsA7qPmYt+LHI
WA8DnAlDFDKstzZL3/X7hRDnOT2vdmpPHuUz9K5hPlTaEcooJHHEHnqZo5f93fwlw/sdb/k9nfG26nRo
wbnent91X89VsRXVTu2VJ1TaDLVrcATLTlhoGMVWzFrPlnqbt2JYz7DAunnLXm07Ol1Y+q7fdV/P6Xm1
U3vy2C0SYqhdg2OHPDGzTaYRRBEJT/JHwxFbwSg0eHPYcPx2s9p72Hb9vH0fo3B+t/O77uu5XP4b1I72
417yp/IZateBQPkGOyggjL/f/SymQrZVFXPb7MuC5I0HM5h/q/N5gcOojSNZ9/VcCs+rHe3tgRJmKJcH
bJIVdn/JwXaKiHicBcXJZuOEa+bY7aPjUc6CsQo+S/jOtmxlC5ZxAKXznJ6nnT1AypXHUC4f2hH2bVKN
AP7noznVCvhnbGPIB+l0gpNxssP5HOJ7K0d2MQXsZeX7e8DuJ+UOX1lpqG4dSjLvI/UIYkHlfwi06Bzg
v+H6IHBjwvkcqXV+z2P+Q1bD7iOVbnG+AJI95J1og1/aMYTk1SO27CxyW0Zx6PRlpNf2ILKoCUHWKvgm
2/BFTD7gJfcZU/chJj4x1xUBltjkVGPiXmgE0k70orLrCi5OzWFylk1w7SYa+yeQe7IHUcUt2HW44e8I
GBP3wjvBZnElAluj8y3GxL24EwGFClgqAirAHL098EsttwQHhzuWiMDtu/1i7P2p3bJYQERh4//j+A7c
D5G/AFoWc7tnHzTjAAAAAElFTkSuQmCC
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAUQSURBVFhH7VV7TNVlGH7JRjNbtS7L1uZWs7m12tzc2qpV
W6vW5qq15bTW1tZlNqgGQzAs5IAYAoHchCH3YwgoIAcMBIEQlLtiCCh3BCVhIhmkxDjn6Xk7H42/6GDH
/vLZvv32+33f+7zP995+shwgSzbYrRI5b5XmOatcglWgT33X77pvjroXjgOyzp7lcQQ5q4CD9wM/3gNk
ewDWFc5ntvyz7NlSpOeN6X+HI0vemc5bNYOjLwAVrwHH3+Lis/x5oHQdYHsaKFoD5D1MARSUKZjJlGm1
MxS3DkfmXVtQQCc1m4DWAKAzAuiOBM7tBE57AQ3vA7WvA9WvAMc2AEfWAjkPAumMBpcjQzYbquUD+2X9
1MEHbqKKTjroeKQYGD8BTNQAlwqAgQSgK5BCPgGatwCn3gWqXgVKnmWaHgFSBb+lyg3lMZTLw3ya50kU
v0hyfzq3Ab/3ALPjwB/DwFQLcKUIGI4Her5lZL4G2j8HmjYzGoyI7TnWByORIphPknpD6TocyfIG0klQ
SrIOhny8zulcMTcJTHcBk8eBsWyK4H5fEHCeKTrLtDQyGpWskcOsjRRPIImp2CcbDbVrsMeLFakUULaR
+f6BAn523lydz44BM+eAaxQwngOMxlJEOFMSShHbgTNbgbr3KJ5Fmv0YkMjOSJQ8Q+0aZqNkAolstaNv
MrQWpqCQDhn26W4uOr9+CrhayjRksR7iuB9FEXuAXhZnhw+L8yN2CaOQ8xQQJ1A+Q/3vQKSsRgyrOJ4C
il5iSL8icRLDzSK8WsXQVxvnvP3lZDqPca5hiuhnFDpZM00szAq2a+4zTh7yOeLkUeNiaTiiZS2iKCDu
XhKwmGo+AH7hzQb20eEB4Fc6HtObL3J+cUFAGFPGWmj6jAKYPrVXHvIpr3GxNLBH1nBR9UpOPBKUk6iJ
ee0KpohoOmPljzDs6nTxGqKA3l1MAQU0fOq0U/sYCiCfY7eLEUCweHYGyzzC7wYyOIRKWAd1H7MW/Fhk
rIcBzoQhChnWW5ul7/r9QojznJ5XO7Unj/IZetcwHyrtCGUUkjhiD73M0cv+bv6S4f2Ot/yeznhbdTq0
4Fxvz++6r+eq2Ipqp/bKEypthto1OIJlJyw0jGIrZq1nS73NWzGsZ1hg3bxlr7YdnS4sfdfvuq/n9Lza
qT157BYJMdSuwbFDnpjZJtMIooiEJ/mj4YitYBQavDlsOH67We09bLt+3r6PUTi/2/ld9/VcLv8Nakf7
cS/5U/kMtetAoHyDHRQQxt/vfhZTIduqirlt9mVB8saDGcy/1fm8wGHUxpGs+3ouhefVjvb2QAkzlMsD
NskKu7/kYDtFRDzOguJks3HCNXPs9tHxKGfBWAWfJXxnW7ayBcs4gNJ5Ts/Tzh4g5cpjKJcP7Qj7NqlG
AP/z0ZxqBfwztjHkg3Q6wck42eF8DvG9lSO7mAL2svL9PWD3k3KHr6w0VLcOJZn3kXoEsaDyPwRadA7w
33B9ELgx4XyO1Dq/5zH/Iath95FKtzhfAMke8k60wS/tGELy6hFbdha5LaM4dPoy0mt7EFnUhCBrFXyT
bfgiJh/wkvuMqfsQE5+Y64oAS2xyqjFxLzQCaSd6Udl1BRen5jA5yya4dhON/RPIPdmDqOIW7Drc8HcE
jIl74Z1gs7gSga3R+RZj4l7ciYBCBSwVARVgjt4e+KWWW4KDwx1LROD23X4x9v7UblksIKKw8f9xfAfu
h8hfV8RzuqW13GsAAAAASUVORK5CYII=
</value>
</data>
<data name="tsbtnLog.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -102,6 +102,8 @@
this.label6 = new System.Windows.Forms.Label();
this.groupBox22 = new System.Windows.Forms.GroupBox();
this.panel22 = new System.Windows.Forms.Panel();
this.numOffset = new System.Windows.Forms.NumericUpDown();
this.label7 = new System.Windows.Forms.Label();
this.label61 = new System.Windows.Forms.Label();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox14 = new System.Windows.Forms.GroupBox();
@ -235,6 +237,7 @@
this.numHttpPort = new System.Windows.Forms.NumericUpDown();
this.label49 = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.cbOpenFlawDistribution = new System.Windows.Forms.CheckBox();
this.toolStrip1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
@ -263,6 +266,7 @@
this.panel23.SuspendLayout();
this.groupBox22.SuspendLayout();
this.panel22.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numOffset)).BeginInit();
this.tabPage1.SuspendLayout();
this.groupBox14.SuspendLayout();
this.panel14.SuspendLayout();
@ -1210,6 +1214,8 @@
// panel22
//
this.panel22.BackColor = System.Drawing.Color.White;
this.panel22.Controls.Add(this.numOffset);
this.panel22.Controls.Add(this.label7);
this.panel22.Controls.Add(this.label61);
this.panel22.Controls.Add(this.cobTension_PortNum);
this.panel22.Dock = System.Windows.Forms.DockStyle.Fill;
@ -1219,10 +1225,44 @@
this.panel22.Size = new System.Drawing.Size(462, 37);
this.panel22.TabIndex = 0;
//
// numOffset
//
this.numOffset.DecimalPlaces = 2;
this.numOffset.Increment = new decimal(new int[] {
1,
0,
0,
131072});
this.numOffset.Location = new System.Drawing.Point(296, 9);
this.numOffset.Margin = new System.Windows.Forms.Padding(2);
this.numOffset.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.numOffset.Minimum = new decimal(new int[] {
10,
0,
0,
-2147483648});
this.numOffset.Name = "numOffset";
this.numOffset.Size = new System.Drawing.Size(120, 21);
this.numOffset.TabIndex = 13;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(234, 13);
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(53, 12);
this.label7.TabIndex = 12;
this.label7.Text = "补偿值:";
//
// label61
//
this.label61.AutoSize = true;
this.label61.Location = new System.Drawing.Point(5, 12);
this.label61.Location = new System.Drawing.Point(5, 13);
this.label61.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label61.Name = "label61";
this.label61.Size = new System.Drawing.Size(41, 12);
@ -2687,6 +2727,7 @@
//
// tabPage9
//
this.tabPage9.Controls.Add(this.cbOpenFlawDistribution);
this.tabPage9.Controls.Add(this.ckSkipSizeFailed);
this.tabPage9.Controls.Add(this.chkSkipSmallAxis);
this.tabPage9.Controls.Add(this.chkSkipScannerCC);
@ -2703,7 +2744,7 @@
this.tabPage9.Name = "tabPage9";
this.tabPage9.Size = new System.Drawing.Size(482, 529);
this.tabPage9.TabIndex = 8;
this.tabPage9.Text = "传感器过滤";
this.tabPage9.Text = "功能过滤";
this.tabPage9.UseVisualStyleBackColor = true;
//
// ckSkipSizeFailed
@ -2923,6 +2964,17 @@
this.label49.TabIndex = 4;
this.label49.Text = "本机IP";
//
// cbOpenFlawDistribution
//
this.cbOpenFlawDistribution.AutoSize = true;
this.cbOpenFlawDistribution.Location = new System.Drawing.Point(19, 304);
this.cbOpenFlawDistribution.Margin = new System.Windows.Forms.Padding(2);
this.cbOpenFlawDistribution.Name = "cbOpenFlawDistribution";
this.cbOpenFlawDistribution.Size = new System.Drawing.Size(96, 16);
this.cbOpenFlawDistribution.TabIndex = 12;
this.cbOpenFlawDistribution.Text = "启用缺陷分布";
this.cbOpenFlawDistribution.UseVisualStyleBackColor = true;
//
// FrmSysSetting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -2980,6 +3032,7 @@
this.groupBox22.ResumeLayout(false);
this.panel22.ResumeLayout(false);
this.panel22.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numOffset)).EndInit();
this.tabPage1.ResumeLayout(false);
this.groupBox14.ResumeLayout(false);
this.panel14.ResumeLayout(false);
@ -3271,5 +3324,8 @@
private System.Windows.Forms.Panel panel22;
private System.Windows.Forms.Label label61;
private System.Windows.Forms.CheckBox ckSkipSizeFailed;
private System.Windows.Forms.NumericUpDown numOffset;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.CheckBox cbOpenFlawDistribution;
}
}

View File

@ -1,465 +1,474 @@
using Newtonsoft.Json.Linq;
using ProductionControl.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace ProductionControl
{
public partial class FrmSysSetting : Form
{
public FrmSysSetting()
{
InitializeComponent();
}
private void FrmSetParams_Load(object sender, EventArgs e)
{
initData();
}
private void initData()
{
string configPath = Application.StartupPath + "\\SysConfig.ini";
string lsTmp = "";
var comNameList = Utils.SSerialPort.getPortNames().ToList();
comNameList.ForEach(comName =>
{
this.cobLight_PortNum.Items.Add(comName);
this.cobTension_PortNum.Items.Add(comName);
this.cobSmallAxis_ComName.Items.Add(comName);
});
//Skip
this.chkSkipAxis0.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis0") == "1";
this.chkSkipAxis1.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis1") == "1";
this.chkSkipAxis2.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis2") == "1";
this.chkSkipAxis3.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis3") == "1";
this.chkSkipTension.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipTension") == "1";
this.chkSkipHeight.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipHeight") == "1";
this.chkSkipLight.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipLight") == "1";
this.chkSkipScannerGL.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipScannerGL") == "1";
this.chkSkipScannerCC.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipScannerCC") == "1";
this.chkSkipSmallAxis.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipSmallAxis") == "1";
this.ckSkipSizeFailed.Checked = Util.ReadIniValue(configPath, "SKIP", "MarkErrorStop") == "1";
//DEV
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis0PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis1PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis2PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis3PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis0HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis1HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis2HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis3HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
var lstLightName = Utils.EnumUtil.GetNamesArr<LightDevNameEnum>();
this.cobLight_Name.Items.AddRange(lstLightName);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Light_Name");
if (string.IsNullOrWhiteSpace(lsTmp))
this.cobLight_Name.SelectedIndex = 0;
else
this.cobLight_Name.Text = ((LightDevNameEnum)Convert.ToInt32(lsTmp)).ToString();
this.cobLight_PortNum.Text = "COM" + Util.ReadIniValue(configPath, "DEV", "Light_PortNum");
this.cobTension_PortNum.Text = "COM" + Util.ReadIniValue(configPath, "DEV", "Tension_PortNum");
this.cobSmallAxis_ComName.Text = Util.ReadIniValue(configPath, "DEV", "SmallAxis_ComName");
this.cobAxis0HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis0_HomeDir"));
this.cobAxis1HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis1_HomeDir"));
this.cobAxis2HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis2_HomeDir"));
this.cobAxis3HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis3_HomeDir"));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelLow");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeVelLow = JArray.Parse(lsTmp);
this.numAxis0HomeVelLow.Value = Axis_HomeVelLow.Count > 0 ? (decimal)Axis_HomeVelLow[0] : 0;
this.numAxis1HomeVelLow.Value = Axis_HomeVelLow.Count > 1 ? (decimal)Axis_HomeVelLow[1] : 0;
this.numAxis2HomeVelLow.Value = Axis_HomeVelLow.Count > 2 ? (decimal)Axis_HomeVelLow[2] : 0;
this.numAxis3HomeVelLow.Value = Axis_HomeVelLow.Count > 3 ? (decimal)Axis_HomeVelLow[3] : 0;
}
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelHigh");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeVelHigh = JArray.Parse(lsTmp);
this.numAxis0HomeVelHigh.Value = Axis_HomeVelHigh.Count > 0 ? (decimal)Axis_HomeVelHigh[0] : 0;
this.numAxis1HomeVelHigh.Value = Axis_HomeVelHigh.Count > 1 ? (decimal)Axis_HomeVelHigh[1] : 0;
this.numAxis2HomeVelHigh.Value = Axis_HomeVelHigh.Count > 2 ? (decimal)Axis_HomeVelHigh[2] : 0;
this.numAxis3HomeVelHigh.Value = Axis_HomeVelHigh.Count > 3 ? (decimal)Axis_HomeVelHigh[3] : 0;
}
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeAcc");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeAcc = JArray.Parse(lsTmp);
this.numAxis0HomeAcc.Value = Axis_HomeAcc.Count > 0 ? (decimal)Axis_HomeAcc[0] : 0;
this.numAxis1HomeAcc.Value = Axis_HomeAcc.Count > 1 ? (decimal)Axis_HomeAcc[1] : 0;
this.numAxis2HomeAcc.Value = Axis_HomeAcc.Count > 2 ? (decimal)Axis_HomeAcc[2] : 0;
this.numAxis3HomeAcc.Value = Axis_HomeAcc.Count > 3 ? (decimal)Axis_HomeAcc[3] : 0;
}
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeDec");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeDec = JArray.Parse(lsTmp);
this.numAxis0HomeDec.Value = Axis_HomeDec.Count > 0 ? (decimal)Axis_HomeDec[0] : 0;
this.numAxis1HomeDec.Value = Axis_HomeDec.Count > 1 ? (decimal)Axis_HomeDec[1] : 0;
this.numAxis2HomeDec.Value = Axis_HomeDec.Count > 2 ? (decimal)Axis_HomeDec[2] : 0;
this.numAxis3HomeDec.Value = Axis_HomeDec.Count > 3 ? (decimal)Axis_HomeDec[3] : 0;
}
this.txtHeightDev_IP.Text = Util.ReadIniValue(configPath, "DEV", "HeightDev_IP");
this.numHeightDev_Port.Value = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "HeightDev_Port"));
this.numHeightDev_SafeValue.Value = Convert.ToDecimal(Util.ReadIniValue(configPath, "DEV", "HeightDev_SafeValue"));
lsTmp = Util.ReadIniValue(configPath, "DEV", "HeightDev_BaseList");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray HeightDev_BaseList = JArray.Parse(lsTmp);
this.numHeightBase0.Value = HeightDev_BaseList.Count > 0 ? (decimal)HeightDev_BaseList[0] : 0;
this.numHeightBase1.Value = HeightDev_BaseList.Count > 1 ? (decimal)HeightDev_BaseList[1] : 0;
this.numHeightBase2.Value = HeightDev_BaseList.Count > 2 ? (decimal)HeightDev_BaseList[2] : 0;
this.numHeightBase3.Value = HeightDev_BaseList.Count > 3 ? (decimal)HeightDev_BaseList[3] : 0;
this.numHeightBase4.Value = HeightDev_BaseList.Count > 4 ? (decimal)HeightDev_BaseList[4] : 0;
}
this.txtIO_DevNum.Text = Util.ReadIniValue(configPath, "DEV", "IOCard_DeviceNum");
this.txtDefect_Path.Text = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath");
this.txtDefect_Small_Path.Text = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath");
this.txtDefect_Compress_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "Defect_Compress_SavePath");
//int liTmp = -1;
double ldTmp = -1;
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkDefect_Path_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numDefect_Path_AutoClear.Value = (decimal)ldTmp;
using Newtonsoft.Json.Linq;
using ProductionControl.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace ProductionControl
{
public partial class FrmSysSetting : Form
{
public FrmSysSetting()
{
InitializeComponent();
}
private void FrmSetParams_Load(object sender, EventArgs e)
{
initData();
}
private void initData()
{
string configPath = Application.StartupPath + "\\SysConfig.ini";
string lsTmp = "";
var comNameList = Utils.SSerialPort.getPortNames().ToList();
comNameList.ForEach(comName =>
{
this.cobLight_PortNum.Items.Add(comName);
this.cobTension_PortNum.Items.Add(comName);
this.cobSmallAxis_ComName.Items.Add(comName);
});
//Skip
this.chkSkipAxis0.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis0") == "1";
this.chkSkipAxis1.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis1") == "1";
this.chkSkipAxis2.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis2") == "1";
this.chkSkipAxis3.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipAxis3") == "1";
this.chkSkipTension.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipTension") == "1";
this.chkSkipHeight.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipHeight") == "1";
this.chkSkipLight.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipLight") == "1";
this.chkSkipScannerGL.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipScannerGL") == "1";
this.chkSkipScannerCC.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipScannerCC") == "1";
this.chkSkipSmallAxis.Checked = Util.ReadIniValue(configPath, "SKIP", "SkipSmallAxis") == "1";
this.ckSkipSizeFailed.Checked = Util.ReadIniValue(configPath, "SKIP", "MarkErrorStop") == "1";
this.cbOpenFlawDistribution.Checked = Util.ReadIniValue(configPath, "SKIP", "OpenFlawDistribution") == "1";
//DEV
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis0PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis1PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis2PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_PulseOutMode");
EnumUtil.BindToEnumName<AxisPulseOutMode>(this.cobAxis3PulseOutMode, typeof(AxisPulseOutMode), lsTmp == "" ? AxisPulseOutMode.O_CW_CCW : (AxisPulseOutMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis0_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis0HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis1_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis1HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis2_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis2HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis3_HomeMode");
EnumUtil.BindToEnumName<AxitHomeMode>(this.cobAxis3HomeMode, typeof(AxitHomeMode), lsTmp == "" ? AxitHomeMode.MODE11_LmtSearch_Ref : (AxitHomeMode)Convert.ToInt32(lsTmp));
var lstLightName = Utils.EnumUtil.GetNamesArr<LightDevNameEnum>();
this.cobLight_Name.Items.AddRange(lstLightName);
lsTmp = Util.ReadIniValue(configPath, "DEV", "Light_Name");
if (string.IsNullOrWhiteSpace(lsTmp))
this.cobLight_Name.SelectedIndex = 0;
else
this.cobLight_Name.Text = ((LightDevNameEnum)Convert.ToInt32(lsTmp)).ToString();
this.cobLight_PortNum.Text = "COM" + Util.ReadIniValue(configPath, "DEV", "Light_PortNum");
this.cobTension_PortNum.Text = "COM" + Util.ReadIniValue(configPath, "DEV", "Tension_PortNum");
lsTmp = Util.ReadIniValue(configPath, "DEV", "Tension_Offset");
if (string.IsNullOrWhiteSpace(lsTmp))
this.numOffset.Value = 0;
else
this.numOffset.Value = (decimal)double.Parse(lsTmp);
this.cobSmallAxis_ComName.Text = Util.ReadIniValue(configPath, "DEV", "SmallAxis_ComName");
this.cobAxis0HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis0_HomeDir"));
this.cobAxis1HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis1_HomeDir"));
this.cobAxis2HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis2_HomeDir"));
this.cobAxis3HomeDir.SelectedIndex = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "Axis3_HomeDir"));
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelLow");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeVelLow = JArray.Parse(lsTmp);
this.numAxis0HomeVelLow.Value = Axis_HomeVelLow.Count > 0 ? (decimal)Axis_HomeVelLow[0] : 0;
this.numAxis1HomeVelLow.Value = Axis_HomeVelLow.Count > 1 ? (decimal)Axis_HomeVelLow[1] : 0;
this.numAxis2HomeVelLow.Value = Axis_HomeVelLow.Count > 2 ? (decimal)Axis_HomeVelLow[2] : 0;
this.numAxis3HomeVelLow.Value = Axis_HomeVelLow.Count > 3 ? (decimal)Axis_HomeVelLow[3] : 0;
}
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeVelHigh");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeVelHigh = JArray.Parse(lsTmp);
this.numAxis0HomeVelHigh.Value = Axis_HomeVelHigh.Count > 0 ? (decimal)Axis_HomeVelHigh[0] : 0;
this.numAxis1HomeVelHigh.Value = Axis_HomeVelHigh.Count > 1 ? (decimal)Axis_HomeVelHigh[1] : 0;
this.numAxis2HomeVelHigh.Value = Axis_HomeVelHigh.Count > 2 ? (decimal)Axis_HomeVelHigh[2] : 0;
this.numAxis3HomeVelHigh.Value = Axis_HomeVelHigh.Count > 3 ? (decimal)Axis_HomeVelHigh[3] : 0;
}
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeAcc");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeAcc = JArray.Parse(lsTmp);
this.numAxis0HomeAcc.Value = Axis_HomeAcc.Count > 0 ? (decimal)Axis_HomeAcc[0] : 0;
this.numAxis1HomeAcc.Value = Axis_HomeAcc.Count > 1 ? (decimal)Axis_HomeAcc[1] : 0;
this.numAxis2HomeAcc.Value = Axis_HomeAcc.Count > 2 ? (decimal)Axis_HomeAcc[2] : 0;
this.numAxis3HomeAcc.Value = Axis_HomeAcc.Count > 3 ? (decimal)Axis_HomeAcc[3] : 0;
}
lsTmp = Util.ReadIniValue(configPath, "DEV", "Axis_HomeDec");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray Axis_HomeDec = JArray.Parse(lsTmp);
this.numAxis0HomeDec.Value = Axis_HomeDec.Count > 0 ? (decimal)Axis_HomeDec[0] : 0;
this.numAxis1HomeDec.Value = Axis_HomeDec.Count > 1 ? (decimal)Axis_HomeDec[1] : 0;
this.numAxis2HomeDec.Value = Axis_HomeDec.Count > 2 ? (decimal)Axis_HomeDec[2] : 0;
this.numAxis3HomeDec.Value = Axis_HomeDec.Count > 3 ? (decimal)Axis_HomeDec[3] : 0;
}
this.txtHeightDev_IP.Text = Util.ReadIniValue(configPath, "DEV", "HeightDev_IP");
this.numHeightDev_Port.Value = Convert.ToInt32(Util.ReadIniValue(configPath, "DEV", "HeightDev_Port"));
this.numHeightDev_SafeValue.Value = Convert.ToDecimal(Util.ReadIniValue(configPath, "DEV", "HeightDev_SafeValue"));
lsTmp = Util.ReadIniValue(configPath, "DEV", "HeightDev_BaseList");
if (!string.IsNullOrWhiteSpace(lsTmp))
{
JArray HeightDev_BaseList = JArray.Parse(lsTmp);
this.numHeightBase0.Value = HeightDev_BaseList.Count > 0 ? (decimal)HeightDev_BaseList[0] : 0;
this.numHeightBase1.Value = HeightDev_BaseList.Count > 1 ? (decimal)HeightDev_BaseList[1] : 0;
this.numHeightBase2.Value = HeightDev_BaseList.Count > 2 ? (decimal)HeightDev_BaseList[2] : 0;
this.numHeightBase3.Value = HeightDev_BaseList.Count > 3 ? (decimal)HeightDev_BaseList[3] : 0;
this.numHeightBase4.Value = HeightDev_BaseList.Count > 4 ? (decimal)HeightDev_BaseList[4] : 0;
}
this.txtIO_DevNum.Text = Util.ReadIniValue(configPath, "DEV", "IOCard_DeviceNum");
this.txtDefect_Path.Text = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath");
this.txtDefect_Small_Path.Text = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath");
this.txtDefect_Compress_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "Defect_Compress_SavePath");
//int liTmp = -1;
double ldTmp = -1;
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkDefect_Path_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numDefect_Path_AutoClear.Value = (decimal)ldTmp;
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_Compress_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkDefect_Compress_SavePath_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numDefect_Compress_SavePath_AutoClear.Value = (decimal)ldTmp;
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkDefect_Compress_SavePath_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numDefect_Compress_SavePath_AutoClear.Value = (decimal)ldTmp;
lsTmp = Util.ReadIniValue(configPath, "DEV", "Defect_Small_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkDefect_Small_Path_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numDefect_Small_Path_AutoClear.Value = (decimal)ldTmp;
this.chkSaveAllDefectImg.Checked= (Util.ReadIniValue(configPath, "DEV", "SaveAllDefectImg") == "1");
this.chkMakeTag.Checked= (Util.ReadIniValue(configPath, "DEV", "MakeTag") == "1");
this.txtSizeEnginePath.Text= Util.ReadIniValue(configPath, "DEV", "SizeEnginePath");
this.txtSizeBmp_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath");
this.txtSizeBmp_Compare_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath");
this.txtSizeBmp_Zoom_Image_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
this.chkSaveAllDefectImg.Checked= (Util.ReadIniValue(configPath, "DEV", "SaveAllDefectImg") == "1");
this.chkMakeTag.Checked= (Util.ReadIniValue(configPath, "DEV", "MakeTag") == "1");
this.txtSizeEnginePath.Text= Util.ReadIniValue(configPath, "DEV", "SizeEnginePath");
this.txtSizeBmp_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath");
this.txtSizeBmp_Compare_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath");
this.txtSizeBmp_Zoom_Image_SavePath.Text = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath");
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkSizeBmp_SavePath_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numSizeBmp_SavePath_AutoClear.Value = (decimal)ldTmp;
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
if (ldTmp > -1) numSizeBmp_SavePath_AutoClear.Value = (decimal)ldTmp;
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkSizeBmp_Compare_SavePath_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numSizeBmp_Compare_SavePath_AutoClear.Value = (decimal)ldTmp;
if (ldTmp > -1) numSizeBmp_Compare_SavePath_AutoClear.Value = (decimal)ldTmp;
lsTmp = Util.ReadIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath_AutoClear");
//if (Util.IsNumber(lsTmp)) liTmp = Convert.ToInt32(lsTmp);
ldTmp = Convert.ToDouble(lsTmp);
chkSizeBmp_Zoom_Image_SavePath_AutoClear.Checked = (ldTmp > -1);
if (ldTmp > -1) numSizeBmp_Zoom_Image_SavePath_AutoClear.Value = (decimal)ldTmp;
//DB
this.txtDBCon.Text = Util.ReadIniValue(configPath, "DB", "DBConStr");
//HTTP
this.txtLocalIp.Text = Util.ReadIniValue(configPath, "HTTP", "LocalIp");
lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalHttpPort");
if (Util.IsNumber(lsTmp))this.numHttpPort.Value = Convert.ToInt32(lsTmp);
//lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalSocketPort");
//if (Util.IsNumber(lsTmp)) this.numSocketPort.Value = Convert.ToInt32(lsTmp);
//LOG
this.txtLogPath.Text = Util.ReadIniValue(configPath, "LOG", "LogPath");
}
private void tsbtnSave_Click(object sender, EventArgs e)
{
try
{
string configPath = Application.StartupPath + "\\SysConfig.ini";
//DEV
string lsLight_Name = this.cobLight_Name.Text.Trim();
if (lsLight_Name == "")
throw new Exception("请选择光源提供商!");
LightDevNameEnum Light_Name = Utils.EnumUtil.Convert2Enum<LightDevNameEnum>(lsLight_Name);
string Light_PortNum = this.cobLight_PortNum.Text.Trim();
string Tension_PortNum = this.cobTension_PortNum.Text.Trim();
string SmallAxis_ComName = this.cobSmallAxis_ComName.Text.Trim();
if (Light_PortNum == "" || Tension_PortNum == "" || SmallAxis_ComName == "")
throw new Exception("请设置设备COM端口");
string HeightDev_IP = this.txtHeightDev_IP.Text;
int HeightDev_Port = (int)this.numHeightDev_Port.Value;
if(HeightDev_IP=="")
throw new Exception("请设置厚度检测设备IP地址");
decimal HeightDev_SafeValue=this.numHeightDev_SafeValue.Value;
string IOCard_DeviceNum = this.txtIO_DevNum.Text.Trim();
if (IOCard_DeviceNum == "")
throw new Exception("请设置I/O设备编号 ");
string Defect_SavePath = this.txtDefect_Path.Text.Trim();
if (Defect_SavePath == "")
throw new Exception("请设置缺陷大图保存路径 ");
string Defect_Compress_SavePath = this.txtDefect_Compress_SavePath.Text.Trim();
if (Defect_Compress_SavePath == "")
throw new Exception("请设置缺陷压缩大图保存路径 ");
string Defect_Small_SavePath = this.txtDefect_Small_Path.Text.Trim();
//if (Defect_Small_SavePath == "")
// throw new Exception("请设置缺陷小图保存路径 ");
//DB
string DBConStr = this.txtDBCon.Text.Trim();
if (DBConStr == "")
throw new Exception("请设置DB连接字符串 ");
//LOG
string LogPath = this.txtLogPath.Text.Trim();
if (LogPath == "")
throw new Exception("请设置日志保存路径 ");
//最后统一保存
//Skip
Util.WriteIniValue(configPath, "SKIP", "SkipAxis0", this.chkSkipAxis0.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipAxis1", this.chkSkipAxis1.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipAxis2", this.chkSkipAxis2.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipAxis3", this.chkSkipAxis3.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipTension", this.chkSkipTension.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipHeight", this.chkSkipHeight.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipLight", this.chkSkipLight.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipScannerGL", this.chkSkipScannerGL.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipScannerCC", this.chkSkipScannerCC.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipSmallAxis", this.chkSkipSmallAxis.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "MarkErrorStop", this.ckSkipSizeFailed.Checked ? "1" : "0");
//DEV
Utils.Util.WriteIniValue(configPath, "DEV", "Axis0_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis0PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis1_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis1PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis2_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis2PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis3_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis3PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis0_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis0HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis1_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis1HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis2_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis2HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis3_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis3HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis0_HomeDir", this.cobAxis0HomeDir.SelectedIndex.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis1_HomeDir", this.cobAxis1HomeDir.SelectedIndex.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis2_HomeDir", this.cobAxis2HomeDir.SelectedIndex.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis3_HomeDir", this.cobAxis3HomeDir.SelectedIndex.ToString());
JArray HeightDev_BaseList = new JArray()
{
numHeightBase0.Value,numHeightBase1.Value,numHeightBase2.Value,numHeightBase3.Value,numHeightBase4.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_BaseList", HeightDev_BaseList.ToString().Replace("\r\n", ""));
Utils.Util.WriteIniValue(configPath, "DEV", "Light_Name", ""+(int)Light_Name);
Utils.Util.WriteIniValue(configPath, "DEV", "Light_PortNum", Light_PortNum.Substring(3));
Utils.Util.WriteIniValue(configPath, "DEV", "Tension_PortNum", Tension_PortNum.Substring(3));
Utils.Util.WriteIniValue(configPath, "DEV", "SmallAxis_ComName", SmallAxis_ComName);
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_IP", HeightDev_IP);
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_Port", HeightDev_Port.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_SafeValue", HeightDev_SafeValue.ToString());
JArray Axis_HomeVelLow = new JArray()
{
numAxis0HomeVelLow.Value,numAxis1HomeVelLow.Value,numAxis2HomeVelLow.Value,numAxis3HomeVelLow.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeVelLow", Axis_HomeVelLow.ToString().Replace("\r\n",""));
JArray Axis_HomeVelHigh = new JArray()
{
numAxis0HomeVelHigh.Value,numAxis1HomeVelHigh.Value,numAxis2HomeVelHigh.Value,numAxis3HomeVelHigh.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeVelHigh", Axis_HomeVelHigh.ToString().Replace("\r\n", ""));
JArray Axis_HomeAcc = new JArray()
{
numAxis0HomeAcc.Value,numAxis1HomeAcc.Value,numAxis2HomeAcc.Value,numAxis3HomeAcc.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeAcc", Axis_HomeAcc.ToString().Replace("\r\n", ""));
JArray Axis_HomeDec = new JArray()
{
numAxis0HomeDec.Value,numAxis1HomeDec.Value,numAxis2HomeDec.Value,numAxis3HomeDec.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeDec", Axis_HomeDec.ToString().Replace("\r\n", ""));
Utils.Util.WriteIniValue(configPath, "DEV", "IOCard_DeviceNum", IOCard_DeviceNum);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_SavePath", Defect_SavePath);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_SavePath_AutoClear", (chkDefect_Path_AutoClear.Checked ? (double)numDefect_Path_AutoClear.Value : -1)+"");
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Compress_SavePath", Defect_Compress_SavePath);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Compress_SavePath_AutoClear", (chkDefect_Compress_SavePath_AutoClear.Checked ? (double)numDefect_Compress_SavePath_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Small_SavePath", Defect_Small_SavePath);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Small_SavePath_AutoClear", (chkDefect_Small_Path_AutoClear.Checked ? (double)numDefect_Small_Path_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "SaveAllDefectImg", this.chkSaveAllDefectImg.Checked ? "1" : "0");
Utils.Util.WriteIniValue(configPath, "DEV", "MakeTag", this.chkMakeTag.Checked ? "1" : "0");
Utils.Util.WriteIniValue(configPath, "DEV", "SizeEnginePath", this.txtSizeEnginePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_SavePath", this.txtSizeBmp_SavePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_SavePath_AutoClear", (chkSizeBmp_SavePath_AutoClear.Checked ? (double)numSizeBmp_SavePath_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath", this.txtSizeBmp_Compare_SavePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath_AutoClear", (chkSizeBmp_Compare_SavePath_AutoClear.Checked ? (double)numSizeBmp_Compare_SavePath_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath", this.txtSizeBmp_Zoom_Image_SavePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath_AutoClear", (chkSizeBmp_Zoom_Image_SavePath_AutoClear.Checked ? (double)numSizeBmp_Zoom_Image_SavePath_AutoClear.Value : -1) + "");
//DB
Utils.Util.WriteIniValue(configPath, "DB", "DBConStr", DBConStr);
//HTTP
Utils.Util.WriteIniValue(configPath, "HTTP", "LocalIp",this.txtLocalIp.Text.Trim());
Utils.Util.WriteIniValue(configPath, "HTTP", "LocalHttpPort", this.numHttpPort.Value.ToString());
//LOG
Utils.Util.WriteIniValue(configPath, "LOG", "LogPath", LogPath);
//
this.Hide();
MessageBox.Show("保存成功,生效需重启程序!");
this.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void tsbtnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void txtDefect_Path_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtDefect_Path.Text = path;
}
private void txtLogPath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtLogPath.Text = path;
}
private void txtSizeEnginePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeEnginePath.Text = path;
}
private void txtSizeBmp_Path_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeBmp_SavePath.Text = path;
}
private void txtSizeBmp_Compare_SavePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeBmp_Compare_SavePath.Text = path;
}
private void txtSizeBmp_Zoom_Image_SavePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeBmp_Zoom_Image_SavePath.Text = path;
}
private void txtDefect_Small_Path_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtDefect_Small_Path.Text = path;
}
private void txtDefect_Compress_SavePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtDefect_Compress_SavePath.Text = path;
}
private void btnClearDefect_Small_Path_Click(object sender, EventArgs e)
{
this.txtDefect_Small_Path.Text = "";
}
private void btnClearDefect_Path_Click(object sender, EventArgs e)
{
this.txtDefect_Path.Text = "";
}
private void btnClearDefect_Compress_SavePath_Click(object sender, EventArgs e)
{
txtDefect_Compress_SavePath.Text = "";
}
private void btnClearSizeBmp_Path_Click(object sender, EventArgs e)
{
txtSizeBmp_SavePath.Text = "";
}
private void btnClearSizeBmp_Compare_SavePath_Click(object sender, EventArgs e)
{
txtSizeBmp_Compare_SavePath.Text = "";
}
private void btnSizeBmp_Zoom_Image_SavePath_Click(object sender, EventArgs e)
{
txtSizeBmp_Zoom_Image_SavePath.Text = "";
}
private void btnBackDB_Click(object sender, EventArgs e)
{
try
{
string lsPath=Utils.FileUtil.selectFolder();
if (string.IsNullOrWhiteSpace(lsPath))
return;
lsPath += "\\DB" + DateTime.Now.ToString("yyyyMMddHHmm") + ".bak";
Service.InitDB.BackupDataBase(lsPath);
MessageBox.Show("备份成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void chkMakeTag_CheckedChanged(object sender, EventArgs e)
{
}
}
}
if (ldTmp > -1) numSizeBmp_Zoom_Image_SavePath_AutoClear.Value = (decimal)ldTmp;
//DB
this.txtDBCon.Text = Util.ReadIniValue(configPath, "DB", "DBConStr");
//HTTP
this.txtLocalIp.Text = Util.ReadIniValue(configPath, "HTTP", "LocalIp");
lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalHttpPort");
if (Util.IsNumber(lsTmp))this.numHttpPort.Value = Convert.ToInt32(lsTmp);
//lsTmp = Util.ReadIniValue(configPath, "HTTP", "LocalSocketPort");
//if (Util.IsNumber(lsTmp)) this.numSocketPort.Value = Convert.ToInt32(lsTmp);
//LOG
this.txtLogPath.Text = Util.ReadIniValue(configPath, "LOG", "LogPath");
}
private void tsbtnSave_Click(object sender, EventArgs e)
{
try
{
string configPath = Application.StartupPath + "\\SysConfig.ini";
//DEV
string lsLight_Name = this.cobLight_Name.Text.Trim();
if (lsLight_Name == "")
throw new Exception("请选择光源提供商!");
LightDevNameEnum Light_Name = Utils.EnumUtil.Convert2Enum<LightDevNameEnum>(lsLight_Name);
string Light_PortNum = this.cobLight_PortNum.Text.Trim();
string Tension_PortNum = this.cobTension_PortNum.Text.Trim();
decimal Tension_Offset = this.numOffset.Value;
string SmallAxis_ComName = this.cobSmallAxis_ComName.Text.Trim();
if (Light_PortNum == "" || Tension_PortNum == "" || SmallAxis_ComName == "")
throw new Exception("请设置设备COM端口");
string HeightDev_IP = this.txtHeightDev_IP.Text;
int HeightDev_Port = (int)this.numHeightDev_Port.Value;
if(HeightDev_IP=="")
throw new Exception("请设置厚度检测设备IP地址");
decimal HeightDev_SafeValue=this.numHeightDev_SafeValue.Value;
string IOCard_DeviceNum = this.txtIO_DevNum.Text.Trim();
if (IOCard_DeviceNum == "")
throw new Exception("请设置I/O设备编号 ");
string Defect_SavePath = this.txtDefect_Path.Text.Trim();
if (Defect_SavePath == "")
throw new Exception("请设置缺陷大图保存路径 ");
string Defect_Compress_SavePath = this.txtDefect_Compress_SavePath.Text.Trim();
if (Defect_Compress_SavePath == "")
throw new Exception("请设置缺陷压缩大图保存路径 ");
string Defect_Small_SavePath = this.txtDefect_Small_Path.Text.Trim();
//if (Defect_Small_SavePath == "")
// throw new Exception("请设置缺陷小图保存路径 ");
//DB
string DBConStr = this.txtDBCon.Text.Trim();
if (DBConStr == "")
throw new Exception("请设置DB连接字符串 ");
//LOG
string LogPath = this.txtLogPath.Text.Trim();
if (LogPath == "")
throw new Exception("请设置日志保存路径 ");
//最后统一保存
//Skip
Util.WriteIniValue(configPath, "SKIP", "SkipAxis0", this.chkSkipAxis0.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipAxis1", this.chkSkipAxis1.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipAxis2", this.chkSkipAxis2.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipAxis3", this.chkSkipAxis3.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipTension", this.chkSkipTension.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipHeight", this.chkSkipHeight.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipLight", this.chkSkipLight.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipScannerGL", this.chkSkipScannerGL.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipScannerCC", this.chkSkipScannerCC.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "SkipSmallAxis", this.chkSkipSmallAxis.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "MarkErrorStop", this.ckSkipSizeFailed.Checked ? "1" : "0");
Util.WriteIniValue(configPath, "SKIP", "OpenFlawDistribution", this.cbOpenFlawDistribution.Checked ? "1" : "0");
//DEV
Utils.Util.WriteIniValue(configPath, "DEV", "Axis0_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis0PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis1_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis1PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis2_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis2PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis3_PulseOutMode", ((int)EnumUtil.GetSelectedItemToEnum<AxisPulseOutMode>(this.cobAxis3PulseOutMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis0_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis0HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis1_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis1HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis2_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis2HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis3_HomeMode", ((int)EnumUtil.GetSelectedItemToEnum<AxitHomeMode>(this.cobAxis3HomeMode)).ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis0_HomeDir", this.cobAxis0HomeDir.SelectedIndex.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis1_HomeDir", this.cobAxis1HomeDir.SelectedIndex.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis2_HomeDir", this.cobAxis2HomeDir.SelectedIndex.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "Axis3_HomeDir", this.cobAxis3HomeDir.SelectedIndex.ToString());
JArray HeightDev_BaseList = new JArray()
{
numHeightBase0.Value,numHeightBase1.Value,numHeightBase2.Value,numHeightBase3.Value,numHeightBase4.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_BaseList", HeightDev_BaseList.ToString().Replace("\r\n", ""));
Utils.Util.WriteIniValue(configPath, "DEV", "Light_Name", ""+(int)Light_Name);
Utils.Util.WriteIniValue(configPath, "DEV", "Light_PortNum", Light_PortNum.Substring(3));
Utils.Util.WriteIniValue(configPath, "DEV", "Tension_PortNum", Tension_PortNum.Substring(3));
Utils.Util.WriteIniValue(configPath, "DEV", "Tension_Offset", Tension_Offset.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "SmallAxis_ComName", SmallAxis_ComName);
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_IP", HeightDev_IP);
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_Port", HeightDev_Port.ToString());
Utils.Util.WriteIniValue(configPath, "DEV", "HeightDev_SafeValue", HeightDev_SafeValue.ToString());
JArray Axis_HomeVelLow = new JArray()
{
numAxis0HomeVelLow.Value,numAxis1HomeVelLow.Value,numAxis2HomeVelLow.Value,numAxis3HomeVelLow.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeVelLow", Axis_HomeVelLow.ToString().Replace("\r\n",""));
JArray Axis_HomeVelHigh = new JArray()
{
numAxis0HomeVelHigh.Value,numAxis1HomeVelHigh.Value,numAxis2HomeVelHigh.Value,numAxis3HomeVelHigh.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeVelHigh", Axis_HomeVelHigh.ToString().Replace("\r\n", ""));
JArray Axis_HomeAcc = new JArray()
{
numAxis0HomeAcc.Value,numAxis1HomeAcc.Value,numAxis2HomeAcc.Value,numAxis3HomeAcc.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeAcc", Axis_HomeAcc.ToString().Replace("\r\n", ""));
JArray Axis_HomeDec = new JArray()
{
numAxis0HomeDec.Value,numAxis1HomeDec.Value,numAxis2HomeDec.Value,numAxis3HomeDec.Value
};
Utils.Util.WriteIniValue(configPath, "DEV", "Axis_HomeDec", Axis_HomeDec.ToString().Replace("\r\n", ""));
Utils.Util.WriteIniValue(configPath, "DEV", "IOCard_DeviceNum", IOCard_DeviceNum);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_SavePath", Defect_SavePath);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_SavePath_AutoClear", (chkDefect_Path_AutoClear.Checked ? (double)numDefect_Path_AutoClear.Value : -1)+"");
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Compress_SavePath", Defect_Compress_SavePath);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Compress_SavePath_AutoClear", (chkDefect_Compress_SavePath_AutoClear.Checked ? (double)numDefect_Compress_SavePath_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Small_SavePath", Defect_Small_SavePath);
Utils.Util.WriteIniValue(configPath, "DEV", "Defect_Small_SavePath_AutoClear", (chkDefect_Small_Path_AutoClear.Checked ? (double)numDefect_Small_Path_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "SaveAllDefectImg", this.chkSaveAllDefectImg.Checked ? "1" : "0");
Utils.Util.WriteIniValue(configPath, "DEV", "MakeTag", this.chkMakeTag.Checked ? "1" : "0");
Utils.Util.WriteIniValue(configPath, "DEV", "SizeEnginePath", this.txtSizeEnginePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_SavePath", this.txtSizeBmp_SavePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_SavePath_AutoClear", (chkSizeBmp_SavePath_AutoClear.Checked ? (double)numSizeBmp_SavePath_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath", this.txtSizeBmp_Compare_SavePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Compare_SavePath_AutoClear", (chkSizeBmp_Compare_SavePath_AutoClear.Checked ? (double)numSizeBmp_Compare_SavePath_AutoClear.Value : -1) + "");
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath", this.txtSizeBmp_Zoom_Image_SavePath.Text.Trim());
Utils.Util.WriteIniValue(configPath, "DEV", "SizeBmp_Zoom_Image_SavePath_AutoClear", (chkSizeBmp_Zoom_Image_SavePath_AutoClear.Checked ? (double)numSizeBmp_Zoom_Image_SavePath_AutoClear.Value : -1) + "");
//DB
Utils.Util.WriteIniValue(configPath, "DB", "DBConStr", DBConStr);
//HTTP
Utils.Util.WriteIniValue(configPath, "HTTP", "LocalIp",this.txtLocalIp.Text.Trim());
Utils.Util.WriteIniValue(configPath, "HTTP", "LocalHttpPort", this.numHttpPort.Value.ToString());
//LOG
Utils.Util.WriteIniValue(configPath, "LOG", "LogPath", LogPath);
//
this.Hide();
MessageBox.Show("保存成功,生效需重启程序!");
this.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void tsbtnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void txtDefect_Path_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtDefect_Path.Text = path;
}
private void txtLogPath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtLogPath.Text = path;
}
private void txtSizeEnginePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeEnginePath.Text = path;
}
private void txtSizeBmp_Path_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeBmp_SavePath.Text = path;
}
private void txtSizeBmp_Compare_SavePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeBmp_Compare_SavePath.Text = path;
}
private void txtSizeBmp_Zoom_Image_SavePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtSizeBmp_Zoom_Image_SavePath.Text = path;
}
private void txtDefect_Small_Path_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtDefect_Small_Path.Text = path;
}
private void txtDefect_Compress_SavePath_Click(object sender, EventArgs e)
{
string path = FileUtil.selectFolder(Application.StartupPath);
if (!string.IsNullOrWhiteSpace(path))
this.txtDefect_Compress_SavePath.Text = path;
}
private void btnClearDefect_Small_Path_Click(object sender, EventArgs e)
{
this.txtDefect_Small_Path.Text = "";
}
private void btnClearDefect_Path_Click(object sender, EventArgs e)
{
this.txtDefect_Path.Text = "";
}
private void btnClearDefect_Compress_SavePath_Click(object sender, EventArgs e)
{
txtDefect_Compress_SavePath.Text = "";
}
private void btnClearSizeBmp_Path_Click(object sender, EventArgs e)
{
txtSizeBmp_SavePath.Text = "";
}
private void btnClearSizeBmp_Compare_SavePath_Click(object sender, EventArgs e)
{
txtSizeBmp_Compare_SavePath.Text = "";
}
private void btnSizeBmp_Zoom_Image_SavePath_Click(object sender, EventArgs e)
{
txtSizeBmp_Zoom_Image_SavePath.Text = "";
}
private void btnBackDB_Click(object sender, EventArgs e)
{
try
{
string lsPath=Utils.FileUtil.selectFolder();
if (string.IsNullOrWhiteSpace(lsPath))
return;
lsPath += "\\DB" + DateTime.Now.ToString("yyyyMMddHHmm") + ".bak";
Service.InitDB.BackupDataBase(lsPath);
MessageBox.Show("备份成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void chkMakeTag_CheckedChanged(object sender, EventArgs e)
{
}
}
}

View File

@ -124,16 +124,16 @@
<data name="tsbtnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIeSURBVFhH7ZfLShxBFIaPCJKAQcgLhBh0I7hTSYi6CVEX
Lmchoq1dVd112rgQ3yC7oBslD+CNJBDIC7gTXXoBFy7dSdaRYELI5VRR09Pl1Mx09TQBwR8+eqaqzt//
VJ/umYF7OdQBUTJGTBaGywngyYDx81Cl0gUs3geBf0uB41vjnFMCh+pM2ueVcc8hLkfTQoaX9Al2QMS7
/shtCPFC+yzgFURRjzlDC0XJyzQAxy0zWkxcvku9hPxsRlsoG0DID2a0mITcrHlpv8DMNFE2AMOPZjS/
GC7SzkX6NccNK8AMfocweaLnGqqdACsrD6nuj65V4rieelUJ4yOa6dDzTrUTIAwfUd034ka/53It9bKQ
q3reKasHcM+M5lOSdMPU9G9dq2Q1ocUXPe+UHaDJwgbSt61pXoHvM141mu6sHUBt5wsz4yeGg1T7NeNV
wyOAQjXVOXFCD5jT1tA6jmcQBL9MfT2eAcrnbgYIgutCVO+KLF4BlImQU8DY40LEcR/5HFqefjtAjdWu
BCaWp+cl+EldvQwiGfGGxcPkN5l+LVe5m01YJp4BbugSzANf6tcNpY55Ueuj6DkweWx5/v8mlGh5eu+A
kHMgxDNYxF59vI0ad8HfPKV6+pGrH9E5A2R/lNqo7wQ/XA8hjfxkzuaQunWcRWXSLEAQPKBFB/VFJTE7
+4N2ecKcrYEqlU5aPE794P7bVRSBr3Vf3MsSwD8RV2WjuxFNUgAAAABJRU5ErkJggg==
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIfSURBVFhH7ZdPaxNBGMbfUBCFSsEvILa0l4K3KoptL9JE
es6hhLpmZ2Z33q09hH4Db6IXpR+gtUULBb+AN6lHW8GDR2/iWZEo4p93hslmp5kkO5ulEOgDPzaZmffZ
J7PvbhI4l0MViJIlolYYLqvAk3nj56F6/QKw+A0I/FcKHB8Z55wSuNBjMjp3jXsOcbmYFjL8TJ/gBYh4
zx+5CyF+0j4P8AtE0ZQ5wxBFyZ00AMcdM1pMXD5OvYQ8NKNDlA0g5EszWkxCPu96ab/AzAxQNgDDV2Y0
vxg2aeci/ZrjMyvAGv6AMLmq5/pqlACt1iWq+6trlTg+Tb06hPE7mqnoeadGCRCGl6nuG9HW77l8knpZ
yC0975TVA7hvRvMpSSahuvpH1ypZTWjxWs87ZQcYsLCP9G1rmlfgdsary8CdtQOo7bxtZvzE8DrVfs14
dfEIoFBN9ZE4pgfMyXBoHccPEAS/TX0vngHKZzwDBMH3QnTuiixeAZSJkPeAsSuFiONZ8jmyPP12gBpr
VAlMLE/PS/CLunoTRHLTGxbfIL9a+rXcYTybsEw8A7TpEtwHvjGnG0od86LWR9EtYPK95Xn2TSjR8vTe
ASHXQYgZaOK0Pp5GjbvgD69RPf3I1Y/onAGyP0pt1HeCH66HkEYemLM5pG4dZ1GZDAoQBBdp0dveopJo
NH7SLlfN2fqoXp+gxcvUD+6/XUURuKL74lyWAP4DwL5ll9fZEiMAAAAASUVORK5CYII=
</value>
</data>
<data name="tsbtnClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -257,9 +257,6 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>166, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>166, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>56</value>
</metadata>

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]

View File

@ -1,222 +1,224 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
{
[SugarIndex("index_{table}_sn", nameof(Order.SN), OrderByType.Asc, isUnique: true)]
public class Order : BaseTable
{
/// <summary>
/// 产品
/// </summary>
public int ProductId { get; set; }
[Navigate(NavigateType.ManyToOne, nameof(ProductId))]
public Product ProductInfo { get; set; }
public string SN { get; set; }
public string BatchId { get; set; }
/// <summary>
/// 流程
/// </summary>
public int StepId { get; set; }
[Navigate(NavigateType.ManyToOne, nameof(StepId))]
public Step StepInfo { get; set; }
/// <summary>
/// 时长-秒
/// </summary>
public double TimeLen { get; set; }
/// <summary>
/// 是否合格
/// </summary>
[SugarColumn(IsNullable = true)]
public bool Qualified { get; set; } = true;
/// <summary>
/// 比对结果 0-未比对 1-通过 2-不通过
/// </summary>
public int CompareResult { get; set; } = 0;
//平均值
public double TensionValue { get; set; }
public double HeightValue { get; set; }
public double LineWidthValue { get; set; }
public double PTValue { get; set; }
//N次
#region 5
public double Tension1 { get; set; }
public double Tension2 { get; set; }
public double Tension3 { get; set; }
public double Tension4 { get; set; }
public double Tension5 { get; set; }
#endregion
#region 5
public double Height1 { get; set; }
public double Height2 { get; set; }
public double Height3 { get; set; }
public double Height4 { get; set; }
public double Height5 { get; set; }
#endregion
#region 线9
public double LineWidth1 { get; set; }
public double LineWidth2 { get; set; }
public double LineWidth3 { get; set; }
public double LineWidth4 { get; set; }
public double LineWidth5 { get; set; }
public double LineWidth6 { get; set; }
public double LineWidth7 { get; set; }
public double LineWidth8 { get; set; }
public double LineWidth9 { get; set; }
#endregion
#region PT6次
public double PT1 { get; set; }
public double PT2 { get; set; }
public double PT3 { get; set; }
public double PT4 { get; set; }
public double PT5 { get; set; }
public double PT6 { get; set; }
#endregion
/// <summary>
/// 缺陷数
/// </summary>
public int DefectCount { get; set; }
#region
public int DKCount { get; set; }//堵孔数量
public int ZWCount { get; set; }//脏污数量
public int GSYCCount { get; set; }//钢丝异常数量
public int XWSCount { get; set; }//纤维丝数量
public int QKCount { get; set; }//缺口数量
public int ZKCount { get; set; }//针孔数量
public int PPCount { get; set; }//泡泡数量
public int HSCount { get; set; }//划伤数量
public int YXCount { get; set; }//压线数量
public int XBCount { get; set; }//斜边数量 new
public int SXCount { get; set; }//栅线数量 new
#endregion
/// <summary>
/// mark点数据:[X1,Y1,X2,Y2,X3,Y3,X4,Y4]
/// </summary>
[SugarColumn(IsNullable = true)]
public string MarkData { get; set; }
//
public bool Succeed { get; set; }
/// <summary>
/// 失败分类
/// </summary>
public int FailType { get; set; }
/// <summary>
/// 失败的工序名称
/// </summary>
[SugarColumn(IsNullable = true)]
public string FailProcessName { get; set; }
[SugarColumn(IsNullable = true, ColumnDataType = "text", Length = 2048)]
public string Note { get; set; }
/// <summary>
/// 0-初始; 5-已检测; 10-出现异常
/// </summary>
public int State { get; set; }
//----------
/// <summary>
/// 修改次数
/// </summary>
public int HistoryCount { get; set; } = 0;
/// <summary>
/// 修改历史记录
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(OrderHistory.Pid))]
public List<OrderHistory> OrderHistoryList { get; set; }
/// <summary>
/// Defect和Size比对失败的坐标位置
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(DefectInfo.Pid))]
public List<DefectInfo> DefectInfoList { get; set; }
//-------IsIgnore = true 不保存
[SugarColumn(IsIgnore = true)]
//[Navigate(NavigateType.OneToMany, nameof(SizeTagData.Pid))]
public List<SizeTagData> SizeTagDataList { get; set; }
//2023-10-30 添加异常列
/// <summary>
/// 异常情况
/// </summary>
public string Abnormalities { get; set; }
/// <summary>
/// 修复人员
/// </summary>
public string RepairCode { get; set; }
}
[SugarIndex("index_{table}_pid", nameof(OrderHistory.Pid), OrderByType.Asc, isUnique: false)]
public class OrderHistory : BaseTable
{
public int Pid { get; set; }
public bool Qualified { get; set; }//合格
//比对
public int CompareResult { get; set; }
//平均值
public double TensionValue { get; set; }
public double HeightValue { get; set; }
public double LineWidthValue { get; set; }
public double PTValue { get; set; }
//外观
public int DKCount { get; set; }//堵孔数量
public int ZWCount { get; set; }//脏污数量
public int GSYCCount { get; set; }//钢丝异常数量
public int XWSCount { get; set; }//纤维丝数量
public int QKCount { get; set; }//缺口数量
public int ZKCount { get; set; }//针孔数量
public int PPCount { get; set; }//泡泡数量
public int HSCount { get; set; }//划伤数量
public int YXCount { get; set; }//压线数量
public int XBCount { get; set; }//斜边数量 new
public int SXCount { get; set; }//栅线数量 new
}
[SugarIndex("index_{table}_pid", nameof(SizeTagData.Pid), OrderByType.Asc, isUnique: false)]
public class SizeTagData : BaseTable
{
public int Pid { get; set; }
public string SizeTag { get; set; }
/// <summary>
/// 产生Tag工序索引
/// </summary>
public int CreateStepIndex { get; set; }
/// <summary>
/// 消费本数据工序索引和消费值索引5-0,8-2
/// </summary>
public string ConsumeStepIndex { get; set; }
/// <summary>
/// double[]
/// </summary>
public string posePT { get; set; }
}
[SugarIndex("index_{table}_pid", nameof(DefectInfo.Pid), OrderByType.Asc, isUnique: false)]
public class DefectInfo : BaseTable
{
public int Pid { get; set; }
/// <summary>
/// 0-Defect 1-Size
/// </summary>
public int Type { get; set; }
public string Code { get;set; }
public double X { get; set; }
public double Y { get; set; }
public double ZXD { get; set; }
}
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
{
[SugarIndex("index_{table}_sn", nameof(Order.SN), OrderByType.Asc, isUnique: true)]
public class Order : BaseTable
{
/// <summary>
/// 产品
/// </summary>
public int ProductId { get; set; }
[Navigate(NavigateType.ManyToOne, nameof(ProductId))]
public Product ProductInfo { get; set; }
public string SN { get; set; }
public string BatchId { get; set; }
/// <summary>
/// 流程
/// </summary>
public int StepId { get; set; }
[Navigate(NavigateType.ManyToOne, nameof(StepId))]
public Step StepInfo { get; set; }
/// <summary>
/// 时长-秒
/// </summary>
public double TimeLen { get; set; }
/// <summary>
/// 是否合格
/// </summary>
[SugarColumn(IsNullable = true)]
public bool Qualified { get; set; } = true;
/// <summary>
/// 比对结果 0-未比对 1-通过 2-不通过
/// </summary>
public int CompareResult { get; set; } = 0;
//平均值
public double TensionValue { get; set; }
public double HeightValue { get; set; }
public double LineWidthValue { get; set; }
public double PTValue { get; set; }
//N次
#region 5
public double Tension1 { get; set; }
public double Tension2 { get; set; }
public double Tension3 { get; set; }
public double Tension4 { get; set; }
public double Tension5 { get; set; }
#endregion
#region 5
public double Height1 { get; set; }
public double Height2 { get; set; }
public double Height3 { get; set; }
public double Height4 { get; set; }
public double Height5 { get; set; }
#endregion
#region 线9
public double LineWidth1 { get; set; }
public double LineWidth2 { get; set; }
public double LineWidth3 { get; set; }
public double LineWidth4 { get; set; }
public double LineWidth5 { get; set; }
public double LineWidth6 { get; set; }
public double LineWidth7 { get; set; }
public double LineWidth8 { get; set; }
public double LineWidth9 { get; set; }
#endregion
#region PT6次
public double PT1 { get; set; }
public double PT2 { get; set; }
public double PT3 { get; set; }
public double PT4 { get; set; }
public double PT5 { get; set; }
public double PT6 { get; set; }
#endregion
/// <summary>
/// 缺陷数
/// </summary>
public int DefectCount { get; set; }
#region
public int DKCount { get; set; }//堵孔数量
public int ZWCount { get; set; }//脏污数量
public int GSYCCount { get; set; }//钢丝异常数量
public int XWSCount { get; set; }//纤维丝数量
public int QKCount { get; set; }//缺口数量
public int ZKCount { get; set; }//针孔数量
public int PPCount { get; set; }//泡泡数量
public int HSCount { get; set; }//划伤数量
public int YXCount { get; set; }//压线数量
public int XBCount { get; set; }//斜边数量 new
public int SXCount { get; set; }//栅线数量 new
#endregion
/// <summary>
/// mark点数据:[X1,Y1,X2,Y2,X3,Y3,X4,Y4]
/// </summary>
[SugarColumn(IsNullable = true)]
public string MarkData { get; set; }
//
public bool Succeed { get; set; }
/// <summary>
/// 失败分类
/// </summary>
public int FailType { get; set; }
/// <summary>
/// 失败的工序名称
/// </summary>
[SugarColumn(IsNullable = true)]
public string FailProcessName { get; set; }
[SugarColumn(IsNullable = true, ColumnDataType = "text", Length = 2048)]
public string Note { get; set; }
/// <summary>
/// 0-初始; 5-已检测; 10-出现异常
/// </summary>
public int State { get; set; }
//----------
/// <summary>
/// 修改次数
/// </summary>
public int HistoryCount { get; set; } = 0;
/// <summary>
/// 修改历史记录
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(OrderHistory.Pid))]
public List<OrderHistory> OrderHistoryList { get; set; }
/// <summary>
/// Defect和Size比对失败的坐标位置
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(DefectInfo.Pid))]
public List<DefectInfo> DefectInfoList { get; set; }
//-------IsIgnore = true 不保存
[SugarColumn(IsIgnore = true)]
//[Navigate(NavigateType.OneToMany, nameof(SizeTagData.Pid))]
public List<SizeTagData> SizeTagDataList { get; set; }
//2023-10-30 添加异常列
/// <summary>
/// 异常情况
/// </summary>
[SugarColumn(IsNullable = true)]
public string Abnormalities { get; set; }
/// <summary>
/// 修复人员
/// </summary>
[SugarColumn(IsNullable = true)]
public string RepairCode { get; set; }
}
[SugarIndex("index_{table}_pid", nameof(OrderHistory.Pid), OrderByType.Asc, isUnique: false)]
public class OrderHistory : BaseTable
{
public int Pid { get; set; }
public bool Qualified { get; set; }//合格
//比对
public int CompareResult { get; set; }
//平均值
public double TensionValue { get; set; }
public double HeightValue { get; set; }
public double LineWidthValue { get; set; }
public double PTValue { get; set; }
//外观
public int DKCount { get; set; }//堵孔数量
public int ZWCount { get; set; }//脏污数量
public int GSYCCount { get; set; }//钢丝异常数量
public int XWSCount { get; set; }//纤维丝数量
public int QKCount { get; set; }//缺口数量
public int ZKCount { get; set; }//针孔数量
public int PPCount { get; set; }//泡泡数量
public int HSCount { get; set; }//划伤数量
public int YXCount { get; set; }//压线数量
public int XBCount { get; set; }//斜边数量 new
public int SXCount { get; set; }//栅线数量 new
}
[SugarIndex("index_{table}_pid", nameof(SizeTagData.Pid), OrderByType.Asc, isUnique: false)]
public class SizeTagData : BaseTable
{
public int Pid { get; set; }
public string SizeTag { get; set; }
/// <summary>
/// 产生Tag工序索引
/// </summary>
public int CreateStepIndex { get; set; }
/// <summary>
/// 消费本数据工序索引和消费值索引5-0,8-2
/// </summary>
public string ConsumeStepIndex { get; set; }
/// <summary>
/// double[]
/// </summary>
public string posePT { get; set; }
}
[SugarIndex("index_{table}_pid", nameof(DefectInfo.Pid), OrderByType.Asc, isUnique: false)]
public class DefectInfo : BaseTable
{
public int Pid { get; set; }
/// <summary>
/// 0-Defect 1-Size
/// </summary>
public int Type { get; set; }
public string Code { get;set; }
public double X { get; set; }
public double Y { get; set; }
public double ZXD { get; set; }
}
}

View File

@ -109,8 +109,10 @@ namespace Models
//mark尺寸
public double MarkSize { get; set; }
//抓点图像
[SugarColumn(IsNullable = true)]
public string MapPath { get; set; }
//抓取点位
[SugarColumn(IsNullable = true)]
public string GetPointList { get; set; }
}
/// <summary>