Commit 4426c22f 贾鹏旭

1

1 个父辈 481b5723
正在显示 62 个修改的文件 包含 5177 行增加1238 行删除
......@@ -56,8 +56,9 @@
<Reference Include="ExcelNumberFormat, Version=1.1.0.0, Culture=neutral, PublicKeyToken=23c6f5d73be07eca, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelNumberFormat.1.1.0\lib\net20\ExcelNumberFormat.dll</HintPath>
</Reference>
<Reference Include="IDHIKCamera">
<HintPath>..\SharedDll\IDHIKCamera.dll</HintPath>
<Reference Include="IDHIKCamera, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\IDHK\IDHIKCamera\IDHIKCamera\bin\Debug\IDHIKCamera.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
......@@ -114,10 +115,12 @@
<Compile Include="Extension\Item_KaiFa.cs" />
<Compile Include="Extension\Item_PanaCIM.cs" />
<Compile Include="ExtraFileData.cs" />
<Compile Include="InvokePlugin.cs" />
<Compile Include="IO\IOManage.cs" />
<Compile Include="IO\IO_Interface.cs" />
<Compile Include="IO\KND.cs" />
<Compile Include="IO\NiRenIO.cs" />
<Compile Include="LabelingPosition.cs" />
<Compile Include="LightSource.cs" />
<Compile Include="MatchAnalysis.cs" />
<Compile Include="MonitorMouseKeyboard.cs" />
......
using CameraVisionLib.Model;
using DocumentFormat.OpenXml.EMMA;
using DocumentFormat.OpenXml.Wordprocessing;
using IDHIKCamera;
using Model;
using System;
......@@ -39,6 +40,7 @@ namespace BLL
// LogNet.log.Info("加载到IDHIK相机:" + name);
//}
cameraName = names.Find(s => s.Contains("ID"));
LogNet.log.Info("加载到扫码相机:" + cameraName);
}
//IDHIK.Instance.OpenAll();
}
......@@ -50,7 +52,7 @@ namespace BLL
else
{
cameraVision = new Asa.Camera.VisionLib(FilePath.CONFIG_CAMERA, BLLCommon.config.EnabledCamera);
LogNet.log.Info("加载相机,数量:" + cameraVision.Count);
LogNet.log.Info("加载拍照相机,数量:" + cameraVision.Count);
}
}
......@@ -116,7 +118,12 @@ namespace BLL
if (useIDCamera)
{
barcodeInfos = grabOne(out Bitmap bitmap);
if (bitmap==null)
{
LogNet.log.Info("扫码相机获取图片为空!");
}
result[0] = bitmap;
}
else
{
......@@ -181,6 +188,7 @@ namespace BLL
List<BarcodeInfo> barcodeInfos = new List<BarcodeInfo>();
if (string.IsNullOrEmpty(cameraName))
{
LogNet.log.Error($"{cameraName}名称为空!");
return barcodeInfos;
}
try
......@@ -200,6 +208,10 @@ namespace BLL
});
}
if (bitmap == null)
{
LogNet.log.Error($"{cameraName}:扫码相机获取图片为空" + cc.Count);
}
}
catch (Exception e)
{
......
......@@ -311,9 +311,6 @@ namespace BLL
/// </summary>
[MyConfigComment("软件后台运行")]
public static MyConfig<bool> Backgrounder;
[MyConfigComment("是否http替换条码内容")]
public static MyConfig<bool> isReplaceData;
[MyConfigComment("数据源类型")]
public static MyConfig<string> DataSource_Type;
[MyConfigComment("数据源文件路径")]
......@@ -347,7 +344,6 @@ namespace BLL
public partial class Config
{
private const string LANGUAGE = "Language";
private const string Smf_Server = "SmfServer";
private const string ClientID = "CID";
......
......@@ -199,7 +199,7 @@ namespace BLL
#region 显示替换数据按钮
string pnkey = ConfigHelper.Config.Get("SelectHttpPN_KeyWords", "");
string pnurl=ConfigHelper.Config.Get("SelectHttpPN_Url","");
if (BLLCommon.config.SelectHttpPN == true&&
if (BLLCommon.config.SelectHttpPN&&
!string.IsNullOrEmpty(pnkey)&&!string.IsNullOrEmpty(pnurl))
{
Dictionary<string, object> C = new(){
......@@ -209,7 +209,7 @@ namespace BLL
{ "Font", "Arial,12,B,"},
{"Width", -1},
{"Height", 40},
{"Text", Asa.FaceControl.Language.Dialog("ReplaceData","替换数据")},}
{"Text", Asa.FaceControl.Language.Dialog("ReplaceData","ReplaceData")},}
},
{
"Event",
......@@ -222,6 +222,30 @@ namespace BLL
listrow.Add(new object[] { C });
}
#endregion
#region 显示重新获取数据源按钮
bool isdisplaybut = ConfigHelper.Config.Get<bool>("DataSource_isdisplaybut", false);
if (isdisplaybut)
{
Dictionary<string, object> displaybut = new(){
{ "Type", "Button" },
{"Attribute",new Dictionary<string, object>(){
{ "Name", "GetDataButton" },
{ "Font", "Arial,12,B,"},
{"Width", -1},
{"Height", 40},
{"Text", Asa.FaceControl.Language.Dialog("RetrieveDataAgain","重新获取数据")},}
},
{
"Event",
new Dictionary<string, object>()
{
{ "Click", "GetDataButtonClick" }
}
}
};
listrow.Add(new object[] { displaybut });
}
#endregion
listrow.Add(new object[] { B });
rows = listrow.ToArray();
}
......
......@@ -23,6 +23,9 @@ using RestSharp;
using System.Web;
using Http = Model.Http;
using System.Drawing;
using DocumentFormat.OpenXml.Spreadsheet;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
using DocumentFormat.OpenXml.Wordprocessing;
namespace BLL
{
......@@ -70,13 +73,14 @@ namespace BLL
{
this.extensions = extensions;
}
static bool mesResult = false;
Dictionary<string, string> lastkey = null;
//读码后第一步
public bool SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch, out string errmsg)
{
errmsg = "";
lastkey = key;
mesResult = false;
var now = DateTime.Now;
if (extensions != null && !extensions[0].Control.InvokeRequired)
......@@ -84,7 +88,7 @@ namespace BLL
//第一次刷新界面
for (int i = 0; i < extensions.Count; i++)
{
extensions[i].Control.ForeColor = Color.White;
extensions[i].Control.ForeColor = System.Drawing.Color.White;
if (key.ContainsKey(extensions[i].Key))
extensions[i].Control.Text = key[extensions[i].Key].Replace("<OCR>", "");
}
......@@ -94,16 +98,23 @@ namespace BLL
{
var Reelidstr = GetReelid();
if (key.ContainsKey(config.ReelIDKeyWord))
{
key[config.ReelIDKeyWord] = Reelidstr;
}
else
{
key.Add(config.ReelIDKeyWord, Reelidstr);
}
}
//客户定制key
string exKey = ConfigHelper.Config.Get("Ex_UserDataKey", "UserData4");
string exKey = ConfigHelper.Config.Get("Ex_UserDataKey", "Manufactured_Date");
if (macroKey.Contains(exKey))
{
if (key.ContainsKey(exKey))
{
key[exKey] = DateTime.Now.ToString(ConfigHelper.Config.Get("Ex_UserDataRule", "MM/dd/yyyy"));
}
else
{
key.Add(exKey, DateTime.Now.ToString(ConfigHelper.Config.Get("Ex_UserDataRule", "MM/dd/yyyy")));
......@@ -128,16 +139,33 @@ namespace BLL
//第二次刷新界面
for (int i = 0; i < extensions.Count; i++)
{
extensions[i].Control.ForeColor = Color.White;
extensions[i].Control.ForeColor = System.Drawing.Color.White;
if (key.ContainsKey(extensions[i].Key))
{
extensions[i].Control.Text = key[extensions[i].Key].Replace("<OCR>", "");
}
}
}
lastkey = key;
if (!updatereelid(key, out errmsg))
return false;
Application.DoEvents();
bool close = ConfigHelper.Config.Get("isprinclose", false);
if (close)
{
if (extensions!=null)
{
var batt = extensions.Where(a => a.Type == "Button" && a.Control.Name == "BtnPrint").FirstOrDefault();
if (batt != null)
{
batt.Control.Enabled = true;
}
}
}
//if (extensions != null && !extensions[0].Control.InvokeRequired)
//{
// if (config.AutoPrint && hasMatch)
......@@ -215,12 +243,14 @@ namespace BLL
}
continue;
}
if (extensions!=null)
{
int index = extensions.FindIndex(match => match.Key == keys[i]);
if (index == -1) continue;
string oldValue = string.Format("[{0}]", keys[i]);
matchID = matchID.Replace(oldValue, extensions[index].Control.Text);
}
}
//SaveAddReelID();
var reelID = ReadReelID();
//填充0
......@@ -292,6 +322,18 @@ namespace BLL
}
Printing?.Invoke(lastkey);
bool close = ConfigHelper.Config.Get("isprinclose", false);
if (close)
{
var batt = extensions.Where(a => a.Type == "Button" && a.Control.Name == "BtnPrint").FirstOrDefault();
if (batt != null)
{
batt.Control.Enabled = isprint;
isprint = false;
}
}
//进行追溯配置保存
SaveRetrospect?.Invoke(lastkey);
}
/// <summary>
///
......@@ -364,10 +406,19 @@ namespace BLL
}
// 定义动态按钮点击事件处理方法
/// <summary>
/// 通过http获取数据替换关键字内容
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DynamicButtonClick(object sender, EventArgs e)
{
try
{
var listexten = extensions.Where(a => a.Type == "TextBox").ToDictionary(kvp => kvp.Key, kvp => kvp.Control.Text);
string jsondata = Replacekeywordss(listexten);
if (jsondata != null)
{
ResponseDatas lists = JsonConvert.DeserializeObject<ResponseDatas>(jsondata);
foreach (var responseItems in lists.Items)
{
......@@ -384,152 +435,41 @@ namespace BLL
}
}
}
}
catch (Exception ex)
{
LogNet.log.Error($"替换数据时出错:{ex.Message}");
}
}
#region
//public void Replacekeywordss()
//{
//try
//{
// //未找到任何关键字信息
// if (lastkey == null || lastkey.Count < 0)
// {
// throw new Exception("未找到任何关键字信息,请重新设置!");
// }
// string Tokensurl = "";
// // 判断并处理 grn_num 和 grn_line
// if (lastkey.ContainsKey("grn_num") && lastkey.ContainsKey("grn_line"))
// {
// string grn_numValue = lastkey["grn_num"];
// string grn_lineValue = lastkey["grn_line"];
// // 发起 HTTP 请求,获取 token 的值
// string tokensValue = Http.Get(Tokensurl);
// if (string.IsNullOrEmpty(tokensValue))
// {
// LogNet.log.Info($"{Tokensurl}:获取token为空!");
// throw new Exception("获取tokens失败!");
// }
// string ido = "IR_SLAPIs";
// string props = "GRNNUM,GRNLine,vendnum,vendor_name,po_num,po_line,po_release,item_code,Rating,qty_ordered,qty_received,rcvd_dat";
// string customloadmethodparms = $"{grn_numValue},,{grn_lineValue},";
// string url = $"http://IRI002S/IDORequestService/MGRestService.svc/json/{ido}/{props}/adv?customloadmethod=IR_GetGrnDetailSp&customloadmethodparms={customloadmethodparms}&loadtype=NEXT&readonly=true&rowcap=-1";
// // 发起第二个 HTTP 请求,并处理返回值
// string result = Http.SendGetRequest(url, tokensValue);
// var lists = JsonConvert.DeserializeObject<ResponseData>(result);
// if (lists.MessageCode != 0 || lists.Items.Count == 0)
// {
// throw new Exception($"{lists.Message}");
// }
// LogNet.log.Info($"{url}:返回数据{lists}");
// // 处理 result 返回的数据
// // 刷新关键字的值
// foreach (var item in lists.Items)
// {
// for (int i = 0; i < extensions.Count; i++)
// {
// if (extensions[i].Key == item.Name)
// {
// extensions[i].Control.Text = item.Value.ToString();
// }
// }
// }
// }
//}
//catch (Exception ex)
//{
// MessageBox.Show(ex.Message,"提示");
// //throw new Exception(ex.Message);
//}
// try
// {
// //是否需要请求token
// string RequestMethod = ConfigurationManager.AppSettings["RequestMethod"];
// //是否需要请求token
// bool isTokenRequired = Convert.ToBoolean(ConfigurationManager.AppSettings["isTokenRequired"]);
// //请求tokenurl
// string tokenurl = ConfigurationManager.AppSettings["tokenurl"];
// //请求正常数据
// string url = ConfigurationManager.AppSettings["url"];
// //关键字,请用,号分割
// string keywords = ConfigurationManager.AppSettings["keywords"];
// if (isTokenRequired && tokenurl != null)
// {
// throw new Exception("需要请求token,请填写tokenurl!");
// }
// if (string.IsNullOrWhiteSpace(url) || string.IsNullOrWhiteSpace(keywords))
// {
// throw new Exception("URL和关键字不能为空");
// }
// //用户提供需要更换的关键字
// var UserKeyword = keywords.Split(',').ToList();
// //未找到任何ns100设置的关键字信息
// if (lastkey == null || lastkey.Count < 0)
// {
// throw new Exception("未找到任何关键字信息,请重新设置!");
// }
// //判断ns100关键字,是否包含用户提供的关键字
// bool allinkey = UserKeyword.All(value => lastkey.ContainsKey(value));
// if (!allinkey)
// {
// throw new Exception($"关键字未包含;{keywords}");
// }
// ResponseData lists = null;
// if (isTokenRequired)
// {
// string tokensValue = Http.Get(tokenurl);
// if (string.IsNullOrEmpty(tokensValue))
// {
// LogNet.log.Info($"{tokenurl}:获取token为空!");
// throw new Exception("获取tokens失败!");
// }
// string ido = "IR_SLAPIs";
// string props = "GRNNUM,GRNLine,vendnum,vendor_name,po_num,po_line,po_release,item_code,Rating,qty_ordered,qty_received,rcvd_dat";
// string customloadmethodparms = $"{UserKeyword},";
// //string url = $"http://IRI002S/IDORequestService/MGRestService.svc/json/{ido}/{props}/adv?customloadmethod=IR_GetGrnDetailSp&customloadmethodparms={customloadmethodparms}&loadtype=NEXT&readonly=true&rowcap=-1";
// url += $"?key={customloadmethodparms}";
// LogNet.log.Info($"请求url:{url}");
// string result = Http.SendGetRequest(url, tokensValue);
// lists = JsonConvert.DeserializeObject<ResponseData>(result);
// if (lists.MessageCode != 0 || lists.Items.Count == 0)
// {
// throw new Exception($"{lists.Message}");
// }
// LogNet.log.Info($"{url}:返回数据{lists}");
// }
// else
// {
// string customloadmethodparms = $"{UserKeyword},";
// url += $"?key={customloadmethodparms}";
// LogNet.log.Info($"请求url:{url}");
// string result = Http.Requestdata(url);
// lists = JsonConvert.DeserializeObject<ResponseData>(result);
// if (lists.MessageCode != 0 || lists.Items.Count == 0)
// {
// throw new Exception($"{lists.Message}");
// }
// LogNet.log.Info($"{url}:返回数据{lists}");
// }
// foreach (var item in lists.Items)
// {
// for (int i = 0; i < extensions.Count; i++)
// {
// if (extensions[i].Key == item.Name)
// {
// extensions[i].Control.Text = item.Value.ToString();
// }
// }
// }
// }
// catch (Exception ex)
// {
// MessageBox.Show(ex.Message); ;
// }
//}
#endregion
private void GetDataButtonClick(object sender, EventArgs e)
{
Dictionary<string, string> valuePairs = new Dictionary<string, string>();
try
{
string datakey = Config.DataSource_DataKey;
foreach (var items in extensions.Where(a => a.Type == "TextBox" && a.Key == datakey))
{
string value = items.Control.Text;
var data = ExtraFileData.AllData[value];
foreach (var item in data)
{
var ext = extensions.Where(a => a.Type == "TextBox" && a.Key == item.Key).ToList();
foreach (var Control in ext)
{
Control.Control.Text = item.Value;
valuePairs.Add(Control.Key, item.Value);
}
}
}
lastkey = valuePairs;
}
catch (Exception)
{
LogNet.log.Info("GetDataButtonClick:请求本地文件数据替换出错!");
}
}
public void DrawTextBackground(Dictionary<string, string> key)
{
if (extensions != null && !extensions[0].Control.InvokeRequired)
......@@ -541,7 +481,7 @@ namespace BLL
{
if (key[extensions[i].Key].StartsWith("<OCR>"))
{
extensions[i].Control.ForeColor = Color.Yellow;
extensions[i].Control.ForeColor = System.Drawing.Color.Yellow;
}
if (!focused && key[extensions[i].Key].StartsWith("<OCR>"))
{
......@@ -555,6 +495,7 @@ namespace BLL
Application.DoEvents();
}
bool isprint = false;
public void Print(bool match, Dictionary<string, string> key)
{
if (extensions != null && !extensions[0].Control.InvokeRequired)
......@@ -562,11 +503,13 @@ namespace BLL
//自动打印and模板匹配成功,只负责打印标签
if (config.AutoPrint && match)
{
PrintLabel(null, EventArgs.Empty);
isprint = true;
PrintLabel(true, EventArgs.Empty);
}
//bool close = ConfigHelper.Config.Get("isprinclose", false);
}
//进行追溯配置保存
SaveRetrospect?.Invoke(key);
////进行追溯配置保存
//SaveRetrospect?.Invoke(key);
}
public Dictionary<string, string> ReplaceData(Dictionary<string, string> key)
......
using DocumentFormat.OpenXml.Spreadsheet;
using log4net;
using log4net.Repository.Hierarchy;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class InvokePlugin
{
static Assembly assembly;
static Type type;
static object instantiation;
static bool isLoadok = false;
private ILog _log=null;
static Dictionary<string, MethodInfo> MethodInfos = new Dictionary<string, MethodInfo>();
public bool LoadDLL(string plugname, ILog log)
{
if (!isLoadok)
{
_log = log;
isLoadok = _LoadDLL(plugname);
}
return isLoadok;
}
private bool _LoadDLL(string plugname)
{
if (!File.Exists("Config\\" + plugname + ".dll"))
{
_log.Error($"LoadDLL 未找到{plugname}.DLL");
return false;
}
try
{
assembly = Assembly.LoadFrom("config\\" + plugname + ".dll");
}
catch (Exception e)
{
_log.Error("LoadDLL", e);
return false;
}
type = assembly.GetType("Plugin.Plugin");
if (type == null)
{
return false;
}
instantiation = Activator.CreateInstance(type);
_log.Info("LoadDLL success");
string[] methods = new string[] { "RequestServer" };
foreach (var meths in methods)
{
var method = type.GetMethod(meths);
if (method != null)
MethodInfos.Add(meths, method);
}
_log.Info("LoadDLL Method:" + string.Join(",", MethodInfos.Keys));
return true;
}
/// <summary>
/// 替换键值对 值的数据
/// </summary>
/// <param name="dic"></param>
/// <param name="httpmaeth">请求方式:0为httpget;1为httppost;2为soappost</param>
/// <returns></returns>
public Dictionary<string, string> RequestServer(Dictionary<string, string> dic,int httpmaeth)
{
if (!MethodInfos.ContainsKey("RequestServer"))
return null;
return (Dictionary<string, string>)MethodInfos["RequestServer"].Invoke(instantiation, new object[] { dic, httpmaeth });
}
}
}
using Model;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary.AutoScanAndLabel
{
public static class LabelingPosition
{
//public static Point MultipleChoiceLabeling(LabelParam labelParam, Point centrality, out int angle,out Bitmap bitmaps)
//{
// //7寸XY偏移量
// int Xpianyilian_7 = ConfigHelper.Config.Get<int>("Labeling_Xpianyilian_7", 0);
// int Ypianyilian_7 = ConfigHelper.Config.Get<int>("Labeling_Ypianyilian_7", 0);
// //13寸XY偏移量
// int Xpianyilian_13 = ConfigHelper.Config.Get<int>("Labeling_Xpianyilian_13", 0);
// int Ypianyilian_13 = ConfigHelper.Config.Get<int>("Labeling_Ypianyilian_13", 0);
// //15寸XY偏移量
// int Xpianyilian_15 = ConfigHelper.Config.Get<int>("Labeling_Xpianyilian_15", 0);
// int Ypianyilian_15 = ConfigHelper.Config.Get<int>("Labeling_Ypianyilian_15", 0);
// //7寸朝那个方向贴标true顺时针,false逆时针
// bool istoward_7 = ConfigHelper.Config.Get<bool>("Labeling_istoward_7", true);
// int degree_7 = ConfigHelper.Config.Get<int>("Labeling_degree_7", 90);
// //13寸朝那个方向贴标true顺时针,false逆时针
// bool istoward_13 = ConfigHelper.Config.Get<bool>("Labeling_istoward_13", true);
// int degree_13 = ConfigHelper.Config.Get<int>("Labeling_degree_13", 90);
// //15寸朝那个方向贴标true顺时针,false逆时针
// bool istoward_15 = ConfigHelper.Config.Get<bool>("Labeling_istoward_15", true);
// int degree_15 = ConfigHelper.Config.Get<int>("Labeling_degree_15", 90);
// //7寸标签旋转多少度
// int Scalerotationdegree_7 = ConfigHelper.Config.Get<int>("Labeling_Scalerotationdegree_7", 90);
// //13寸标签旋转多少度
// int Scalerotationdegree_13 = ConfigHelper.Config.Get<int>("Labeling_Scalerotationdegree_13", 90);
// //15寸标签旋转多少度
// int Scalerotationdegree_15 = ConfigHelper.Config.Get<int>("Labeling_Scalerotationdegree_15", 90);
// #region 数据
// //标签位置
// SolidBrush blue = new SolidBrush(Color.DarkBlue);
// //料盘中心点
// SolidBrush red = new SolidBrush(Color.Red);
// //贴标位置
// SolidBrush yeelow = new SolidBrush(Color.Yellow);
// Bitmap srcbitmap;
// if (File.Exists(labelParam.bitmapfilename))
// {
// srcbitmap = new Bitmap(labelParam.bitmapfilename);
// }
// else
// {
// srcbitmap = new Bitmap(3648, 3648);
// }
// Bitmap bitmap = new Bitmap(srcbitmap);
// Graphics g = Graphics.FromImage(bitmap);
// Size pointsize = new Size(60, 60);
// g.FillEllipse(red, new Rectangle(centrality, pointsize));
// int idenx = 0; //Array.FindIndex(labelParam.AMatch, x => x);
// if (idenx == -1)
// {
// idenx = 0;
// }
// int angles = (int)labelParam.codeInfos[idenx].Orientation;
// Point CalPoint = new Point(labelParam.codeInfos[idenx].X, labelParam.codeInfos[idenx].Y);
// g.FillEllipse(blue, new Rectangle(CalPoint, pointsize));
// #endregion
// LogNet.log.Info($"标签坐标x={CalPoint.X},y={CalPoint.Y},中心点x={centrality.X},y={centrality.Y}");
// Point point = new Point();
// switch (labelParam.PlateW)
// {
// case 13:
// point = LabelingAngle_13(CalPoint, centrality, out angle);
// break;
// case 15:
// point = LabelingAngle_15(CalPoint, centrality, out angle);
// break;
// default:
// point = LabelingAngle_7(CalPoint, centrality, out angle);
// break;
// }
// g.FillEllipse(yeelow, new Rectangle(point, pointsize));
// g.Save();
// g.Dispose();
// ImageSave(bitmap);
// bitmaps = bitmap;
// return point;
//}
public static Point MultipleChoiceLabeling_new(string pathfile,string name,Point point,Point centrality, out Bitmap bitmaps)
{
#region 数据
//标签位置
SolidBrush blue = new SolidBrush(Color.DarkBlue);
//料盘中心点
SolidBrush red = new SolidBrush(Color.Red);
//贴标位置
SolidBrush yeelow = new SolidBrush(Color.Yellow);
Bitmap srcbitmap;
if (File.Exists(pathfile))
{
srcbitmap = new Bitmap(pathfile);
}
else
{
srcbitmap = new Bitmap(3648, 3648);
}
Bitmap bitmap = new Bitmap(srcbitmap);
Graphics g = Graphics.FromImage(bitmap);
Size pointsize = new Size(60, 60);
g.FillEllipse(red, new Rectangle(centrality, pointsize));
Point CalPoint = new Point(point.X, point.Y);
g.FillEllipse(blue, new Rectangle(CalPoint, pointsize));
#endregion
LogNet.log.Info($"标签坐标x={CalPoint.X},y={CalPoint.Y},中心点x={centrality.X},y={centrality.Y}");
Point point_new = new Point();
g.FillEllipse(yeelow, new Rectangle(point, pointsize));
g.Save();
g.Dispose();
ImageSave(bitmap);
bitmaps = bitmap;
return point;
}
public static Point LabelingAngle(string name,Point lable, Point centrality, out int angle)
{
//7寸XY偏移量
int Xpianyilian_7 = ConfigHelper.Config.Get<int>("Labeling_Xpianyilian_7", 100);
int Ypianyilian_7 = ConfigHelper.Config.Get<int>("Labeling_Ypianyilian_7", 100);
//7寸朝那个方向贴标true顺时针,false逆时针
bool istoward_7 = ConfigHelper.Config.Get<bool>("Labeling_istoward_7", true);
int degree_7 = ConfigHelper.Config.Get<int>("Labeling_degree_7", 90);
//7寸标签旋转多少度
int Scalerotationdegree_7 = ConfigHelper.Config.Get<int>("Labeling_Scalerotationdegree_7", 90);
Point point = lable;
LogNet.log.Info($"7寸料盘,原标签角度={lable};中心点={centrality};");
if (istoward_7)
{
point = ClockwiseRotation(lable, centrality, degree_7);
}
else
{
point = CounterclockwiseRotation(lable, centrality, degree_7);
}
Point Newpoint = new Point(point.X + Xpianyilian_7, point.Y + Ypianyilian_7);
LogNet.log.Info($"7寸料盘,xy轴偏移后位置,x={Newpoint.X},y={Newpoint.Y}");
angle = Scalerotationdegree_7;
return Newpoint;
}
public static Point LabelingAngle_7(Point lable, Point centrality, out int angle)
{
//7寸XY偏移量
int Xpianyilian_7 = ConfigHelper.Config.Get<int>("Labeling_Xpianyilian_7", 100);
int Ypianyilian_7 = ConfigHelper.Config.Get<int>("Labeling_Ypianyilian_7", 100);
//7寸朝那个方向贴标true顺时针,false逆时针
bool istoward_7 = ConfigHelper.Config.Get<bool>("Labeling_istoward_7", true);
int degree_7 = ConfigHelper.Config.Get<int>("Labeling_degree_7", 90);
//7寸标签旋转多少度
int Scalerotationdegree_7 = ConfigHelper.Config.Get<int>("Labeling_Scalerotationdegree_7", 90);
Point point = lable;
LogNet.log.Info($"7寸料盘,原标签角度={lable};中心点={centrality};");
if (istoward_7)
{
point = ClockwiseRotation(lable, centrality, degree_7);
}
else
{
point = CounterclockwiseRotation(lable, centrality, degree_7);
}
Point Newpoint = new Point(point.X + Xpianyilian_7, point.Y + Ypianyilian_7);
LogNet.log.Info($"7寸料盘,xy轴偏移后位置,x={Newpoint.X},y={Newpoint.Y}");
angle = Scalerotationdegree_7;
return Newpoint;
}
public static Point LabelingAngle_13(Point lable, Point centrality, out int angle)
{
//13寸XY偏移量
int Xpianyilian_13 = ConfigHelper.Config.Get<int>("Labeling_Xpianyilian_13", 100);
int Ypianyilian_13 = ConfigHelper.Config.Get<int>("Labeling_Ypianyilian_13", 100);
//13寸朝那个方向贴标true顺时针,false逆时针
bool istoward_13 = ConfigHelper.Config.Get<bool>("Labeling_istoward_13", true);
int degree_13 = ConfigHelper.Config.Get<int>("Labeling_degree_13", 90);
//13寸标签旋转多少度
int Scalerotationdegree_13 = ConfigHelper.Config.Get<int>("Labeling_Scalerotationdegree_13", 90);
Point point = lable;
LogNet.log.Info($"13寸料盘,原标签角度={lable};中心点={centrality};");
if (istoward_13)
{
point = ClockwiseRotation(lable, centrality, degree_13);
}
else
{
point = CounterclockwiseRotation(lable, centrality, degree_13);
}
Point Newpoint = new Point(point.X + Xpianyilian_13, point.Y + Ypianyilian_13);
LogNet.log.Info($"13寸料盘,xy轴偏移后位置,x={Newpoint.X},y={Newpoint.Y}");
angle = Scalerotationdegree_13;
return Newpoint;
}
public static Point LabelingAngle_15(Point lable, Point centrality, out int angle)
{
//15寸XY偏移量
int Xpianyilian_15 = ConfigHelper.Config.Get<int>("Labeling_Xpianyilian_15", 100);
int Ypianyilian_15 = ConfigHelper.Config.Get<int>("Labeling_Ypianyilian_15", 100);
//15寸朝那个方向贴标true顺时针,false逆时针
bool istoward_15 = ConfigHelper.Config.Get<bool>("Labeling_istoward_15", true);
int degree_15 = ConfigHelper.Config.Get<int>("Labeling_degree_15", 90);
//15寸标签旋转多少度
int Scalerotationdegree_15 = ConfigHelper.Config.Get<int>("Labeling_Scalerotationdegree_15", 90);
Point point = lable;
LogNet.log.Info($"15寸料盘,原标签角度={lable};中心点={centrality};");
if (istoward_15)
{
point = ClockwiseRotation(lable, centrality, degree_15);
}
else
{
point = CounterclockwiseRotation(lable, centrality, degree_15);
}
Point Newpoint = new Point(point.X + Xpianyilian_15, point.Y + Ypianyilian_15);
LogNet.log.Info($"15寸料盘,xy轴偏移后位置,x={Newpoint.X},y={Newpoint.Y}");
angle = Scalerotationdegree_15;
return Newpoint;
}
/// <summary>
/// 顺时针旋转
/// </summary>
/// <param name="lable">标签坐标</param>
/// <param name="center">中心点</param>
/// <param name="angle">旋转角度</param>
/// <returns></returns>
public static Point ClockwiseRotation(Point lable, Point center, double angle)
{
angle += 83;
double theta = angle * Math.PI / 180;
double x_new = (lable.X - center.X) * Math.Cos(theta) - (lable.Y - center.Y) * Math.Sin(theta) + center.X;
double y_new = (lable.X - center.X) * Math.Sin(theta) + (lable.Y - center.Y) * Math.Cos(theta) + center.Y;
LogNet.log.Info($"顺时针旋转{angle}度,x={x_new},y={y_new};");
return new Point((int)x_new, (int)y_new);
}
/// <summary>
/// 逆时针旋转
/// </summary>
/// <param name="lable">标签坐标</param>
/// <param name="center">中心点</param>
/// <param name="angle">旋转角度</param>
/// <returns></returns>
public static Point CounterclockwiseRotation(Point lable, Point center, double angle)
{
lable=ClockwiseRotation(lable, center, 0);
double theta = angle * Math.PI / 180;
//double x, double y, double h, double k, double angle
//double x_new = (x - h) * Math.Cos(theta) + (y - k) * Math.Sin(theta) + h;
//double y_new = -(x - h) * Math.Sin(theta) + (y - k) * Math.Cos(theta) + k;
double x_new = (lable.X - center.X) * Math.Cos(theta) + (lable.Y - center.Y) * Math.Sin(theta) + center.X;
double y_new = -(lable.X - center.X) * Math.Sin(theta) + (lable.Y - center.Y) * Math.Cos(theta) + center.Y;
LogNet.log.Info($"逆时针旋转{angle}度,x={x_new},y={y_new};");
return new Point((int)x_new, (int)y_new);
}
static void ImageSave(Bitmap bitmap)
{
string filepath = Application.StartupPath + "\\image\\Labeling\\";
if (!Directory.Exists(filepath))
{
Directory.CreateDirectory(filepath);
}
else if (Directory.GetFiles(filepath).Length > 100)
{
try
{
Directory.Delete(filepath, true);
Directory.CreateDirectory(filepath);
}
catch (Exception)
{
LogNet.log.Info($"删除失败:{filepath}");
}
}
Bitmap bitmaps = (Bitmap)bitmap.Clone();
bitmaps.Save(filepath + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + DateTime.Now.Millisecond + ".jpg");
//LabelResult?.Invoke(new LabelResult() { Bitmap = (Bitmap)bitmap.Clone() });
//bitmap.Dispose();
}
}
}
using System;
using CameraVisionLib.Model;
using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Xml;
using CameraVisionLib.Model;
using DocumentFormat.OpenXml.Drawing;
using DocumentFormat.OpenXml.Math;
using Model;
using Newtonsoft.Json;
namespace BLL
{
......@@ -40,6 +37,7 @@ namespace BLL
MaterialTemplate temp = LoadFile(xmlFile[i], jpgFile[i]);
mateTemp.Add(temp);
}
mateTemp = mateTemp.OrderBy(x=>x.Name).ToList();
}
public string[] Name
......@@ -138,14 +136,14 @@ namespace BLL
/// <param name="keyword">关键字和对应的内容</param>
/// <param name="isCodeUsed"></param>
/// <returns></returns>
public bool MatchingTemplate(List<BarcodeInfo> code, string firstMaterial, bool analyisMode, out string mateName, out Dictionary<string, string> keyword, out bool[] isCodeUsed)
public bool MatchingTemplate(List<BarcodeInfo> code, string firstMaterial, bool analyisMode, out string mateName, out Dictionary<string, string> keyword,out AMatch aMatch)
{
aMatch = new AMatch();
if (Directory.Exists("ocr"))
Directory.Delete("ocr", true);
mateName = "";
keyword = null;
isCodeUsed = null;
code.ForEach((c) =>
{
LogNet.log.Info($"扫描到 {c.CodeType},{c.Text}");
......@@ -153,12 +151,15 @@ namespace BLL
MatchAnalysis.StartNewAnalysis(code);
if (Config.Func_EnabledOCR)
{
Bitmap bitmaps =new Bitmap(CurrntBitmap);
//保存需要识别ocr的区域
//CurrntBitmap?.Save(@"ocr.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
string currentDirectory = System.Windows.Forms.Application.StartupPath;
string filePath = System.IO.Path.Combine(currentDirectory, "ocr.jpg");
CurrntBitmap?.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);
regOcrCodes = OcrRecognize("..\\ocr.jpg");
//CurrntBitmap?.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);
bitmaps?.Save(filePath);
regOcrCodes = OcrRecognize($"{currentDirectory}\\ocr.jpg");
LogNet.log.Info($"保存地址:{filePath};获取地址:{currentDirectory}\\ocr.jpg");
LogNet.log.Info($"OCR 识别结果:{regOcrCodes}");
}
......@@ -166,7 +167,7 @@ namespace BLL
int firstIndex = mateTemp.FindIndex(math => math.Name == firstMaterial);
if (firstIndex > -1)
{
if (TemplateExtract(firstIndex, code, out keyword, out isCodeUsed))
if (TemplateExtract(firstIndex, code, out keyword,out aMatch))
{
//if (string.IsNullOrEmpty(mateName))
mateName = mateTemp[firstIndex].Name;
......@@ -183,7 +184,7 @@ namespace BLL
int index = mateTemp[i].Code.FindIndex(match => match.ID == mateTemp[i].PrimaryCode);
if (index == -1) continue;
string text = mateTemp[i].Match.Find(m => m.CodeID == mateTemp[i].Code[index].ID).Keyword;
if (TemplateExtract(i, code, out keyword, out isCodeUsed))
if (TemplateExtract(i, code, out keyword, out aMatch))
{
//if (string.IsNullOrEmpty(mateName))
mateName = mateTemp[i].Name;
......@@ -197,7 +198,7 @@ namespace BLL
{
if (i == firstIndex) continue;
if (mateTemp[i].PrimaryCode != -1) continue;
if (TemplateExtract(i, code, out keyword, out isCodeUsed))
if (TemplateExtract(i, code, out keyword, out aMatch))
{
//if (string.IsNullOrEmpty(mateName))
mateName = mateTemp[i].Name;
......@@ -220,10 +221,10 @@ namespace BLL
temp.PrimaryCode = Convert.ToInt32(xmlRoot.Attributes["PrimaryCode"].Value);
temp.FilePath = filePath;
temp.ImagePath = imgPath;
if (System.IO.File.Exists(imgPath))
{
temp.Image = ObjConversion.ReadImageFile(imgPath);
}
//if (System.IO.File.Exists(imgPath))
//{
// temp.Image = ObjConversion.ReadImageFile(imgPath);
//}
temp.Code.AddRange(LoadMateCode());
temp.Ocr.AddRange(LoadMateOcr());
......@@ -234,7 +235,6 @@ namespace BLL
LogNet.log.Error("LoadFile", ex);
}
return temp;
}
private List<MaterialCode> LoadMateCode()
......@@ -391,10 +391,13 @@ namespace BLL
temp.State = TemplateState.Saved;
}
private bool TemplateExtract(int index, List<BarcodeInfo> code, out Dictionary<string, string> keyword, out bool[] isCodeUsed)
private bool TemplateExtract(int index, List<BarcodeInfo> code, out Dictionary<string, string> keyword, out AMatch aMatch)
{
aMatch = new AMatch();
bool Islable= true;
keyword = new(StringComparer.OrdinalIgnoreCase);
isCodeUsed = new bool[code.Count];
aMatch.IsCodeUsed = new bool[code.Count];
int matchCount = 0;
bool isMatch = false;
List<MaterialCode> ocrlist = new List<MaterialCode>();
......@@ -411,19 +414,24 @@ namespace BLL
for (int j = 0; j < code.Count; j++)
{
Dictionary<string, string> matchKey = CodeMatch(code[j], codeMatch);
Dictionary<string, string> matchKey = CodeMatch(code[j], codeMatch,out bool isIdentification);
if (matchKey != null && matchKey.Count > 0)
{
isCodeUsed[j] = true;
foreach (string key in matchKey.Keys)
{
if (!keyword.ContainsKey(key))
{
if (isIdentification&& Islable)
{
Islable = false;
aMatch.IsCodeUsed[j] = true;
aMatch.Points= new Point((int)code[j].Center.X, (int)code[j].Center.Y);
aMatch.Angle = (int)code[j].Angle;
}
MatchCodeIndex.Add(j);
keyword.Add(key, matchKey[key]);
LogNet.log.Info($"{mateTemp[index].Name} 匹配 [{key}={matchKey[key]}]");
}
}
}
......@@ -447,7 +455,7 @@ namespace BLL
{
if (string.IsNullOrEmpty(regCode)) continue;
var x = new BarcodeInfo() { Text = regCode, CodeType = Setting_Str.OCR };
Dictionary<string, string> matchKey = CodeMatch(x, codeMatch);
Dictionary<string, string> matchKey = CodeMatch(x, codeMatch, out bool isIdentification );
if (matchKey != null)
{
foreach (string key in matchKey.Keys)
......@@ -460,7 +468,6 @@ namespace BLL
LogNet.log.Info($"{mateTemp[index].Name} OCR匹配 [{key}={value}]");
}
}
}
}
}
......@@ -497,6 +504,13 @@ namespace BLL
}
code = code2.ToList();
#endregion
if (aMatch.Points.X==-1||aMatch.Points.Y==-1)
{
//aMatch.IsCodeUsed[0] = true;
aMatch.Points = new Point((int)code[0].Center.X, (int)code[0].Center.Y);
aMatch.Angle = (int)code[0].Angle;
}
return true;
}
else
......@@ -585,12 +599,12 @@ namespace BLL
ocrRotate.Save($"ocr\\{ocrname}.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
return ocrRotate;
}
private Dictionary<string, string> CodeMatch(BarcodeInfo codeinfo, List<MaterialCodeMatch> codeMatch)
private Dictionary<string, string> CodeMatch(BarcodeInfo codeinfo, List<MaterialCodeMatch> codeMatch,out bool Identification)
{
Dictionary<string, string> key = new();
string code, text;
int index, count;
Identification = false;
for (int i = 0; i < codeMatch.Count; i++)
{
......@@ -605,10 +619,13 @@ namespace BLL
if (codeMatch[i].CheckCodeType && !string.IsNullOrEmpty(codeMatch[i].CodeType) && !string.IsNullOrEmpty(codeinfo.CodeType))
{
matchCount++;
if (codeinfo.CodeType != codeMatch[i].CodeType)
{
if (!IsCodeEqual(codeinfo.CodeType, codeMatch[i].CodeType))
{
ismatch = false;
}
}
MatchAnalysis.AddMatch(codeMatch[i].Keyword, ismatch, codeMatch[i].CodeID, $"条码类型:{codeMatch[i].CodeType}", $"{codeinfo.CodeType}");
//if (!ismatch) return null;
}
......@@ -690,9 +707,6 @@ namespace BLL
//if (!ismatch) return null;
}
//截取
if (!ismatch) continue;
int startIndex = codeMatch[i].SubstringStart;
......@@ -749,6 +763,10 @@ namespace BLL
key[codeMatch[i].Keyword] = filtercode.Trim();
else
key.Add(codeMatch[i].Keyword, filtercode.Trim());
if (codeMatch[i].Characteristic)
{
Identification = true;
}
}
return key;
}
......@@ -1127,5 +1145,55 @@ namespace BLL
// temp.Image.Save(temp.ImagePath, System.Drawing.Imaging.ImageFormat.Jpeg);
//}
}
/// <summary>
/// 对应新旧相机code类型
/// </summary>
/// <param name="type"></param>
/// <param name="codetype"></param>
/// <returns></returns>
public bool IsCodeEqual(string type,string codetype)
{
type = type.Replace(" ","");
codetype = codetype.Replace(" ", "");
LogNet.log.Info($"type={type},codetype={codetype}");
try
{
string Correspondence = ConfigHelper.Config.Get("Template_CodeCorrespondences");
Dictionary<string, string> dic = new Dictionary<string, string>();
//初始化对应数据
if (string.IsNullOrEmpty(Correspondence))//
{
dic.Add("Code39码", "Code39");
dic.Add("Code93码", "Code93");
dic.Add("Code128码", "Code128");
dic.Add("QR码", "QRCode");
dic.Add("DM码", "DataMatrixECC200");
dic.Add("PDF417码", "PDF417");
dic.Add("OCR", "OCR");
dic.Add("交叉25码", "2/5Interleaved");
dic.Add("DataMatrix", "DataMatrixECC200");
Correspondence = JsonConvert.SerializeObject(dic);
ConfigHelper.Config.Set("Template_CodeCorrespondences", Correspondence);
}
dic = JsonConvert.DeserializeObject<Dictionary<string, string>>(Correspondence);
if (dic.TryGetValue(type, out string typeValue) && typeValue == codetype)
{
LogNet.log.Info($"匹配结果为true");
return true;
}
if (dic.TryGetValue(codetype, out string codetypeValue) && codetypeValue == type)
{
LogNet.log.Info($"匹配结果为true");
return true;
}
return false;
}
catch (Exception ex)
{
LogNet.log.Info($"条形码对应失败:{type}:{codetype};{ex.Message}");
return false;
}
}
}
}
\ No newline at end of file
......@@ -46,8 +46,6 @@ namespace BLL
loop = false;
}
/// <summary>
/// 计时线程
/// </summary>
......
......@@ -37,7 +37,7 @@ namespace BLL
Process process = new Process();
process.StartInfo = new ProcessStartInfo();
process.StartInfo.FileName = paddle;
process.StartInfo.WorkingDirectory = ".\\paddle";
process.StartInfo.WorkingDirectory =Application.StartupPath+"\\paddle";
process.Start();
}
catch (Exception ex)
......@@ -58,7 +58,7 @@ namespace BLL
Process process = new Process();
process.StartInfo = new ProcessStartInfo();
process.StartInfo.FileName = paddle;
process.StartInfo.WorkingDirectory = ".\\paddle";
process.StartInfo.WorkingDirectory = Application.StartupPath + "\\paddle";
process.Start();
}
catch (Exception ex)
......@@ -72,7 +72,9 @@ namespace BLL
[HandleProcessCorruptedStateExceptions]
static string StartCplusOcr(string imgPath)
{
LogNet.log.Error("进入OcrGet请求");
string json=Http.Get($"{baseUrl}?ver=cplus&imgPath={imgPath}");
LogNet.log.Error($"返回数据为:{json}");
Result result= JsonConvert.DeserializeObject<Result>(json);
return result?.data??"";
}
......
......@@ -14,8 +14,6 @@ namespace BLL
private List<PrintLabelTemplate> labelTemp; //所有模板文件
private PrintLabelTemplate interimLabel; //临时的
////private string _path;
//private int labelIdx = -1;
//private int fieldIdx = -1;
......@@ -43,7 +41,6 @@ namespace BLL
//public event SelectEvent Selected;
//public event LabelSizeEvent LabelSize;
public PrintLabelEdit()
{
LogNet.log.Info("读取打印标签");
......@@ -59,7 +56,6 @@ namespace BLL
PrintLabelTemplate temp = LoadFile(xmlFile[i]);
labelTemp.Add(temp);
}
}
public string[] Name
......@@ -368,25 +364,6 @@ namespace BLL
}
//====================================
///// <summary>
///// 标签名称
///// </summary>
......
......@@ -21,23 +21,23 @@ namespace BLL
if (macroKey == null || macroKey.Count < 0)
{
LogNet.log.Error("更换关键字:未找到任何关键字信息,请重新设置!");
throw new Exception("未找到任何关键字信息,请重新设置!");
return jsondata;
}
if (config.Method != Method.POST && config.Method != Method.GET)
{
LogNet.log.Error("更换关键字:请求方式参数不正确!");
throw new Exception("请求方式参数不正确!");
return jsondata;
}
if (config.IsTokenRequired && config.Tokenurl == null)
{
LogNet.log.Error("更换关键字:需要请求token,请填写tokenurl!");
throw new Exception("需要请求token,请填写tokenurl!");
return jsondata;
}
if (string.IsNullOrWhiteSpace(config.Url) || config.KeyWords.Length < 0)
{
LogNet.log.Error("更换关键字:URL和关键字不能为空");
throw new Exception("URL和关键字不能为空");
return jsondata;
}
config.filteredData = macroKey
.Where(kvp => config.KeyWords.Contains(kvp.Key))
......@@ -48,7 +48,7 @@ namespace BLL
{
LogNet.log.Error($"更换关键字:关键字未包含;{config.KeyWords}");
throw new Exception($"关键字未包含;{config.KeyWords}");
return jsondata;
}
#endregion
......@@ -69,7 +69,7 @@ namespace BLL
jsondata = SendHttpRequest(config, request);
if (string.IsNullOrWhiteSpace(jsondata))
{
throw new Exception("返回信息为空请检查请求!");
return jsondata;
}
#endregion
return jsondata;
......
using DataHandling;
using log4net;
using MemoryRead;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
namespace Plugin
{
public class Plugin
{
private static ILog log = LogManager.GetLogger("SmartScan");
public Dictionary<string, string> CompleteData = new Dictionary<string, string>();
/// <summary>
/// 请求webserver获取替换数据
/// </summary>
/// <param name="pasr">请求的关键字和内容</param>
/// <param name="method">0:http_get;1:http_post;2:soap</param>
/// <returns>返回键值对</returns>
public Dictionary<string, string> RequestServer(Dictionary<string, string> pasr, int method)
{
try
{
log.Info($"WebServer_请求参数:{JsonConvert.SerializeObject(pasr)}");
if (pasr == null || pasr.Count <= 0)
{
log.Info("WebServer_传入参数为空");
return pasr;
}
CompleteData = pasr;
if (!ConfigHelper.Config.Get("WebServer_Isformal", true))
{
pasr = MatchDicData(pasr);
log.Info($"对应关系处理后数据:{JsonConvert.SerializeObject(pasr)}");
}
Dictionary<string, string> dic = new Dictionary<string, string>();
String Url = ConfigHelper.Config.Get("WebServer_Url", "http://10.159.150.10/EIWebService/Service1.asmx");
String MethodName = ConfigHelper.Config.Get("WebServer_MethodName", "VmsizBarkodOlusturUserName");
WebServiceHelper webService = new WebServiceHelper(log);
switch (method)
{
case 0:
dic = webService.QueryGetWebService(Url, MethodName, pasr);
break;
case 1:
dic = webService.QueryPostWebService(Url, MethodName, pasr);
break;
case 2:
dic = webService.QuerySoapWebService(Url, MethodName, pasr);
break;
default:
break;
}
//foreach (var item in dic)
//{
// if (CompleteData.ContainsKey(item.Key))
// {
// CompleteData[item.Key] = item.Value;
// }
//}
//return CompleteData;
if (dic != null || dic.Count != 0)
{
string json = JsonConvert.SerializeObject(dic);
log.Info($"WebServer_返回数据:{json}");
}
else
{
log.Info($"WebServer_返回数据:为空!");
}
return YourMethod(dic);
}
catch (Exception ex)
{
log.Info($"WebServer请求出错:{ex.Message}");
return CompleteData;
}
//string[] shuz = { "Material code", "Tracibilty Serial Number", "Qty", "Supplier Code", "Code for who printed this label", "Qr barcode" };
}
/// <summary>
/// 对应键值对信息
/// </summary>
/// <param name="dic"></param>
/// <returns></returns>
public Dictionary<string, string> MatchDicData(Dictionary<string, string> dic)
{
Dictionary<string, string> parameterToContent = new Dictionary<string, string>();
string json = ConfigHelper.Config.Get("WebServer_Match", "{\"malzemeKodu\":\"\",\"firmaKodu\":\"\",\"malzemeAdet\":\"\",\"lot\":\"\",\"firmaUrunKodu\":\"PN\"}");
Dictionary<string, string> matchdata = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
foreach (var item in matchdata)
{
if (dic.ContainsKey(item.Value))
{
parameterToContent.Add(item.Key, dic[item.Value]);
}
}
parameterToContent.Add("barkodAdet", "1");
parameterToContent.Add("printerMacId", "0F0F0F0F0F0F");
parameterToContent.Add("userName", "bekoservice");
parameterToContent.Add("pass", "beko1209tyu");
parameterToContent.Add("basanUserName", "579");
return parameterToContent;
}
/// <summary>
/// 对应返回的键值对数据
/// </summary>
/// <param name="dic"></param>
/// <returns></returns>
public Dictionary<string, string> YourMethod(Dictionary<string, string> dic)
{
List<string> strings = new List<string>();
foreach (var item in dic)
{
strings.Add(item.Value);
}
log.Info($"请求完成数据:{string.Join(",", strings)}");
if (strings.Contains("OK"))
{
string[] arr = strings[1].Split('$');
if (ConfigHelper.Config.Get("WebServer_Isformal", true))
{
Dictionary<string, string> keys = new Dictionary<string, string>()
{
{"Material code", arr[1]},
{"Tracibilty Serial Number", arr[2]},
{"Qty", arr[3]},
{"Supplier Code", arr[4]},
{"Code for who printed this label", "579579"},
{"Qr barcode", strings[1]}
};
return keys;
}
else
{
try
{
Dictionary<string, int> valuePairs = new Dictionary<string, int>()
{
{"Material code", 0},
{"Tracibilty Serial Number", 1},
{"Qty", 2},
{"Supplier Code", 3},
{"Code for who printed this label", 4},
{"Qr barcode", 5}
};
foreach (var item in valuePairs)
{
if (CompleteData.ContainsKey(item.Key))
{
if (valuePairs.Count > 4)
{
CompleteData[item.Key] = arr[item.Value];
}
}
}
if (CompleteData.ContainsKey("Code for who printed this label"))
{
CompleteData["Code for who printed this label"] = "579579";
}
if (CompleteData.ContainsKey("Qr barcode"))
{
CompleteData["Qr barcode"] = strings[1];
}
log.Info($"请求对应完成数据:{string.Join(",", CompleteData.Values)}");
}
catch (Exception ex)
{
log.Error($"处理返回数据报错:{ex.Message}");
}
}
}
return CompleteData;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0F23B7DB-9953-46ED-9166-115646467647}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DataHandling</RootNamespace>
<AssemblyName>DataHandling</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\..\..\..\类库\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\CameraLibraryProject\CameraLibraryProject\CodeLibraryProject\CodeLibrary\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CallImplementation.cs" />
<Compile Include="LogUtil.cs" />
<Compile Include="WebServiceHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using log4net.Config;
using log4net;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace MemoryRead
{
public class LogUtil
{
public static ILog LOGGER;
static LogUtil()
{
XmlConfigurator.Configure(new FileInfo("log4net.config"));
LOGGER = LogManager.GetLogger("SmartScan");
}
public static void info(string str, Color color)
{
LOGGER.Info(str);
}
public static void info(string str)
{
LOGGER.Info(str);
}
public static void error(string str, Exception err)
{
LOGGER.Error(str, err);
}
public static void error(string str)
{
LOGGER.Error(str);
}
public static void debug(string str)
{
LOGGER.Debug(str);
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DataHandling")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataHandling")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("0f23b7db-9953-46ed-9166-115646467647")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
using log4net;
using MemoryRead;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Serialization;
namespace DataHandling
{
public class WebServiceHelper
{
private ILog _log;
public WebServiceHelper(ILog log)
{
_log = log;
}
//<webServices>
// <protocols>
// <add name="HttpGet"/>
// <add name="HttpPost"/>
// </protocols>
//</webServices>
private static Hashtable _xmlNamespaces = new Hashtable();//缓存xmlNamespace,避免重复调用GetNamespace
/// <summary>
/// 需要WebService支持Post调用
/// </summary>
public Dictionary<string,string> QueryPostWebService(String URL, String MethodName, Dictionary<string,string> Pars)
{
//Dictionary<string, string> dic=new Dictionary<string, string>();
//try
//{
// HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(URL + "/" + MethodName);
// request.Method = "POST";
// request.ContentType = "application/x-www-form-urlencoded";
// SetWebRequest(request);
// byte[] data = EncodePars(Pars);
// WriteRequestData(request, data);
// XmlDocument xmlDocument = ReadXmlResponse(request.GetResponse());
// dic=XmlToDictionary(xmlDocument);
//}
//catch (Exception ex)
//{
// _log.Info($"WebServer_POST错误提示:{ex.Message}");
//}
//return dic;
Dictionary<string, string> dic = new Dictionary<string, string>();
try
{
using (HttpClient client = new HttpClient())
{
string requestUri = $"{URL}/{MethodName}";
_log.Info($"WebServer_POST,请求路径:{requestUri}");
HttpResponseMessage response;
using (HttpContent content = new FormUrlEncodedContent(Pars))
{
response =client.PostAsync(requestUri, content).Result;
}
if (response.IsSuccessStatusCode)
{
string responseContent = response.Content.ReadAsStringAsync().Result;
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(responseContent);
dic = XmlToDictionary(xmlDocument);
}
else
{
_log.Info($"WebServer_POST错误提示:{response.ReasonPhrase}");
}
}
}
catch (Exception ex)
{
_log.Info($"WebServer_POST错误提示:{ex.Message}");
}
return dic;
}
/// <summary>
/// 需要WebService支持Get调用
/// </summary>
public Dictionary<string,string> QueryGetWebService(String URL, String MethodName, Dictionary<string,string> Pars)
{
Dictionary<string, string> dic= new Dictionary<string, string>();
try
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(URL + "/" + MethodName + "?" + ParsToString(Pars));
request.Method = "GET";
request.ContentType = "text/xml";
//_log.Info($"WebServer_Http请求路径为:{request.RequestUri};请求方式:{request.Method};" +
//$"ContentType:{request.ContentType};");
SetWebRequest(request);
XmlDocument xmlDocument = ReadXmlResponse(request.GetResponse());
dic = XmlToDictionary(xmlDocument);
string json = JsonConvert.SerializeObject(dic);
//_log.Info($"WebServer_返回数据:{json}");
}
catch (Exception ex)
{
using (StreamWriter writer = new StreamWriter("D:\\example.txt"))
{
writer.WriteLine($"{ex.Message}");
}
//LogUtil.info($"get报错{ex.Message}");
//_log.Error(ex.Message);
}
return dic;
}
/// <summary>
/// 通用WebService调用(Soap),参数Pars为String类型的参数名、参数值
/// </summary>
public Dictionary<string,string> QuerySoapWebService(String URL, String MethodName, Dictionary<string,string> Pars)
{
if (_xmlNamespaces.ContainsKey(URL))
{
return QuerySoapWebService(URL, MethodName, Pars, _xmlNamespaces[URL].ToString());
}
else
{
return QuerySoapWebService(URL, MethodName, Pars, GetNamespace(URL));
}
}
/// <summary>
/// 通用WebService调用(Soap)
/// </summary>
/// <param name="URL"></param>
/// <param name="MethodName"></param>
/// <param name="Pars"></param>
/// <param name="XmlNs"></param>
/// <returns></returns>
private Dictionary<string,string> QuerySoapWebService(String URL, String MethodName, Dictionary<string,string> Pars, string XmlNs)
{
Dictionary<string,string> dic= new Dictionary<string,string>();
try
{
_xmlNamespaces[URL] = XmlNs;//加入缓存,提高效率
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(URL);
request.Method = "POST";
request.ContentType = "text/xml; charset=utf-8";
request.Headers.Add("SOAPAction", "\"" + XmlNs + (XmlNs.EndsWith("/") ? "" : "/") + MethodName + "\"");
//_log.Info($"WebServer_SOAP请求路径为:{request.RequestUri};请求方式:{request.Method};" +
// $"ContentType:{request.ContentType};Headers_SOAPAction:{request.Headers.Get("SOAPAction")}");
SetWebRequest(request);
byte[] data = EncodeParsToSoap(Pars, XmlNs, MethodName);
WriteRequestData(request, data);
XmlDocument doc = new XmlDocument();
doc = ReadXmlResponse(request.GetResponse());
dic=XmlToDictionary(doc);
string json= JsonConvert.SerializeObject(dic);
string filePath = "D:\\example.txt";
using (StreamWriter writer = new StreamWriter(filePath))
{
writer.WriteLine(json);
}
//_log.Info($"WebServer_SOAP请求结果:{json}");
//XmlNamespaceManager mgr = new XmlNamespaceManager(doc.NameTable);
//mgr.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");
//String RetXml = doc.SelectSingleNode("//soap:Body/*/*", mgr).InnerXml;
//doc2.LoadXml("<root>" + RetXml + "</root>");
//AddDelaration(doc2);
//return doc2;
}
catch (Exception ex)
{
string filePath = "D:\\example.txt";
using (StreamWriter writer = new StreamWriter(filePath))
{
writer.WriteLine(ex.Message);
}
//_log.Error(ex.Message);
}
return dic;
}
/// <summary>
/// 通过WebService的WSDL获取XML名称空间
/// </summary>
/// <param name="URL"></param>
/// <returns></returns>
private static string GetNamespace(String URL)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL + "?WSDL");
SetWebRequest(request);
WebResponse response = request.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
XmlDocument doc = new XmlDocument();
doc.LoadXml(sr.ReadToEnd());
sr.Close();
return doc.SelectSingleNode("//@targetNamespace").Value;
}
/// <summary>
/// 动态生成SOP请求报文内容
/// </summary>
/// <param name="Pars"></param>
/// <param name="XmlNs"></param>
/// <param name="MethodName"></param>
/// <returns></returns>
private static byte[] EncodeParsToSoap(Dictionary<string,string> Pars, String XmlNs, String MethodName)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"></soap:Envelope>");
AddDelaration(doc);
XmlElement soapBody = doc.CreateElement("soap", "Body", "http://schemas.xmlsoap.org/soap/envelope/");
XmlElement soapMethod = doc.CreateElement(MethodName);
soapMethod.SetAttribute("xmlns", XmlNs);
foreach (string k in Pars.Keys)
{
XmlElement soapPar = doc.CreateElement(k);
soapPar.InnerXml = ObjectToSoapXml(Pars[k]);
soapMethod.AppendChild(soapPar);
}
soapBody.AppendChild(soapMethod);
doc.DocumentElement.AppendChild(soapBody);
return Encoding.UTF8.GetBytes(doc.OuterXml);
}
/// <summary>
/// 将对象转换成XML节点格式
/// </summary>
/// <param name="o"></param>
/// <returns></returns>
private static string ObjectToSoapXml(object o)
{
XmlSerializer mySerializer = new XmlSerializer(o.GetType());
MemoryStream ms = new MemoryStream();
mySerializer.Serialize(ms, o);
XmlDocument doc = new XmlDocument();
doc.LoadXml(Encoding.UTF8.GetString(ms.ToArray()));
if (doc.DocumentElement != null)
{
return doc.DocumentElement.InnerXml;
}
else
{
return o.ToString();
}
}
/// <summary>
/// 设置WEB请求
/// </summary>
/// <param name="request"></param>
private static void SetWebRequest(HttpWebRequest request)
{
request.Credentials = CredentialCache.DefaultCredentials;
request.Timeout = 10000;
}
/// <summary>
/// 设置请求数据
/// </summary>
/// <param name="request"></param>
/// <param name="data"></param>
private static void WriteRequestData(HttpWebRequest request, byte[] data)
{
request.ContentLength = data.Length;
Stream writer = request.GetRequestStream();
writer.Write(data, 0, data.Length);
writer.Close();
}
/// <summary>
/// 获取字符串的UTF8码字符串
/// </summary>
/// <param name="Pars"></param>
/// <returns></returns>
private byte[] EncodePars(Dictionary<string,string> Pars)
{
return Encoding.UTF8.GetBytes(ParsToString(Pars));
}
/// <summary>
/// 将Hashtable转换成WEB请求键值对字符串
/// </summary>
/// <param name="Pars"></param>
/// <returns></returns>
private static String ParsToString(Hashtable Pars)
{
StringBuilder sb = new StringBuilder();
foreach (string k in Pars.Keys)
{
if (sb.Length > 0)
{
sb.Append("&");
}
sb.Append(HttpUtility.UrlEncode(k) + "=" + HttpUtility.UrlEncode(Pars[k].ToString()));
}
return sb.ToString();
}
/// <summary>
/// 获取Webservice响应报文XML
/// </summary>
/// <param name="response"></param>
/// <returns></returns>
private static XmlDocument ReadXmlResponse(WebResponse response)
{
StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
String retXml = sr.ReadToEnd();
sr.Close();
XmlDocument doc = new XmlDocument();
doc.LoadXml(retXml);
return doc;
}
/// <summary>
/// 设置XML文档版本声明
/// </summary>
/// <param name="doc"></param>
private static void AddDelaration(XmlDocument doc)
{
XmlDeclaration decl = doc.CreateXmlDeclaration("1.0", "utf-8", null);
doc.InsertBefore(decl, doc.DocumentElement);
}
public static string ParsToString(Dictionary<string, string> Pars)
{
StringBuilder sb = new StringBuilder();
foreach (string key in Pars.Keys)
{
if (sb.Length > 0)
{
sb.Append("&");
}
sb.Append(HttpUtility.UrlEncode(key) + "=" + HttpUtility.UrlEncode(Pars[key]));
}
string str= sb.ToString();
return str;
}
private static Dictionary<string, string> XmlToDictionary(XmlDocument xml)
{
XmlNodeList stringNodes = xml.SelectNodes("//ns:string", GetXmlNamespaceManager(xml));
Dictionary<string, string> dic = new Dictionary<string, string>();
if (stringNodes != null)
{
int i = 1;
foreach (XmlNode node in stringNodes)
{
// 将 <string> 元素的内容添加到字典中
dic.Add(i.ToString(), node.InnerText);
i++;
}
}
return dic;
}
static XmlNamespaceManager GetXmlNamespaceManager(XmlDocument xmlDoc)
{
XmlNamespaceManager namespaceManager = new XmlNamespaceManager(xmlDoc.NameTable);
namespaceManager.AddNamespace("ns", xmlDoc.DocumentElement.NamespaceURI);
return namespaceManager;
}
private static List<string> XmlToString(XmlDocument xml)
{
List<string> strings = new List<string>();
String xmlnode = ConfigHelper.Config.Get("WebServer_xmlnode", "/ArrayOfString/");
XmlNodeList stringNodes = xml.SelectNodes(xmlnode);
foreach (XmlNode node in stringNodes)
{
strings.Add(node.InnerText);
}
return strings;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.15" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
</packages>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class AMatch
{
/// <summary>
/// 条码匹配结果
/// </summary>
public bool[] IsCodeUsed { get; set; }
/// <summary>
/// 第一个匹配条码的坐标
/// </summary>
public Point Points { get; set; }=new Point(-1,-1);
/// <summary>
/// 第一个匹配条码的角度
/// </summary>
public int Angle { get; set; } = 0;
}
/// <summary>
/// 计算完成新的XY坐标及角度
/// </summary>
public class NewPositionAngle()
{
public int X { get; set; }
public int Y { get; set; }
public int Angle { get; set; }
public bool[] IsCodeUsed { get; set; }
}
}
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Model
{
......@@ -13,7 +14,7 @@ namespace Model
{
public static readonly string LANGUAGE_DIR = Environment.CurrentDirectory + "\\Language\\";
public static readonly string MATERIAL_DIR = Environment.CurrentDirectory + "\\Material\\";
public static readonly string RETROSPECT_DIR = Environment.CurrentDirectory + "\\Retrospect\\";
public static readonly string RETROSPECT_DIR = Application.StartupPath + "\\Retrospect\\";
public static readonly string PRINT_LABEL_DIR = Environment.CurrentDirectory + "\\PrintLabel\\";
public static readonly string CONFIG_DIR = Environment.CurrentDirectory + "\\Config\\";
......
......@@ -33,11 +33,15 @@ namespace Model
public static string Get(string url)
{
RestClient client = new(url) { Timeout = 60000 };
RestRequest request = new(Method.GET);
IRestResponse response = client.Execute(request);
string s = response.Content;
//RestClient client = new(url) { Timeout = 60000 };
//RestRequest request = new(Method.GET);
//IRestResponse response = client.Execute(request);
//string s = response.Content;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, url);
var response = client.SendAsync(request).Result;
response.EnsureSuccessStatusCode();
string s= response.Content.ReadAsStringAsync().Result;
LogNet.log.Info($"[GET][URL:{url}][Return:{s}]");
return FormatContent(s);
}
......
......@@ -4,6 +4,8 @@ using System.ServiceModel.Web;
using System.Runtime.Serialization;
using System.Collections.Generic;
using CameraVisionLib.Model;
using System.Drawing;
using System.Reflection;
namespace Model
{
......@@ -28,6 +30,12 @@ namespace Model
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "NeoScan/ProcessBitmap?param={param}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
WebResultCode ProcessBitmap(Stream info, string param);
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "NeoScan/ProcessBitmaps",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
WebResultCode ProcessBitmaps(BitmapData bitmapData);
}
[DataContract]
......@@ -61,6 +69,8 @@ namespace Model
[DataMember]
public List<BarcodeInfo> workCodeInfo = new List<BarcodeInfo>();
[DataMember]
public NewPositionAngle PositionAngle { get; set; }
public WebResultCode()
{
ErrorCode = 0;
......@@ -87,4 +97,71 @@ namespace Model
public bool IsUsed { get; set; } = false;
}
[DataContract]
public class BitmapData
{
[DataMember]
public string ImageData { get; set; }
[DataMember]
public List<BarcodeInfos> BarCodeList { get; set; }
/// <summary>
/// 中心点xy
/// </summary>
[DataMember]
public int X { get; set; }
[DataMember]
public int Y { get; set; }
[DataMember]
public bool IsIDCamera { get; set; }
[DataMember]
public int PlateW { get; set; }
}
[DataContract]
public class BarcodeInfos
{
//
// 摘要:
// 文本
[DataMember]
public string Text { get; set; }
//
// 摘要:
// 条码类型
[DataMember]
public string CodeType { get; set; }
//
// 摘要:
// 中心点
//[DataMember]
//public PointF Center { get; set; }
[DataMember]
public int X { get; set; }
[DataMember]
public int Y { get; set; }
////
//// 摘要:
//// 条码尺寸大小
//[DataMember]
//public SizeF Size { get; set; }
//
// 摘要:
// 角度,3点钟方向0°,逆时针为正,顺时针为负。
[DataMember]
public float Angle { get; set; }
//
// 摘要:
// 原点垂直于经过中心点的直线的距离
[DataMember]
public float Distance { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class LabelingData
{
/// <summary>
/// 标签名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 是否覆盖圆标签
/// </summary>
public bool IsOverlaylabel { get; set; } = true;
/// <summary>
/// X轴偏移量
/// </summary>
public int Xoffset { get; set; } = 0;
/// <summary>
/// Y轴偏移量
/// </summary>
public int Yoffset { get; set; } = 0;
/// <summary>
/// 是否顺时针旋转
/// </summary>
public bool IscIockwise { get; set; } = false;
/// <summary>
/// 是否顺时针旋转
/// </summary>
public bool IsCounterclockwise { get; set; } = false;
/// <summary>
/// 旋转角度
/// </summary>
public int RotationAngle { get; set; } = 0;
/// <summary>
/// 标签角度
/// </summary>
public int LabelRotationAngle { get; set; } = 0;
}
}
......@@ -52,6 +52,10 @@ namespace Model
public int SplitPart { get; set; } = 1;
public bool MatchISNumber { get; set; } = false;
/// <summary>
/// 特征条码
/// </summary>
public bool Characteristic { get; set; } = false;
public MaterialCodeMatch Clone()
{
MaterialCodeMatch node = new();
......
......@@ -77,6 +77,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AMatch.cs" />
<Compile Include="AutoGenRule.cs" />
<Compile Include="ExtensionControl.cs" />
<Compile Include="ExtensionFunction.cs" />
......@@ -86,6 +87,7 @@
<Compile Include="IExtension.cs" />
<Compile Include="ISetMenu.cs" />
<Compile Include="IWeb.cs" />
<Compile Include="LabelingData.cs" />
<Compile Include="LanguageDialogKey.cs" />
<Compile Include="Log.cs" />
<Compile Include="MaterialAsciiCode.cs" />
......
......@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "paddleOCR", "paddleOCR\paddleOCR.csproj", "{7178A902-E193-40CB-8AF5-4EEA05876522}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataHandling", "DataHandling\DataHandling.csproj", "{0F23B7DB-9953-46ED-9166-115646467647}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -97,6 +99,18 @@ Global
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|x64.Build.0 = Release|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|x86.ActiveCfg = Release|x86
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|x86.Build.0 = Release|x86
{0F23B7DB-9953-46ED-9166-115646467647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Debug|x64.ActiveCfg = Debug|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Debug|x64.Build.0 = Debug|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Debug|x86.ActiveCfg = Debug|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Debug|x86.Build.0 = Debug|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Release|Any CPU.Build.0 = Release|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Release|x64.ActiveCfg = Release|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Release|x64.Build.0 = Release|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Release|x86.ActiveCfg = Release|Any CPU
{0F23B7DB-9953-46ED-9166-115646467647}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
using Model;
using System;
using System.Collections.Generic;
using System.Drawing;
namespace SmartScan
namespace SmartScan
{
public static class Common
{
public static FrmMain frmMain;
public static FrmWaitting frmWaitting;
}
}
......@@ -47,12 +47,13 @@ namespace SmartScan
this.ChkCaseSensitivity = new Asa.FaceControl.FaceCheckBox();
this.ChoMatchMiddleType = new Asa.FaceControl.FaceComboBox();
this.lblMatchRes = new Asa.FaceControl.FaceLabel();
this.Characteristicbarcode = new Asa.FaceControl.FaceCheckBox();
this.pnlRawCode = new Asa.FaceControl.FacePanel();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.pnlKeywords = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.pnlMatch.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.pnlRawCode.SuspendLayout();
......@@ -70,7 +71,7 @@ namespace SmartScan
this.BtnOK.BorderWidth = 2;
this.BtnOK.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnOK.HoldPress = false;
this.BtnOK.Location = new System.Drawing.Point(1184, 848);
this.BtnOK.Location = new System.Drawing.Point(1184, 737);
this.BtnOK.Name = "BtnOK";
this.BtnOK.Padding = new System.Windows.Forms.Padding(3);
this.BtnOK.Size = new System.Drawing.Size(120, 40);
......@@ -86,7 +87,7 @@ namespace SmartScan
this.BtnCancel.BorderWidth = 2;
this.BtnCancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnCancel.HoldPress = false;
this.BtnCancel.Location = new System.Drawing.Point(1310, 848);
this.BtnCancel.Location = new System.Drawing.Point(1310, 737);
this.BtnCancel.Name = "BtnCancel";
this.BtnCancel.Padding = new System.Windows.Forms.Padding(3);
this.BtnCancel.Size = new System.Drawing.Size(120, 40);
......@@ -99,13 +100,13 @@ namespace SmartScan
this.PnlTemp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.PnlTemp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.PnlTemp.BorderWidth = 2;
this.PnlTemp.Dock = System.Windows.Forms.DockStyle.Fill;
this.PnlTemp.Dock = System.Windows.Forms.DockStyle.Bottom;
this.PnlTemp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.PnlTemp.Location = new System.Drawing.Point(3, 240);
this.PnlTemp.Location = new System.Drawing.Point(3, 202);
this.PnlTemp.Name = "PnlTemp";
this.PnlTemp.Padding = new System.Windows.Forms.Padding(3);
this.PnlTemp.ShowText = false;
this.PnlTemp.Size = new System.Drawing.Size(698, 534);
this.PnlTemp.Size = new System.Drawing.Size(698, 461);
this.PnlTemp.TabIndex = 28;
this.PnlTemp.Text = "facePanel1";
this.PnlTemp.TitleFont = new System.Drawing.Font("宋体", 12F);
......@@ -113,12 +114,10 @@ namespace SmartScan
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 38);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 6);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(692, 190);
this.flowLayoutPanel1.Size = new System.Drawing.Size(692, 184);
this.flowLayoutPanel1.TabIndex = 29;
//
// pnlMatch
......@@ -129,7 +128,7 @@ namespace SmartScan
this.pnlMatch.Controls.Add(this.tableLayoutPanel1);
this.pnlMatch.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMatch.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlMatch.Location = new System.Drawing.Point(3, 503);
this.pnlMatch.Location = new System.Drawing.Point(3, 392);
this.pnlMatch.Name = "pnlMatch";
this.pnlMatch.Padding = new System.Windows.Forms.Padding(3);
this.pnlMatch.Size = new System.Drawing.Size(697, 271);
......@@ -160,6 +159,7 @@ namespace SmartScan
this.tableLayoutPanel1.Controls.Add(this.ChkCaseSensitivity, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.ChoMatchMiddleType, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.lblMatchRes, 3, 3);
this.tableLayoutPanel1.Controls.Add(this.Characteristicbarcode, 3, 2);
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 36);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 4;
......@@ -179,7 +179,7 @@ namespace SmartScan
this.NudMiddleTextCount.Dock = System.Windows.Forms.DockStyle.Fill;
this.NudMiddleTextCount.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.NudMiddleTextCount.Increment = 1F;
this.NudMiddleTextCount.Location = new System.Drawing.Point(176, 172);
this.NudMiddleTextCount.Location = new System.Drawing.Point(4, 172);
this.NudMiddleTextCount.Margin = new System.Windows.Forms.Padding(4);
this.NudMiddleTextCount.Maximum = 9999F;
this.NudMiddleTextCount.Minimum = 1F;
......@@ -364,7 +364,7 @@ namespace SmartScan
this.ChoMatchMiddleType.BorderWidth = 2;
this.ChoMatchMiddleType.Dock = System.Windows.Forms.DockStyle.Fill;
this.ChoMatchMiddleType.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ChoMatchMiddleType.Location = new System.Drawing.Point(4, 172);
this.ChoMatchMiddleType.Location = new System.Drawing.Point(176, 172);
this.ChoMatchMiddleType.Margin = new System.Windows.Forms.Padding(4);
this.ChoMatchMiddleType.Name = "ChoMatchMiddleType";
this.ChoMatchMiddleType.Padding = new System.Windows.Forms.Padding(4);
......@@ -391,6 +391,23 @@ namespace SmartScan
this.lblMatchRes.Size = new System.Drawing.Size(167, 56);
this.lblMatchRes.TabIndex = 63;
//
// Characteristicbarcode
//
this.Characteristicbarcode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Characteristicbarcode.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Characteristicbarcode.BorderWidth = 0;
this.Characteristicbarcode.Dock = System.Windows.Forms.DockStyle.Fill;
this.Characteristicbarcode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.Characteristicbarcode.Location = new System.Drawing.Point(520, 116);
this.Characteristicbarcode.Margin = new System.Windows.Forms.Padding(4);
this.Characteristicbarcode.Name = "Characteristicbarcode";
this.Characteristicbarcode.Padding = new System.Windows.Forms.Padding(4);
this.Characteristicbarcode.Size = new System.Drawing.Size(167, 48);
this.Characteristicbarcode.TabIndex = 64;
this.Characteristicbarcode.Text = "特征码";
this.Characteristicbarcode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Characteristicbarcode.Visible = false;
//
// pnlRawCode
//
this.pnlRawCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
......@@ -402,12 +419,24 @@ namespace SmartScan
this.pnlRawCode.Location = new System.Drawing.Point(3, 3);
this.pnlRawCode.Name = "pnlRawCode";
this.pnlRawCode.Padding = new System.Windows.Forms.Padding(3);
this.pnlRawCode.Size = new System.Drawing.Size(697, 494);
this.pnlRawCode.Size = new System.Drawing.Size(697, 383);
this.pnlRawCode.TabIndex = 31;
this.pnlRawCode.Text = "原始条码信息";
this.pnlRawCode.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.pnlRawCode.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.richTextBox1.ForeColor = System.Drawing.SystemColors.Menu;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(691, 377);
this.richTextBox1.TabIndex = 7;
this.richTextBox1.Text = "weqw";
//
// pnlKeywords
//
this.pnlKeywords.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
......@@ -419,7 +448,7 @@ namespace SmartScan
this.pnlKeywords.Location = new System.Drawing.Point(3, 3);
this.pnlKeywords.Name = "pnlKeywords";
this.pnlKeywords.Padding = new System.Windows.Forms.Padding(3);
this.pnlKeywords.Size = new System.Drawing.Size(698, 231);
this.pnlKeywords.Size = new System.Drawing.Size(698, 193);
this.pnlKeywords.TabIndex = 32;
this.pnlKeywords.Text = "关键字";
this.pnlKeywords.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
......@@ -439,7 +468,7 @@ namespace SmartScan
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(1419, 783);
this.tableLayoutPanel2.Size = new System.Drawing.Size(1419, 672);
this.tableLayoutPanel2.TabIndex = 33;
//
// tableLayoutPanel3
......@@ -452,9 +481,9 @@ namespace SmartScan
this.tableLayoutPanel3.Location = new System.Drawing.Point(712, 3);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 540F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(704, 777);
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 70F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(704, 666);
this.tableLayoutPanel3.TabIndex = 32;
//
// tableLayoutPanel4
......@@ -469,26 +498,14 @@ namespace SmartScan
this.tableLayoutPanel4.RowCount = 2;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 277F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(703, 777);
this.tableLayoutPanel4.Size = new System.Drawing.Size(703, 666);
this.tableLayoutPanel4.TabIndex = 33;
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.richTextBox1.ForeColor = System.Drawing.SystemColors.Menu;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(691, 488);
this.richTextBox1.TabIndex = 7;
this.richTextBox1.Text = "weqw";
//
// FrmCodeExtract
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1441, 899);
this.ClientSize = new System.Drawing.Size(1441, 788);
this.Controls.Add(this.tableLayoutPanel2);
this.Controls.Add(this.BtnCancel);
this.Controls.Add(this.BtnOK);
......@@ -535,5 +552,6 @@ namespace SmartScan
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.RichTextBox richTextBox1;
private Asa.FaceControl.FaceCheckBox Characteristicbarcode;
}
}
\ No newline at end of file
......@@ -54,6 +54,7 @@ namespace SmartScan
ChkCaseSensitivity.Checked = matchShared.CaseSensitive;
ChoMatchMiddleType.SelectedIndex = matchShared.MatchMiddleType + 1;
ChkCheckCodeType.Checked = matchShared.CheckCodeType;
Characteristicbarcode.Checked = matchShared.Characteristic;
LblCodeType.Text = codeType;
for (int i = 0; i < match.Count; i++)
......@@ -64,6 +65,13 @@ namespace SmartScan
BtnAddMatch_Click(null, EventArgs.Empty);
myStringArray = strings;
//if (BLL.Config.Backgrounder)
//{
// Characteristicbarcode.Visible = true;
//}
Characteristicbarcode.Visible = true;
}
public List<MaterialCodeMatch> CodeMatch { get; private set; }
......@@ -232,7 +240,7 @@ namespace SmartScan
match.CodeType = LblCodeType.Text;
match.MatchMiddleType = ChoMatchMiddleType.SelectedIndex - 1;
match.CodeID = codeID;
match.Characteristic = Characteristicbarcode.Checked;
var hasmatchselect = match.MatchISNumber || match.CheckCodeType || match.MatchEnd || match.MatchMaxLength || match.MatchMiddle || match.MatchMinLength || match.MatchSplit || match.MatchStart;
if (!hasmatchselect)
{
......
......@@ -3,6 +3,7 @@ using Model;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
......@@ -22,9 +23,10 @@ namespace SmartScan
{
Process current = Process.GetCurrentProcess();
FileInfo fileInfo = new FileInfo(current.MainModule.FileName);
DateTime dateTime = fileInfo.LastWriteTime;
LogNet.log = log4net.LogManager.GetLogger("SmartScan");
string version = $"{dateTime.Year%10}.{dateTime.Month}.{dateTime.Day.ToString("00")}{dateTime.Hour.ToString("00")}";
//DateTime dateTime = fileInfo.LastWriteTime;
//string version = $"{dateTime.Year%10}.{dateTime.Month}.{dateTime.Day.ToString("00")}{dateTime.Hour.ToString("00")}";
string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
LogNet.log.Info($"===== 程序开始 {version} =====");
BLLCommon.config = new BLL.Config();
......@@ -35,7 +37,6 @@ namespace SmartScan
Asa.FaceControl.Language.LoadPath(FilePath.LANGUAGE_DIR);
LogNet.log.Debug("加载语言文件夹:" + FilePath.LANGUAGE_DIR);
Asa.FaceControl.Language.LoadLanguage(BLLCommon.config.Language);
Camera.LoadCamera();
if (BLLCommon.config.EnabledIO)
......@@ -55,7 +56,8 @@ namespace SmartScan
BLLCommon.extension = new(BLLCommon.config);
BLLCommon.labelEdit = new();
BLLCommon.mateEdit = new();
WebService.Open();
//如果是直接启动ns100就不需要开启条码规则服务
//WebService.Open();
ReadMacro();
Shortcut();
......
......@@ -122,7 +122,7 @@ namespace SmartScan
this.BtnTriggerIO.BorderWidth = 2;
this.BtnTriggerIO.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnTriggerIO.HoldPress = false;
this.BtnTriggerIO.Location = new System.Drawing.Point(11, 643);
this.BtnTriggerIO.Location = new System.Drawing.Point(11, 616);
this.BtnTriggerIO.Name = "BtnTriggerIO";
this.BtnTriggerIO.Padding = new System.Windows.Forms.Padding(3);
this.BtnTriggerIO.Size = new System.Drawing.Size(160, 40);
......@@ -137,7 +137,7 @@ namespace SmartScan
this.LblCameraExist.BorderStyle = Asa.FaceControl.ControlShape.EllipseRectangle;
this.LblCameraExist.BorderWidth = 2;
this.LblCameraExist.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblCameraExist.Location = new System.Drawing.Point(11, 689);
this.LblCameraExist.Location = new System.Drawing.Point(11, 662);
this.LblCameraExist.Name = "LblCameraExist";
this.LblCameraExist.Padding = new System.Windows.Forms.Padding(3);
this.LblCameraExist.Size = new System.Drawing.Size(160, 40);
......@@ -151,7 +151,7 @@ namespace SmartScan
this.LblIOExist.BorderStyle = Asa.FaceControl.ControlShape.EllipseRectangle;
this.LblIOExist.BorderWidth = 2;
this.LblIOExist.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblIOExist.Location = new System.Drawing.Point(11, 735);
this.LblIOExist.Location = new System.Drawing.Point(11, 708);
this.LblIOExist.Name = "LblIOExist";
this.LblIOExist.Padding = new System.Windows.Forms.Padding(3);
this.LblIOExist.Size = new System.Drawing.Size(160, 40);
......@@ -170,7 +170,7 @@ namespace SmartScan
this.PicShow.Location = new System.Drawing.Point(177, 55);
this.PicShow.Name = "PicShow";
this.PicShow.Padding = new System.Windows.Forms.Padding(3);
this.PicShow.Size = new System.Drawing.Size(667, 749);
this.PicShow.Size = new System.Drawing.Size(667, 722);
this.PicShow.TabIndex = 10;
this.PicShow.Text = "facePictureBox1";
//
......@@ -185,7 +185,7 @@ namespace SmartScan
this.PnlExtension.Location = new System.Drawing.Point(850, 55);
this.PnlExtension.Name = "PnlExtension";
this.PnlExtension.Padding = new System.Windows.Forms.Padding(3);
this.PnlExtension.Size = new System.Drawing.Size(235, 749);
this.PnlExtension.Size = new System.Drawing.Size(235, 722);
this.PnlExtension.TabIndex = 11;
this.PnlExtension.Text = "facePanel1";
this.PnlExtension.TextHeight = 36;
......@@ -234,12 +234,13 @@ namespace SmartScan
this.LblVersion.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LblVersion.BorderWidth = 0;
this.LblVersion.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblVersion.Location = new System.Drawing.Point(11, 781);
this.LblVersion.Location = new System.Drawing.Point(11, 754);
this.LblVersion.Name = "LblVersion";
this.LblVersion.Padding = new System.Windows.Forms.Padding(3);
this.LblVersion.Size = new System.Drawing.Size(160, 23);
this.LblVersion.TabIndex = 14;
this.LblVersion.Text = "Version";
this.LblVersion.Click += new System.EventHandler(this.LblVersion_Click);
//
// LblUserName
//
......@@ -249,7 +250,7 @@ namespace SmartScan
this.LblUserName.BorderWidth = 0;
this.LblUserName.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.LblUserName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblUserName.Location = new System.Drawing.Point(11, 614);
this.LblUserName.Location = new System.Drawing.Point(11, 587);
this.LblUserName.Name = "LblUserName";
this.LblUserName.Padding = new System.Windows.Forms.Padding(3);
this.LblUserName.Size = new System.Drawing.Size(160, 23);
......@@ -259,7 +260,7 @@ namespace SmartScan
// FrmMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1096, 815);
this.ClientSize = new System.Drawing.Size(1096, 788);
this.Controls.Add(this.PicShow);
this.Controls.Add(this.LblUserName);
this.Controls.Add(this.LblVersion);
......
using System;
using Asa.FaceControl;
using BLL;
using DocumentFormat.OpenXml.Bibliography;
using Model;
using Newtonsoft.Json;
using SmartScan.Form;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using Asa.FaceControl;
using System.Windows.Forms;
using BLL;
using Model;
using System.Web.Script.Serialization;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Drawing.Charts;
using System.IO;
using System.Web.UI.WebControls;
using System.Windows.Interop;
using System.Web.Script.Serialization;
using System.Windows.Forms;
namespace SmartScan
{
......@@ -167,7 +164,6 @@ namespace SmartScan
//LogNet.log.Info(string.Format("打印标签 Label[{0}] Printer[{1}]", Common.config.DefaultPrintLabel, Common.config.PrinterName));
var barcode = content.Values.ToArray();
SaveRetrospect(labelBmp, barcode, content);
}
catch (Exception ex)
{
......@@ -209,7 +205,10 @@ namespace SmartScan
try
{
foreach (string key in content.Keys)
{
str += string.Format("({0}:{1})", key, content[key]);
}
LogNet.log.Info(str);
SaveResult(content);
//Bitmap labelBmp = Common.labelEdit.PrintImage(Common.config.DefaultPrintLabel, content, out _);
......@@ -250,6 +249,7 @@ namespace SmartScan
LblUserName.Visible = false;
BtnSet.Enabled = BLLCommon.config.UserLevel == UserLevel.Admin;
FrmRetrospect.Print += Extension_Printing;
//扩展面板
PnlExtension.Width = BLLCommon.config.ExtensionWidth;
PnlExtension.Left = Width - PnlExtension.Width - 12;
......@@ -289,7 +289,7 @@ namespace SmartScan
}
else
{
Hide();
//Hide();
bool rtn = UserLoginWindow.Show();
if (rtn)
{
......@@ -386,9 +386,9 @@ namespace SmartScan
private void BtnSet_Click(object sender, EventArgs e)
{
monitor.Pause = true;
FrmSet set =new FrmSet();
set.Width=PicShow.Width;
set.Height=PicShow.Height;
FrmSet set = new FrmSet();
set.Width = PicShow.Width;
set.Height = PicShow.Height;
set.ShowDialog();
monitor.Pause = false;
}
......@@ -408,7 +408,6 @@ namespace SmartScan
scanWork.Scan();
//scanWork.TouchOff();
});
}
private void BtnMatchedName_Click(object sender, EventArgs e)
......@@ -442,9 +441,8 @@ namespace SmartScan
}
Common.frmWaitting.Close();
}
public void SetWaittingMsg(string msg)
public void SetWaittingMsg(string msg,int keepsec=3)
{
if (Common.frmMain.InvokeRequired)
{
Common.frmMain.Invoke(delegate ()
......@@ -453,12 +451,11 @@ namespace SmartScan
});
return;
}
BLLCommon.SCMM.ShowMsg(msg, 3, msgType.INFO);
//BLLCommon.SCMM.ShowMsg(msg, keepsec, msgType.INFO);
Common.frmWaitting.SetMessage(msg);
Application.DoEvents();
}
public void DrawTextForm(Dictionary<string,string> valuePairs)
{
//
......@@ -475,5 +472,15 @@ namespace SmartScan
BLLCommon.extension.DrawTextBackground(valuePairs);
Application.DoEvents();
}
private void LblVersion_Click(object sender, EventArgs e)
{
//var HCEditor = new HCEditor();
//if (Config.Get<int>("HB_ENABLE") >= 1)
// new HBEditor();
ConfigHelper.AdvanceConfigForm.ShowEditDialog(this, true);
}
}
}
......@@ -29,67 +29,171 @@ namespace SmartScan
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.butt_startserver = new Asa.FaceControl.FaceButton();
this.DtpUpper = new System.Windows.Forms.DateTimePicker();
this.DtpLower = new System.Windows.Forms.DateTimePicker();
this.LstLabel = new Asa.FaceControl.FaceListBox();
this.BtnExport = new Asa.FaceControl.FaceButton();
this.LblDateRange = new Asa.FaceControl.FaceLabel();
this.TxtCode = new Asa.FaceControl.FaceTextBox();
this.BtnSelect = new Asa.FaceControl.FaceButton();
this.BtnExport = new Asa.FaceControl.FaceButton();
this.BtnExportAll = new Asa.FaceControl.FaceButton();
this.PicShow = new Asa.FaceControl.FacePictureBox();
this.LblCode = new Asa.FaceControl.FaceLabel();
this.DtpLower = new System.Windows.Forms.DateTimePicker();
this.PicLabel = new System.Windows.Forms.PictureBox();
this.PicShow = new Asa.FaceControl.FacePictureBox();
this.LstCode = new Asa.FaceControl.FaceListBox();
this.LstLabel = new Asa.FaceControl.FaceListBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.LblAllCode = new Asa.FaceControl.FaceLabel();
this.LblAllLabel = new Asa.FaceControl.FaceLabel();
this.BtnExportAll = new Asa.FaceControl.FaceButton();
this.LblAllCode = new Asa.FaceControl.FaceLabel();
this.faceBut_prin = new Asa.FaceControl.FaceButton();
this.LstRecord = new Asa.FaceControl.FaceListBox();
this.LblCode = new Asa.FaceControl.FaceLabel();
this.LblDateRange = new Asa.FaceControl.FaceLabel();
this.butt_getData = new Asa.FaceControl.FaceButton();
((System.ComponentModel.ISupportInitialize)(this.PicLabel)).BeginInit();
this.faceLabel1 = new Asa.FaceControl.FaceLabel();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PicLabel)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.Controls.Add(this.butt_startserver, 0, 8);
this.tableLayoutPanel1.Controls.Add(this.DtpUpper, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.LstLabel, 2, 10);
this.tableLayoutPanel1.Controls.Add(this.BtnExport, 0, 6);
this.tableLayoutPanel1.Controls.Add(this.LblDateRange, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.TxtCode, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.BtnSelect, 0, 5);
this.tableLayoutPanel1.Controls.Add(this.LblCode, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.DtpLower, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.PicLabel, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.PicShow, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.LstCode, 2, 6);
this.tableLayoutPanel1.Controls.Add(this.LblAllLabel, 2, 9);
this.tableLayoutPanel1.Controls.Add(this.BtnExportAll, 0, 7);
this.tableLayoutPanel1.Controls.Add(this.LblAllCode, 2, 5);
this.tableLayoutPanel1.Controls.Add(this.faceBut_prin, 2, 4);
this.tableLayoutPanel1.Controls.Add(this.LstRecord, 0, 10);
this.tableLayoutPanel1.Controls.Add(this.faceLabel1, 0, 9);
this.tableLayoutPanel1.Location = new System.Drawing.Point(16, 50);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 10;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1524, 970);
this.tableLayoutPanel1.TabIndex = 19;
//
// butt_startserver
//
this.butt_startserver.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.butt_startserver.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.butt_startserver.BorderWidth = 2;
this.butt_startserver.Dock = System.Windows.Forms.DockStyle.Fill;
this.butt_startserver.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.butt_startserver.HoldPress = false;
this.butt_startserver.Location = new System.Drawing.Point(3, 504);
this.butt_startserver.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.butt_startserver.Name = "butt_startserver";
this.butt_startserver.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.butt_startserver.Size = new System.Drawing.Size(298, 69);
this.butt_startserver.TabIndex = 22;
this.butt_startserver.Text = "启动服务";
this.butt_startserver.Visible = false;
this.butt_startserver.Click += new System.EventHandler(this.butt_startservice_Click);
//
// DtpUpper
//
this.DtpUpper.CustomFormat = "yyyy-MM-dd";
this.DtpUpper.Dock = System.Windows.Forms.DockStyle.Fill;
this.DtpUpper.Font = new System.Drawing.Font("宋体", 12F);
this.DtpUpper.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.DtpUpper.Location = new System.Drawing.Point(15, 120);
this.DtpUpper.Margin = new System.Windows.Forms.Padding(4);
this.DtpUpper.Location = new System.Drawing.Point(4, 52);
this.DtpUpper.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.DtpUpper.Name = "DtpUpper";
this.DtpUpper.ShowCheckBox = true;
this.DtpUpper.Size = new System.Drawing.Size(292, 30);
this.DtpUpper.Size = new System.Drawing.Size(296, 35);
this.DtpUpper.TabIndex = 6;
//
// DtpLower
// LstLabel
//
this.DtpLower.CustomFormat = "yyyy-MM-dd";
this.DtpLower.Font = new System.Drawing.Font("宋体", 12F);
this.DtpLower.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.DtpLower.Location = new System.Drawing.Point(15, 160);
this.DtpLower.Margin = new System.Windows.Forms.Padding(4);
this.DtpLower.Name = "DtpLower";
this.DtpLower.ShowCheckBox = true;
this.DtpLower.Size = new System.Drawing.Size(292, 30);
this.DtpLower.TabIndex = 7;
this.LstLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LstLabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LstLabel.BorderWidth = 2;
this.LstLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.LstLabel.Font = new System.Drawing.Font("宋体", 9F);
this.LstLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstLabel.ItemHeight = 40;
this.LstLabel.Location = new System.Drawing.Point(1070, 629);
this.LstLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LstLabel.Name = "LstLabel";
this.LstLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LstLabel.SelectedIndex = -1;
this.LstLabel.Size = new System.Drawing.Size(450, 337);
this.LstLabel.TabIndex = 18;
this.LstLabel.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// BtnExport
//
this.BtnExport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnExport.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnExport.BorderWidth = 2;
this.BtnExport.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnExport.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnExport.HoldPress = false;
this.BtnExport.Location = new System.Drawing.Point(4, 350);
this.BtnExport.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.BtnExport.Name = "BtnExport";
this.BtnExport.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.BtnExport.Size = new System.Drawing.Size(296, 69);
this.BtnExport.TabIndex = 10;
this.BtnExport.Text = "导出";
this.BtnExport.Click += new System.EventHandler(this.BtnExport_Click);
//
// LblDateRange
//
this.LblDateRange.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LblDateRange.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LblDateRange.BorderWidth = 0;
this.LblDateRange.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblDateRange.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblDateRange.Location = new System.Drawing.Point(4, 4);
this.LblDateRange.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblDateRange.Name = "LblDateRange";
this.LblDateRange.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblDateRange.Size = new System.Drawing.Size(296, 40);
this.LblDateRange.TabIndex = 21;
this.LblDateRange.Text = "日期";
this.LblDateRange.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// TxtCode
//
this.TxtCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.TxtCode.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.TxtCode.BorderWidth = 2;
this.TxtCode.Location = new System.Drawing.Point(15, 251);
this.TxtCode.Margin = new System.Windows.Forms.Padding(4);
this.TxtCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.TxtCode.Location = new System.Drawing.Point(4, 196);
this.TxtCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.TxtCode.MaxLength = 32767;
this.TxtCode.Name = "TxtCode";
this.TxtCode.Padding = new System.Windows.Forms.Padding(4);
this.TxtCode.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.TxtCode.SelectedText = "";
this.TxtCode.SelectionLength = 0;
this.TxtCode.SelectionStart = 0;
this.TxtCode.ShowDel = true;
this.TxtCode.ShowQuery = false;
this.TxtCode.Size = new System.Drawing.Size(293, 56);
this.TxtCode.Size = new System.Drawing.Size(296, 69);
this.TxtCode.TabIndex = 8;
//
// BtnSelect
......@@ -97,77 +201,77 @@ namespace SmartScan
this.BtnSelect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnSelect.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnSelect.BorderWidth = 2;
this.BtnSelect.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnSelect.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnSelect.HoldPress = false;
this.BtnSelect.Location = new System.Drawing.Point(15, 315);
this.BtnSelect.Margin = new System.Windows.Forms.Padding(4);
this.BtnSelect.Location = new System.Drawing.Point(4, 273);
this.BtnSelect.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.BtnSelect.Name = "BtnSelect";
this.BtnSelect.Padding = new System.Windows.Forms.Padding(4);
this.BtnSelect.Size = new System.Drawing.Size(293, 56);
this.BtnSelect.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.BtnSelect.Size = new System.Drawing.Size(296, 69);
this.BtnSelect.TabIndex = 9;
this.BtnSelect.Text = "查询";
this.BtnSelect.Click += new System.EventHandler(this.BtnSelect_Click);
//
// BtnExport
// LblCode
//
this.BtnExport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnExport.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnExport.BorderWidth = 2;
this.BtnExport.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnExport.HoldPress = false;
this.BtnExport.Location = new System.Drawing.Point(15, 379);
this.BtnExport.Margin = new System.Windows.Forms.Padding(4);
this.BtnExport.Name = "BtnExport";
this.BtnExport.Padding = new System.Windows.Forms.Padding(4);
this.BtnExport.Size = new System.Drawing.Size(293, 56);
this.BtnExport.TabIndex = 10;
this.BtnExport.Text = "导出";
this.BtnExport.Click += new System.EventHandler(this.BtnExport_Click);
this.LblCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LblCode.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LblCode.BorderWidth = 0;
this.LblCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblCode.Location = new System.Drawing.Point(4, 148);
this.LblCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblCode.Name = "LblCode";
this.LblCode.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblCode.Size = new System.Drawing.Size(296, 40);
this.LblCode.TabIndex = 20;
this.LblCode.Text = "条码";
this.LblCode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// BtnExportAll
// DtpLower
//
this.BtnExportAll.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnExportAll.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnExportAll.BorderWidth = 2;
this.BtnExportAll.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnExportAll.HoldPress = false;
this.BtnExportAll.Location = new System.Drawing.Point(13, 443);
this.BtnExportAll.Margin = new System.Windows.Forms.Padding(4);
this.BtnExportAll.Name = "BtnExportAll";
this.BtnExportAll.Padding = new System.Windows.Forms.Padding(4);
this.BtnExportAll.Size = new System.Drawing.Size(293, 56);
this.BtnExportAll.TabIndex = 11;
this.BtnExportAll.Text = "导出所有";
this.BtnExportAll.Click += new System.EventHandler(this.BtnExportAll_Click);
this.DtpLower.CustomFormat = "yyyy-MM-dd";
this.DtpLower.Dock = System.Windows.Forms.DockStyle.Fill;
this.DtpLower.Font = new System.Drawing.Font("宋体", 12F);
this.DtpLower.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.DtpLower.Location = new System.Drawing.Point(4, 100);
this.DtpLower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.DtpLower.Name = "DtpLower";
this.DtpLower.ShowCheckBox = true;
this.DtpLower.Size = new System.Drawing.Size(296, 35);
this.DtpLower.TabIndex = 7;
//
// PicLabel
//
this.PicLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.PicLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.PicLabel.Location = new System.Drawing.Point(1070, 4);
this.PicLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.PicLabel.Name = "PicLabel";
this.tableLayoutPanel1.SetRowSpan(this.PicLabel, 4);
this.PicLabel.Size = new System.Drawing.Size(450, 184);
this.PicLabel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PicLabel.TabIndex = 16;
this.PicLabel.TabStop = false;
//
// PicShow
//
this.PicShow.AutoSize = true;
this.PicShow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.PicShow.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.PicShow.BorderWidth = 2;
this.PicShow.Dock = System.Windows.Forms.DockStyle.Fill;
this.PicShow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.PicShow.Location = new System.Drawing.Point(4, 4);
this.PicShow.Margin = new System.Windows.Forms.Padding(4);
this.PicShow.Location = new System.Drawing.Point(308, 4);
this.PicShow.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.PicShow.Name = "PicShow";
this.PicShow.Padding = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.SetRowSpan(this.PicShow, 5);
this.PicShow.Size = new System.Drawing.Size(764, 697);
this.PicShow.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tableLayoutPanel1.SetRowSpan(this.PicShow, 11);
this.PicShow.Size = new System.Drawing.Size(754, 962);
this.PicShow.TabIndex = 12;
this.PicShow.Text = "facePictureBox1";
//
// PicLabel
//
this.PicLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.PicLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.PicLabel.Location = new System.Drawing.Point(776, 4);
this.PicLabel.Margin = new System.Windows.Forms.Padding(4);
this.PicLabel.Name = "PicLabel";
this.PicLabel.Size = new System.Drawing.Size(507, 177);
this.PicLabel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PicLabel.TabIndex = 16;
this.PicLabel.TabStop = false;
//
// LstCode
//
this.LstCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
......@@ -177,58 +281,48 @@ namespace SmartScan
this.LstCode.Font = new System.Drawing.Font("宋体", 9F);
this.LstCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstCode.ItemHeight = 40;
this.LstCode.Location = new System.Drawing.Point(776, 233);
this.LstCode.Margin = new System.Windows.Forms.Padding(4);
this.LstCode.Location = new System.Drawing.Point(1070, 350);
this.LstCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LstCode.Name = "LstCode";
this.LstCode.Padding = new System.Windows.Forms.Padding(4);
this.LstCode.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tableLayoutPanel1.SetRowSpan(this.LstCode, 3);
this.LstCode.SelectedIndex = -1;
this.LstCode.Size = new System.Drawing.Size(507, 207);
this.LstCode.Size = new System.Drawing.Size(450, 223);
this.LstCode.TabIndex = 17;
this.LstCode.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// LstLabel
// LblAllLabel
//
this.LstLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LstLabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LstLabel.BorderWidth = 2;
this.LstLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.LstLabel.Font = new System.Drawing.Font("宋体", 9F);
this.LstLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstLabel.ItemHeight = 40;
this.LstLabel.Location = new System.Drawing.Point(776, 492);
this.LstLabel.Margin = new System.Windows.Forms.Padding(4);
this.LstLabel.Name = "LstLabel";
this.LstLabel.Padding = new System.Windows.Forms.Padding(4);
this.LstLabel.SelectedIndex = -1;
this.LstLabel.Size = new System.Drawing.Size(507, 209);
this.LstLabel.TabIndex = 18;
this.LstLabel.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.LblAllLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LblAllLabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LblAllLabel.BorderWidth = 0;
this.LblAllLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblAllLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblAllLabel.Location = new System.Drawing.Point(1070, 581);
this.LblAllLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblAllLabel.Name = "LblAllLabel";
this.LblAllLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblAllLabel.Size = new System.Drawing.Size(450, 40);
this.LblAllLabel.TabIndex = 20;
this.LblAllLabel.Text = "faceLabel2";
this.LblAllLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// tableLayoutPanel1
// BtnExportAll
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F));
this.tableLayoutPanel1.Controls.Add(this.LstCode, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.LstLabel, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.PicLabel, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.PicShow, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.LblAllCode, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.LblAllLabel, 1, 3);
this.tableLayoutPanel1.Location = new System.Drawing.Point(316, 69);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 5;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 44F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 44F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1287, 705);
this.tableLayoutPanel1.TabIndex = 19;
this.BtnExportAll.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnExportAll.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnExportAll.BorderWidth = 2;
this.BtnExportAll.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnExportAll.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnExportAll.HoldPress = false;
this.BtnExportAll.Location = new System.Drawing.Point(4, 427);
this.BtnExportAll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.BtnExportAll.Name = "BtnExportAll";
this.BtnExportAll.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.BtnExportAll.Size = new System.Drawing.Size(296, 69);
this.BtnExportAll.TabIndex = 11;
this.BtnExportAll.Text = "导出所有";
this.BtnExportAll.Click += new System.EventHandler(this.BtnExportAll_Click);
//
// LblAllCode
//
......@@ -237,151 +331,102 @@ namespace SmartScan
this.LblAllCode.BorderWidth = 0;
this.LblAllCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblAllCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblAllCode.Location = new System.Drawing.Point(776, 189);
this.LblAllCode.Margin = new System.Windows.Forms.Padding(4);
this.LblAllCode.Location = new System.Drawing.Point(1070, 273);
this.LblAllCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblAllCode.Name = "LblAllCode";
this.LblAllCode.Padding = new System.Windows.Forms.Padding(4);
this.LblAllCode.Size = new System.Drawing.Size(507, 36);
this.LblAllCode.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LblAllCode.Size = new System.Drawing.Size(450, 69);
this.LblAllCode.TabIndex = 19;
this.LblAllCode.Text = "faceLabel1";
this.LblAllCode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// LblAllLabel
//
this.LblAllLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LblAllLabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LblAllLabel.BorderWidth = 0;
this.LblAllLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblAllLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblAllLabel.Location = new System.Drawing.Point(776, 448);
this.LblAllLabel.Margin = new System.Windows.Forms.Padding(4);
this.LblAllLabel.Name = "LblAllLabel";
this.LblAllLabel.Padding = new System.Windows.Forms.Padding(4);
this.LblAllLabel.Size = new System.Drawing.Size(507, 36);
this.LblAllLabel.TabIndex = 20;
this.LblAllLabel.Text = "faceLabel2";
this.LblAllLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// faceBut_prin
//
this.faceBut_prin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.faceBut_prin.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.faceBut_prin.BorderWidth = 2;
this.faceBut_prin.Dock = System.Windows.Forms.DockStyle.Fill;
this.faceBut_prin.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.faceBut_prin.HoldPress = false;
this.faceBut_prin.Location = new System.Drawing.Point(1069, 195);
this.faceBut_prin.Name = "faceBut_prin";
this.faceBut_prin.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.faceBut_prin.Size = new System.Drawing.Size(452, 71);
this.faceBut_prin.TabIndex = 23;
this.faceBut_prin.Text = "打印";
this.faceBut_prin.Click += new System.EventHandler(this.faceBut_prin_Click);
//
// LstRecord
//
this.LstRecord.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.LstRecord.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LstRecord.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LstRecord.BorderWidth = 2;
this.LstRecord.Dock = System.Windows.Forms.DockStyle.Fill;
this.LstRecord.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstRecord.Location = new System.Drawing.Point(15, 569);
this.LstRecord.Margin = new System.Windows.Forms.Padding(4);
this.LstRecord.Location = new System.Drawing.Point(4, 629);
this.LstRecord.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LstRecord.Name = "LstRecord";
this.LstRecord.Padding = new System.Windows.Forms.Padding(4);
this.LstRecord.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.LstRecord.SelectedIndex = -1;
this.LstRecord.Size = new System.Drawing.Size(293, 205);
this.LstRecord.Size = new System.Drawing.Size(296, 337);
this.LstRecord.TabIndex = 19;
this.LstRecord.SelectedIndexChanged += new System.EventHandler(this.LstRecord_SelectedIndexChanged);
//
// LblCode
//
this.LblCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LblCode.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LblCode.BorderWidth = 0;
this.LblCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblCode.Location = new System.Drawing.Point(15, 200);
this.LblCode.Margin = new System.Windows.Forms.Padding(4);
this.LblCode.Name = "LblCode";
this.LblCode.Padding = new System.Windows.Forms.Padding(4);
this.LblCode.Size = new System.Drawing.Size(293, 44);
this.LblCode.TabIndex = 20;
this.LblCode.Text = "条码";
this.LblCode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// LblDateRange
//
this.LblDateRange.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LblDateRange.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LblDateRange.BorderWidth = 0;
this.LblDateRange.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblDateRange.Location = new System.Drawing.Point(15, 69);
this.LblDateRange.Margin = new System.Windows.Forms.Padding(4);
this.LblDateRange.Name = "LblDateRange";
this.LblDateRange.Padding = new System.Windows.Forms.Padding(4);
this.LblDateRange.Size = new System.Drawing.Size(293, 44);
this.LblDateRange.TabIndex = 21;
this.LblDateRange.Text = "日期";
this.LblDateRange.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// butt_getData
//
this.butt_getData.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.butt_getData.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.butt_getData.BorderWidth = 2;
this.butt_getData.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.butt_getData.HoldPress = false;
this.butt_getData.Location = new System.Drawing.Point(14, 506);
this.butt_getData.Name = "butt_getData";
this.butt_getData.Padding = new System.Windows.Forms.Padding(3);
this.butt_getData.Size = new System.Drawing.Size(292, 56);
this.butt_getData.TabIndex = 22;
this.butt_getData.Text = "启动服务";
this.butt_getData.Visible = false;
this.butt_getData.Click += new System.EventHandler(this.butt_startservice_Click);
// faceLabel1
//
this.faceLabel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.faceLabel1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.faceLabel1.BorderWidth = 2;
this.faceLabel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.faceLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.faceLabel1.Location = new System.Drawing.Point(4, 581);
this.faceLabel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.faceLabel1.Name = "faceLabel1";
this.faceLabel1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.faceLabel1.Size = new System.Drawing.Size(296, 40);
this.faceLabel1.TabIndex = 24;
this.faceLabel1.Text = "共查询到0条信息";
//
// FrmRetrospect
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1617, 788);
this.Controls.Add(this.butt_getData);
this.Controls.Add(this.LblDateRange);
this.Controls.Add(this.LblCode);
this.ClientSize = new System.Drawing.Size(1558, 788);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.LstRecord);
this.Controls.Add(this.BtnExportAll);
this.Controls.Add(this.BtnExport);
this.Controls.Add(this.BtnSelect);
this.Controls.Add(this.TxtCode);
this.Controls.Add(this.DtpLower);
this.Controls.Add(this.DtpUpper);
this.Icon = global::SmartScan.Properties.Resources.App;
this.Margin = new System.Windows.Forms.Padding(4);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "FrmRetrospect";
this.Padding = new System.Windows.Forms.Padding(11, 10, 11, 10);
this.Padding = new System.Windows.Forms.Padding(12, 12, 12, 12);
this.Text = "FrmRetrospect";
this.Load += new System.EventHandler(this.FrmRetrospect_Load);
this.Controls.SetChildIndex(this.DtpUpper, 0);
this.Controls.SetChildIndex(this.DtpLower, 0);
this.Controls.SetChildIndex(this.TxtCode, 0);
this.Controls.SetChildIndex(this.BtnSelect, 0);
this.Controls.SetChildIndex(this.BtnExport, 0);
this.Controls.SetChildIndex(this.BtnExportAll, 0);
this.Controls.SetChildIndex(this.LstRecord, 0);
this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);
this.Controls.SetChildIndex(this.LblCode, 0);
this.Controls.SetChildIndex(this.LblDateRange, 0);
this.Controls.SetChildIndex(this.butt_getData, 0);
((System.ComponentModel.ISupportInitialize)(this.PicLabel)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.PicLabel)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private Asa.FaceControl.FaceListBox LstRecord;
private Asa.FaceControl.FaceButton butt_startserver;
private System.Windows.Forms.DateTimePicker DtpUpper;
private System.Windows.Forms.DateTimePicker DtpLower;
private Asa.FaceControl.FaceListBox LstLabel;
private Asa.FaceControl.FaceButton BtnExport;
private Asa.FaceControl.FaceLabel LblDateRange;
private Asa.FaceControl.FaceTextBox TxtCode;
private Asa.FaceControl.FaceButton BtnSelect;
private Asa.FaceControl.FaceButton BtnExport;
private Asa.FaceControl.FaceButton BtnExportAll;
private Asa.FaceControl.FacePictureBox PicShow;
private System.Windows.Forms.PictureBox PicLabel;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private Asa.FaceControl.FaceListBox LstCode;
private Asa.FaceControl.FaceListBox LstLabel;
private Asa.FaceControl.FaceLabel LblCode;
private Asa.FaceControl.FaceListBox LstRecord;
private System.Windows.Forms.DateTimePicker DtpLower;
private System.Windows.Forms.PictureBox PicLabel;
private Asa.FaceControl.FacePictureBox PicShow;
private Asa.FaceControl.FaceLabel LblAllCode;
private Asa.FaceControl.FaceListBox LstCode;
private Asa.FaceControl.FaceLabel LblAllLabel;
private Asa.FaceControl.FaceLabel LblDateRange;
private Asa.FaceControl.FaceButton butt_getData;
private Asa.FaceControl.FaceButton BtnExportAll;
private Asa.FaceControl.FaceButton faceBut_prin;
private Asa.FaceControl.FaceLabel faceLabel1;
}
}
\ No newline at end of file
using System;
using Asa.FaceControl;
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Text;
using Asa.FaceControl;
using System.Windows.Forms;
using System.Reflection;
using System.Web.UI.WebControls;
using DocumentFormat.OpenXml.ExtendedProperties;
using DocumentFormat.OpenXml.Wordprocessing;
using BLL;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Xml.Linq;
namespace SmartScan
{
public partial class FrmRetrospect : FaceFormFixed
{
public delegate void RestrPrint(Dictionary<string, string> keys);
public static event RestrPrint Print;
private List<HistoryPath> fileFull = new();
public FrmRetrospect()
{
InitializeComponent();
}
private class HistoryPath
{
public string cameraPath = "";
......@@ -132,13 +125,23 @@ namespace SmartScan
private void FrmRetrospect_Load(object sender, EventArgs e)
{
int SH = Screen.PrimaryScreen.Bounds.Height; //1080
int SW = Screen.PrimaryScreen.Bounds.Width; //1920
if (SH>=1080&&SW>=1920)
{
this.Width = 1200;
this.Height = 800;
}
DtpLower.Value = DateTime.Now.Date;
DtpUpper.Value = DateTime.Now.Date;
tableLayoutPanel1.Width = this.Width-20;
tableLayoutPanel1.Height = this.Height - 60;
if (ConfigHelper.Config.Get("Display_EnableGetData", "1181")=="1181")
{
butt_getData.Visible = true;
LstRecord.Height = 206;
butt_startserver.Visible = true;
}
this.StartPosition = FormStartPosition.CenterScreen;
}
private void BtnSelect_Click(object sender, EventArgs e)
......@@ -197,8 +200,10 @@ namespace SmartScan
LstRecord.Items.Clear();
LstRecord.Items.AddRange(items);
LstRecord.SelectedFirst();
faceLabel1.Text = string.Format(Language.Dialog("information"), fileFull.Count);
}
Dictionary<string, string> printdic = new Dictionary<string, string>();
private void LstRecord_SelectedIndexChanged(object sender, EventArgs e)
{
if (LstRecord.Items.Count == 0)
......@@ -213,13 +218,14 @@ namespace SmartScan
LstCode.Items.Clear();
PicShow.CodeCenterClear();
LstLabel.Items.Clear();
string json = System.IO.File.ReadAllText(path.codePath);
System.Web.Script.Serialization.JavaScriptSerializer serializer = new();
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (dic.ContainsKey("Code"))
{
if (dic["Code"]!=null)
{
object[] obj = (object[])dic["Code"];
string[] items = new string[obj.Length];
PointF[] center = new PointF[obj.Length];
......@@ -236,6 +242,8 @@ namespace SmartScan
LstCode.SelectedIndex = -1;
}
}
if (dic.ContainsKey("Label"))
{
object[] obj = (object[])dic["Label"];
......@@ -246,6 +254,28 @@ namespace SmartScan
LstLabel.SelectedIndex = -1;
}
//添加关键字键值对,用于打印
printdic.Clear();
try
{
if (dic.ContainsKey("Content"))
{
var content = (object[])dic["Content"];
var dictionary = (Dictionary<string, object>)content[0];
foreach (var item in dictionary)
{
if (!string.IsNullOrWhiteSpace((string)item.Value))
{
printdic.Add(item.Key, (string)item.Value);
}
}
}
}
catch (Exception)
{
LogNet.log.Info("打印内容加载出错");
printdic = new Dictionary<string, string>();
}
}
/// <summary>
/// 导出文件格式
......@@ -334,12 +364,11 @@ namespace SmartScan
return true;
else if (!BLLCommon.macroKey.Contains(pairs[0])) { return false; }
}
}
}
return true;
}
bool checkHasMacroKey(Dictionary<string, object> content)
{
for (int i = 0; i < BLLCommon.macroKey.Count; i++)
......@@ -434,13 +463,13 @@ namespace SmartScan
var pss = Process.GetProcessesByName(servicename);
if (pss.Length > 0)
return;
var f = ConfigHelper.Config.Get("Display_GetDataAppPath");
if (!File.Exists(f))
var serverpath =Application.StartupPath+"\\"+ConfigHelper.Config.Get("Display_GetDataAppPath");
if (!File.Exists(serverpath))
throw new Exception("未找到服务文件!");
proes.StartInfo = new ProcessStartInfo
{
FileName = f,
WorkingDirectory = System.IO.Path.Combine(Environment.CurrentDirectory, "ASTI"),
FileName = serverpath,
WorkingDirectory = System.IO.Path.Combine(Application.StartupPath, "ASTI"),
Verb = "runas" // 这里设置为 "runas" 表示以管理员身份运行
};
proes.StartInfo.UseShellExecute = false;
......@@ -448,10 +477,18 @@ namespace SmartScan
}
catch (Exception)
{
throw;
}
}
private void faceBut_prin_Click(object sender, EventArgs e)
{
if (printdic.Count==0)
{
LogNet.log.Info("打印参数为0");
return;
}
Print?.Invoke(printdic);
}
}
}
......@@ -47,10 +47,10 @@ namespace SmartScan
this.BtnGenneralSetting.BorderWidth = 2;
this.BtnGenneralSetting.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnGenneralSetting.HoldPress = false;
this.BtnGenneralSetting.Location = new System.Drawing.Point(11, 279);
this.BtnGenneralSetting.Location = new System.Drawing.Point(11, 292);
this.BtnGenneralSetting.Name = "BtnGenneralSetting";
this.BtnGenneralSetting.Padding = new System.Windows.Forms.Padding(3);
this.BtnGenneralSetting.Size = new System.Drawing.Size(160, 50);
this.BtnGenneralSetting.Size = new System.Drawing.Size(196, 50);
this.BtnGenneralSetting.TabIndex = 3;
this.BtnGenneralSetting.Text = "GeneralSetting";
this.BtnGenneralSetting.Click += new System.EventHandler(this.BtnMenu_Click);
......@@ -62,10 +62,10 @@ namespace SmartScan
this.BtnLabel.BorderWidth = 2;
this.BtnLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnLabel.HoldPress = false;
this.BtnLabel.Location = new System.Drawing.Point(11, 167);
this.BtnLabel.Location = new System.Drawing.Point(11, 178);
this.BtnLabel.Name = "BtnLabel";
this.BtnLabel.Padding = new System.Windows.Forms.Padding(3);
this.BtnLabel.Size = new System.Drawing.Size(160, 50);
this.BtnLabel.Size = new System.Drawing.Size(196, 50);
this.BtnLabel.TabIndex = 5;
this.BtnLabel.Text = "Label";
this.BtnLabel.Click += new System.EventHandler(this.BtnMenu_Click);
......@@ -77,10 +77,10 @@ namespace SmartScan
this.BtnMaterial.BorderWidth = 2;
this.BtnMaterial.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnMaterial.HoldPress = false;
this.BtnMaterial.Location = new System.Drawing.Point(11, 111);
this.BtnMaterial.Location = new System.Drawing.Point(11, 121);
this.BtnMaterial.Name = "BtnMaterial";
this.BtnMaterial.Padding = new System.Windows.Forms.Padding(3);
this.BtnMaterial.Size = new System.Drawing.Size(160, 50);
this.BtnMaterial.Size = new System.Drawing.Size(196, 50);
this.BtnMaterial.TabIndex = 6;
this.BtnMaterial.Text = "Material";
this.BtnMaterial.Click += new System.EventHandler(this.BtnMenu_Click);
......@@ -92,10 +92,10 @@ namespace SmartScan
this.BtnKeyword.BorderWidth = 2;
this.BtnKeyword.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnKeyword.HoldPress = false;
this.BtnKeyword.Location = new System.Drawing.Point(11, 55);
this.BtnKeyword.Location = new System.Drawing.Point(11, 64);
this.BtnKeyword.Name = "BtnKeyword";
this.BtnKeyword.Padding = new System.Windows.Forms.Padding(3);
this.BtnKeyword.Size = new System.Drawing.Size(160, 50);
this.BtnKeyword.Size = new System.Drawing.Size(196, 50);
this.BtnKeyword.TabIndex = 7;
this.BtnKeyword.Text = "Keyword";
this.BtnKeyword.Click += new System.EventHandler(this.BtnMenu_Click);
......@@ -141,10 +141,10 @@ namespace SmartScan
this.PnlTemp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.PnlTemp.BorderWidth = 2;
this.PnlTemp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.PnlTemp.Location = new System.Drawing.Point(177, 55);
this.PnlTemp.Location = new System.Drawing.Point(213, 55);
this.PnlTemp.Name = "PnlTemp";
this.PnlTemp.Padding = new System.Windows.Forms.Padding(3);
this.PnlTemp.Size = new System.Drawing.Size(836, 656);
this.PnlTemp.Size = new System.Drawing.Size(800, 656);
this.PnlTemp.TabIndex = 11;
this.PnlTemp.Text = "facePanel1";
this.PnlTemp.TitleFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -173,10 +173,10 @@ namespace SmartScan
this.BtnDataSource.BorderWidth = 2;
this.BtnDataSource.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnDataSource.HoldPress = false;
this.BtnDataSource.Location = new System.Drawing.Point(11, 223);
this.BtnDataSource.Location = new System.Drawing.Point(11, 235);
this.BtnDataSource.Name = "BtnDataSource";
this.BtnDataSource.Padding = new System.Windows.Forms.Padding(3);
this.BtnDataSource.Size = new System.Drawing.Size(160, 50);
this.BtnDataSource.Size = new System.Drawing.Size(196, 50);
this.BtnDataSource.TabIndex = 7;
this.BtnDataSource.Text = "Datasource";
this.BtnDataSource.Click += new System.EventHandler(this.BtnMenu_Click);
......
......@@ -18,6 +18,7 @@ namespace SmartScan
public FrmSet()
{
InitializeComponent();
//WebService.Open();//启动条码匹配服务
}
private void FrmSet_Load(object sender, EventArgs e)
{
......
......@@ -38,6 +38,7 @@ namespace SmartScan
private void FrmWaitting_Load(object sender, EventArgs e)
{
this.Text = Language.Dialog("PleaseWaiting");//请稍后
this.label1.Text= Language.Dialog("PleaseWaiting");
faceLoading1.Start();
Task.Run(()=> {
Task.Delay(10 * 1000).Wait();
......
Dialog_LoginWrong 登录密码错误。 The login password is incorrect.
Dialog_LoginWrong 登录密码错误。 The Login Password Is Incorrect.
Dialog_SaveSucceed 保存成功 Save Successfully
Dialog_Error 错误 Error
Dialog_CodeCount 条码数量为0 The code number is 0
Dialog_SelectPrintContent 识别完成,选择打印内容 Recognition complete, select print content
Dialog_PrintTemplateAdd 输入新的打印标签模板名称 Name of print template
Dialog_PrintTemplateDel 确定要删除打印标签模板 [name] 吗? Delete print label template [name] ?
Dialog_PrintTemplateRename 把模板 [name] 重命名为 Rename print label template [name] to
Dialog_MaterialTemplateAdd 输入新的物料模板名称 Name of new material template
Dialog_MaterialTemplateDel 确定要删除物料模板 [name] 吗? Delete material template [name] ?
Dialog_MaterialTemplateRename 把模板 [name] 重命名为 Rename material template [name] to
Dialog_MaterialTemplateNoMatch 没有匹配到物料模板 The material template does not match
Dialog_ServerReturn 服务端返回数据错误 The server returned data is error
Dialog_ServerJson 服务端数据为空 The server returned data is empty
Dialog_LabelEmpty 打印标签内容有空内容,是否继续打印? Print label content is empty, do you want to continue printing?
Dialog_KeyExists [name],关键字已存在 Dupicated field found:[name]
Dialog_KeyRepeat 重复关键字 Repeat keyword
Dialog_KeyEmpty 关键字为空 Keyword can't be empty
Dialog_NoMatchSelect 必须选择一个匹配模式 A matching pattern must be selected
Dialog_UnlockWrong 解锁密码错误 Wrong unlock password
Dialog_RepeatPrint 该料盘标签已打印 The tray label has been printed
Dialog_MaterialScanning 拍照识别... In recognition...
Dialog_MaterialTemplateMatching 模版匹配... Template matching...
Dialog_MaterialProcessing 计算结果... Processing results...
Dialog_CodeCount 条码数量为0 Code Qty Is 0
Dialog_SelectPrintContent 识别完成,选择打印内容 Recognition Complete, Select Print Content
Dialog_PrintTemplateAdd 输入新的打印标签模板名称 Name Of Print Template
Dialog_PrintTemplateDel 确定要删除打印标签模板 [name] 吗? Delete Print Label Template [Name] ?
Dialog_PrintTemplateRename 把模板 [name] 重命名为 Rename Print Label Template [Name] To
Dialog_MaterialTemplateAdd 输入新的物料模板名称 Name The New Material Template
Dialog_MaterialTemplateDel 确定要删除物料模板 [name] 吗? Delete Material Template [Name] ?
Dialog_MaterialTemplateRename 把模板 [name] 重命名为 Rename Material Template [Name] To
Dialog_MaterialTemplateNoMatch 没有匹配到物料模板 No Material Template Matched
Dialog_ServerReturn 服务端返回数据错误 The Server Returned Data Is Error
Dialog_ServerJson 服务端数据为空 The Server Returned Data Is Empty
Dialog_LabelEmpty 打印标签内容有空内容,是否继续打印? Print Label Content Is Empty. Confirm To Continue Printing?
Dialog_KeyExists [name],关键字已存在 Dupicated Field Found:[Name]
Dialog_KeyRepeat 重复关键字 Repeat Keyword
Dialog_KeyEmpty 关键字为空 Keyword Can'T Be Empty
Dialog_NoMatchSelect 必须选择一个匹配模式 Must Select A Matching Mode
Dialog_UnlockWrong 解锁密码错误 Wrong Unlock Password
Dialog_RepeatPrint 该料盘标签已打印 The Label Has Been Printed
Dialog_MaterialScanning 拍照识别... In Recognition...
Dialog_MaterialTemplateMatching 模版匹配... Template Matching...
Dialog_MaterialProcessing 计算结果... Processing Results...
Dialog_PleaseWaiting 请稍后... Please Waiting...
Dialog_MatchType_max 匹配数量至多 Match at most
Dialog_MatchType_equals 匹配数量等于 Occurrence
Dialog_MatchType_min 匹配数量至少 Match at least
Dialog_OcrNeedCodeSetKey Ocr的基准条码必须先匹配关键字 Ocr's based barcode must first match the keyword
Dialog_ThisMatchHasOcrCantdelete 该匹配规则下有Ocr规则,不能删除全部关键字 There are Ocr rules under this matching rule, and all keywords cannot be deleted
Dialog_selectdatasource 请选择数据文件 Please select data source
Dialog_filenotexists 文件状态:该文件不存在 File status:The file doesn't exit
Dialog_filepatseerror File read fails
Dialog_fileformaterror 文件格式不正确 Incorrect file format
Dialog_OcrNotSupport2DCode 二维码不能用于OCR定位基准 2D barcode cannot be used as OCR positioning benchmarks
Dialog_RemindClearTemplate 识别将重置模板。您确定要执行该操作吗? Recognition will reset the template.Are you sure to perform the action?
Dialog_PrintLabel 打印标签 Print
Dialog_RemindSelectCode 请选择一个条码! Please select a barcode!
Dialog_TemplateMatchingConflict [name] 与以下的模板匹配冲突 [name] conflicts with the following template
Dialog_TemplateKeyMatchingDul [name] 以下关键字重复匹配 The following keywords of [name] are duplicates
Dialog_TemplateKeyUnMatching [name] 以下关键字匹配失败 The following keywords of [name] match failed
Dialog_TemplateUnSetMatching [name] 模板不匹配,未设置匹配规则 [name] do not match, and no matching rules are set.
Dialog_MatchType_max 匹配数量至多 Match Times At Most
Dialog_MatchType_equals 匹配数量等于 Match Times Equals
Dialog_MatchType_min 匹配数量至少 Match Times At Least
Dialog_OcrNeedCodeSetKey Ocr的基准条码必须先匹配关键字 OCR Based Barcode Must Match The Keyword First
Dialog_ThisMatchHasOcrCantdelete 该匹配规则下有Ocr规则,不能删除全部关键字 There Are OCR Rules Under This Matching Rule. Cannot Delete All Keywords
Dialog_selectdatasource 请选择数据文件 Please Select Data Source
Dialog_filenotexists 文件状态:该文件不存在 File Status:The File Doesn't Exist
Dialog_filepatseerror File Read Failure
Dialog_fileformaterror 文件格式不正确 Incorrect File Format
Dialog_OcrNotSupport2DCode 二维码不能用于OCR定位基准 2D Codes Cannot Be Used For Ocr Positioning References
Dialog_RemindClearTemplate 识别将重置模板。您确定要执行该操作吗? Recognition Will Reset The Template. Confirm To Perform The Action?
Dialog_PrintLabel 打印标签 Print Label
Dialog_RetrieveDataAgain 重新获取数据 Retrieve data again
Dialog_RemindSelectCode 请选择一个条码! Please Select A Barcode!
Dialog_TemplateMatchingConflict [name] 与以下的模板匹配冲突 [Name] Conflicts With The Following Template
Dialog_TemplateKeyMatchingDul [name] 以下关键字重复匹配 The Following Keywords Of [Name] Are Duplicates
Dialog_TemplateKeyUnMatching [name] 以下关键字匹配失败 The Following Keywords Of [Name] Match Failed
Dialog_TemplateUnSetMatching [name] 模板不匹配,未设置匹配规则 [Name] Do Not Match, And Matching Rules Not Set.
Dialog_Start 开始 Start
Dialog_Exit 退出 Exit
Dialog_MatchEmpty 匹配条件为空 Rule can't be empty
Dialog_MatchEmpty 匹配条件为空 Match Rule Can't Be Empty
Dialog_ResetidByNone 序号不重置 No-Reset UID
Dialog_ResetidByDay 序号每日重置 Auto-Reset UID Daily
Dialog_ResetidByMonth 序号每月重置 Auto-Reset UID Monthly
FrmUsersLogin_FrmUsersLogin 登录 Login Arial,20,B,
FrmUsersLogin_LblUser 用户名: User name Arial,11,,
FrmUsersLogin_LblUser 用户名: User Name Arial,11,,
FrmUsersLogin_TxtUser Arial,12,,
FrmUsersLogin_BtnCancel 取消 Cancel Arial,12,,
FrmUsersLogin_BtnLogin 登录 Login Arial,15,B,
......@@ -59,76 +60,80 @@ FrmMain_BtnTriggerIO 触发识别设备 Manual Scan Arial,9,,
FrmMain_LblCameraExist 识别设备连接 Camera Arial,9,,
FrmMain_LblIOExist IO模块连接 Machine Arial,9,,
FrmMain_PnlExtension 功能 Print Info. Arial,14,,
FrmMain_BtnPrint 打印标签 Print Arial,12,,
FrmMain_DynamicButton 替换数据 ReplaceData 微软雅黑,12,,
FrmMain_BtnPrint 打印标签 Print Label Arial,12,,
FrmMain_DynamicButton 替换数据 Replacedata 微软雅黑,12,,
FrmSet_FrmSet 设置 Setting Arial,20,B,
FrmSet_BtnGenneralSetting 通用设置 General Arial,12,B,
FrmSet_BtnIdentify 识别设备 Debug Arial,12,B,
FrmSet_BtnLabel 打印模版 Print Arial,12,B,
FrmSet_BtnMaterial 物料模版 Material Arial,12,B,
FrmSet_BtnKeyword 关键字 Field Arial,12,B,
FrmSet_BtnGenneralSetting 通用设置 General Setting Arial,12,B,
FrmSet_BtnIdentify 识别条码 Recognition Arial,12,B,
FrmSet_BtnLabel 打印模版 Print Template Arial,12,B,
FrmSet_BtnMaterial 物料模版 Material Template Arial,12,B,
FrmSet_BtnKeyword 关键字 Keyword Arial,12,B,
FrmSet_BtnOK 保存 Save Arial,12,,
FrmSet_BtnCancel 取消 Cancel Arial,12,,
FrmSet_BtnApply 应用 Apply Arial,12,,
FrmSet_BtnDataSource 数据源 Source 微软雅黑,12,B,
FrmSetPlus_FrmSetPlus 条码规则设置 BarCode Rule Setting Arial,20,B,
FrmSetPlus_BtnWorkMode 工作模式 Config Arial,12,B,
FrmSetPlus_BtnIdentify 识别设备 Debug Arial,12,B,
FrmSetPlus_BtnLabel 打印模版 Label Arial,12,B,
FrmSetPlus_BtnMaterial 物料模版 Material Template Arial,12,B,
FrmSetPlus_BtnKeyword 关键字 Field Arial,12,B,
FrmSet_BtnDataSource 数据源 Source Arial,12,B,
FrmSetPlus_FrmSetPlus 条码规则设置 Barcode Rule Setting Arial,20,B,
FrmSetPlus_BtnWorkMode 工作模式 Config. Arial,12,B,
FrmSetPlus_BtnIdentify 识别条码 Recog. Arial,12,B,
FrmSetPlus_BtnLabel 打印模版 Lable Arial,12,B,
FrmSetPlus_BtnMaterial 物料模版 MAT Temp. Arial,12,B,
FrmSetPlus_BtnKeyword 关键字 Keyword Arial,12,B,
FrmSetPlus_BtnOK 保存 Save Arial,12,,
FrmSetPlus_BtnCancel 取消 Cancel Arial,12,,
FrmSetPlus_BtnApply 应用 Apply Arial,12,,
FrmSetPlus_BtnRetrospect 追溯历史 Traceability Arial,12,B,
FrmSetPlus_but_Labeling 贴标参数 Labeling PARM Arial,12,B,
FrmSetPlus_Keywordlabeling 关键字贴标 Keyword Labeling Arial,12,B,
UsrWorkMode_UsrWorkMode
UsrWorkMode_LblPrint 打印机 Printer Arial,12,B,
UsrWorkMode_LblDefaultLabel 默认打印标签 Default Print Template Arial,12,B,
UsrWorkMode_RdoLandscape 横向打印 Landscape Arial,12,,
UsrWorkMode_RdoVertical 纵向打印 Portrait Arial,12,,
UsrWorkMode_LblHistoryImage 追溯图像保存 Image Arial,12,B,
UsrWorkMode_LblHistoryImage 追溯图像保存 Save Retroactive Image Arial,12,B,
UsrWorkMode_RdoOriginal 原图 Original Arial,12,,
UsrWorkMode_RdoCondense 压缩图像 Compressed Arial,12,,
UsrWorkMode_RdoNoImage 不保存 Skip Image Arial,12,,
UsrWorkMode_ChkSelectPN 从服务器上查询PN Query PN from the server Arial,12,,
UsrWorkMode_ChkLabelEmptyCheck 打印标签空内容提醒 Empty label alert Arial,12,,
UsrWorkMode_RdoCondense 压缩图像 Compressed Image Arial,12,,
UsrWorkMode_RdoNoImage 不保存 Skip Saving Arial,12,,
UsrWorkMode_ChkSelectPN 从服务器上查询PN Query PN From The Server Arial,12,,
UsrWorkMode_ChkLabelEmptyCheck 打印标签空内容提醒 Empty Label Alert Arial,12,,
UsrWorkMode_ChkPrintCompletedClear 打印标签后清除内容 Print&Clear Arial,12,,
UsrWorkMode_ChkOpenEnterWork 打开软件自动进入工作模式 Auto Start Mode Arial,12,,
UsrWorkMode_ChkOpenMaximize 打开软件最大化窗口 Always Open Maximized Arial,12,,
UsrWorkMode_ChkTriggerOpenLight 触发信号后在打开光源 Turn on light after triggering device Arial,12,,
UsrWorkMode_ChkPromptAfterPrinting 识别完成后提示 Prompt after recognition is complete Arial,12,,
UsrWorkMode_ChkTriggerOpenLight 触发信号后在打开光源 Turn On Light After Triggering Device Arial,12,,
UsrWorkMode_ChkPromptAfterPrinting 识别完成后提示 Prompt After Recognition Is Complete Arial,12,,
UsrWorkMode_ChkAutoPrint 自动打印 Auto Print Arial,12,,
UsrWorkMode_LstPrinter Arial,12,,
UsrWorkMode_LstLabel Arial,12,,
UsrWorkMode_LblDefaultMate 优先匹配模板 Preferred template Arial,12,B,
UsrWorkMode_LblDefaultMate 优先匹配模板 Prioritize Match Template Arial,12,B,
UsrWorkMode2_LblDefaultMate 优先匹配模板 Prioritize Match Template Arial,12,B,
UsrWorkMode_LstMate Arial,12,,
UsrWorkMode_ChkAllowModifyPrint 允许修改打印内容 Modification of hit content is allowed Arial,12,,
UsrWorkMode_ChkAllowModifyPrint 允许修改打印内容 Allow Modify Printing Content Arial,12,,
UsrCamera_UsrCamera
UsrCamera_BtnOpenLight 打开光源 Turn on light Arial,12,,
UsrCamera_BtnCloseLight 关闭光源 Turn off light Arial,12,,
UsrCamera_BtnCameraImage 获取设备图像 Gain device image Arial,12,,
UsrCamera_BtnLocalImage 打开本地图片 Open local image Arial,12,,
UsrCamera_BtnScanCode 识别 Recognition Arial,12,,
UsrCamera_BtnSaveImage 保存图像 Save image Arial,12,,
UsrCamera_BtnOpenLight 打开光源 Turn On Light Arial,12,,
UsrCamera_BtnCloseLight 关闭光源 Turn Off Light Arial,12,,
UsrCamera_BtnCameraImage 获取设备图像 Gain Device Image Arial,12,,
UsrCamera_BtnLocalImage 打开本地图片 Open Local Image Arial,12,,
UsrCamera_BtnScanCode 识别条码 Recognition Arial,12,,
UsrCamera_BtnSaveImage 保存图像 Save Image Arial,12,,
UsrCamera_LstCode Arial,12,,
UsrPrintTemplate_UsrPrintTemplate
UsrPrintTemplate_BtnAddLabel 新建标签 New Arial,12,,
UsrPrintTemplate_BtnDelLabel 删除标签 Delete Arial,12,,
UsrPrintTemplate_BtnCopyLabel 复制标签 Duplicate Arial,12,,
UsrPrintTemplate_BtnDelLabel 删除标签 Delete Label Arial,12,,
UsrPrintTemplate_BtnCopyLabel 复制标签 Duplicate Label Arial,12,,
UsrPrintTemplate_BtnRenameLabel 重命名 Rename Arial,12,,
UsrPrintTemplate_BtnPrintTest 打印测试 Print Test Arial,12,,
UsrPrintTemplate_BtnAddField 添加字段 Add Block Arial,12,,
UsrPrintTemplate_BtnDelField 删除字段 Delete Block Arial,12,,
UsrPrintTemplate_BtnFieldFont 字段字体 Block Font Arial,12,,
UsrPrintTemplate_BtnSetField 设置字段内容 Set BLock Content Arial,12,,
UsrPrintTemplate_LblFieldType 码制 Type Arial,12,B,
UsrPrintTemplate_ChkFieldShowKey 显示关键字 Display key Arial,12,,
UsrPrintTemplate_LblFieldX X(mm) X(mm) Arial,12,B,
UsrPrintTemplate_LblFieldY Y(mm) Y(mm) Arial,12,B,
UsrPrintTemplate_LblFieldW W(mm) W(mm) Arial,12,B,
UsrPrintTemplate_LblFieldH L(mm) L(mm) Arial,12,B,
UsrPrintTemplate_BtnAddField 添加字段 Add Filed Arial,12,,
UsrPrintTemplate_BtnDelField 删除字段 Delete Filed Arial,12,,
UsrPrintTemplate_BtnFieldFont 字段字体 Field Font Arial,12,,
UsrPrintTemplate_BtnSetField 设置字段内容 Set Filed Content Arial,12,,
UsrPrintTemplate_LblFieldType 条形码类型 Code Type Arial,12,B,
UsrPrintTemplate_ChkFieldShowKey 显示关键字 Display Keyword Arial,12,,
UsrPrintTemplate_LblFieldX X(mm) X(Mm) Arial,12,B,
UsrPrintTemplate_LblFieldY Y(mm) Y(Mm) Arial,12,B,
UsrPrintTemplate_LblFieldW W(mm) W(Mm) Arial,12,B,
UsrPrintTemplate_LblFieldH L(mm) L(Mm) Arial,12,B,
UsrPrintTemplate_pnlPrintTmpLst 标签模板 Label Template 微软雅黑,12,,
UsrPrintTemplate_pnlPrintTmpLstOp 标签模板操作 Label Template Operation 微软雅黑,12,,
UsrPrintTemplate_pnLabelStyle 标签样式 Label 微软雅黑,12,,
UsrPrintTemplate_pnLabelStyle 标签样式 Label Format 微软雅黑,12,,
UsrPrintTemplate_pnAllFieldsOfLabel 标签的所有字段 Fields 微软雅黑,12,,
UsrPrintTemplate_facePanel7 字段操作 Field Operation 微软雅黑,12,,
UsrPrintTemplate_pnLabelFieldPos 字段位置 Field Location 微软雅黑,12,,
......@@ -136,16 +141,16 @@ UsrMaterialTemplate_UsrMaterialTemplate
UsrMaterialTemplate_BtnAddMate 新建模板 New Arial,12,,
UsrMaterialTemplate_BtnDelMate 删除模板 Delete Arial,12,,
UsrMaterialTemplate_BtnRenameMate 重命名 Rename Arial,12,,
UsrMaterialTemplate_BtnOpenLight 打开光源 Turn on light Arial,12,,
UsrMaterialTemplate_BtnCloseLight 关闭光源 Turn off light Arial,12,,
UsrMaterialTemplate_BtnCameraImage 获取设备图像 Gain device image Arial,12,,
UsrMaterialTemplate_BtnLocalImage 打开本地图片 Open Local image Arial,12,,
UsrMaterialTemplate_BtnOpenLight 打开光源 Turn On Light Arial,12,,
UsrMaterialTemplate_BtnCloseLight 关闭光源 Turn Off Light Arial,12,,
UsrMaterialTemplate_BtnCameraImage 获取设备图像 Gain Device Image Arial,12,,
UsrMaterialTemplate_BtnLocalImage 打开本地图片 Open Local Image Arial,12,,
UsrMaterialTemplate_BtnScanCode 识别 Recognition Arial,12,,
UsrMaterialTemplate_BtnExtractCode 提取 Extract Arial,12,,
UsrMaterialTemplate_BtnOcrCode OCR OCR Arial,12,,
UsrMaterialTemplate_BtnPrimaryCode 特征码 Set Primary code Arial,12,,
UsrMaterialTemplate_BtnPrimaryCode 特征码 Set Primary Code Arial,12,,
UsrMaterialTemplate_BtnSaveImage 图片另存 Save As Arial,12,,
UsrMaterialTemplate_BtnTemplateValite 模板验证 Template validation Arial,12,,
UsrMaterialTemplate_BtnTemplateValite 模板验证 Template Validation Arial,12,,
UsrMaterialTemplate_pnlMaterial 模板 Template Arial,12,,
UsrMaterialTemplate_pnlMaterialOp 模板操作 Template Operation Arial,12,,
UsrMaterialTemplate_pnlCode 条码 Barcode Arial,12,,
......@@ -153,41 +158,41 @@ UsrMaterialTemplate_pnlCodeOp 条码操作 Barcode Operation Arial,12,,
UsrMaterialTemplate_pnlImg 图片 Image Arial,12,,
UsrMaterialTemplate_pnlImgOp 图片操作 Image Operation Arial,12,,
UsrDataSource_UsrDataSource
UsrDataSource_ChkRecursive 遍历同目录 Search files in the same directory Arial,12,,
UsrDataSource_ChkRecursive 遍历同目录 Traversal Same Catalogue Arial,12,,
UsrDataSource_groupBox_lblkey 标签可用字段 Label Available Fields Arial,12,,
UsrDataSource_BtnSelectFile 选择文件 Select File Arial,12,,
UsrDataSource_faceLabel2 关键字匹配数据标题 Keyword matches the data title Arial,12,,
UsrDataSource_faceLabel1 识别关键词 Identify Key Words Arial,12,,
UsrDataSource_faceLabel2 关键字匹配数据标题 Keyword Matches The Data Title Arial,12,,
UsrDataSource_faceLabel1 识别关键词 Identify Keyword Arial,12,,
UsrDataSource_LblFilestatus 文件状态: File Status: Arial,12,,
UsrDataSource_LblContent 标签数据源 Label Data Source Arial,12,,
UsrMacro_UsrMacro
UsrMacro_BtnAddKey 添加 Add Arial,12,,
UsrMacro_BtnDelKey 删除 Delete Arial,12,,
UsrMacro_BtnUpdateKey 更新 Update Arial,12,,
UsrMacro_BtnAppendKey 添加到生成条件 Append conditions Arial,12,,
UsrMacro_BtnAppendKey 添加到生成条件 Append Conditions Arial,12,,
UsrMacro_btn_setriid 切换自动RI Toggle Auto RI Arial,12,,
UsrMacro_PnlReelid Reel ID Reel ID Arial,12,,
UsrMacro_LblContent 生成条件 Build conditions Arial,12,B,
UsrMacro_LblContent 生成条件 Generation Condition Arial,12,B,
UsrMacro_LblPrefix 开头字符串 Prefix Arial,10,,
UsrMacro_LblPostfix 结尾字符串 Suffix Arial,10,,
UsrMacro_LblPlaces 数字位数 Field length Arial,10,,
UsrMacro_ChkReelIDFillZero 位数不足前面补0 Add leading zero Arial,12,,
UsrMacro_LblPlaces 数字位数 Field Length Arial,10,,
UsrMacro_ChkReelIDFillZero 位数不足前面补0 Add Leading Zero Arial,12,,
UsrMacro_btn_adddatetime 添加日期时间 Add Date Arial,12,,
UsrCodeExtractList_UsrCodeExtractList
UsrCodeExtractList_ChkMatchingStart 匹配开头字符 Starting Character Arial,12,,
UsrCodeExtractList_ChkMatchingEnd 匹配结尾字符 Ending Character Arial,12,,
UsrCodeExtractList_ChkMatchingMiddle 匹配任意位置字符 Contain Arial,12,,
UsrCodeExtractList_ChkMatchisnumber 检测并转换为数字 Detect and convert to number Arial,12,,
UsrCodeExtractList_ChkMatchingStart 开头字符 Starting Character Arial,12,,
UsrCodeExtractList_ChkMatchingEnd 结尾字符 Ending Character Arial,12,,
UsrCodeExtractList_ChkMatchingMiddle 包含字符 Contain Character Arial,12,,
UsrCodeExtractList_ChkMatchisnumber 检测并转换为数字 Detect And Convert To Number Arial,12,,
UsrCodeExtractList_ChkMatchingSplit 条码分割字符 Delimiter Arial,12,,
UsrCodeExtractList_LblSplitPart 获取分割部分 Left Most Arial,12,,
UsrCodeExtractList_LblSplitPart 获取分割部分 Delimiter Part Sequence Arial,12,,
UsrCodeExtractList_ChkCaseSensitivity 区分大小写 Case Sensitive Arial,12,,
UsrCodeExtractList_ChkMinLength 最小长度 Min length Arial,12,,
UsrCodeExtractList_ChkMaxLength 最大长度 Max length Arial,12,,
UsrCodeExtractList_LblKeyword 设置关键字 Field Arial,12,,
UsrCodeExtractList_LblStart 内容截取起始位 Part code start Arial,12,,
UsrCodeExtractList_LblLength 内容截取长度 Part code length Arial,12,,
UsrCodeExtractList_ChkLengthEnd 截取至结尾 Code ending Arial,12,,
UsrCodeExtractList_ChkCheckCodeType 匹配条码编码类型 Match barcode encode type Arial,12,,
UsrCodeExtractList_ChkMinLength 最小长度 Min Length Arial,12,,
UsrCodeExtractList_ChkMaxLength 最大长度 Max Length Arial,12,,
UsrCodeExtractList_LblKeyword 选择关键字 Select Keyword Arial,12,,
UsrCodeExtractList_LblStart 内容截取起始位 Content Start From Arial,12,,
UsrCodeExtractList_LblLength 内容截取长度 Content Length Arial,12,,
UsrCodeExtractList_ChkLengthEnd 截取至结尾 Content to End Arial,12,,
UsrCodeExtractList_ChkCheckCodeType 条码编码类型 Code Type Arial,12,,
UsrCodeExtractList_BtnDel 删除 Delete Arial,12,,
UsrCodeExtractList_BtnAdd 添加 Add Arial,12,,
UsrCodeExtractList_pnlExtractRule 提取 Code Extraction 微软雅黑,12,,
......@@ -197,40 +202,65 @@ FrmAbout_LblName 物料注册系统 Material Registration System Arial,20,,
FrmFieldContent_FrmFieldContent 字段内容设置 Set Field Content Arial,24,B,
FrmFieldContent_LblContent 字段内容 Field Content Arial,12,,
FrmFieldContent_BtnInsert 插入 Insert Arial,12,,
FrmFieldContent_BtnOK 确定 OK Arial,12,,
FrmFieldContent_BtnOK 确定 Ok Arial,12,,
FrmFieldContent_BtnCancel 取消 Cancel Arial,12,,
FrmCodeExtract_FrmCodeExtract 提取条码 Code Extract Arial,24,B,
FrmCodeExtract_BtnAddMatch + + Arial,12,,
FrmCodeExtract_BtnOK 确定 OK Arial,12,,
FrmCodeExtract_BtnOK 确定 Ok Arial,12,,
FrmCodeExtract_BtnCancel 取消 Cancel Arial,12,,
FrmCodeExtract_ChkMatchingStart 匹配开头字符 Starting Character Arial,12,,
FrmCodeExtract_ChkMatchingEnd 匹配结尾字符 Ending Character Arial,12,,
FrmCodeExtract_ChkMatchingMiddle 匹配任意位置字符 Contain Arial,12,,
FrmCodeExtract_ChkMatchisnumber 必须为数字 Detect and convert to number Arial,12,,
FrmCodeExtract_ChkMatchisnumber 必须为数字 Must Be Number Arial,12,,
FrmCodeExtract_ChkCaseSensitivity 区分大小写 Case Sensitive Arial,12,,
FrmCodeExtract_ChkCheckCodeType 匹配条码编码类型 Match barcode encode type Arial,12,,
FrmCodeExtract_Characteristicbarcode 特征码 Signature code Arial,12,,
FrmCodeExtract_ChkCheckCodeType 匹配条码编码类型 Match Barcode Encode Type Arial,12,,
FrmCodeExtract_BtnDel 删除 Delete Arial,12,,
FrmCodeExtract_BtnAdd 添加 Add Arial,12,,
FrmCodeExtract_LblStart 内容截取起始位 Part code start Arial,12,,
FrmCodeExtract_LblLength 内容截取长度 Part code length Arial,12,,
FrmCodeExtract_pnlKeywords 关键字 Field 微软雅黑,12,,
FrmCodeExtract_LblStart 内容截取起始位 Part Code Start Arial,12,,
FrmCodeExtract_LblLength 内容截取长度 Part Code Length Arial,12,,
FrmCodeExtract_pnlKeywords 关键字 Keyword 微软雅黑,12,,
FrmCodeExtract_pnlRawCode 原始条码信息 Original Barcode Info. 微软雅黑,12,,
FrmCodeExtract_pnlMatch 匹配 Matching 微软雅黑,12,,
FrmCodeExtract_pnlExtractRule 提取 Code Extraction 微软雅黑,12,,
FrmCodeExtract_pnlParseResult 解析结果 Analysis 微软雅黑,12,,
FrmCodeOCR_FrmCodeOCR OCR OCR Arial,24,B,
FrmCodeOCR_BtnSelect 矩形选择框 Select Arial,12,,
FrmCodeOCR_BtnMove 移动图像 Moving images Arial,12,,
FrmCodeOCR_BtnMove 移动图像 Moving Images Arial,12,,
FrmCodeOCR_BtnDel 删除 Delete Arial,12,,
FrmCodeOCR_BtnKey 设置关键字 Set field Arial,12,,
FrmCodeOCR_BtnOK 确定 OK Arial,12,,
FrmCodeOCR_BtnKey 设置关键字 Set Keyword Arial,12,,
FrmCodeOCR_BtnOK 确定 Ok Arial,12,,
FrmCodeOCR_BtnCancel 取消 Cancel Arial,12,,
FrmRetrospect_FrmRetrospect 追溯 Traceability Arial,24,B,
FrmRetrospect_LblDateRange 日期范围 Date range Arial,12,,
FrmRetrospect_LblDateRange 日期范围 Date Range Arial,12,,
FrmRetrospect_LblCode 条码 Material ID Arial,12,,
FrmRetrospect_BtnSelect 查询 Search Arial,12,,
FrmRetrospect_BtnExport 导出 Export Arial,12,,
FrmRetrospect_BtnExportAll 导出所有 Export All Arial,12,,
FrmRetrospect_butt_getData 启动服务 Start Service Arial,12,,
FrmRetrospect_butt_startserver 启动服务 Start Service Arial,12,,
FrmRetrospect_LblAllCode 物料条码 Original Arial,12,,
FrmRetrospect_LblAllLabel 标签内容 Extracted Info. Arial,12,,
FrmRetrospect_faceBut_prin 打印 print Arial,12,,
FrmRetrospect_faceLabel1 共查询到{0}条信息 Found {0} information Arial,12,,
Dialog_information 共查询到{0}条信息 Found {0} information Arial,12,,
UsrCustomlabeling_facePanel6 覆盖原标签 Cover Orig Lable Arial,12,,
UsrCustomlabeling_IsOverlaylabel 覆盖原标签 Cover Orig Lable Arial,12,,
UsrCustomlabeling_facePanel3 XY轴偏移量 XY axis offset Arial,12,,
UsrCustomlabeling_becurrentX X轴 X-axis Arial,12,,
UsrCustomlabeling_becurrentY Y轴 Y-axis Arial,12,,
UsrCustomlabeling_facePanel4 旋转方向及角度 Rot DRI&Angle Arial,12,,
UsrCustomlabeling_IscIockwise 顺时针 Clockwise Arial,12,,
UsrCustomlabeling_IsCounterclockwise 逆时针 Reversal Arial,12,,
UsrCustomlabeling_facePanel5 标签旋转角度 Lable Rot angle Arial,12,,
UsrCustomlabeling_faceButton1 确认 Confirm Arial,12,,
Dialog_Res001 通用 Common Arial,12,,
Dialog_Res002 请选择关键字 Please Select Keyword Arial,12,,
UsrKeywordlabeling_AddLabel 添加 Add Arial,12,,
UsrKeywordlabeling_RotateAngle 以特征码顺时针旋转角度 Clockwise Rotation Angle(Based On Target Label) Arial,12,,
UsrKeywordlabeling_Xoffset X轴偏移量 X Axis Offset Arial,12,,
UsrKeywordlabeling_Yoffset Y轴偏移量 Y Axis Offset Arial,12,,
UsrKeywordlabeling_LabelRotation 标签旋转角度 Label Rotation Angle Arial,12,,
UsrKeywordlabeling_UpdateLabel 修改关键字 Modify keywords Arial,12,,
UsrKeywordlabeling_SaveLabel 确认 Confirm Arial,12,,
FrmKeyCollection_FrmKeyCollection 选择关键字 Select keywords Arial,12,,
FrmKeyCollection_faceButton1 确认 Confirm Arial,12,,
......@@ -63,7 +63,7 @@ FrmMain_BtnPrint 打印标签 打印标签 微软雅黑,12,,
FrmMain_DynamicButton 替换数据 替换数据 微软雅黑,12,,
FrmSet_FrmSet 设置 设置 微软雅黑,20,B,
FrmSet_BtnGenneralSetting 通用设置 通用设置 微软雅黑,12,B,
FrmSet_BtnIdentify 识别设备 识别设备 微软雅黑,12,B,
FrmSet_BtnIdentify 识别条码 识别条码 微软雅黑,12,B,
FrmSet_BtnLabel 打印模版 打印模版 微软雅黑,12,B,
FrmSet_BtnMaterial 物料模版 物料模版 微软雅黑,12,B,
FrmSet_BtnKeyword 关键字 关键字 微软雅黑,12,B,
......@@ -73,14 +73,16 @@ FrmSet_BtnApply 应用 应用 微软雅黑,12,,
FrmSet_BtnDataSource 数据源 数据源 微软雅黑,12,B,
FrmSetPlus_FrmSetPlus 条码规则设置 条码规则设置 微软雅黑,20,B,
FrmSetPlus_BtnWorkMode 工作模式 工作模式 微软雅黑,12,B,
FrmSetPlus_BtnIdentify 识别设备 识别设备 微软雅黑,12,B,
FrmSetPlus_BtnIdentify 识别条码 识别条码 微软雅黑,12,B,
FrmSetPlus_BtnLabel 打印模版 打印模版 微软雅黑,12,B,
FrmSetPlus_BtnMaterial 物料模版 物料模版 微软雅黑,12,B,
FrmSetPlus_BtnKeyword 关键字 关键字 微软雅黑,12,B,
FrmSetPlus_BtnOK 保存 保存 微软雅黑,12,,
FrmSetPlus_BtnCancel 取消 取消 微软雅黑,12,,
FrmSetPlus_BtnApply 应用 应用 微软雅黑,12,,
UsrWorkMode_UsrWorkMode
FrmSetPlus_BtnRetrospect 追溯历史 追溯历史 微软雅黑,12,B,
FrmSetPlus_but_Labeling 贴标参数 贴标参数 微软雅黑,12,B,
FrmSetPlus_Keywordlabeling 贴标 贴标 微软雅黑,12,B,
UsrWorkMode_LblPrint 打印机 打印机 微软雅黑,12,B,
UsrWorkMode_LblDefaultLabel 默认打印标签 默认打印标签 微软雅黑,12,B,
UsrWorkMode_RdoLandscape 横向打印 横向打印 微软雅黑,12,,
......@@ -102,12 +104,13 @@ UsrWorkMode_LstLabel 微软雅黑,12,,
UsrWorkMode_LblDefaultMate 优先匹配模板 优先匹配模板 微软雅黑,12,B,
UsrWorkMode_LstMate 微软雅黑,12,,
UsrWorkMode_ChkAllowModifyPrint 允许修改打印内容 允许修改打印内容 微软雅黑,12,,
UsrWorkMode2_LblDefaultMate 优先匹配模板 优先匹配模板 微软雅黑,12,B,
UsrCamera_UsrCamera
UsrCamera_BtnOpenLight 打开光源 打开光源 微软雅黑,12,,
UsrCamera_BtnCloseLight 关闭光源 关闭光源 微软雅黑,12,,
UsrCamera_BtnCameraImage 获取设备图像 获取设备图像 微软雅黑,12,,
UsrCamera_BtnLocalImage 打开本地图片 打开本地图片 微软雅黑,12,,
UsrCamera_BtnScanCode 识别 识别 微软雅黑,12,,
UsrCamera_BtnScanCode 识别条码 识别条码 微软雅黑,12,,
UsrCamera_BtnSaveImage 保存图像 保存图像 微软雅黑,12,,
UsrCamera_LstCode 微软雅黑,12,,
UsrPrintTemplate_UsrPrintTemplate
......@@ -120,7 +123,7 @@ UsrPrintTemplate_BtnAddField 添加字段 添加字段 微软雅黑,12,,
UsrPrintTemplate_BtnDelField 删除字段 删除字段 微软雅黑,12,,
UsrPrintTemplate_BtnFieldFont 字段字体 字段字体 微软雅黑,12,,
UsrPrintTemplate_BtnSetField 设置字段内容 设置字段内容 微软雅黑,12,,
UsrPrintTemplate_LblFieldType 码制 码制 微软雅黑,12,B,
UsrPrintTemplate_LblFieldType 条形码类型 条形码类型 微软雅黑,12,B,
UsrPrintTemplate_ChkFieldShowKey 显示关键字 显示关键字 微软雅黑,12,,
UsrPrintTemplate_LblFieldX X(mm) X(mm) 微软雅黑,12,B,
UsrPrintTemplate_LblFieldY Y(mm) Y(mm) 微软雅黑,12,B,
......@@ -174,20 +177,21 @@ UsrMacro_LblPlaces 数字位数 数字位数 微软雅黑,10,,
UsrMacro_ChkReelIDFillZero 位数不足前面补0 位数不足前面补0 微软雅黑,12,,
UsrMacro_btn_adddatetime 添加日期时间 添加日期时间 微软雅黑,12,,
UsrCodeExtractList_UsrCodeExtractList
UsrCodeExtractList_ChkMatchingStart 匹配开头字符 匹配开头字符 微软雅黑,12,,
UsrCodeExtractList_ChkMatchingEnd 匹配结尾字符 匹配结尾字符 微软雅黑,12,,
UsrCodeExtractList_ChkMatchingMiddle 匹配任意位置字符 匹配任意位置字符 微软雅黑,12,,
UsrCodeExtractList_ChkMatchingStart 开头字符 开头字符 微软雅黑,12,,
UsrCodeExtractList_ChkMatchingEnd 结尾字符 结尾字符 微软雅黑,12,,
UsrCodeExtractList_ChkMatchingMiddle 任意位置字符 任意位置字符 微软雅黑,12,,
UsrCodeExtractList_ChkMatchisnumber 检测并转换为数字 检测并转换为数字 微软雅黑,12,,
UsrCodeExtractList_ChkMatchingSplit 条码分割字符 条码分割字符 微软雅黑,12,,
UsrCodeExtractList_LblSplitPart 获取分割部分 获取分割部分 微软雅黑,12,,
UsrCodeExtractList_ChkCaseSensitivity 区分大小写 区分大小写 微软雅黑,12,,
UsrCodeExtractList_Characteristicbarcode 特征码 特征码 微软雅黑,12,,
UsrCodeExtractList_ChkMinLength 最小长度 最小长度 微软雅黑,12,,
UsrCodeExtractList_ChkMaxLength 最大长度 最大长度 微软雅黑,12,,
UsrCodeExtractList_LblKeyword 设置关键字 设置关键字 微软雅黑,12,,
UsrCodeExtractList_LblKeyword 选择关键字 选择关键字 微软雅黑,12,,
UsrCodeExtractList_LblStart 内容截取起始位 内容截取起始位 微软雅黑,12,,
UsrCodeExtractList_LblLength 内容截取长度 内容截取长度 微软雅黑,12,,
UsrCodeExtractList_ChkLengthEnd 截取至结尾 截取至结尾 微软雅黑,12,,
UsrCodeExtractList_ChkCheckCodeType 匹配条码编码类型 匹配条码编码类型 微软雅黑,12,,
UsrCodeExtractList_ChkCheckCodeType 条码类型 条码类型 微软雅黑,12,,
UsrCodeExtractList_BtnDel 删除 删除 微软雅黑,12,,
UsrCodeExtractList_BtnAdd 添加 添加 微软雅黑,12,,
UsrCodeExtractList_pnlExtractRule 提取 提取 微软雅黑,12,,
......@@ -203,12 +207,13 @@ FrmCodeExtract_FrmCodeExtract 提取条码 提取条码 微软雅黑,24,B,
FrmCodeExtract_BtnAddMatch + + 微软雅黑,12,,
FrmCodeExtract_BtnOK 确定 确定 微软雅黑,12,,
FrmCodeExtract_BtnCancel 取消 取消 微软雅黑,12,,
FrmCodeExtract_ChkMatchingStart 匹配开头字符 匹配开头字符 微软雅黑,12,,
FrmCodeExtract_ChkMatchingEnd 匹配结尾字符 匹配结尾字符 微软雅黑,12,,
FrmCodeExtract_ChkMatchingMiddle 匹配任意位置字符 匹配任意位置字符 微软雅黑,12,,
FrmCodeExtract_ChkMatchingStart 开头字符 开头字符 微软雅黑,12,,
FrmCodeExtract_ChkMatchingEnd 结尾字符 结尾字符 微软雅黑,12,,
FrmCodeExtract_ChkMatchingMiddle 任意位置字符 任意位置字符 微软雅黑,12,,
FrmCodeExtract_ChkMatchisnumber 必须为数字 必须为数字 微软雅黑,12,,
FrmCodeExtract_ChkCaseSensitivity 区分大小写 区分大小写 微软雅黑,12,,
FrmCodeExtract_ChkCheckCodeType 匹配条码编码类型 匹配条码编码类型 微软雅黑,12,,
FrmCodeExtract_Characteristicbarcode 特征码 特征码 微软雅黑,12,,
FrmCodeExtract_ChkCheckCodeType 条码类型 条码类型 微软雅黑,12,,
FrmCodeExtract_BtnDel 删除 删除 微软雅黑,12,,
FrmCodeExtract_BtnAdd 添加 添加 微软雅黑,12,,
FrmCodeExtract_LblStart 内容截取起始位 内容截取起始位 微软雅黑,12,,
......@@ -231,6 +236,30 @@ FrmRetrospect_LblCode 条码 条码 微软雅黑,12,,
FrmRetrospect_BtnSelect 查询 查询 微软雅黑,12,,
FrmRetrospect_BtnExport 导出 导出 微软雅黑,12,,
FrmRetrospect_BtnExportAll 导出所有 导出所有 微软雅黑,12,,
FrmRetrospect_butt_getData 启动服务 启动服务 微软雅黑,12,,
FrmRetrospect_butt_startserver 启动服务 启动服务 微软雅黑,12,,
FrmRetrospect_LblAllCode 物料条码 物料条码 微软雅黑,12,,
FrmRetrospect_LblAllLabel 标签内容 标签内容 微软雅黑,12,,
FrmRetrospect_faceBut_prin 打印 打印 微软雅黑,12,,
FrmRetrospect_faceLabel1 共查询到{0}条信息 共查询到{0}条信息 微软雅黑,12,,
Dialog_information 共查询到{0}条信息 共查询到{0}条信息 微软雅黑,12,,
UsrCustomlabeling_facePanel6 覆盖原标签 覆盖原标签 微软雅黑,12,,
UsrCustomlabeling_IsOverlaylabel 覆盖原标签 覆盖原标签 微软雅黑,12,,
UsrCustomlabeling_facePanel3 XY轴偏移量 XY轴偏移量 微软雅黑,12,,
UsrCustomlabeling_becurrentX X轴 X轴 微软雅黑,12,,
UsrCustomlabeling_becurrentY Y轴 Y轴 微软雅黑,12,,
UsrCustomlabeling_facePanel4 旋转方向及角度 旋转方向及角度 微软雅黑,12,,
UsrCustomlabeling_IscIockwise 顺时针 顺时针 微软雅黑,12,,
UsrCustomlabeling_faceRadioBox2 逆时针 逆时针 微软雅黑,12,,
UsrCustomlabeling_facePanel5 标签旋转角度 标签旋转角度 微软雅黑,12,,
UsrCustomlabeling_faceButton1 确认 确认 微软雅黑,12,,
Dialog_Res001 通用 通用 微软雅黑,12,,
Dialog_Res002 请选择关键字 请选择关键字 微软雅黑,12,,
UsrKeywordlabeling_AddLabel 添加 添加 微软雅黑,12,,
UsrKeywordlabeling_RotateAngle 以特征码顺时针旋转角度 以特征码顺时针旋转角度 微软雅黑,12,,
UsrKeywordlabeling_Xoffset X轴偏移量 X轴偏移量 微软雅黑,12,,
UsrKeywordlabeling_Yoffset Y轴偏移量 Y轴偏移量 微软雅黑,12,,
UsrKeywordlabeling_LabelRotation 标签旋转角度 标签旋转角度 微软雅黑,12,,
UsrKeywordlabeling_UpdateLabel 修改关键字 修改关键字 微软雅黑,12,,
UsrKeywordlabeling_SaveLabel 确认 确认 微软雅黑,12,,
FrmKeyCollection_FrmKeyCollection 选择关键字 选择关键字 微软雅黑,12,,
FrmKeyCollection_faceButton1 确认 确认 微软雅黑,12,,
namespace SmartScan.PlusSettingFrm
{
partial class FrmKeyCollection
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.keyList = new Asa.FaceControl.FaceComboBox();
this.faceButton1 = new Asa.FaceControl.FaceButton();
this.SuspendLayout();
//
// keyList
//
this.keyList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.keyList.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.keyList.BorderWidth = 2;
this.keyList.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.keyList.Location = new System.Drawing.Point(70, 150);
this.keyList.Name = "keyList";
this.keyList.Padding = new System.Windows.Forms.Padding(3);
this.keyList.SelectedIndex = -1;
this.keyList.SelectedText = "";
this.keyList.Size = new System.Drawing.Size(667, 49);
this.keyList.TabIndex = 6;
this.keyList.Text = "faceComboBox1";
//
// faceButton1
//
this.faceButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.faceButton1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.faceButton1.BorderWidth = 2;
this.faceButton1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.faceButton1.HoldPress = false;
this.faceButton1.Location = new System.Drawing.Point(279, 287);
this.faceButton1.Name = "faceButton1";
this.faceButton1.Padding = new System.Windows.Forms.Padding(3);
this.faceButton1.Size = new System.Drawing.Size(201, 68);
this.faceButton1.TabIndex = 7;
this.faceButton1.Text = "确认";
this.faceButton1.Click += new System.EventHandler(this.faceButton1_Click);
//
// FrmKeyCollection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.faceButton1);
this.Controls.Add(this.keyList);
this.Icon = global::SmartScan.Properties.Resources.App;
this.Name = "FrmKeyCollection";
this.Text = "选择关键字";
this.Controls.SetChildIndex(this.keyList, 0);
this.Controls.SetChildIndex(this.faceButton1, 0);
this.ResumeLayout(false);
}
#endregion
private Asa.FaceControl.FaceComboBox keyList;
private Asa.FaceControl.FaceButton faceButton1;
}
}
\ No newline at end of file
using BLL;
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;
namespace SmartScan.PlusSettingFrm
{
public partial class FrmKeyCollection : Asa.FaceControl.FaceFormFixed
{
public string keyname = null;
public FrmKeyCollection()
{
InitializeComponent();
keyList.Items.AddRange(BLLCommon.macroKey.ToArray());
keyList.SelectedIndex = 0;
}
private void faceButton1_Click(object sender, EventArgs e)
{
if (keyList.SelectedIndex==-1)
{
MessageBox.Show("请选择关键字!");
return;
}
keyname = keyList.SelectedText;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}
<?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>
\ No newline at end of file
......@@ -38,6 +38,8 @@ namespace SmartScan
this.CboLanguage = new Asa.FaceControl.FaceComboBox();
this.BtnWorkMode = new Asa.FaceControl.FaceButton();
this.BtnRetrospect = new Asa.FaceControl.FaceButton();
this.but_Labeling = new Asa.FaceControl.FaceButton();
this.Keywordlabeling = new Asa.FaceControl.FaceButton();
this.SuspendLayout();
//
// BtnMaterial
......@@ -50,7 +52,7 @@ namespace SmartScan
this.BtnMaterial.Location = new System.Drawing.Point(11, 111);
this.BtnMaterial.Name = "BtnMaterial";
this.BtnMaterial.Padding = new System.Windows.Forms.Padding(3);
this.BtnMaterial.Size = new System.Drawing.Size(160, 50);
this.BtnMaterial.Size = new System.Drawing.Size(125, 50);
this.BtnMaterial.TabIndex = 6;
this.BtnMaterial.Text = "Material";
this.BtnMaterial.Click += new System.EventHandler(this.BtnMenu_Click);
......@@ -65,7 +67,7 @@ namespace SmartScan
this.BtnKeyword.Location = new System.Drawing.Point(11, 167);
this.BtnKeyword.Name = "BtnKeyword";
this.BtnKeyword.Padding = new System.Windows.Forms.Padding(3);
this.BtnKeyword.Size = new System.Drawing.Size(160, 50);
this.BtnKeyword.Size = new System.Drawing.Size(125, 50);
this.BtnKeyword.TabIndex = 7;
this.BtnKeyword.Text = "Keyword";
this.BtnKeyword.Click += new System.EventHandler(this.BtnMenu_Click);
......@@ -78,7 +80,7 @@ namespace SmartScan
this.BtnOK.BorderWidth = 2;
this.BtnOK.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnOK.HoldPress = false;
this.BtnOK.Location = new System.Drawing.Point(891, 827);
this.BtnOK.Location = new System.Drawing.Point(910, 737);
this.BtnOK.Name = "BtnOK";
this.BtnOK.Padding = new System.Windows.Forms.Padding(3);
this.BtnOK.Size = new System.Drawing.Size(120, 40);
......@@ -94,7 +96,7 @@ namespace SmartScan
this.BtnCancel.BorderWidth = 2;
this.BtnCancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnCancel.HoldPress = false;
this.BtnCancel.Location = new System.Drawing.Point(1017, 827);
this.BtnCancel.Location = new System.Drawing.Point(1036, 737);
this.BtnCancel.Name = "BtnCancel";
this.BtnCancel.Padding = new System.Windows.Forms.Padding(3);
this.BtnCancel.Size = new System.Drawing.Size(120, 40);
......@@ -111,10 +113,10 @@ namespace SmartScan
this.PnlTemp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.PnlTemp.BorderWidth = 2;
this.PnlTemp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.PnlTemp.Location = new System.Drawing.Point(177, 55);
this.PnlTemp.Location = new System.Drawing.Point(142, 55);
this.PnlTemp.Name = "PnlTemp";
this.PnlTemp.Padding = new System.Windows.Forms.Padding(3);
this.PnlTemp.Size = new System.Drawing.Size(1086, 766);
this.PnlTemp.Size = new System.Drawing.Size(1140, 676);
this.PnlTemp.TabIndex = 11;
this.PnlTemp.Text = "facePanel1";
this.PnlTemp.TitleFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -128,7 +130,7 @@ namespace SmartScan
this.BtnApply.BorderWidth = 2;
this.BtnApply.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnApply.HoldPress = false;
this.BtnApply.Location = new System.Drawing.Point(1143, 827);
this.BtnApply.Location = new System.Drawing.Point(1162, 737);
this.BtnApply.Name = "BtnApply";
this.BtnApply.Padding = new System.Windows.Forms.Padding(3);
this.BtnApply.Size = new System.Drawing.Size(120, 40);
......@@ -143,7 +145,7 @@ namespace SmartScan
this.CboLanguage.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.CboLanguage.BorderWidth = 2;
this.CboLanguage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.CboLanguage.Location = new System.Drawing.Point(983, 11);
this.CboLanguage.Location = new System.Drawing.Point(1002, 11);
this.CboLanguage.Name = "CboLanguage";
this.CboLanguage.Padding = new System.Windows.Forms.Padding(3);
this.CboLanguage.ReadOnly = true;
......@@ -165,8 +167,9 @@ namespace SmartScan
this.BtnWorkMode.Location = new System.Drawing.Point(11, 55);
this.BtnWorkMode.Name = "BtnWorkMode";
this.BtnWorkMode.Padding = new System.Windows.Forms.Padding(3);
this.BtnWorkMode.Size = new System.Drawing.Size(160, 50);
this.BtnWorkMode.Size = new System.Drawing.Size(125, 50);
this.BtnWorkMode.TabIndex = 14;
this.BtnWorkMode.Tag = "not";
this.BtnWorkMode.Text = "Work";
this.BtnWorkMode.Click += new System.EventHandler(this.BtnMenu_Click);
//
......@@ -175,20 +178,60 @@ namespace SmartScan
this.BtnRetrospect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnRetrospect.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnRetrospect.BorderWidth = 2;
this.BtnRetrospect.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.BtnRetrospect.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnRetrospect.HoldPress = false;
this.BtnRetrospect.Location = new System.Drawing.Point(11, 223);
this.BtnRetrospect.Location = new System.Drawing.Point(11, 279);
this.BtnRetrospect.Name = "BtnRetrospect";
this.BtnRetrospect.Padding = new System.Windows.Forms.Padding(3);
this.BtnRetrospect.Size = new System.Drawing.Size(160, 50);
this.BtnRetrospect.Size = new System.Drawing.Size(125, 50);
this.BtnRetrospect.TabIndex = 7;
this.BtnRetrospect.Tag = "not";
this.BtnRetrospect.Text = "Traceability";
this.BtnRetrospect.Visible = false;
this.BtnRetrospect.Click += new System.EventHandler(this.BtnHistory_Click);
//
// but_Labeling
//
this.but_Labeling.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.but_Labeling.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.but_Labeling.BorderWidth = 2;
this.but_Labeling.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.but_Labeling.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.but_Labeling.HoldPress = false;
this.but_Labeling.Location = new System.Drawing.Point(11, 335);
this.but_Labeling.Name = "but_Labeling";
this.but_Labeling.Padding = new System.Windows.Forms.Padding(3);
this.but_Labeling.Size = new System.Drawing.Size(125, 50);
this.but_Labeling.TabIndex = 15;
this.but_Labeling.Tag = "";
this.but_Labeling.Text = "贴标参数";
this.but_Labeling.Visible = false;
this.but_Labeling.Click += new System.EventHandler(this.BtnMenu_Click);
//
// Keywordlabeling
//
this.Keywordlabeling.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Keywordlabeling.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Keywordlabeling.BorderWidth = 2;
this.Keywordlabeling.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Keywordlabeling.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.Keywordlabeling.HoldPress = false;
this.Keywordlabeling.Location = new System.Drawing.Point(11, 223);
this.Keywordlabeling.Name = "Keywordlabeling";
this.Keywordlabeling.Padding = new System.Windows.Forms.Padding(3);
this.Keywordlabeling.Size = new System.Drawing.Size(125, 50);
this.Keywordlabeling.TabIndex = 16;
this.Keywordlabeling.Tag = "";
this.Keywordlabeling.Text = "关键字匹配";
this.Keywordlabeling.Click += new System.EventHandler(this.BtnMenu_Click);
//
// FrmSetPlus
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1274, 878);
this.ClientSize = new System.Drawing.Size(1293, 788);
this.Controls.Add(this.but_Labeling);
this.Controls.Add(this.Keywordlabeling);
this.Controls.Add(this.BtnWorkMode);
this.Controls.Add(this.CboLanguage);
this.Controls.Add(this.BtnApply);
......@@ -212,6 +255,8 @@ namespace SmartScan
this.Controls.SetChildIndex(this.BtnApply, 0);
this.Controls.SetChildIndex(this.CboLanguage, 0);
this.Controls.SetChildIndex(this.BtnWorkMode, 0);
this.Controls.SetChildIndex(this.Keywordlabeling, 0);
this.Controls.SetChildIndex(this.but_Labeling, 0);
this.ResumeLayout(false);
}
......@@ -226,5 +271,7 @@ namespace SmartScan
private Asa.FaceControl.FaceComboBox CboLanguage;
private Asa.FaceControl.FaceButton BtnWorkMode;
private Asa.FaceControl.FaceButton BtnRetrospect;
private Asa.FaceControl.FaceButton but_Labeling;
private Asa.FaceControl.FaceButton Keywordlabeling;
}
}
\ No newline at end of file
using System;
using Asa.FaceControl;
using BLL;
using Model;
using SmartScan.PlusSettingFrm;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using Asa.FaceControl;
using System.Windows.Forms;
using BLL;
namespace SmartScan
{
public partial class FrmSetPlus : FaceFormNormal
{
private readonly Dictionary<FaceButton, Model.ISetMenu> menu = new();
public FrmSetPlus()
{
InitializeComponent();
......@@ -25,6 +21,8 @@ namespace SmartScan
this.Height = 738;
this.Top = 15;
this.Left = 0;
WebService.Open();//启动条码匹配服务
LogNet.log = log4net.LogManager.GetLogger("SmartScan");
}
private void FrmSetPlus_FormClosing(object sender, FormClosingEventArgs e)
......@@ -40,10 +38,6 @@ namespace SmartScan
{
this.Hide();
}
else {
}
}
private void FrmSet_Load(object sender, EventArgs e)
......@@ -55,8 +49,10 @@ namespace SmartScan
menu.Clear();
menu.Add(BtnWorkMode, new UsrWorkMode2());
//menu.Add(BtnLabel, new UsrPrintTemplate());
menu.Add(BtnMaterial, new UsrMaterialTemplate());
menu.Add(BtnMaterial, new UsrMaterialTemplate(true));
menu.Add(BtnKeyword, new UsrMacro());
//menu.Add(but_Labeling, new UsrCustomlabeling());
menu.Add(Keywordlabeling, new UsrKeywordlabeling());
foreach (FaceButton button in menu.Keys)
{
......@@ -76,6 +72,7 @@ namespace SmartScan
CboLanguage.Items.Clear();
CboLanguage.Items.AddRange(Language.Name.ToArray());
CboLanguage.SelectedText = BLLCommon.config.Language;
Language.SetLanguage(this);
}
private void BtnMenu_Click(object sender, EventArgs e)
......@@ -115,7 +112,7 @@ namespace SmartScan
new FaceMessageBox("", text, MessageBoxButtons.OK).ShowDialog();
BLLCommon.extension.Update();
DialogResult = DialogResult.OK;
WindowState = FormWindowState.Minimized;
//WindowState = FormWindowState.Minimized;
}
private void BtnCancel_Click(object sender, EventArgs e)
......@@ -148,7 +145,9 @@ namespace SmartScan
private void BtnHistory_Click(object sender, EventArgs e)
{
new FrmRetrospect().ShowDialog();
FrmRetrospect frm = new FrmRetrospect();
frm.WindowState = FormWindowState.Maximized;
frm.Show();
}
}
}
namespace SmartScan.PlusSettingFrm
{
partial class UsrCustomlabeling
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.facePanel1 = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.faceButton1 = new Asa.FaceControl.FaceButton();
this.facePanel5 = new Asa.FaceControl.FacePanel();
this.LabelRotationAngle = new Asa.FaceControl.FaceTextBox();
this.ImgShow = new Asa.FaceControl.FacePictureBox();
this.facePanel3 = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.Yoffset = new Asa.FaceControl.FaceTextBox();
this.becurrentY = new Asa.FaceControl.FaceLabel();
this.becurrentX = new Asa.FaceControl.FaceLabel();
this.Xoffset = new Asa.FaceControl.FaceTextBox();
this.facePanel4 = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.IscIockwise = new Asa.FaceControl.FaceRadioBox();
this.IsCounterclockwise = new Asa.FaceControl.FaceRadioBox();
this.RotationAngle = new Asa.FaceControl.FaceTextBox();
this.facePanel2 = new Asa.FaceControl.FacePanel();
this.LstMate = new Asa.FaceControl.FaceListBox();
this.facePanel6 = new Asa.FaceControl.FacePanel();
this.IsOverlaylabel = new Asa.FaceControl.FaceCheckBox();
this.facePanel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.facePanel5.SuspendLayout();
this.facePanel3.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.facePanel4.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.facePanel2.SuspendLayout();
this.facePanel6.SuspendLayout();
this.SuspendLayout();
//
// facePanel1
//
this.facePanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.facePanel1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel1.BorderWidth = 2;
this.facePanel1.Controls.Add(this.tableLayoutPanel1);
this.facePanel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel1.Location = new System.Drawing.Point(57, 26);
this.facePanel1.Margin = new System.Windows.Forms.Padding(4);
this.facePanel1.Name = "facePanel1";
this.facePanel1.Padding = new System.Windows.Forms.Padding(3);
this.facePanel1.ShowText = false;
this.facePanel1.Size = new System.Drawing.Size(1262, 795);
this.facePanel1.TabIndex = 0;
this.facePanel1.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.Controls.Add(this.faceButton1, 2, 4);
this.tableLayoutPanel1.Controls.Add(this.facePanel5, 2, 3);
this.tableLayoutPanel1.Controls.Add(this.ImgShow, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.facePanel3, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.facePanel4, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.facePanel2, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.facePanel6, 2, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 5;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1137, 716);
this.tableLayoutPanel1.TabIndex = 8;
//
// faceButton1
//
this.faceButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.faceButton1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.faceButton1.BorderWidth = 2;
this.faceButton1.Dock = System.Windows.Forms.DockStyle.Fill;
this.faceButton1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.faceButton1.HoldPress = false;
this.faceButton1.Location = new System.Drawing.Point(912, 646);
this.faceButton1.Name = "faceButton1";
this.faceButton1.Padding = new System.Windows.Forms.Padding(3);
this.faceButton1.Size = new System.Drawing.Size(222, 67);
this.faceButton1.TabIndex = 12;
this.faceButton1.Text = "确认";
this.faceButton1.Click += new System.EventHandler(this.button1_Click);
//
// facePanel5
//
this.facePanel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.facePanel5.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel5.BorderWidth = 2;
this.facePanel5.Controls.Add(this.LabelRotationAngle);
this.facePanel5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel5.Location = new System.Drawing.Point(913, 540);
this.facePanel5.Margin = new System.Windows.Forms.Padding(4);
this.facePanel5.Name = "facePanel5";
this.facePanel5.Padding = new System.Windows.Forms.Padding(4);
this.facePanel5.Size = new System.Drawing.Size(220, 99);
this.facePanel5.TabIndex = 5;
this.facePanel5.Text = "标签旋转角度";
this.facePanel5.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// LabelRotationAngle
//
this.LabelRotationAngle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LabelRotationAngle.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LabelRotationAngle.BorderWidth = 2;
this.LabelRotationAngle.Dock = System.Windows.Forms.DockStyle.Bottom;
this.LabelRotationAngle.Location = new System.Drawing.Point(4, 31);
this.LabelRotationAngle.Margin = new System.Windows.Forms.Padding(4);
this.LabelRotationAngle.MaxLength = 32767;
this.LabelRotationAngle.Name = "LabelRotationAngle";
this.LabelRotationAngle.Padding = new System.Windows.Forms.Padding(4);
this.LabelRotationAngle.SelectedText = "";
this.LabelRotationAngle.SelectionLength = 0;
this.LabelRotationAngle.SelectionStart = 0;
this.LabelRotationAngle.ShowDel = false;
this.LabelRotationAngle.ShowQuery = false;
this.LabelRotationAngle.Size = new System.Drawing.Size(212, 64);
this.LabelRotationAngle.TabIndex = 11;
//
// ImgShow
//
this.ImgShow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.ImgShow.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.ImgShow.BorderWidth = 2;
this.ImgShow.Dock = System.Windows.Forms.DockStyle.Fill;
this.ImgShow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ImgShow.Location = new System.Drawing.Point(231, 4);
this.ImgShow.Margin = new System.Windows.Forms.Padding(4);
this.ImgShow.Name = "ImgShow";
this.ImgShow.Padding = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.SetRowSpan(this.ImgShow, 5);
this.ImgShow.Size = new System.Drawing.Size(674, 708);
this.ImgShow.TabIndex = 6;
this.ImgShow.Text = "facePictureBox1";
//
// facePanel3
//
this.facePanel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.facePanel3.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel3.BorderWidth = 2;
this.facePanel3.Controls.Add(this.tableLayoutPanel3);
this.facePanel3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel3.Location = new System.Drawing.Point(913, 111);
this.facePanel3.Margin = new System.Windows.Forms.Padding(4);
this.facePanel3.Name = "facePanel3";
this.facePanel3.Padding = new System.Windows.Forms.Padding(4);
this.facePanel3.Size = new System.Drawing.Size(220, 171);
this.facePanel3.TabIndex = 3;
this.facePanel3.Text = "XY轴偏移量";
this.facePanel3.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 2;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F));
this.tableLayoutPanel3.Controls.Add(this.Yoffset, 1, 1);
this.tableLayoutPanel3.Controls.Add(this.becurrentY, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.becurrentX, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.Xoffset, 1, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel3.Location = new System.Drawing.Point(4, 34);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(212, 133);
this.tableLayoutPanel3.TabIndex = 0;
//
// Yoffset
//
this.Yoffset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Yoffset.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Yoffset.BorderWidth = 2;
this.Yoffset.Dock = System.Windows.Forms.DockStyle.Fill;
this.Yoffset.Location = new System.Drawing.Point(88, 70);
this.Yoffset.Margin = new System.Windows.Forms.Padding(4);
this.Yoffset.MaxLength = 32767;
this.Yoffset.Name = "Yoffset";
this.Yoffset.Padding = new System.Windows.Forms.Padding(4);
this.Yoffset.SelectedText = "";
this.Yoffset.SelectionLength = 0;
this.Yoffset.SelectionStart = 0;
this.Yoffset.ShowDel = false;
this.Yoffset.ShowQuery = false;
this.Yoffset.Size = new System.Drawing.Size(120, 59);
this.Yoffset.TabIndex = 9;
//
// becurrentY
//
this.becurrentY.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.becurrentY.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.becurrentY.BorderWidth = 2;
this.becurrentY.Dock = System.Windows.Forms.DockStyle.Fill;
this.becurrentY.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.becurrentY.Location = new System.Drawing.Point(4, 70);
this.becurrentY.Margin = new System.Windows.Forms.Padding(4);
this.becurrentY.Name = "becurrentY";
this.becurrentY.Padding = new System.Windows.Forms.Padding(4);
this.becurrentY.Size = new System.Drawing.Size(76, 59);
this.becurrentY.TabIndex = 1;
this.becurrentY.Text = "Y轴";
//
// becurrentX
//
this.becurrentX.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.becurrentX.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.becurrentX.BorderWidth = 2;
this.becurrentX.Dock = System.Windows.Forms.DockStyle.Fill;
this.becurrentX.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.becurrentX.Location = new System.Drawing.Point(4, 4);
this.becurrentX.Margin = new System.Windows.Forms.Padding(4);
this.becurrentX.Name = "becurrentX";
this.becurrentX.Padding = new System.Windows.Forms.Padding(4);
this.becurrentX.Size = new System.Drawing.Size(76, 58);
this.becurrentX.TabIndex = 0;
this.becurrentX.Text = "X轴";
//
// Xoffset
//
this.Xoffset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Xoffset.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Xoffset.BorderWidth = 2;
this.Xoffset.Dock = System.Windows.Forms.DockStyle.Fill;
this.Xoffset.Location = new System.Drawing.Point(88, 4);
this.Xoffset.Margin = new System.Windows.Forms.Padding(4);
this.Xoffset.MaxLength = 32767;
this.Xoffset.Name = "Xoffset";
this.Xoffset.Padding = new System.Windows.Forms.Padding(4);
this.Xoffset.SelectedText = "";
this.Xoffset.SelectionLength = 0;
this.Xoffset.SelectionStart = 0;
this.Xoffset.ShowDel = false;
this.Xoffset.ShowQuery = false;
this.Xoffset.Size = new System.Drawing.Size(120, 58);
this.Xoffset.TabIndex = 8;
//
// facePanel4
//
this.facePanel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.facePanel4.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel4.BorderWidth = 2;
this.facePanel4.Controls.Add(this.tableLayoutPanel2);
this.facePanel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel4.Location = new System.Drawing.Point(913, 290);
this.facePanel4.Margin = new System.Windows.Forms.Padding(4);
this.facePanel4.Name = "facePanel4";
this.facePanel4.Padding = new System.Windows.Forms.Padding(4);
this.facePanel4.Size = new System.Drawing.Size(220, 242);
this.facePanel4.TabIndex = 4;
this.facePanel4.Text = "旋转方向角度";
this.facePanel4.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.RotationAngle, 0, 2);
this.tableLayoutPanel2.Controls.Add(this.IsCounterclockwise, 0, 1);
this.tableLayoutPanel2.Controls.Add(this.IscIockwise, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel2.Location = new System.Drawing.Point(4, 29);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 3;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(212, 209);
this.tableLayoutPanel2.TabIndex = 0;
//
// IscIockwise
//
this.IscIockwise.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.IscIockwise.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.IscIockwise.BorderWidth = 2;
this.IscIockwise.Dock = System.Windows.Forms.DockStyle.Fill;
this.IscIockwise.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.IscIockwise.Group = null;
this.IscIockwise.Location = new System.Drawing.Point(6, 6);
this.IscIockwise.Margin = new System.Windows.Forms.Padding(4);
this.IscIockwise.Name = "IscIockwise";
this.IscIockwise.Padding = new System.Windows.Forms.Padding(4);
this.IscIockwise.Size = new System.Drawing.Size(204, 54);
this.IscIockwise.TabIndex = 0;
this.IscIockwise.Text = "顺时针";
//
// IsCounterclockwise
//
this.IsCounterclockwise.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.IsCounterclockwise.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.IsCounterclockwise.BorderWidth = 2;
this.IsCounterclockwise.Dock = System.Windows.Forms.DockStyle.Fill;
this.IsCounterclockwise.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.IsCounterclockwise.Group = null;
this.IsCounterclockwise.Location = new System.Drawing.Point(6, 99);
this.IsCounterclockwise.Margin = new System.Windows.Forms.Padding(4);
this.IsCounterclockwise.Name = "IsCounterclockwise";
this.IsCounterclockwise.Padding = new System.Windows.Forms.Padding(4);
this.IsCounterclockwise.Size = new System.Drawing.Size(306, 81);
this.IsCounterclockwise.TabIndex = 1;
this.IsCounterclockwise.Text = "逆时针";
//
// RotationAngle
//
this.RotationAngle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.RotationAngle.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.RotationAngle.BorderWidth = 2;
this.RotationAngle.Dock = System.Windows.Forms.DockStyle.Fill;
this.RotationAngle.Location = new System.Drawing.Point(6, 192);
this.RotationAngle.Margin = new System.Windows.Forms.Padding(4);
this.RotationAngle.MaxLength = 32767;
this.RotationAngle.Name = "RotationAngle";
this.RotationAngle.Padding = new System.Windows.Forms.Padding(4);
this.RotationAngle.SelectedText = "";
this.RotationAngle.SelectionLength = 0;
this.RotationAngle.SelectionStart = 0;
this.RotationAngle.ShowDel = false;
this.RotationAngle.ShowQuery = false;
this.RotationAngle.Size = new System.Drawing.Size(306, 116);
this.RotationAngle.TabIndex = 10;
//
// facePanel2
//
this.facePanel2.AutoSize = true;
this.facePanel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.facePanel2.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel2.BorderWidth = 2;
this.facePanel2.Controls.Add(this.LstMate);
this.facePanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.facePanel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel2.Location = new System.Drawing.Point(4, 4);
this.facePanel2.Margin = new System.Windows.Forms.Padding(4);
this.facePanel2.Name = "facePanel2";
this.facePanel2.Padding = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.SetRowSpan(this.facePanel2, 5);
this.facePanel2.Size = new System.Drawing.Size(219, 708);
this.facePanel2.TabIndex = 29;
this.facePanel2.Text = "模板列表";
this.facePanel2.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// LstMate
//
this.LstMate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LstMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LstMate.BorderWidth = 2;
this.LstMate.Dock = System.Windows.Forms.DockStyle.Fill;
this.LstMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstMate.Location = new System.Drawing.Point(4, 4);
this.LstMate.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
this.LstMate.Name = "LstMate";
this.LstMate.Padding = new System.Windows.Forms.Padding(3);
this.LstMate.SelectedIndex = -1;
this.LstMate.Size = new System.Drawing.Size(211, 700);
this.LstMate.TabIndex = 0;
this.LstMate.SelectedIndexChanged += new System.EventHandler(this.LstMate_SelectedIndexChanged);
//
// facePanel6
//
this.facePanel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.facePanel6.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel6.BorderWidth = 2;
this.facePanel6.Controls.Add(this.IsOverlaylabel);
this.facePanel6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel6.Location = new System.Drawing.Point(913, 4);
this.facePanel6.Margin = new System.Windows.Forms.Padding(4);
this.facePanel6.Name = "facePanel6";
this.facePanel6.Padding = new System.Windows.Forms.Padding(4);
this.facePanel6.Size = new System.Drawing.Size(220, 99);
this.facePanel6.TabIndex = 7;
this.facePanel6.Text = "覆盖原标签";
this.facePanel6.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// IsOverlaylabel
//
this.IsOverlaylabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.IsOverlaylabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.IsOverlaylabel.BorderWidth = 2;
this.IsOverlaylabel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.IsOverlaylabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.IsOverlaylabel.Location = new System.Drawing.Point(4, 33);
this.IsOverlaylabel.Margin = new System.Windows.Forms.Padding(4);
this.IsOverlaylabel.Name = "IsOverlaylabel";
this.IsOverlaylabel.Padding = new System.Windows.Forms.Padding(4);
this.IsOverlaylabel.Size = new System.Drawing.Size(212, 62);
this.IsOverlaylabel.TabIndex = 1;
this.IsOverlaylabel.Text = "覆盖原标签";
//
// UsrCustomlabeling
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.facePanel1);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "UsrCustomlabeling";
this.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Size = new System.Drawing.Size(1301, 821);
this.Load += new System.EventHandler(this.UsrCustomlabeling_Load);
this.facePanel1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.facePanel5.ResumeLayout(false);
this.facePanel3.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.facePanel4.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.facePanel2.ResumeLayout(false);
this.facePanel6.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Asa.FaceControl.FacePanel facePanel1;
private Asa.FaceControl.FacePanel facePanel2;
private Asa.FaceControl.FaceListBox LstMate;
private Asa.FaceControl.FaceCheckBox IsOverlaylabel;
private Asa.FaceControl.FacePanel facePanel3;
private Asa.FaceControl.FaceLabel becurrentY;
private Asa.FaceControl.FaceLabel becurrentX;
private Asa.FaceControl.FaceTextBox Yoffset;
private Asa.FaceControl.FaceTextBox Xoffset;
private Asa.FaceControl.FacePanel facePanel5;
private Asa.FaceControl.FaceTextBox LabelRotationAngle;
private Asa.FaceControl.FacePanel facePanel4;
private Asa.FaceControl.FaceTextBox RotationAngle;
private Asa.FaceControl.FaceRadioBox IsCounterclockwise;
private Asa.FaceControl.FaceRadioBox IscIockwise;
private Asa.FaceControl.FacePictureBox ImgShow;
private Asa.FaceControl.FacePanel facePanel6;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private Asa.FaceControl.FaceButton faceButton1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
}
}
using Asa.FaceControl;
using BLL;
using DeviceLibrary.AutoScanAndLabel;
using DocumentFormat.OpenXml.Wordprocessing;
using MemoryRead;
using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace SmartScan.PlusSettingFrm
{
public partial class UsrCustomlabeling : UserControl, ISetMenu
{
public static List<LabelingData> labelings = new List<LabelingData>();
private List<MaterialTemplate> mateCopy;
private int mateIndex = -1;
string flie = Application.StartupPath + "\\LabelingFiles";
public UsrCustomlabeling()
{
InitializeComponent();
mateCopy = BLLCommon.mateEdit.ToCopy();
LstMate.Items.AddRange(BLLCommon.mateEdit.Name);
InitializedData();
Language.SetLanguage(this);
}
static string BitmapToBase64(Bitmap bitmap)
{
using (MemoryStream memoryStream = new MemoryStream())
{
// 将Bitmap保存到MemoryStream中
bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
// 获取字节数组
byte[] byteArray = memoryStream.ToArray();
// 将字节数组转换为Base64编码的字符串
return Convert.ToBase64String(byteArray);
}
}
public void InitializedData()
{
if (!File.Exists(flie))
{
//File.Create(flie);
System.IO.Directory.CreateDirectory(flie);
}
var files = Directory.GetFiles(flie, "*.txt", SearchOption.TopDirectoryOnly);
foreach (var file in files)
{
try
{
string fileContent = File.ReadAllText(file);
LabelingData labelingData = JsonConvert.DeserializeObject<LabelingData>(fileContent);
if (labelingData != null)
{
labelings.Add(labelingData);
}
}
catch (Exception e)
{
LogNet.log.Info(file + "加载贴标数据错误:" + e.Message);
}
}
}
public FacePanel GetPanel()
{
//BitmapData bitmapData = new BitmapData();
//bitmapData.IsIDCamera = true;
//bitmapData.X = 512; bitmapData.Y = 512;
//Bitmap bitmap = new Bitmap("D:\\Desktop\\项目\\ns100\\测试条码\\7inch\\Kingbright2 - 50x70.jpg");
////bitmapData.ImageData = BitmapToBase64(bitmap);
//List<BarcodeInfos> barcodeInfos = new List<BarcodeInfos>();
//bitmapData.PlateW = 15;
//var list = Camera.GetBarCode(bitmap);
//list.ForEach(b => { barcodeInfos.Add(new BarcodeInfos { Angle = b.Angle, Text = b.Text, X = (int)b.Center.X, Y = (int)b.Center.Y }); });
//bitmapData.BarCodeList = barcodeInfos;
//var a = JsonConvert.SerializeObject(bitmapData);
tableLayoutPanel1.Width = facePanel1.Width - 10;
tableLayoutPanel1.Height = facePanel1.Height - 10;
return facePanel1;
}
public void Save()
{
if (!File.Exists(flie))
{
System.IO.Directory.CreateDirectory(flie);
}
foreach (var item in labelings)
{
string json = JsonConvert.SerializeObject(item);
string pathfile = flie + $"\\{item.Name}.txt";
File.WriteAllText(pathfile, json);
}
}
private void UsrCustomlabeling_Load(object sender, EventArgs e)
{
}
private void LstMate_SelectedIndexChanged(object sender, EventArgs e)
{
LabelRotationAngle.Text = null;
IsOverlaylabel.Checked = false;
Xoffset.Text = null;
Yoffset.Text = null;
IscIockwise.Checked = false;
IsCounterclockwise.Checked = false;
RotationAngle.Text = null;
LabelRotationAngle.Text = null;
if (LstMate.SelectedIndex == -1) return;
mateIndex = LstMate.SelectedIndex;
BLLCommon.mateMaxCodeID = mateCopy[mateIndex].GetMaxID();
string iamgepath = mateCopy[mateIndex].ImagePath;
if (!string.IsNullOrEmpty(iamgepath))
{
if (System.IO.File.Exists(iamgepath))
{
ImgShow.Image = ObjConversion.ReadImageFile(iamgepath);
}
}
//ImgShow.Image = mateCopy[mateIndex].Image;
ImgShow.CodeCenterClear();
ImgShow.AddCodeCenter(LabelCenter());
string name = mateCopy[mateIndex].Name;
if (labelings == null)
{
return;
}
var lable = labelings.Where(a => a.Name == name).FirstOrDefault();
if (lable != null)
{
IsOverlaylabel.Checked = lable.IsOverlaylabel;
LabelRotationAngle.Text = lable.LabelRotationAngle.ToString();
Xoffset.Text = lable.Xoffset.ToString();
Yoffset.Text = lable.Yoffset.ToString();
if (!IsOverlaylabel.Checked)
{
IscIockwise.Checked = lable.IscIockwise;
IsCounterclockwise.Checked = lable.IsCounterclockwise;
RotationAngle.Text = lable.RotationAngle.ToString();
}
}
}
private PointF[] LabelCenter()
{
List<PointF> item = new();
float x, y;
for (int i = 0; i < mateCopy[mateIndex].Code.Count; i++)
{
x = mateCopy[mateIndex].Code[i].CenterX;
y = mateCopy[mateIndex].Code[i].CenterY;
item.Add(new PointF(x, y));
}
return item.ToArray();
}
private void button1_Click(object sender, EventArgs e)
{
//string a = " True;匹配成功条码xy:X=1498;Y=1934,角度=120";
//string name = "1";
//AMatch aMatch = new AMatch();
//aMatch.Angle = 120;
//aMatch.Points = new Point(1498, 1934);
//Point cenl = new Point(2000, 1800);
//LabelingAngle_New(name, aMatch, cenl, true, 7, out int angle);
if (mateIndex == -1)
{
return;
}
LabelingData labeling = new LabelingData();
if (labelings != null)
{
var list = labelings.Where(a => a.Name == mateCopy[mateIndex].Name).ToList();
foreach (var item in list) { labelings.Remove(item); }
}
labeling.Name = mateCopy[mateIndex].Name;
labeling.IsOverlaylabel = IsOverlaylabel.Checked;
labeling.Xoffset = Xoffset.Text != "" ? int.Parse(Xoffset.Text) : 0;
labeling.Yoffset = Yoffset.Text != "" ? int.Parse(Yoffset.Text) : 0;
if (!labeling.IsOverlaylabel)
{
labeling.IscIockwise = IscIockwise.Checked ? true : false;
labeling.IsCounterclockwise = IsCounterclockwise.Checked ? true : false;
labeling.RotationAngle = RotationAngle.Text != "" ? int.Parse(RotationAngle.Text) : 0;
labeling.LabelRotationAngle = LabelRotationAngle.Text != "" ? int.Parse(LabelRotationAngle.Text) : 0;
}
labelings.Add(labeling);
}
public static System.Drawing.Point LabelingAngle(string name, AMatch aMatch, System.Drawing.Point centrality, bool isvaor, int PlateW, out int angle)
{
System.Drawing.Point lable = aMatch.Points;
var data = labelings.Where(a => a.Name == name).FirstOrDefault();
LogNet.log.Info($"{name}:原标签角度x={lable.X};y={lable.Y};中心点x={centrality.X};y={centrality.Y}");
if (data != null)
{
if (data.IsOverlaylabel)
{
#region 覆盖原标签
//LogNet.log.Info($"{name}:覆盖原标签;是否ID相机={isvaor};");
//aMatch.Points = LabelingPosition.ClockwiseRotation(lable, centrality, 0);
//if (isvaor)
//{
// angle = ScanningCameraAngle(aMatch.Angle);
//}
//else
//{
// angle = OldAngleAlgo(centrality, lable, PlateW);
//}
//LogNet.log.Info($"{name}:覆盖原标签!新标签位置:{aMatch.Points};角度:{angle}");
//return aMatch.Points;
#endregion
return Overwritelabel(centrality, aMatch.Points, isvaor, PlateW, aMatch.Angle, out angle);
}
System.Drawing.Point point = new Point(0, 0);
if (data.IscIockwise)
{
point = LabelingPosition.ClockwiseRotation(lable, centrality, data.RotationAngle);
}
if (data.IsCounterclockwise)
{
point = LabelingPosition.CounterclockwiseRotation(lable, centrality, data.RotationAngle);
}
if (!data.IscIockwise && !data.IsCounterclockwise)
{
return Overwritelabel(centrality, aMatch.Points, isvaor, PlateW, aMatch.Angle, out angle);
}
System.Drawing.Point Newpoint = new System.Drawing.Point(point.X + data.Xoffset, point.Y + data.Yoffset);
angle = data.LabelRotationAngle;
LogNet.log.Info($"{name}:xy轴偏移后位置,x={Newpoint.X},y={Newpoint.Y};角度为:{angle}");
return Newpoint;
}
else
{
LogNet.log.Info($"未找到<{name}>模板:默认覆盖原标签!");
return Overwritelabel(centrality, aMatch.Points, isvaor, PlateW, aMatch.Angle, out angle);
#region 覆盖原标签
//aMatch.Points = LabelingPosition.ClockwiseRotation(lable, centrality, 0);
//if (isvaor)
//{
// angle = ScanningCameraAngle(aMatch.Angle);
//}
//else
//{
// angle = OldAngleAlgo(centrality, lable, PlateW);
//}
//LogNet.log.Info($"未找到<{name}>模板:默认覆盖原标签!新标签位置:{aMatch.Points};角度:{angle}");
//return aMatch.Points;
#endregion
}
}
public static System.Drawing.Point LabelingAngle_New(string name, AMatch aMatch, System.Drawing.Point centrality, bool isvaor, int PlateW, out int angle)
{
System.Drawing.Point label = aMatch.Points;
var data = labelings.FirstOrDefault(a => a.Name == name);
LogNet.log.Info($"{name}:原标签角度x={label.X};y={label.Y};中心点x={centrality.X};y={centrality.Y}");
if (data == null)
{
LogNet.log.Info("未查询到贴标数据,使用覆盖原标签方式;");
return Overwritelabel(centrality, aMatch.Points, isvaor, PlateW, aMatch.Angle, out angle);
}
else
{
if (data.IsOverlaylabel || (!data.IscIockwise && !data.IsCounterclockwise))
{
var position = Overwritelabel(centrality, aMatch.Points, isvaor, PlateW, aMatch.Angle, out angle);
return new Point(position.X+data.Xoffset,position.Y+data.Yoffset);
}
System.Drawing.Point point = new Point(0, 0);
if (data.IscIockwise)
{
point = LabelingPosition.ClockwiseRotation(label, centrality, data.RotationAngle);
}
else if (data.IsCounterclockwise)
{
point = LabelingPosition.CounterclockwiseRotation(label, centrality, data.RotationAngle);
}
System.Drawing.Point newPoint = new System.Drawing.Point(point.X + data.Xoffset, point.Y + data.Yoffset);
angle = data.LabelRotationAngle;
LogNet.log.Info($"{name}:xy轴偏移后位置,x={newPoint.X},y={newPoint.Y};角度为:{angle}");
return newPoint;
}
}
public static Point Overwritelabel(Point centrality, Point lable, bool isvaor, int PlateW, int Angle, out int angle)
{
Point Points = LabelingPosition.ClockwiseRotation(lable, centrality, 0);
if (isvaor)
{
angle = ScanningCameraAngle(Angle);
}
else
{
angle = OldAngleAlgo(centrality, lable, PlateW);
}
LogNet.log.Info($"覆盖原标签!是否id相机={isvaor};新标签位置:{Points};角度:{angle}");
return Points;
}
public static int ScanningCameraAngle(int angles)
{
int angle = 0;
double rotationAngle = 83;
if (angles < 0 && angles != 0)
{
angle = (int)(Math.Abs(angles) + rotationAngle);
}
else
{
if (angles <= 83)
{
angle = (int)Math.Abs(angles - rotationAngle);
}
else
{
angle = 350 - (int)(angles - rotationAngle);
}
}
angle += 90;
if (angle > 344)
{
angle -= 344;
}
return angle;
}
/// <summary>
/// 获取以点为中心的角度,-180~180
/// </summary>
/// <param name="pt1"></param>
/// <param name="pt2"></param>
/// <returns></returns>
public static double getAngle(Point pt1, Point pt2)
{
double mb_x = pt2.X - pt1.X;
double mb_y = pt2.Y - pt1.Y;
double rotation = Math.Atan2(mb_y, mb_x);
rotation = rotation / Math.PI * 180;
return rotation;
//double angle = 360 - rotation + 90;
//angle = angle < 0 ? 360 + angle : angle;
//angle = angle % 360;
//return Math.Floor(angle / 360 * 24);
}
public static int OldAngleAlgo(Point lable, Point center, int PlateW)
{
int labelAngle = 0;
var a = (int)getAngle(lable, center);
int angle = a < 0 ? 360 + a : a;
if (PlateW == 15)
{
labelAngle = angle + 120;
}
else if (PlateW == 13)
{
labelAngle = angle + 180;
}
else
{
labelAngle = angle + 180;
}
labelAngle += 83;
labelAngle = labelAngle > 360 ? labelAngle - 360 : labelAngle;
return labelAngle;
//if (labelAngle <= 180)
//{
// labelAngle = Label_R_Angle_Diff - (180 - labelAngle);
//}
//else
//{
// labelAngle = (labelAngle - 180) + Label_R_Angle_Diff;
//}
}
}
}
<?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>
\ No newline at end of file
namespace SmartScan.PlusSettingFrm
{
partial class UsrKeywordlabeling
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.facePanel1 = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.UpdateLabel = new Asa.FaceControl.FaceButton();
this.AddLabel = new Asa.FaceControl.FaceButton();
this.LabelAngle = new Asa.FaceControl.FaceComboBox();
this.SaveLabel = new Asa.FaceControl.FaceButton();
this.ClockwiseAngle = new Asa.FaceControl.FaceComboBox();
this.keyname = new Asa.FaceControl.FaceTextBox();
this.Xoffset = new Asa.FaceControl.FaceLabel();
this.ListData = new Asa.FaceControl.FaceListBox();
this.Yoffset = new Asa.FaceControl.FaceLabel();
this.LabelRotation = new Asa.FaceControl.FaceLabel();
this.Xaxisoffset = new Asa.FaceControl.FaceTextBox();
this.Yaxisoffset = new Asa.FaceControl.FaceTextBox();
this.Keyvalue = new Asa.FaceControl.FaceTextBox();
this.RotateAngle = new Asa.FaceControl.FaceLabel();
this.lab_PlateWs = new System.Windows.Forms.Label();
this.facePanel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// facePanel1
//
this.facePanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.facePanel1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel1.BorderWidth = 2;
this.facePanel1.Controls.Add(this.lab_PlateWs);
this.facePanel1.Controls.Add(this.tableLayoutPanel1);
this.facePanel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel1.Location = new System.Drawing.Point(119, 55);
this.facePanel1.Name = "facePanel1";
this.facePanel1.Padding = new System.Windows.Forms.Padding(3);
this.facePanel1.ShowText = false;
this.facePanel1.Size = new System.Drawing.Size(1044, 648);
this.facePanel1.TabIndex = 0;
this.facePanel1.Text = "facePanel1";
this.facePanel1.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.Controls.Add(this.UpdateLabel, 1, 5);
this.tableLayoutPanel1.Controls.Add(this.AddLabel, 0, 5);
this.tableLayoutPanel1.Controls.Add(this.LabelAngle, 2, 4);
this.tableLayoutPanel1.Controls.Add(this.SaveLabel, 2, 5);
this.tableLayoutPanel1.Controls.Add(this.ClockwiseAngle, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.keyname, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.Xoffset, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.ListData, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.Yoffset, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.LabelRotation, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.Xaxisoffset, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.Yaxisoffset, 2, 3);
this.tableLayoutPanel1.Controls.Add(this.Keyvalue, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.RotateAngle, 1, 1);
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 6);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 6;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(834, 636);
this.tableLayoutPanel1.TabIndex = 2;
//
// UpdateLabel
//
this.UpdateLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.UpdateLabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.UpdateLabel.BorderWidth = 2;
this.UpdateLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.UpdateLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.UpdateLabel.HoldPress = false;
this.UpdateLabel.Location = new System.Drawing.Point(336, 508);
this.UpdateLabel.Name = "UpdateLabel";
this.UpdateLabel.Padding = new System.Windows.Forms.Padding(3);
this.UpdateLabel.Size = new System.Drawing.Size(244, 125);
this.UpdateLabel.TabIndex = 4;
this.UpdateLabel.Text = "修改关键字";
this.UpdateLabel.Click += new System.EventHandler(this.UpdateLabel_Click);
//
// AddLabel
//
this.AddLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.AddLabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.AddLabel.BorderWidth = 2;
this.AddLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.AddLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.AddLabel.HoldPress = false;
this.AddLabel.Location = new System.Drawing.Point(3, 508);
this.AddLabel.Name = "AddLabel";
this.AddLabel.Padding = new System.Windows.Forms.Padding(3);
this.AddLabel.Size = new System.Drawing.Size(327, 125);
this.AddLabel.TabIndex = 1;
this.AddLabel.Text = "添加";
this.AddLabel.Click += new System.EventHandler(this.AddLabel_Click);
//
// LabelAngle
//
this.LabelAngle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LabelAngle.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LabelAngle.BorderWidth = 2;
this.LabelAngle.Dock = System.Windows.Forms.DockStyle.Fill;
this.LabelAngle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LabelAngle.Location = new System.Drawing.Point(586, 407);
this.LabelAngle.Name = "LabelAngle";
this.LabelAngle.Padding = new System.Windows.Forms.Padding(3);
this.LabelAngle.SelectedIndex = -1;
this.LabelAngle.SelectedText = "";
this.LabelAngle.Size = new System.Drawing.Size(245, 95);
this.LabelAngle.TabIndex = 6;
this.LabelAngle.Text = "0";
//
// SaveLabel
//
this.SaveLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.SaveLabel.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.SaveLabel.BorderWidth = 2;
this.SaveLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.SaveLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.SaveLabel.HoldPress = false;
this.SaveLabel.Location = new System.Drawing.Point(586, 508);
this.SaveLabel.Name = "SaveLabel";
this.SaveLabel.Padding = new System.Windows.Forms.Padding(3);
this.SaveLabel.Size = new System.Drawing.Size(245, 125);
this.SaveLabel.TabIndex = 3;
this.SaveLabel.Text = "确认";
this.SaveLabel.Click += new System.EventHandler(this.SaveLabel_Click);
//
// ClockwiseAngle
//
this.ClockwiseAngle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.ClockwiseAngle.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.ClockwiseAngle.BorderWidth = 2;
this.ClockwiseAngle.Dock = System.Windows.Forms.DockStyle.Fill;
this.ClockwiseAngle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ClockwiseAngle.Location = new System.Drawing.Point(586, 104);
this.ClockwiseAngle.Name = "ClockwiseAngle";
this.ClockwiseAngle.Padding = new System.Windows.Forms.Padding(3);
this.ClockwiseAngle.SelectedIndex = -1;
this.ClockwiseAngle.SelectedText = "";
this.ClockwiseAngle.Size = new System.Drawing.Size(245, 95);
this.ClockwiseAngle.TabIndex = 5;
this.ClockwiseAngle.Text = "0";
//
// keyname
//
this.keyname.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.keyname.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.keyname.BorderWidth = 2;
this.keyname.Dock = System.Windows.Forms.DockStyle.Fill;
this.keyname.Enabled = false;
this.keyname.Location = new System.Drawing.Point(336, 3);
this.keyname.MaxLength = 32767;
this.keyname.Name = "keyname";
this.keyname.Padding = new System.Windows.Forms.Padding(3);
this.keyname.SelectedText = "";
this.keyname.SelectionLength = 0;
this.keyname.SelectionStart = 0;
this.keyname.ShowDel = false;
this.keyname.ShowQuery = false;
this.keyname.Size = new System.Drawing.Size(244, 95);
this.keyname.TabIndex = 11;
//
// Xoffset
//
this.Xoffset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Xoffset.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Xoffset.BorderWidth = 2;
this.Xoffset.Dock = System.Windows.Forms.DockStyle.Fill;
this.Xoffset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.Xoffset.Location = new System.Drawing.Point(336, 205);
this.Xoffset.Name = "Xoffset";
this.Xoffset.Padding = new System.Windows.Forms.Padding(3);
this.Xoffset.Size = new System.Drawing.Size(244, 95);
this.Xoffset.TabIndex = 8;
this.Xoffset.Text = "X轴偏移量";
//
// ListData
//
this.ListData.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.ListData.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.ListData.BorderWidth = 2;
this.ListData.Dock = System.Windows.Forms.DockStyle.Fill;
this.ListData.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ListData.Location = new System.Drawing.Point(3, 3);
this.ListData.Name = "ListData";
this.ListData.Padding = new System.Windows.Forms.Padding(3);
this.tableLayoutPanel1.SetRowSpan(this.ListData, 5);
this.ListData.SelectedIndex = -1;
this.ListData.Size = new System.Drawing.Size(327, 499);
this.ListData.TabIndex = 0;
this.ListData.SelectedIndexChanged += new System.EventHandler(this.ListData_SelectedIndexChanged);
//
// Yoffset
//
this.Yoffset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Yoffset.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Yoffset.BorderWidth = 2;
this.Yoffset.Dock = System.Windows.Forms.DockStyle.Fill;
this.Yoffset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.Yoffset.Location = new System.Drawing.Point(336, 306);
this.Yoffset.Name = "Yoffset";
this.Yoffset.Padding = new System.Windows.Forms.Padding(3);
this.Yoffset.Size = new System.Drawing.Size(244, 95);
this.Yoffset.TabIndex = 9;
this.Yoffset.Text = "Y轴偏移量";
//
// LabelRotation
//
this.LabelRotation.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LabelRotation.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LabelRotation.BorderWidth = 2;
this.LabelRotation.Dock = System.Windows.Forms.DockStyle.Fill;
this.LabelRotation.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LabelRotation.Location = new System.Drawing.Point(336, 407);
this.LabelRotation.Name = "LabelRotation";
this.LabelRotation.Padding = new System.Windows.Forms.Padding(3);
this.LabelRotation.Size = new System.Drawing.Size(244, 95);
this.LabelRotation.TabIndex = 10;
this.LabelRotation.Text = "标签旋转角度";
//
// Xaxisoffset
//
this.Xaxisoffset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Xaxisoffset.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Xaxisoffset.BorderWidth = 2;
this.Xaxisoffset.Dock = System.Windows.Forms.DockStyle.Fill;
this.Xaxisoffset.Location = new System.Drawing.Point(586, 205);
this.Xaxisoffset.MaxLength = 32767;
this.Xaxisoffset.Name = "Xaxisoffset";
this.Xaxisoffset.Padding = new System.Windows.Forms.Padding(3);
this.Xaxisoffset.SelectedText = "";
this.Xaxisoffset.SelectionLength = 0;
this.Xaxisoffset.SelectionStart = 0;
this.Xaxisoffset.ShowDel = true;
this.Xaxisoffset.ShowQuery = false;
this.Xaxisoffset.Size = new System.Drawing.Size(245, 95);
this.Xaxisoffset.TabIndex = 4;
this.Xaxisoffset.Text = "0";
//
// Yaxisoffset
//
this.Yaxisoffset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Yaxisoffset.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Yaxisoffset.BorderWidth = 2;
this.Yaxisoffset.Dock = System.Windows.Forms.DockStyle.Fill;
this.Yaxisoffset.Location = new System.Drawing.Point(586, 306);
this.Yaxisoffset.MaxLength = 32767;
this.Yaxisoffset.Name = "Yaxisoffset";
this.Yaxisoffset.Padding = new System.Windows.Forms.Padding(3);
this.Yaxisoffset.SelectedText = "";
this.Yaxisoffset.SelectionLength = 0;
this.Yaxisoffset.SelectionStart = 0;
this.Yaxisoffset.ShowDel = true;
this.Yaxisoffset.ShowQuery = false;
this.Yaxisoffset.Size = new System.Drawing.Size(245, 95);
this.Yaxisoffset.TabIndex = 5;
this.Yaxisoffset.Text = "0";
//
// Keyvalue
//
this.Keyvalue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.Keyvalue.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.Keyvalue.BorderWidth = 2;
this.Keyvalue.Dock = System.Windows.Forms.DockStyle.Fill;
this.Keyvalue.Location = new System.Drawing.Point(586, 3);
this.Keyvalue.MaxLength = 32767;
this.Keyvalue.Name = "Keyvalue";
this.Keyvalue.Padding = new System.Windows.Forms.Padding(3);
this.Keyvalue.SelectedText = "";
this.Keyvalue.SelectionLength = 0;
this.Keyvalue.SelectionStart = 0;
this.Keyvalue.ShowDel = true;
this.Keyvalue.ShowQuery = false;
this.Keyvalue.Size = new System.Drawing.Size(245, 95);
this.Keyvalue.TabIndex = 1;
//
// RotateAngle
//
this.RotateAngle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.RotateAngle.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.RotateAngle.BorderWidth = 2;
this.RotateAngle.Dock = System.Windows.Forms.DockStyle.Fill;
this.RotateAngle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.RotateAngle.Location = new System.Drawing.Point(336, 104);
this.RotateAngle.Name = "RotateAngle";
this.RotateAngle.Padding = new System.Windows.Forms.Padding(3);
this.RotateAngle.Size = new System.Drawing.Size(244, 95);
this.RotateAngle.TabIndex = 7;
this.RotateAngle.Text = "以特征码顺时针旋转角度";
//
// lab_PlateWs
//
this.lab_PlateWs.AutoSize = true;
this.lab_PlateWs.Location = new System.Drawing.Point(846, 9);
this.lab_PlateWs.Name = "lab_PlateWs";
this.lab_PlateWs.Size = new System.Drawing.Size(26, 27);
this.lab_PlateWs.TabIndex = 3;
this.lab_PlateWs.Text = "0";
this.lab_PlateWs.Visible = false;
//
// UsrKeywordlabeling
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.facePanel1);
this.Name = "UsrKeywordlabeling";
this.Size = new System.Drawing.Size(1317, 773);
this.facePanel1.ResumeLayout(false);
this.facePanel1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Asa.FaceControl.FacePanel facePanel1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private Asa.FaceControl.FaceButton AddLabel;
private Asa.FaceControl.FaceListBox ListData;
private Asa.FaceControl.FaceLabel Xoffset;
private Asa.FaceControl.FaceLabel Yoffset;
private Asa.FaceControl.FaceLabel LabelRotation;
private Asa.FaceControl.FaceTextBox Xaxisoffset;
private Asa.FaceControl.FaceTextBox Yaxisoffset;
private Asa.FaceControl.FaceTextBox Keyvalue;
private Asa.FaceControl.FaceLabel RotateAngle;
private Asa.FaceControl.FaceButton SaveLabel;
private Asa.FaceControl.FaceTextBox keyname;
private Asa.FaceControl.FaceButton UpdateLabel;
private Asa.FaceControl.FaceComboBox ClockwiseAngle;
private Asa.FaceControl.FaceComboBox LabelAngle;
private System.Windows.Forms.Label lab_PlateWs;
}
}
using Asa.FaceControl;
using DeviceLibrary.AutoScanAndLabel;
using DocumentFormat.OpenXml.Drawing;
using DocumentFormat.OpenXml.EMMA;
using DocumentFormat.OpenXml.Wordprocessing;
using MemoryRead;
using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using Point = System.Drawing.Point;
namespace SmartScan.PlusSettingFrm
{
public partial class UsrKeywordlabeling : UserControl, ISetMenu
{
static List<keylabel> labels = new List<keylabel>();
string flie = Application.StartupPath + "\\Config\\LabelingData.txt";
public UsrKeywordlabeling()
{
InitializeComponent();
InitializedData();
Language.SetLanguage(this);
ClockwiseAngle.Items.Add(90.ToString());
ClockwiseAngle.Items.Add(180.ToString());
ClockwiseAngle.Items.Add(270.ToString());
ClockwiseAngle.Items.Add(340.ToString());
LabelAngle.Items.Add(90.ToString());
LabelAngle.Items.Add(180.ToString());
LabelAngle.Items.Add(270.ToString());
LabelAngle.Items.Add(340.ToString());
}
public FacePanel GetPanel()
{
tableLayoutPanel1.Width = facePanel1.Width - 10;
tableLayoutPanel1.Height = facePanel1.Height - 10;
return facePanel1;
}
public void InitializedData()
{
if (!File.Exists(flie))
{
File.Create(flie).Close();
int[] ints = { 7, 13, 15 };
foreach (var item in ints)
{
keylabel label = new keylabel();
label.Primarykey = true;
label.PlateW = item;
label.key = $"通用-{item}寸(Common-{item} inches)";
label.value = $"通用-{item}寸(Common-{item} inches)";
label.ClockwiseAngle = 0;
label.X = 0;
label.Y = 0;
label.LabelAngle = 0;
labels.Add(label);
}
string json = JsonConvert.SerializeObject(labels);
File.WriteAllText(flie, json);
}
else
{
string fileContent = File.ReadAllText(flie);
labels = JsonConvert.DeserializeObject<List<keylabel>>(fileContent);
}
ListData.Items.AddRange(labels.Select(a=>a.value).ToArray());
}
public void Save()
{
try
{
string json = JsonConvert.SerializeObject(labels);
if (!File.Exists(flie))
{
File.Create(flie).Close();
}
File.WriteAllText(flie, json);
ListData.Items.Clear();
ListData.Items.AddRange(labels.Select(a => a.value).ToArray());
var data = labels.Where(a => a.Primarykey == false).FirstOrDefault();
if (data!=null)
{
ConfigHelper.Config.Set("Label_Key", data.key);
}
}
catch (Exception ex)
{
LogUtil.error($"保存关键字贴标数据出错{ex.Message}");
}
}
private void AddLabel_Click(object sender, EventArgs e)
{
try
{
string key = ConfigHelper.Config.Get("Label_Key", "");
if (string.IsNullOrWhiteSpace(key))
{
FrmKeyCollection frmKey = new FrmKeyCollection();
frmKey.ShowDialog();
if (frmKey.DialogResult == DialogResult.OK)
{
string name = frmKey.keyname;
ConfigHelper.Config.Set("Label_Key", name);
keyname.Text = name;
}
}
else
{
keyname.Text = key;
Keyvalue.Text = null;
ClockwiseAngle.Text = null;
Xaxisoffset.Text = null;
Yaxisoffset.Text = null;
LabelAngle.Text = null;
}
keyname.Visible = true;
Keyvalue.Visible = true;
}
catch (Exception ex)
{
LogUtil.error($"添加时出错{ex.Message}");
}
}
string name = null;
private void ListData_SelectedIndexChanged(object sender, EventArgs e)
{
Keyvalue.Text = null;
keyname.Text = null;
ClockwiseAngle.Text = null;
Xaxisoffset.Text = null;
Yaxisoffset.Text = null;
LabelAngle.Text = null;
int i = ListData.SelectedIndex;
if (i<0||labels.Count<1)
{
return;
}
var model = labels[i];
if (model == null)
{
return;
}
else
{
if (model.Primarykey)
{
keyname.Visible = false;
Keyvalue.Visible = false;
}
else
{
keyname.Visible = true;
Keyvalue.Visible = true;
}
lab_PlateWs.Text = model.PlateW.ToString();
name = model.value;
Keyvalue.Text = model.value;
keyname.Text = model.key;
ClockwiseAngle.Text = model.ClockwiseAngle.ToString();
Xaxisoffset.Text = model.X.ToString();
Yaxisoffset.Text = model.Y.ToString();
LabelAngle.Text = model.LabelAngle.ToString();
}
}
private void UpdateLabel_Click(object sender, EventArgs e)
{
FrmKeyCollection frmKey = new FrmKeyCollection();
frmKey.ShowDialog();
if (frmKey.DialogResult == DialogResult.OK)
{
string name = frmKey.keyname;
ConfigHelper.Config.Set("Label_Key", name);
if (keyname.Text!= Language.Dialog("Res001"))
{
keyname.Text = name;
}
var list = labels.Where(a => a.Primarykey==false);
foreach (var item in list)
{
item.key = name;
}
}
}
private void SaveLabel_Click(object sender, EventArgs e)
{
//string a = " True;匹配成功条码xy:X=1498;Y=1934,角度=120";
//string names = "579";
//AMatch aMatch = new AMatch();
//aMatch.Angle = 120;
//aMatch.Points = new Point(1498, 1934);
//Point cenl = new Point(2000, 1800);
//LabelingAngle(names, aMatch, cenl, true, 15, out int angle);
////var i = labels.RemoveAll(A => A.value == Keyvalue.Text);
if (string.IsNullOrWhiteSpace(keyname.Text)||string.IsNullOrWhiteSpace(Keyvalue.Text))
{
return;
}
bool Primarykey = false;
if (keyname.Text.Contains("通用"))
{
Primarykey = true;
}
var acd= ClockwiseAngle.Text;
labels.RemoveAll(A => A.value == Keyvalue.Text);
keylabel model = new keylabel();
int.TryParse(lab_PlateWs.Text, out int PlateW);
model.PlateW = PlateW;
model.Primarykey = Primarykey;
model.value = Keyvalue.Text;
model.key = keyname.Text;
int.TryParse(ClockwiseAngle.Text, out int Cloc);
model.ClockwiseAngle = Cloc;
int.TryParse(Xaxisoffset.Text, out int X);
model.X = X;
int.TryParse(Yaxisoffset.Text, out int Y);
model.Y = Y;
int.TryParse(LabelAngle.Text, out int CLABANGloc);
model.LabelAngle = CLABANGloc;
labels.Add(model);
Save();
}
public static void Updatekeyname(string name)
{
string keybname= ConfigHelper.Config.Get("Label_Key");
var list= labels.Where(a => a.Primarykey == false).ToList();
foreach (var item in list)
{
item.key = name;
}
}
public static void Deletskeyname()
{
var list = labels.Where(a => a.Primarykey == false).ToList();
foreach (var item in list)
{
item.key = "";
}
}
public static System.Drawing.Point LabelingAngle(string keyvalue, AMatch aMatch, System.Drawing.Point centrality, bool isvaor, int PlateW, out int angle)
{
Point lable = aMatch.Points;
Point newpoint = aMatch.Points;
var Data = labels.FirstOrDefault(a => a.value == keyvalue);
int RotateAngle = 0;
int X = 0, Y = 0;
if (Data==null&&labels.Count>0)
{
Data = labels.FirstOrDefault(a=>a.Primarykey&&a.PlateW==PlateW);
}
if (Data!=null)
{
RotateAngle = Data.ClockwiseAngle;
X += Data.X; Y += Data.Y;
LogUtil.info($"关键字{Data.key}={Data.value};顺时针旋转角度={Data.ClockwiseAngle};xy偏移{Data.X};{Data.Y};标签角度:{Data.LabelAngle}");
}
newpoint = Overwritelabel(centrality, aMatch.Points, isvaor, PlateW, aMatch.Angle, RotateAngle, out angle);
if (Data != null&&Data.LabelAngle > 0)
{
angle = Data.LabelAngle;
}
return new Point(newpoint.X + X, newpoint.Y + Y);
}
public static Point Overwritelabel(Point centrality, Point lable, bool isvaor, int PlateW, int Angle,int RotateAngle, out int angle)
{
Point Points = LabelingPosition.ClockwiseRotation(lable, centrality, RotateAngle);
if (isvaor)
{
angle = ScanningCameraAngle(Angle);
}
else
{
angle = OldAngleAlgo(centrality, lable, PlateW);
}
LogNet.log.Info($"是否id相机={isvaor};新标签位置:{Points};角度:{angle}");
return Points;
}
public static int ScanningCameraAngle(int angles)
{
int angle = 0;
double rotationAngle = 83;
if (angles < 0 && angles != 0)
{
angle = (int)(Math.Abs(angles) + rotationAngle);
}
else
{
if (angles <= 83)
{
angle = (int)Math.Abs(angles - rotationAngle);
}
else
{
angle = 350 - (int)(angles - rotationAngle);
}
}
angle += 90;
if (angle > 344)
{
angle -= 344;
}
return angle;
}
/// <summary>
/// 获取以点为中心的角度,-180~180
/// </summary>
/// <param name="pt1"></param>
/// <param name="pt2"></param>
/// <returns></returns>
public static double getAngle(Point pt1, Point pt2)
{
double mb_x = pt2.X - pt1.X;
double mb_y = pt2.Y - pt1.Y;
double rotation = Math.Atan2(mb_y, mb_x);
rotation = rotation / Math.PI * 180;
return rotation;
//double angle = 360 - rotation + 90;
//angle = angle < 0 ? 360 + angle : angle;
//angle = angle % 360;
//return Math.Floor(angle / 360 * 24);
}
public static int OldAngleAlgo(Point lable, Point center, int PlateW)
{
int labelAngle = 0;
var a = (int)getAngle(lable, center);
int angle = a < 0 ? 360 + a : a;
if (PlateW == 15)
{
labelAngle = angle + 120;
}
else if (PlateW == 13)
{
labelAngle = angle + 180;
}
else
{
labelAngle = angle + 180;
}
labelAngle += 83;
labelAngle = labelAngle > 360 ? labelAngle - 360 : labelAngle;
return labelAngle;
//if (labelAngle <= 180)
//{
// labelAngle = Label_R_Angle_Diff - (180 - labelAngle);
//}
//else
//{
// labelAngle = (labelAngle - 180) + Label_R_Angle_Diff;
//}
}
}
public class keylabel
{
public bool Primarykey { get; set; } = false;
/// <summary>
/// 料盘尺寸
/// </summary>
public int PlateW { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string key { get; set; }
/// <summary>
/// 关键字内容
/// </summary>
public string value { get; set; }
/// <summary>
/// 顺特征码旋转多少度
/// </summary>
public int ClockwiseAngle { get; set; } = 0;
/// <summary>
/// x轴偏移量
/// </summary>
public int X { get; set; } = 0;
/// <summary>
/// y轴偏移量
/// </summary>
public int Y { get; set; } = 0;
/// <summary>
/// 标签旋转角度
/// </summary>
public int LabelAngle { get; set; } = 0;
}
}
<?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>
\ No newline at end of file
using Asa.FaceControl;
using Model;
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;
namespace SmartScan
......
using System;
using BLL;
using HalconDotNet;
using Model;
using System.Windows.Forms;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Runtime.InteropServices;
using System.IO;
using BLL;
using log4net;
using System.Runtime.InteropServices;
using System.Text;
using System.Collections.Generic;
using log4net.Util;
using System.Threading;
using System.Windows.Forms;
namespace SmartScan
{
......@@ -34,7 +33,7 @@ namespace SmartScan
_ = new Mutex(true, Application.ProductName, out bool ret);
if (!ret)
{
IntPtr formhwnd = GetWindowHandle("BarCode Rule Setting");
IntPtr formhwnd = GetWindowHandle("Barcode Rule Setting");
if (formhwnd == IntPtr.Zero)
formhwnd = GetWindowHandle("条码规则设置");
......@@ -110,8 +109,8 @@ namespace SmartScan
Process process = new Process();
process.StartInfo = new ProcessStartInfo();
process.StartInfo.FileName = paddle;
process.StartInfo.WorkingDirectory = ".\\paddle";
if (File.Exists(".\\paddle\\paddleOCR.exe"))
process.StartInfo.WorkingDirectory = Application.StartupPath+"\\paddle";
if (File.Exists(Application.StartupPath+"\\paddle\\paddleOCR.exe"))
process.Start();
}
//else
......@@ -119,28 +118,23 @@ namespace SmartScan
// var onnxexe = "onnx\\OcrLiteOnnxForm.exe";
// Process process1 = Process.Start(onnxexe);
//}
Application.Run(new FrmLoading(back)); //预加载,完成后自动退出
Common.frmMain = new FrmMain();
Common.frmWaitting = new FrmWaitting();
if (back)
{
var fsp = new FrmSetPlus();
if (hide)
{
fsp.WindowState = FormWindowState.Minimized;
}
Application.Run(fsp);
}
else
{
Application.Run(Common.frmMain);
}
}
Exit();
}
......
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Neo Scan")]
[assembly: AssemblyTitle("NS100_Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Neo Scan")]
[assembly: AssemblyProduct("NS100_Client")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
......@@ -31,7 +30,7 @@ using System.Runtime.InteropServices;
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
[assembly: AssemblyVersion("3.1.*")]
[assembly: AssemblyVersion("4.1.*")]
//[assembly: AssemblyVersion("3.0.0.0")]
//[assembly: AssemblyFileVersion("3.0.0.0")]
......
using Asa.FaceControl;
using BLL;
using DocumentFormat.OpenXml.Vml;
using Model;
using SmartScan.Form;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
......@@ -70,8 +68,15 @@ namespace SmartScan
isTouch = false;
}
private readonly object lockObject = new object();
static System.Diagnostics.Stopwatch reckontime = new System.Diagnostics.Stopwatch();
public void Scan()
{
//此段代码加锁是因为,客户在连续点击识别设备按钮时,线程会同时生成rid=123并且rid赋值是重复的123123
//在测试时也遇到这个情况,但只成功复现了一次;故加锁。
lock (lockObject)
{
if (!isRun) return;
if (isTouch) return;
isTouch = true;
......@@ -81,17 +86,17 @@ namespace SmartScan
btnMatchedName.Visible = false;
BLLCommon.extension.Clear();
});
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialScanning"));//拍照识别...
var t = Task.Run(() =>
{
reckontime.Restart();
try
{
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialScanning"));//拍照识别...
workCodeInfo = new();
workCodeKeyword = new(StringComparer.OrdinalIgnoreCase);
originalCodeText = null;
originalCodeIsUsed = null;
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialScanning"));//拍照识别...
if (!GetCodeInfo())
{
isTouch = false;
......@@ -102,17 +107,20 @@ namespace SmartScan
{
AddCodeCenter();
});
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialTemplateMatching"));//模版匹配...
LogNet.log.Info($"获取图片耗时{reckontime.ElapsedMilliseconds}ms");
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialTemplateMatching"),5);//模版匹配...
reckontime.Restart();
bool hasMatch = MatchingTemplate();
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialProcessing"));//计算结果...
LogNet.log.Info($"模板匹配耗时{reckontime.ElapsedMilliseconds}ms");
reckontime.Restart();
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialProcessing"),5);//计算结果...
Common.frmMain.Invoke(delegate ()
{
SetKey(hasMatch);
});
isTouch = false;
LogNet.log.Info("Work scan is done");
LogNet.log.Info($"渲染控件耗时{reckontime.ElapsedMilliseconds}ms");
}
catch (Exception ex)
{
......@@ -128,10 +136,8 @@ namespace SmartScan
{
Common.frmMain.ShowWaittingDialog();
});
}
}
public void Scan(string[] code)
{
......@@ -214,8 +220,6 @@ namespace SmartScan
return str;
}
private bool GetCodeInfo()
{
LogNet.log.Info("Work GetCodeInfo");
......@@ -238,6 +242,12 @@ namespace SmartScan
}
else
{
Common.frmMain.Invoke(delegate ()
{
if (!BLL.Config.Backgrounder)
picShow.Image?.Dispose();
BLLCommon.mateEdit.CurrntBitmap?.Dispose();
});
string filename = "";
Common.frmMain.Invoke(delegate ()
{
......@@ -290,7 +300,7 @@ namespace SmartScan
//if (workCodeInfo.Count == 0) return false;
originalCodeText = Camera.GetBarCodeText(workCodeInfo);
bool rtn = BLLCommon.mateEdit.MatchingTemplate(workCodeInfo, BLLCommon.config.DefaultMaterialName, false, out string mateName, out workCodeKeyword, out originalCodeIsUsed);
bool rtn = BLLCommon.mateEdit.MatchingTemplate(workCodeInfo, BLLCommon.config.DefaultMaterialName, false, out string mateName, out workCodeKeyword, out AMatch aMatch);
BLL.MatchAnalysis.ShowResult();
Common.frmMain.Invoke(delegate ()
......@@ -322,8 +332,9 @@ namespace SmartScan
private void SetKey(bool hasMatch)
{
LogNet.log.Info("Work SetKey hasMatch:" + hasMatch);
BLLCommon.extension.SetKey(originalCodeText, workCodeKeyword, hasMatch, out _);
if (workCodeKeyword.Count == 0) return;
BLLCommon.extension.SetKey(originalCodeText, workCodeKeyword, hasMatch, out _);
//if (workCodeKeyword.Count == 0) return;放前面执行
if (workCodeKeyword.Any(a => a.Value.StartsWith("<OCR>")))
{
BLLCommon.extension.DrawTextBackground(workCodeKeyword);
......
......@@ -68,11 +68,11 @@ namespace SmartScan
this.facePanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.facePanel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel1.Location = new System.Drawing.Point(0, 0);
this.facePanel1.Margin = new System.Windows.Forms.Padding(4);
this.facePanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.facePanel1.Name = "facePanel1";
this.facePanel1.Padding = new System.Windows.Forms.Padding(4);
this.facePanel1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.facePanel1.ShowText = false;
this.facePanel1.Size = new System.Drawing.Size(697, 540);
this.facePanel1.Size = new System.Drawing.Size(784, 648);
this.facePanel1.TabIndex = 0;
this.facePanel1.Text = "facePanel1";
this.facePanel1.TitleFont = new System.Drawing.Font("宋体", 12F);
......@@ -85,11 +85,11 @@ namespace SmartScan
this.pnlExtractRule.Controls.Add(this.tableLayoutPanel1);
this.pnlExtractRule.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlExtractRule.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlExtractRule.Location = new System.Drawing.Point(4, 138);
this.pnlExtractRule.Margin = new System.Windows.Forms.Padding(4);
this.pnlExtractRule.Location = new System.Drawing.Point(4, 166);
this.pnlExtractRule.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.pnlExtractRule.Name = "pnlExtractRule";
this.pnlExtractRule.Padding = new System.Windows.Forms.Padding(4);
this.pnlExtractRule.Size = new System.Drawing.Size(689, 398);
this.pnlExtractRule.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.pnlExtractRule.Size = new System.Drawing.Size(776, 477);
this.pnlExtractRule.TabIndex = 46;
this.pnlExtractRule.Text = "提取";
this.pnlExtractRule.TitleFont = new System.Drawing.Font("宋体", 12F);
......@@ -122,16 +122,17 @@ namespace SmartScan
this.tableLayoutPanel1.Controls.Add(this.ChkLengthEnd, 2, 3);
this.tableLayoutPanel1.Controls.Add(this.BtnDel, 3, 5);
this.tableLayoutPanel1.Controls.Add(this.ChkMatchisnumber, 0, 3);
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 42);
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 50);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 6;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 56F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 56F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 56F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 56F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 56F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 56F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(681, 342);
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(767, 409);
this.tableLayoutPanel1.TabIndex = 44;
//
// CboKeyword
......@@ -141,13 +142,13 @@ namespace SmartScan
this.CboKeyword.BorderWidth = 2;
this.CboKeyword.Dock = System.Windows.Forms.DockStyle.Fill;
this.CboKeyword.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.CboKeyword.Location = new System.Drawing.Point(514, 4);
this.CboKeyword.Margin = new System.Windows.Forms.Padding(4);
this.CboKeyword.Location = new System.Drawing.Point(577, 5);
this.CboKeyword.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.CboKeyword.Name = "CboKeyword";
this.CboKeyword.Padding = new System.Windows.Forms.Padding(4);
this.CboKeyword.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.CboKeyword.SelectedIndex = -1;
this.CboKeyword.SelectedText = "";
this.CboKeyword.Size = new System.Drawing.Size(163, 48);
this.CboKeyword.Size = new System.Drawing.Size(186, 57);
this.CboKeyword.TabIndex = 39;
this.CboKeyword.Text = "faceComboBox1";
this.CboKeyword.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......@@ -160,11 +161,11 @@ namespace SmartScan
this.ChkMatchingSplit.BorderWidth = 0;
this.ChkMatchingSplit.Dock = System.Windows.Forms.DockStyle.Fill;
this.ChkMatchingSplit.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ChkMatchingSplit.Location = new System.Drawing.Point(4, 60);
this.ChkMatchingSplit.Margin = new System.Windows.Forms.Padding(4);
this.ChkMatchingSplit.Location = new System.Drawing.Point(4, 72);
this.ChkMatchingSplit.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMatchingSplit.Name = "ChkMatchingSplit";
this.ChkMatchingSplit.Padding = new System.Windows.Forms.Padding(4);
this.ChkMatchingSplit.Size = new System.Drawing.Size(162, 48);
this.ChkMatchingSplit.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMatchingSplit.Size = new System.Drawing.Size(183, 57);
this.ChkMatchingSplit.TabIndex = 44;
this.ChkMatchingSplit.Text = "Split";
this.ChkMatchingSplit.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -178,11 +179,11 @@ namespace SmartScan
this.BtnAdd.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnAdd.ForeColor = System.Drawing.Color.DeepSkyBlue;
this.BtnAdd.HoldPress = false;
this.BtnAdd.Location = new System.Drawing.Point(4, 284);
this.BtnAdd.Margin = new System.Windows.Forms.Padding(4);
this.BtnAdd.Location = new System.Drawing.Point(4, 340);
this.BtnAdd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnAdd.Name = "BtnAdd";
this.BtnAdd.Padding = new System.Windows.Forms.Padding(4);
this.BtnAdd.Size = new System.Drawing.Size(162, 54);
this.BtnAdd.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnAdd.Size = new System.Drawing.Size(183, 64);
this.BtnAdd.TabIndex = 54;
this.BtnAdd.Text = "Add";
this.BtnAdd.Click += new System.EventHandler(this.BtnAdd_Click);
......@@ -196,13 +197,13 @@ namespace SmartScan
this.NudMaxLength.Dock = System.Windows.Forms.DockStyle.Fill;
this.NudMaxLength.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.NudMaxLength.Increment = 1F;
this.NudMaxLength.Location = new System.Drawing.Point(514, 228);
this.NudMaxLength.Margin = new System.Windows.Forms.Padding(4);
this.NudMaxLength.Location = new System.Drawing.Point(577, 273);
this.NudMaxLength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudMaxLength.Maximum = 9999F;
this.NudMaxLength.Minimum = 0F;
this.NudMaxLength.Name = "NudMaxLength";
this.NudMaxLength.Padding = new System.Windows.Forms.Padding(4);
this.NudMaxLength.Size = new System.Drawing.Size(163, 48);
this.NudMaxLength.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudMaxLength.Size = new System.Drawing.Size(186, 57);
this.NudMaxLength.TabIndex = 35;
this.NudMaxLength.Text = "0";
this.NudMaxLength.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......@@ -216,11 +217,11 @@ namespace SmartScan
this.ChkMaxLength.BorderWidth = 0;
this.ChkMaxLength.Dock = System.Windows.Forms.DockStyle.Fill;
this.ChkMaxLength.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ChkMaxLength.Location = new System.Drawing.Point(344, 228);
this.ChkMaxLength.Margin = new System.Windows.Forms.Padding(4);
this.ChkMaxLength.Location = new System.Drawing.Point(386, 273);
this.ChkMaxLength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMaxLength.Name = "ChkMaxLength";
this.ChkMaxLength.Padding = new System.Windows.Forms.Padding(4);
this.ChkMaxLength.Size = new System.Drawing.Size(162, 48);
this.ChkMaxLength.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMaxLength.Size = new System.Drawing.Size(183, 57);
this.ChkMaxLength.TabIndex = 30;
this.ChkMaxLength.Text = "Max";
this.ChkMaxLength.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -235,13 +236,13 @@ namespace SmartScan
this.NudMinLength.Dock = System.Windows.Forms.DockStyle.Fill;
this.NudMinLength.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.NudMinLength.Increment = 1F;
this.NudMinLength.Location = new System.Drawing.Point(174, 228);
this.NudMinLength.Margin = new System.Windows.Forms.Padding(4);
this.NudMinLength.Location = new System.Drawing.Point(195, 273);
this.NudMinLength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudMinLength.Maximum = 9999F;
this.NudMinLength.Minimum = 0F;
this.NudMinLength.Name = "NudMinLength";
this.NudMinLength.Padding = new System.Windows.Forms.Padding(4);
this.NudMinLength.Size = new System.Drawing.Size(162, 48);
this.NudMinLength.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudMinLength.Size = new System.Drawing.Size(183, 57);
this.NudMinLength.TabIndex = 34;
this.NudMinLength.Text = "0";
this.NudMinLength.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......@@ -255,11 +256,11 @@ namespace SmartScan
this.ChkMinLength.BorderWidth = 0;
this.ChkMinLength.Dock = System.Windows.Forms.DockStyle.Fill;
this.ChkMinLength.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ChkMinLength.Location = new System.Drawing.Point(4, 228);
this.ChkMinLength.Margin = new System.Windows.Forms.Padding(4);
this.ChkMinLength.Location = new System.Drawing.Point(4, 273);
this.ChkMinLength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMinLength.Name = "ChkMinLength";
this.ChkMinLength.Padding = new System.Windows.Forms.Padding(4);
this.ChkMinLength.Size = new System.Drawing.Size(162, 48);
this.ChkMinLength.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMinLength.Size = new System.Drawing.Size(183, 57);
this.ChkMinLength.TabIndex = 29;
this.ChkMinLength.Text = "Min";
this.ChkMinLength.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -274,13 +275,13 @@ namespace SmartScan
this.NudSplitPart.Dock = System.Windows.Forms.DockStyle.Fill;
this.NudSplitPart.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.NudSplitPart.Increment = 1F;
this.NudSplitPart.Location = new System.Drawing.Point(514, 60);
this.NudSplitPart.Margin = new System.Windows.Forms.Padding(4);
this.NudSplitPart.Location = new System.Drawing.Point(577, 72);
this.NudSplitPart.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudSplitPart.Maximum = 9999F;
this.NudSplitPart.Minimum = 1F;
this.NudSplitPart.Name = "NudSplitPart";
this.NudSplitPart.Padding = new System.Windows.Forms.Padding(4);
this.NudSplitPart.Size = new System.Drawing.Size(163, 48);
this.NudSplitPart.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudSplitPart.Size = new System.Drawing.Size(186, 57);
this.NudSplitPart.TabIndex = 47;
this.NudSplitPart.Text = "1";
this.NudSplitPart.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......@@ -296,13 +297,13 @@ namespace SmartScan
this.NudLength.Dock = System.Windows.Forms.DockStyle.Fill;
this.NudLength.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.NudLength.Increment = 1F;
this.NudLength.Location = new System.Drawing.Point(514, 116);
this.NudLength.Margin = new System.Windows.Forms.Padding(4);
this.NudLength.Location = new System.Drawing.Point(577, 139);
this.NudLength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudLength.Maximum = 9999F;
this.NudLength.Minimum = 1F;
this.NudLength.Name = "NudLength";
this.NudLength.Padding = new System.Windows.Forms.Padding(4);
this.NudLength.Size = new System.Drawing.Size(163, 48);
this.NudLength.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudLength.Size = new System.Drawing.Size(186, 57);
this.NudLength.TabIndex = 41;
this.NudLength.Text = "1";
this.NudLength.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......@@ -316,11 +317,11 @@ namespace SmartScan
this.LblStart.BorderWidth = 0;
this.LblStart.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblStart.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblStart.Location = new System.Drawing.Point(4, 116);
this.LblStart.Margin = new System.Windows.Forms.Padding(4);
this.LblStart.Location = new System.Drawing.Point(4, 139);
this.LblStart.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblStart.Name = "LblStart";
this.LblStart.Padding = new System.Windows.Forms.Padding(4);
this.LblStart.Size = new System.Drawing.Size(162, 48);
this.LblStart.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblStart.Size = new System.Drawing.Size(183, 57);
this.LblStart.TabIndex = 37;
this.LblStart.Text = "起始";
this.LblStart.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -332,11 +333,11 @@ namespace SmartScan
this.LblLength.BorderWidth = 0;
this.LblLength.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblLength.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblLength.Location = new System.Drawing.Point(344, 116);
this.LblLength.Margin = new System.Windows.Forms.Padding(4);
this.LblLength.Location = new System.Drawing.Point(386, 139);
this.LblLength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblLength.Name = "LblLength";
this.LblLength.Padding = new System.Windows.Forms.Padding(4);
this.LblLength.Size = new System.Drawing.Size(162, 48);
this.LblLength.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblLength.Size = new System.Drawing.Size(183, 57);
this.LblLength.TabIndex = 38;
this.LblLength.Text = "长度";
this.LblLength.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -350,13 +351,13 @@ namespace SmartScan
this.NudStart.Dock = System.Windows.Forms.DockStyle.Fill;
this.NudStart.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.NudStart.Increment = 1F;
this.NudStart.Location = new System.Drawing.Point(174, 116);
this.NudStart.Margin = new System.Windows.Forms.Padding(4);
this.NudStart.Location = new System.Drawing.Point(195, 139);
this.NudStart.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudStart.Maximum = 9999F;
this.NudStart.Minimum = 0F;
this.NudStart.Name = "NudStart";
this.NudStart.Padding = new System.Windows.Forms.Padding(4);
this.NudStart.Size = new System.Drawing.Size(162, 48);
this.NudStart.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.NudStart.Size = new System.Drawing.Size(183, 57);
this.NudStart.TabIndex = 40;
this.NudStart.Text = "0";
this.NudStart.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......@@ -370,11 +371,11 @@ namespace SmartScan
this.LblKeyword.BorderWidth = 0;
this.LblKeyword.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblKeyword.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblKeyword.Location = new System.Drawing.Point(344, 4);
this.LblKeyword.Margin = new System.Windows.Forms.Padding(4);
this.LblKeyword.Location = new System.Drawing.Point(386, 5);
this.LblKeyword.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblKeyword.Name = "LblKeyword";
this.LblKeyword.Padding = new System.Windows.Forms.Padding(4);
this.LblKeyword.Size = new System.Drawing.Size(162, 48);
this.LblKeyword.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblKeyword.Size = new System.Drawing.Size(183, 57);
this.LblKeyword.TabIndex = 36;
this.LblKeyword.Text = "key";
this.LblKeyword.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -386,11 +387,11 @@ namespace SmartScan
this.LblSplitPart.BorderWidth = 0;
this.LblSplitPart.Dock = System.Windows.Forms.DockStyle.Fill;
this.LblSplitPart.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LblSplitPart.Location = new System.Drawing.Point(344, 60);
this.LblSplitPart.Margin = new System.Windows.Forms.Padding(4);
this.LblSplitPart.Location = new System.Drawing.Point(386, 72);
this.LblSplitPart.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblSplitPart.Name = "LblSplitPart";
this.LblSplitPart.Padding = new System.Windows.Forms.Padding(4);
this.LblSplitPart.Size = new System.Drawing.Size(162, 48);
this.LblSplitPart.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LblSplitPart.Size = new System.Drawing.Size(183, 57);
this.LblSplitPart.TabIndex = 46;
this.LblSplitPart.Text = "Field";
this.LblSplitPart.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -402,13 +403,13 @@ namespace SmartScan
this.CboMatchingSplit.BorderWidth = 2;
this.CboMatchingSplit.Dock = System.Windows.Forms.DockStyle.Fill;
this.CboMatchingSplit.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.CboMatchingSplit.Location = new System.Drawing.Point(174, 60);
this.CboMatchingSplit.Margin = new System.Windows.Forms.Padding(4);
this.CboMatchingSplit.Location = new System.Drawing.Point(195, 72);
this.CboMatchingSplit.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.CboMatchingSplit.Name = "CboMatchingSplit";
this.CboMatchingSplit.Padding = new System.Windows.Forms.Padding(4);
this.CboMatchingSplit.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.CboMatchingSplit.SelectedIndex = -1;
this.CboMatchingSplit.SelectedText = "";
this.CboMatchingSplit.Size = new System.Drawing.Size(162, 48);
this.CboMatchingSplit.Size = new System.Drawing.Size(183, 57);
this.CboMatchingSplit.TabIndex = 45;
this.CboMatchingSplit.Text = "faceComboBox1";
this.CboMatchingSplit.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......@@ -423,11 +424,11 @@ namespace SmartScan
this.ChkLengthEnd.BorderWidth = 0;
this.ChkLengthEnd.Dock = System.Windows.Forms.DockStyle.Fill;
this.ChkLengthEnd.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ChkLengthEnd.Location = new System.Drawing.Point(344, 172);
this.ChkLengthEnd.Margin = new System.Windows.Forms.Padding(4);
this.ChkLengthEnd.Location = new System.Drawing.Point(386, 206);
this.ChkLengthEnd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkLengthEnd.Name = "ChkLengthEnd";
this.ChkLengthEnd.Padding = new System.Windows.Forms.Padding(4);
this.ChkLengthEnd.Size = new System.Drawing.Size(162, 48);
this.ChkLengthEnd.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkLengthEnd.Size = new System.Drawing.Size(183, 57);
this.ChkLengthEnd.TabIndex = 42;
this.ChkLengthEnd.Text = "faceCheckBox7";
this.ChkLengthEnd.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -441,11 +442,11 @@ namespace SmartScan
this.BtnDel.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnDel.ForeColor = System.Drawing.Color.Red;
this.BtnDel.HoldPress = false;
this.BtnDel.Location = new System.Drawing.Point(514, 284);
this.BtnDel.Margin = new System.Windows.Forms.Padding(4);
this.BtnDel.Location = new System.Drawing.Point(577, 340);
this.BtnDel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnDel.Name = "BtnDel";
this.BtnDel.Padding = new System.Windows.Forms.Padding(4);
this.BtnDel.Size = new System.Drawing.Size(163, 54);
this.BtnDel.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnDel.Size = new System.Drawing.Size(186, 64);
this.BtnDel.TabIndex = 43;
this.BtnDel.Text = "Del";
this.BtnDel.Click += new System.EventHandler(this.BtnDel_Click);
......@@ -457,11 +458,11 @@ namespace SmartScan
this.ChkMatchisnumber.BorderWidth = 0;
this.ChkMatchisnumber.Dock = System.Windows.Forms.DockStyle.Fill;
this.ChkMatchisnumber.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ChkMatchisnumber.Location = new System.Drawing.Point(4, 172);
this.ChkMatchisnumber.Margin = new System.Windows.Forms.Padding(4);
this.ChkMatchisnumber.Location = new System.Drawing.Point(4, 206);
this.ChkMatchisnumber.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMatchisnumber.Name = "ChkMatchisnumber";
this.ChkMatchisnumber.Padding = new System.Windows.Forms.Padding(4);
this.ChkMatchisnumber.Size = new System.Drawing.Size(162, 48);
this.ChkMatchisnumber.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ChkMatchisnumber.Size = new System.Drawing.Size(183, 57);
this.ChkMatchisnumber.TabIndex = 53;
this.ChkMatchisnumber.Text = "AsNumber";
this.ChkMatchisnumber.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -474,11 +475,11 @@ namespace SmartScan
this.pnlParseResult.Controls.Add(this.faceTextBox1);
this.pnlParseResult.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlParseResult.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlParseResult.Location = new System.Drawing.Point(4, 4);
this.pnlParseResult.Margin = new System.Windows.Forms.Padding(4);
this.pnlParseResult.Location = new System.Drawing.Point(4, 5);
this.pnlParseResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.pnlParseResult.Name = "pnlParseResult";
this.pnlParseResult.Padding = new System.Windows.Forms.Padding(4);
this.pnlParseResult.Size = new System.Drawing.Size(689, 134);
this.pnlParseResult.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.pnlParseResult.Size = new System.Drawing.Size(776, 161);
this.pnlParseResult.TabIndex = 44;
this.pnlParseResult.Text = "解析结果";
this.pnlParseResult.TitleFont = new System.Drawing.Font("宋体", 12F);
......@@ -491,30 +492,31 @@ namespace SmartScan
this.faceTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.faceTextBox1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.faceTextBox1.BorderWidth = 2;
this.faceTextBox1.Location = new System.Drawing.Point(4, 34);
this.faceTextBox1.Margin = new System.Windows.Forms.Padding(4);
this.faceTextBox1.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.faceTextBox1.Location = new System.Drawing.Point(4, 41);
this.faceTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.faceTextBox1.MaxLength = 32767;
this.faceTextBox1.Multiline = true;
this.faceTextBox1.Name = "faceTextBox1";
this.faceTextBox1.Padding = new System.Windows.Forms.Padding(4);
this.faceTextBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.faceTextBox1.ReadOnly = true;
this.faceTextBox1.SelectedText = "";
this.faceTextBox1.SelectionLength = 0;
this.faceTextBox1.SelectionStart = 0;
this.faceTextBox1.ShowDel = false;
this.faceTextBox1.ShowQuery = false;
this.faceTextBox1.Size = new System.Drawing.Size(681, 92);
this.faceTextBox1.Size = new System.Drawing.Size(767, 110);
this.faceTextBox1.TabIndex = 48;
this.faceTextBox1.Text = "faceTextBox1";
//
// UsrCodeExtractList
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.facePanel1);
this.Margin = new System.Windows.Forms.Padding(4);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "UsrCodeExtractList";
this.Size = new System.Drawing.Size(697, 540);
this.Size = new System.Drawing.Size(784, 648);
this.facePanel1.ResumeLayout(false);
this.pnlExtractRule.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Asa.FaceControl;
using BLL;
using DocumentFormat.OpenXml.Wordprocessing;
using Model;
using SmartScan.PlusSettingFrm;
namespace SmartScan
{
......@@ -93,6 +96,12 @@ namespace SmartScan
if (LstKey.SelectedIndex == -1) return;
keyCopy.RemoveAt(LstKey.SelectedIndex);
LstKey.Items.RemoveAt(LstKey.SelectedIndex);
var keyname= ConfigHelper.Config.Get("Label_Key");
if (!string.IsNullOrWhiteSpace(keyname))
{
UsrKeywordlabeling.Deletskeyname();
}
}
private void BtnUpdateKey_Click(object sender, EventArgs e)
......@@ -103,6 +112,16 @@ namespace SmartScan
if (index == -1)
{
keyCopy[LstKey.SelectedIndex] = text;
var oldname=LstKey.Items[LstKey.SelectedIndex];
var keyname = ConfigHelper.Config.Get("Label_Key");
if (!string.IsNullOrWhiteSpace(keyname))
{
//ConfigHelper.Config.Set("Label_Key", "Part No");
if (oldname == keyname)
{
UsrKeywordlabeling.Updatekeyname(text);
}
}
LstKey.Items[LstKey.SelectedIndex] = text;
setRIkey();
}
......
......@@ -31,24 +31,13 @@ namespace SmartScan
{
this.facePanel1 = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.pnlMaterial = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.LstMate = new Asa.FaceControl.FaceListBox();
this.panel5 = new System.Windows.Forms.Panel();
this.pnlMaterialOp = new Asa.FaceControl.FacePanel();
this.BtnAddMate = new Asa.FaceControl.FaceButton();
this.BtnRenameMate = new Asa.FaceControl.FaceButton();
this.BtnDelMate = new Asa.FaceControl.FaceButton();
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.pnlCode = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.pnlCodeOp = new Asa.FaceControl.FacePanel();
this.BtnExtractCode = new Asa.FaceControl.FaceButton();
this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel();
this.BtnTemplateValite = new Asa.FaceControl.FaceButton();
this.BtnExtractCode = new Asa.FaceControl.FaceButton();
this.LstCode = new Asa.FaceControl.FaceListBox();
this.panel3 = new System.Windows.Forms.Panel();
this.pnlImg = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.pnlImgOp = new Asa.FaceControl.FacePanel();
......@@ -60,25 +49,31 @@ namespace SmartScan
this.BtnLocalImage = new Asa.FaceControl.FaceButton();
this.BtnScanCode = new Asa.FaceControl.FaceButton();
this.BtnSaveImage = new Asa.FaceControl.FaceButton();
this.panel6 = new System.Windows.Forms.Panel();
this.ImgShow = new Asa.FaceControl.FacePictureBox();
this.pnlMaterial = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.panel5 = new System.Windows.Forms.Panel();
this.pnlMaterialOp = new Asa.FaceControl.FacePanel();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.BtnAddMate = new Asa.FaceControl.FaceButton();
this.BtnDelMate = new Asa.FaceControl.FaceButton();
this.BtnRenameMate = new Asa.FaceControl.FaceButton();
this.LstMate = new Asa.FaceControl.FaceListBox();
this.facePanel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.pnlMaterial.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.panel5.SuspendLayout();
this.pnlMaterialOp.SuspendLayout();
this.panel2.SuspendLayout();
this.panel4.SuspendLayout();
this.pnlCode.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.pnlCodeOp.SuspendLayout();
this.panel3.SuspendLayout();
this.tableLayoutPanel7.SuspendLayout();
this.pnlImg.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.pnlImgOp.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.pnlMaterial.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.panel5.SuspendLayout();
this.pnlMaterialOp.SuspendLayout();
this.tableLayoutPanel6.SuspendLayout();
this.SuspendLayout();
//
// facePanel1
......@@ -88,191 +83,35 @@ namespace SmartScan
this.facePanel1.BorderWidth = 2;
this.facePanel1.Controls.Add(this.tableLayoutPanel1);
this.facePanel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.facePanel1.Location = new System.Drawing.Point(4, 4);
this.facePanel1.Margin = new System.Windows.Forms.Padding(4);
this.facePanel1.Location = new System.Drawing.Point(4, 5);
this.facePanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.facePanel1.Name = "facePanel1";
this.facePanel1.Padding = new System.Windows.Forms.Padding(4);
this.facePanel1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.facePanel1.ShowText = false;
this.facePanel1.Size = new System.Drawing.Size(1608, 698);
this.facePanel1.Size = new System.Drawing.Size(1809, 838);
this.facePanel1.TabIndex = 1;
this.facePanel1.Text = "facePanel1";
this.facePanel1.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.AutoSize = true;
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 468F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 525F));
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.panel2, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.panel3, 1, 0);
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.Controls.Add(this.pnlCode, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.pnlImg, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.pnlMaterial, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 4);
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 5);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1600, 690);
this.tableLayoutPanel1.Size = new System.Drawing.Size(1801, 828);
this.tableLayoutPanel1.TabIndex = 20;
//
// panel1
//
this.panel1.Controls.Add(this.pnlMaterial);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(462, 684);
this.panel1.TabIndex = 0;
//
// pnlMaterial
//
this.pnlMaterial.AutoSize = true;
this.pnlMaterial.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.pnlMaterial.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.pnlMaterial.BorderWidth = 2;
this.pnlMaterial.Controls.Add(this.tableLayoutPanel2);
this.pnlMaterial.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMaterial.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlMaterial.Location = new System.Drawing.Point(0, 0);
this.pnlMaterial.Name = "pnlMaterial";
this.pnlMaterial.Padding = new System.Windows.Forms.Padding(3);
this.pnlMaterial.Size = new System.Drawing.Size(462, 684);
this.pnlMaterial.TabIndex = 29;
this.pnlMaterial.Text = "模板";
this.pnlMaterial.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.LstMate, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.panel5, 0, 1);
this.tableLayoutPanel2.Location = new System.Drawing.Point(6, 34);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 164F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(450, 644);
this.tableLayoutPanel2.TabIndex = 8;
//
// LstMate
//
this.LstMate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LstMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LstMate.BorderWidth = 2;
this.LstMate.Dock = System.Windows.Forms.DockStyle.Fill;
this.LstMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstMate.Location = new System.Drawing.Point(4, 4);
this.LstMate.Margin = new System.Windows.Forms.Padding(4);
this.LstMate.Name = "LstMate";
this.LstMate.Padding = new System.Windows.Forms.Padding(4);
this.LstMate.SelectedIndex = -1;
this.LstMate.Size = new System.Drawing.Size(442, 472);
this.LstMate.TabIndex = 4;
this.LstMate.SelectedIndexChanged += new System.EventHandler(this.LstMate_SelectedIndexChanged);
//
// panel5
//
this.panel5.Controls.Add(this.pnlMaterialOp);
this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel5.Location = new System.Drawing.Point(3, 483);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(444, 158);
this.panel5.TabIndex = 5;
//
// pnlMaterialOp
//
this.pnlMaterialOp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.pnlMaterialOp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.pnlMaterialOp.BorderWidth = 2;
this.pnlMaterialOp.Controls.Add(this.BtnAddMate);
this.pnlMaterialOp.Controls.Add(this.BtnRenameMate);
this.pnlMaterialOp.Controls.Add(this.BtnDelMate);
this.pnlMaterialOp.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMaterialOp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlMaterialOp.Location = new System.Drawing.Point(0, 0);
this.pnlMaterialOp.Name = "pnlMaterialOp";
this.pnlMaterialOp.Padding = new System.Windows.Forms.Padding(3);
this.pnlMaterialOp.Size = new System.Drawing.Size(444, 158);
this.pnlMaterialOp.TabIndex = 29;
this.pnlMaterialOp.Text = "模板操作";
this.pnlMaterialOp.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// BtnAddMate
//
this.BtnAddMate.BackColor = System.Drawing.Color.Black;
this.BtnAddMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnAddMate.BorderWidth = 2;
this.BtnAddMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnAddMate.HoldPress = false;
this.BtnAddMate.Image = global::SmartScan.Properties.Resources.create;
this.BtnAddMate.Location = new System.Drawing.Point(7, 42);
this.BtnAddMate.Margin = new System.Windows.Forms.Padding(4);
this.BtnAddMate.Name = "BtnAddMate";
this.BtnAddMate.Padding = new System.Windows.Forms.Padding(4);
this.BtnAddMate.Size = new System.Drawing.Size(139, 105);
this.BtnAddMate.TabIndex = 5;
this.BtnAddMate.Text = "创建模板";
this.BtnAddMate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnAddMate.Click += new System.EventHandler(this.BtnAddMate_Click);
//
// BtnRenameMate
//
this.BtnRenameMate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnRenameMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnRenameMate.BorderWidth = 2;
this.BtnRenameMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnRenameMate.HoldPress = false;
this.BtnRenameMate.Image = global::SmartScan.Properties.Resources.rename;
this.BtnRenameMate.Location = new System.Drawing.Point(296, 42);
this.BtnRenameMate.Margin = new System.Windows.Forms.Padding(4);
this.BtnRenameMate.Name = "BtnRenameMate";
this.BtnRenameMate.Padding = new System.Windows.Forms.Padding(4);
this.BtnRenameMate.Size = new System.Drawing.Size(139, 105);
this.BtnRenameMate.TabIndex = 7;
this.BtnRenameMate.Text = "重命名";
this.BtnRenameMate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnRenameMate.Click += new System.EventHandler(this.BtnRenameMate_Click);
//
// BtnDelMate
//
this.BtnDelMate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnDelMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnDelMate.BorderWidth = 2;
this.BtnDelMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnDelMate.HoldPress = false;
this.BtnDelMate.Image = global::SmartScan.Properties.Resources.delete;
this.BtnDelMate.Location = new System.Drawing.Point(151, 42);
this.BtnDelMate.Margin = new System.Windows.Forms.Padding(4);
this.BtnDelMate.Name = "BtnDelMate";
this.BtnDelMate.Padding = new System.Windows.Forms.Padding(4);
this.BtnDelMate.Size = new System.Drawing.Size(139, 105);
this.BtnDelMate.TabIndex = 6;
this.BtnDelMate.Text = "删除模板";
this.BtnDelMate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnDelMate.Click += new System.EventHandler(this.BtnDelMate_Click);
//
// panel2
//
this.panel2.Controls.Add(this.panel4);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(1078, 3);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(519, 684);
this.panel2.TabIndex = 2;
//
// panel4
//
this.panel4.Controls.Add(this.pnlCode);
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(0, 0);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(519, 684);
this.panel4.TabIndex = 0;
//
// pnlCode
//
this.pnlCode.AutoSize = true;
......@@ -282,10 +121,11 @@ namespace SmartScan
this.pnlCode.Controls.Add(this.tableLayoutPanel4);
this.pnlCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlCode.Location = new System.Drawing.Point(0, 0);
this.pnlCode.Location = new System.Drawing.Point(1263, 4);
this.pnlCode.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlCode.Name = "pnlCode";
this.pnlCode.Padding = new System.Windows.Forms.Padding(3);
this.pnlCode.Size = new System.Drawing.Size(519, 684);
this.pnlCode.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlCode.Size = new System.Drawing.Size(535, 820);
this.pnlCode.TabIndex = 29;
this.pnlCode.Text = "条码";
this.pnlCode.TitleFont = new System.Drawing.Font("宋体", 12F);
......@@ -299,12 +139,13 @@ namespace SmartScan
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.pnlCodeOp, 0, 1);
this.tableLayoutPanel4.Controls.Add(this.LstCode, 0, 0);
this.tableLayoutPanel4.Location = new System.Drawing.Point(6, 38);
this.tableLayoutPanel4.Location = new System.Drawing.Point(7, 46);
this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 2;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 177F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(509, 643);
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 212F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(524, 771);
this.tableLayoutPanel4.TabIndex = 18;
//
// pnlCodeOp
......@@ -312,57 +153,74 @@ namespace SmartScan
this.pnlCodeOp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.pnlCodeOp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.pnlCodeOp.BorderWidth = 2;
this.pnlCodeOp.Controls.Add(this.BtnExtractCode);
this.pnlCodeOp.Controls.Add(this.BtnTemplateValite);
this.pnlCodeOp.Controls.Add(this.tableLayoutPanel7);
this.pnlCodeOp.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlCodeOp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlCodeOp.Location = new System.Drawing.Point(3, 469);
this.pnlCodeOp.Location = new System.Drawing.Point(3, 563);
this.pnlCodeOp.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlCodeOp.Name = "pnlCodeOp";
this.pnlCodeOp.Padding = new System.Windows.Forms.Padding(3);
this.pnlCodeOp.Size = new System.Drawing.Size(503, 171);
this.pnlCodeOp.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlCodeOp.Size = new System.Drawing.Size(518, 204);
this.pnlCodeOp.TabIndex = 29;
this.pnlCodeOp.Text = "条码操作";
this.pnlCodeOp.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// BtnExtractCode
//
this.BtnExtractCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.BtnExtractCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnExtractCode.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnExtractCode.BorderWidth = 2;
this.BtnExtractCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnExtractCode.HoldPress = false;
this.BtnExtractCode.Image = global::SmartScan.Properties.Resources.filter;
this.BtnExtractCode.Location = new System.Drawing.Point(18, 43);
this.BtnExtractCode.Margin = new System.Windows.Forms.Padding(4);
this.BtnExtractCode.Name = "BtnExtractCode";
this.BtnExtractCode.Padding = new System.Windows.Forms.Padding(4);
this.BtnExtractCode.Size = new System.Drawing.Size(232, 114);
this.BtnExtractCode.TabIndex = 17;
this.BtnExtractCode.Text = "提取";
this.BtnExtractCode.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnExtractCode.Click += new System.EventHandler(this.BtnExtractCode_Click);
// tableLayoutPanel7
//
this.tableLayoutPanel7.AutoSize = true;
this.tableLayoutPanel7.ColumnCount = 2;
this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel7.Controls.Add(this.BtnTemplateValite, 1, 0);
this.tableLayoutPanel7.Controls.Add(this.BtnExtractCode, 0, 0);
this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 53);
this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel7.Name = "tableLayoutPanel7";
this.tableLayoutPanel7.RowCount = 1;
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(512, 147);
this.tableLayoutPanel7.TabIndex = 0;
//
// BtnTemplateValite
//
this.BtnTemplateValite.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.BtnTemplateValite.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnTemplateValite.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnTemplateValite.BorderWidth = 2;
this.BtnTemplateValite.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnTemplateValite.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.BtnTemplateValite.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnTemplateValite.HoldPress = false;
this.BtnTemplateValite.Image = global::SmartScan.Properties.Resources.validate;
this.BtnTemplateValite.Location = new System.Drawing.Point(258, 44);
this.BtnTemplateValite.Margin = new System.Windows.Forms.Padding(4);
this.BtnTemplateValite.Location = new System.Drawing.Point(260, 5);
this.BtnTemplateValite.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnTemplateValite.Name = "BtnTemplateValite";
this.BtnTemplateValite.Padding = new System.Windows.Forms.Padding(4);
this.BtnTemplateValite.Size = new System.Drawing.Size(232, 114);
this.BtnTemplateValite.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnTemplateValite.Size = new System.Drawing.Size(248, 137);
this.BtnTemplateValite.TabIndex = 15;
this.BtnTemplateValite.Text = "Template validation";
this.BtnTemplateValite.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnTemplateValite.Click += new System.EventHandler(this.BtnTemplateValite_Click);
//
// BtnExtractCode
//
this.BtnExtractCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnExtractCode.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnExtractCode.BorderWidth = 2;
this.BtnExtractCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnExtractCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnExtractCode.HoldPress = false;
this.BtnExtractCode.Image = global::SmartScan.Properties.Resources.filter;
this.BtnExtractCode.Location = new System.Drawing.Point(4, 5);
this.BtnExtractCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnExtractCode.Name = "BtnExtractCode";
this.BtnExtractCode.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnExtractCode.Size = new System.Drawing.Size(248, 137);
this.BtnExtractCode.TabIndex = 17;
this.BtnExtractCode.Text = "提取";
this.BtnExtractCode.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnExtractCode.Click += new System.EventHandler(this.BtnExtractCode_Click);
//
// LstCode
//
this.LstCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
......@@ -372,25 +230,16 @@ namespace SmartScan
this.LstCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LstCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstCode.ItemHeight = 40;
this.LstCode.Location = new System.Drawing.Point(4, 4);
this.LstCode.Margin = new System.Windows.Forms.Padding(4);
this.LstCode.Location = new System.Drawing.Point(4, 5);
this.LstCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LstCode.Name = "LstCode";
this.LstCode.Padding = new System.Windows.Forms.Padding(4);
this.LstCode.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LstCode.SelectedIndex = -1;
this.LstCode.Size = new System.Drawing.Size(501, 458);
this.LstCode.Size = new System.Drawing.Size(516, 549);
this.LstCode.TabIndex = 13;
this.LstCode.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.LstCode.SelectedIndexChanged += new System.EventHandler(this.LstCode_SelectedIndexChanged);
//
// panel3
//
this.panel3.Controls.Add(this.pnlImg);
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(471, 3);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(601, 684);
this.panel3.TabIndex = 3;
//
// pnlImg
//
this.pnlImg.AutoSize = true;
......@@ -400,10 +249,11 @@ namespace SmartScan
this.pnlImg.Controls.Add(this.tableLayoutPanel3);
this.pnlImg.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlImg.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlImg.Location = new System.Drawing.Point(0, 0);
this.pnlImg.Location = new System.Drawing.Point(363, 4);
this.pnlImg.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlImg.Name = "pnlImg";
this.pnlImg.Padding = new System.Windows.Forms.Padding(3);
this.pnlImg.Size = new System.Drawing.Size(601, 684);
this.pnlImg.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlImg.Size = new System.Drawing.Size(894, 820);
this.pnlImg.TabIndex = 29;
this.pnlImg.Text = "图片";
this.pnlImg.TitleFont = new System.Drawing.Font("宋体", 12F);
......@@ -417,13 +267,14 @@ namespace SmartScan
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Controls.Add(this.pnlImgOp, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.ImgShow, 0, 0);
this.tableLayoutPanel3.Location = new System.Drawing.Point(6, 34);
this.tableLayoutPanel3.Location = new System.Drawing.Point(7, 41);
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 285F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(589, 641);
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 342F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(881, 768);
this.tableLayoutPanel3.TabIndex = 20;
//
// pnlImgOp
......@@ -432,13 +283,13 @@ namespace SmartScan
this.pnlImgOp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.pnlImgOp.BorderWidth = 2;
this.pnlImgOp.Controls.Add(this.tableLayoutPanel5);
this.pnlImgOp.Controls.Add(this.panel6);
this.pnlImgOp.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlImgOp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlImgOp.Location = new System.Drawing.Point(3, 359);
this.pnlImgOp.Location = new System.Drawing.Point(3, 430);
this.pnlImgOp.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlImgOp.Name = "pnlImgOp";
this.pnlImgOp.Padding = new System.Windows.Forms.Padding(3);
this.pnlImgOp.Size = new System.Drawing.Size(583, 279);
this.pnlImgOp.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlImgOp.Size = new System.Drawing.Size(875, 334);
this.pnlImgOp.TabIndex = 29;
this.pnlImgOp.Text = "图片操作";
this.pnlImgOp.TitleFont = new System.Drawing.Font("宋体", 12F);
......@@ -459,12 +310,13 @@ namespace SmartScan
this.tableLayoutPanel5.Controls.Add(this.BtnScanCode, 3, 0);
this.tableLayoutPanel5.Controls.Add(this.BtnSaveImage, 2, 0);
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 42);
this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 48);
this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
this.tableLayoutPanel5.RowCount = 2;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(577, 234);
this.tableLayoutPanel5.Size = new System.Drawing.Size(869, 282);
this.tableLayoutPanel5.TabIndex = 16;
//
// BtnCloseLight
......@@ -476,11 +328,11 @@ namespace SmartScan
this.BtnCloseLight.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnCloseLight.HoldPress = false;
this.BtnCloseLight.Image = global::SmartScan.Properties.Resources.light_off;
this.BtnCloseLight.Location = new System.Drawing.Point(4, 121);
this.BtnCloseLight.Margin = new System.Windows.Forms.Padding(4);
this.BtnCloseLight.Location = new System.Drawing.Point(4, 146);
this.BtnCloseLight.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnCloseLight.Name = "BtnCloseLight";
this.BtnCloseLight.Padding = new System.Windows.Forms.Padding(4);
this.BtnCloseLight.Size = new System.Drawing.Size(136, 109);
this.BtnCloseLight.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnCloseLight.Size = new System.Drawing.Size(209, 131);
this.BtnCloseLight.TabIndex = 9;
this.BtnCloseLight.Text = "Turn off light";
this.BtnCloseLight.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
......@@ -495,11 +347,11 @@ namespace SmartScan
this.BtnOcrCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnOcrCode.HoldPress = false;
this.BtnOcrCode.Image = global::SmartScan.Properties.Resources.OCR;
this.BtnOcrCode.Location = new System.Drawing.Point(436, 121);
this.BtnOcrCode.Margin = new System.Windows.Forms.Padding(4);
this.BtnOcrCode.Location = new System.Drawing.Point(655, 146);
this.BtnOcrCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnOcrCode.Name = "BtnOcrCode";
this.BtnOcrCode.Padding = new System.Windows.Forms.Padding(4);
this.BtnOcrCode.Size = new System.Drawing.Size(137, 109);
this.BtnOcrCode.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnOcrCode.Size = new System.Drawing.Size(210, 131);
this.BtnOcrCode.TabIndex = 19;
this.BtnOcrCode.Text = "OCR";
this.BtnOcrCode.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
......@@ -514,11 +366,11 @@ namespace SmartScan
this.BtnOpenLight.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnOpenLight.HoldPress = false;
this.BtnOpenLight.Image = global::SmartScan.Properties.Resources.light_on;
this.BtnOpenLight.Location = new System.Drawing.Point(4, 4);
this.BtnOpenLight.Margin = new System.Windows.Forms.Padding(4);
this.BtnOpenLight.Location = new System.Drawing.Point(4, 5);
this.BtnOpenLight.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnOpenLight.Name = "BtnOpenLight";
this.BtnOpenLight.Padding = new System.Windows.Forms.Padding(4);
this.BtnOpenLight.Size = new System.Drawing.Size(136, 109);
this.BtnOpenLight.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnOpenLight.Size = new System.Drawing.Size(209, 131);
this.BtnOpenLight.TabIndex = 8;
this.BtnOpenLight.Text = "Turn on light";
this.BtnOpenLight.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
......@@ -533,11 +385,11 @@ namespace SmartScan
this.BtnCameraImage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnCameraImage.HoldPress = false;
this.BtnCameraImage.Image = global::SmartScan.Properties.Resources.camera;
this.BtnCameraImage.Location = new System.Drawing.Point(148, 121);
this.BtnCameraImage.Margin = new System.Windows.Forms.Padding(4);
this.BtnCameraImage.Location = new System.Drawing.Point(221, 146);
this.BtnCameraImage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnCameraImage.Name = "BtnCameraImage";
this.BtnCameraImage.Padding = new System.Windows.Forms.Padding(4);
this.BtnCameraImage.Size = new System.Drawing.Size(136, 109);
this.BtnCameraImage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnCameraImage.Size = new System.Drawing.Size(209, 131);
this.BtnCameraImage.TabIndex = 10;
this.BtnCameraImage.Text = "Gain device image";
this.BtnCameraImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
......@@ -552,11 +404,11 @@ namespace SmartScan
this.BtnLocalImage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnLocalImage.HoldPress = false;
this.BtnLocalImage.Image = global::SmartScan.Properties.Resources.localfile;
this.BtnLocalImage.Location = new System.Drawing.Point(148, 4);
this.BtnLocalImage.Margin = new System.Windows.Forms.Padding(4);
this.BtnLocalImage.Location = new System.Drawing.Point(221, 5);
this.BtnLocalImage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnLocalImage.Name = "BtnLocalImage";
this.BtnLocalImage.Padding = new System.Windows.Forms.Padding(4);
this.BtnLocalImage.Size = new System.Drawing.Size(136, 109);
this.BtnLocalImage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnLocalImage.Size = new System.Drawing.Size(209, 131);
this.BtnLocalImage.TabIndex = 11;
this.BtnLocalImage.Text = "Open Local image";
this.BtnLocalImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
......@@ -571,11 +423,11 @@ namespace SmartScan
this.BtnScanCode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnScanCode.HoldPress = false;
this.BtnScanCode.Image = global::SmartScan.Properties.Resources.recognize;
this.BtnScanCode.Location = new System.Drawing.Point(436, 4);
this.BtnScanCode.Margin = new System.Windows.Forms.Padding(4);
this.BtnScanCode.Location = new System.Drawing.Point(655, 5);
this.BtnScanCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnScanCode.Name = "BtnScanCode";
this.BtnScanCode.Padding = new System.Windows.Forms.Padding(4);
this.BtnScanCode.Size = new System.Drawing.Size(137, 109);
this.BtnScanCode.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnScanCode.Size = new System.Drawing.Size(210, 131);
this.BtnScanCode.TabIndex = 12;
this.BtnScanCode.Text = "识别";
this.BtnScanCode.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
......@@ -590,23 +442,16 @@ namespace SmartScan
this.BtnSaveImage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnSaveImage.HoldPress = false;
this.BtnSaveImage.Image = global::SmartScan.Properties.Resources.saveas;
this.BtnSaveImage.Location = new System.Drawing.Point(292, 4);
this.BtnSaveImage.Margin = new System.Windows.Forms.Padding(4);
this.BtnSaveImage.Location = new System.Drawing.Point(438, 5);
this.BtnSaveImage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnSaveImage.Name = "BtnSaveImage";
this.BtnSaveImage.Padding = new System.Windows.Forms.Padding(4);
this.BtnSaveImage.Size = new System.Drawing.Size(136, 109);
this.BtnSaveImage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnSaveImage.Size = new System.Drawing.Size(209, 131);
this.BtnSaveImage.TabIndex = 18;
this.BtnSaveImage.Text = "ImageSave";
this.BtnSaveImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnSaveImage.Click += new System.EventHandler(this.BtnSaveImage_Click);
//
// panel6
//
this.panel6.Location = new System.Drawing.Point(583, 83);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(571, 236);
this.panel6.TabIndex = 15;
//
// ImgShow
//
this.ImgShow.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
......@@ -616,43 +461,198 @@ namespace SmartScan
this.ImgShow.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.ImgShow.BorderWidth = 2;
this.ImgShow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.ImgShow.Location = new System.Drawing.Point(4, 4);
this.ImgShow.Margin = new System.Windows.Forms.Padding(4);
this.ImgShow.Location = new System.Drawing.Point(4, 5);
this.ImgShow.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ImgShow.Name = "ImgShow";
this.ImgShow.Padding = new System.Windows.Forms.Padding(4);
this.ImgShow.Size = new System.Drawing.Size(581, 348);
this.ImgShow.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.ImgShow.Size = new System.Drawing.Size(873, 416);
this.ImgShow.TabIndex = 14;
this.ImgShow.Text = "facePictureBox1";
//
// pnlMaterial
//
this.pnlMaterial.AutoSize = true;
this.pnlMaterial.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.pnlMaterial.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.pnlMaterial.BorderWidth = 2;
this.pnlMaterial.Controls.Add(this.tableLayoutPanel2);
this.pnlMaterial.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMaterial.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlMaterial.Location = new System.Drawing.Point(3, 4);
this.pnlMaterial.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlMaterial.Name = "pnlMaterial";
this.pnlMaterial.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlMaterial.Size = new System.Drawing.Size(354, 820);
this.pnlMaterial.TabIndex = 29;
this.pnlMaterial.Text = "模板";
this.pnlMaterial.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.panel5, 0, 1);
this.tableLayoutPanel2.Controls.Add(this.LstMate, 0, 0);
this.tableLayoutPanel2.Location = new System.Drawing.Point(7, 41);
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 197F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(341, 772);
this.tableLayoutPanel2.TabIndex = 8;
//
// panel5
//
this.panel5.Controls.Add(this.pnlMaterialOp);
this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel5.Location = new System.Drawing.Point(3, 579);
this.panel5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(335, 189);
this.panel5.TabIndex = 5;
//
// pnlMaterialOp
//
this.pnlMaterialOp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.pnlMaterialOp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.pnlMaterialOp.BorderWidth = 2;
this.pnlMaterialOp.Controls.Add(this.tableLayoutPanel6);
this.pnlMaterialOp.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMaterialOp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.pnlMaterialOp.Location = new System.Drawing.Point(0, 0);
this.pnlMaterialOp.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlMaterialOp.Name = "pnlMaterialOp";
this.pnlMaterialOp.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pnlMaterialOp.Size = new System.Drawing.Size(335, 189);
this.pnlMaterialOp.TabIndex = 29;
this.pnlMaterialOp.Text = "模板操作";
this.pnlMaterialOp.TitleFont = new System.Drawing.Font("宋体", 12F);
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.AutoSize = true;
this.tableLayoutPanel6.ColumnCount = 3;
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.Controls.Add(this.BtnAddMate, 0, 0);
this.tableLayoutPanel6.Controls.Add(this.BtnDelMate, 2, 0);
this.tableLayoutPanel6.Controls.Add(this.BtnRenameMate, 1, 0);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 49);
this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 1;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(329, 136);
this.tableLayoutPanel6.TabIndex = 0;
//
// BtnAddMate
//
this.BtnAddMate.BackColor = System.Drawing.Color.Black;
this.BtnAddMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnAddMate.BorderWidth = 2;
this.BtnAddMate.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnAddMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnAddMate.HoldPress = false;
this.BtnAddMate.Image = global::SmartScan.Properties.Resources.create;
this.BtnAddMate.Location = new System.Drawing.Point(4, 5);
this.BtnAddMate.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnAddMate.Name = "BtnAddMate";
this.BtnAddMate.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnAddMate.Size = new System.Drawing.Size(101, 126);
this.BtnAddMate.TabIndex = 5;
this.BtnAddMate.Text = "创建模板";
this.BtnAddMate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnAddMate.Click += new System.EventHandler(this.BtnAddMate_Click);
//
// BtnDelMate
//
this.BtnDelMate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnDelMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnDelMate.BorderWidth = 2;
this.BtnDelMate.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnDelMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnDelMate.HoldPress = false;
this.BtnDelMate.Image = global::SmartScan.Properties.Resources.delete;
this.BtnDelMate.Location = new System.Drawing.Point(222, 5);
this.BtnDelMate.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnDelMate.Name = "BtnDelMate";
this.BtnDelMate.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnDelMate.Size = new System.Drawing.Size(103, 126);
this.BtnDelMate.TabIndex = 6;
this.BtnDelMate.Text = "删除模板";
this.BtnDelMate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnDelMate.Click += new System.EventHandler(this.BtnDelMate_Click);
//
// BtnRenameMate
//
this.BtnRenameMate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnRenameMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnRenameMate.BorderWidth = 2;
this.BtnRenameMate.Dock = System.Windows.Forms.DockStyle.Fill;
this.BtnRenameMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnRenameMate.HoldPress = false;
this.BtnRenameMate.Image = global::SmartScan.Properties.Resources.rename;
this.BtnRenameMate.Location = new System.Drawing.Point(113, 5);
this.BtnRenameMate.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnRenameMate.Name = "BtnRenameMate";
this.BtnRenameMate.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.BtnRenameMate.Size = new System.Drawing.Size(101, 126);
this.BtnRenameMate.TabIndex = 7;
this.BtnRenameMate.Text = "重命名";
this.BtnRenameMate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.BtnRenameMate.Click += new System.EventHandler(this.BtnRenameMate_Click);
//
// LstMate
//
this.LstMate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.LstMate.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.LstMate.BorderWidth = 2;
this.LstMate.Dock = System.Windows.Forms.DockStyle.Fill;
this.LstMate.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LstMate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.LstMate.Location = new System.Drawing.Point(4, 5);
this.LstMate.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LstMate.Name = "LstMate";
this.LstMate.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.LstMate.SelectedIndex = -1;
this.LstMate.Size = new System.Drawing.Size(333, 565);
this.LstMate.TabIndex = 4;
this.LstMate.SelectedIndexChanged += new System.EventHandler(this.LstMate_SelectedIndexChanged);
//
// UsrMaterialTemplate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.facePanel1);
this.Margin = new System.Windows.Forms.Padding(4);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "UsrMaterialTemplate";
this.Size = new System.Drawing.Size(1636, 717);
this.Size = new System.Drawing.Size(1840, 860);
this.facePanel1.ResumeLayout(false);
this.facePanel1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.pnlMaterial.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.pnlMaterialOp.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.tableLayoutPanel1.PerformLayout();
this.pnlCode.ResumeLayout(false);
this.tableLayoutPanel4.ResumeLayout(false);
this.pnlCodeOp.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.pnlCodeOp.PerformLayout();
this.tableLayoutPanel7.ResumeLayout(false);
this.pnlImg.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.pnlImgOp.ResumeLayout(false);
this.pnlImgOp.PerformLayout();
this.tableLayoutPanel5.ResumeLayout(false);
this.pnlMaterial.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.pnlMaterialOp.ResumeLayout(false);
this.pnlMaterialOp.PerformLayout();
this.tableLayoutPanel6.ResumeLayout(false);
this.ResumeLayout(false);
}
......@@ -660,10 +660,6 @@ namespace SmartScan
#endregion
private Asa.FaceControl.FacePanel facePanel1;
private Asa.FaceControl.FaceButton BtnRenameMate;
private Asa.FaceControl.FaceButton BtnDelMate;
private Asa.FaceControl.FaceButton BtnAddMate;
private Asa.FaceControl.FaceListBox LstMate;
private Asa.FaceControl.FaceButton BtnExtractCode;
private Asa.FaceControl.FacePictureBox ImgShow;
private Asa.FaceControl.FaceListBox LstCode;
......@@ -676,21 +672,22 @@ namespace SmartScan
private Asa.FaceControl.FaceButton BtnOcrCode;
private Asa.FaceControl.FaceButton BtnTemplateValite;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.Panel panel6;
private Asa.FaceControl.FacePanel pnlMaterial;
private Asa.FaceControl.FacePanel pnlMaterialOp;
private Asa.FaceControl.FacePanel pnlImg;
private Asa.FaceControl.FacePanel pnlImgOp;
private Asa.FaceControl.FacePanel pnlCode;
private Asa.FaceControl.FacePanel pnlCodeOp;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private Asa.FaceControl.FacePanel pnlMaterial;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.Panel panel5;
private Asa.FaceControl.FacePanel pnlMaterialOp;
private Asa.FaceControl.FaceButton BtnAddMate;
private Asa.FaceControl.FaceButton BtnRenameMate;
private Asa.FaceControl.FaceButton BtnDelMate;
private Asa.FaceControl.FaceListBox LstMate;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7;
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
......@@ -11,6 +12,7 @@ using CameraVisionLib.Model;
using DocumentFormat.OpenXml.EMMA;
using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing;
using Model;
using Newtonsoft.Json;
namespace SmartScan
{
......@@ -21,8 +23,10 @@ namespace SmartScan
private int codeIndex = -1;
private Bitmap bmp = null;
public UsrMaterialTemplate()
public bool isvisbles = false;
public UsrMaterialTemplate(bool isvisble=false)
{
isvisbles=isvisble;
InitializeComponent();
BtnOcrCode.Visible = Config.Func_EnabledOCR;
//if (!Config.Func_EnabledOCR)
......@@ -34,8 +38,56 @@ namespace SmartScan
Language.SetLanguage(this);
BtnCameraImage.Enabled = Camera.IsConnected();
//LstMate.SelectedFirst();
if (isvisble)
{
ClearImagesInButtonsOnTableLayoutPanels();
}
}
#region 作为服务启动时
//递归查找指定类型的控件
private void ClearImagesInButtonsOnTableLayoutPanels()
{
string[] btuuarr = new string[]{ "BtnOpenLight", "BtnCloseLight", "BtnCameraImage"};
var tableLayoutPanels = FindControlsOfType<TableLayoutPanel>(this);
foreach (var tableLayoutPanel in tableLayoutPanels)
{
var buttons = FindControlsOfType<Asa.FaceControl.FaceButton>(tableLayoutPanel);
foreach (var button in buttons)
{
if (btuuarr.Contains(button.Name))
{
button.Visible = false;
}
button.Image = null;
}
}
}
private List<T> FindControlsOfType<T>(Control container) where T : Control
{
var controls = new List<T>();
foreach (Control control in container.Controls)
{
if (control is T tControl)
{
controls.Add(tControl);
}
// 递归查找嵌套控件
controls.AddRange(FindControlsOfType<T>(control));
}
return controls;
}
//递归设置所有控件字体大小
private void SetFontSizes(Control control, int fontSize)
{
control.Font = new Font(control.Font.FontFamily, fontSize);
foreach (Control childControl in control.Controls)
{
SetFontSizes(childControl, fontSize);
}
}
#endregion
public FacePanel GetPanel()
{
return facePanel1;
......@@ -125,14 +177,21 @@ namespace SmartScan
if (LstMate.SelectedIndex == -1) return;
mateIndex = LstMate.SelectedIndex;
BLLCommon.mateMaxCodeID = mateCopy[mateIndex].GetMaxID();
ImgShow.Image = mateCopy[mateIndex].Image;
string iamgepath= mateCopy[mateIndex].ImagePath;
if (!string.IsNullOrEmpty(iamgepath))
{
if (System.IO.File.Exists(iamgepath))
{
ImgShow.Image = ObjConversion.ReadImageFile(iamgepath);
}
}
//ImgShow.Image = mateCopy[mateIndex].Image;
ImgShow.CodeCenterClear();
ImgShow.AddCodeCenter(LabelCenter());
LstCode.Items.Clear();
LstCode.Items.AddRange(FormatCode());
LstCode.SelectedIndex = -1;
bmp = mateCopy[mateIndex].Image;
bmp = ImgShow.Image;
}
private void BtnAddMate_Click(object sender, EventArgs e)
......@@ -227,13 +286,14 @@ namespace SmartScan
ImgShow.Image = bmp;
iscamp = true;
}
string nsimagepath = null;
private void BtnLocalImage_Click(object sender, EventArgs e)
{
if (mateIndex < 0) return;
using OpenFileDialog dlg = new() { Filter = "Image Files|*.jpg;*.jpeg;*.png;*.bmp;*.gif|All Files|*.*" };
if (dlg.ShowDialog() != DialogResult.OK) return;
nsimagepath = dlg.FileName;
bmp = ObjConversion.ReadImageFile(dlg.FileName);
LstCode.Items.Clear();
ImgShow.CodeCenterClear();
......@@ -322,7 +382,6 @@ namespace SmartScan
return;
}
MaterialCode code = mateCopy[mateIndex].Code[codeIndex];
AsciiToCharReplacer asciiControl = new AsciiToCharReplacer();
string[] strings = null;
string codestring = asciiControl.StringToAscii(code.Text, out strings);
......@@ -339,9 +398,7 @@ namespace SmartScan
mateCopy[mateIndex].Match.RemoveAll(s => s.CodeID == code.ID);
mateCopy[mateIndex].Match.AddRange(frm.CodeMatch);
mateCopy[mateIndex].State = TemplateState.Unsaved;
mateCopy[mateIndex].Match.RemoveAll(x => { return mateCopy[mateIndex].Code.FindIndex(c => c.ID == x.CodeID) == -1 && mateCopy[mateIndex].Ocr.FindIndex(c => c.ID == x.CodeID) == -1; });
LstCode.Items[codeIndex] = FormatCode(codeIndex);
}
}
......
......@@ -129,12 +129,30 @@
<Compile Include="Form\FrmWaitting.Designer.cs">
<DependentUpon>FrmWaitting.cs</DependentUpon>
</Compile>
<Compile Include="PlusSettingFrm\FrmKeyCollection.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PlusSettingFrm\FrmKeyCollection.Designer.cs">
<DependentUpon>FrmKeyCollection.cs</DependentUpon>
</Compile>
<Compile Include="PlusSettingFrm\FrmSetPlus.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PlusSettingFrm\FrmSetPlus.Designer.cs">
<DependentUpon>FrmSetPlus.cs</DependentUpon>
</Compile>
<Compile Include="PlusSettingFrm\UsrCustomlabeling.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PlusSettingFrm\UsrCustomlabeling.Designer.cs">
<DependentUpon>UsrCustomlabeling.cs</DependentUpon>
</Compile>
<Compile Include="PlusSettingFrm\UsrKeywordlabeling.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PlusSettingFrm\UsrKeywordlabeling.Designer.cs">
<DependentUpon>UsrKeywordlabeling.cs</DependentUpon>
</Compile>
<Compile Include="PlusSettingFrm\UsrLabeling.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -309,9 +327,18 @@
<EmbeddedResource Include="Form\FrmWaitting.resx">
<DependentUpon>FrmWaitting.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlusSettingFrm\FrmKeyCollection.resx">
<DependentUpon>FrmKeyCollection.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlusSettingFrm\FrmSetPlus.resx">
<DependentUpon>FrmSetPlus.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlusSettingFrm\UsrCustomlabeling.resx">
<DependentUpon>UsrCustomlabeling.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlusSettingFrm\UsrKeywordlabeling.resx">
<DependentUpon>UsrKeywordlabeling.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlusSettingFrm\UsrLabeling.resx">
<DependentUpon>UsrLabeling.cs</DependentUpon>
</EmbeddedResource>
......@@ -399,6 +426,10 @@
<Project>{f7499de9-5665-49fd-bdb6-602b9af98541}</Project>
<Name>BLL</Name>
</ProjectReference>
<ProjectReference Include="..\DataHandling\DataHandling.csproj">
<Project>{0F23B7DB-9953-46ED-9166-115646467647}</Project>
<Name>DataHandling</Name>
</ProjectReference>
<ProjectReference Include="..\Model\Model.csproj">
<Project>{20e61a3d-bf87-4a99-9756-7fe13d2daa6e}</Project>
<Name>Model</Name>
......
using BLL;
using System;
using System.Windows.Forms;
namespace SmartScan
......
using System;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.IO;
using BLL;
using Model;
using System.Runtime.Serialization.Formatters.Binary;
using System.Drawing;
using Newtonsoft.Json;
using SmartScan.PlusSettingFrm;
using System;
using System.Collections.Generic;
using BLL;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.ServiceModel;
using System.ServiceModel.Activation;
namespace SmartScan
{
......@@ -23,7 +26,6 @@ namespace SmartScan
LogNet.log.Info("WebService CloseApp 接口被调用");
Common.frmMain.Invoke(new Action(() => { Common.frmMain.Close(); }));
}
public WebResultCamera WorkWithCamera()
{
LogNet.log.Info("WebService WorkWithCamera 接口被调用");
......@@ -48,10 +50,12 @@ namespace SmartScan
Common.frmMain.Invoke(new Action(() => { msg = Common.frmMain.WebTouchWork(str); }));
return new WebResultCode() { Data = msg };
}
public string alive()
{
return "1";
}
public WebResultCode ProcessBitmap(Stream info, string param)
{
BinaryFormatter bf = new BinaryFormatter();
......@@ -66,31 +70,63 @@ namespace SmartScan
if (workCodeInfo.Count == 0)
return new WebResultCode() { ErrorCode = -1, Msg = "扫码失败" };
BLLCommon.mateEdit.CurrntBitmap = bitmap;
bool rtn = BLLCommon.mateEdit.MatchingTemplate(workCodeInfo, BLLCommon.config.DefaultMaterialName, false, out string mateName, out workCodeKeyword, out originalCodeIsUsed);
bool rtn = BLLCommon.mateEdit.MatchingTemplate(workCodeInfo, BLLCommon.config.DefaultMaterialName, false, out string mateName, out workCodeKeyword, out AMatch aMatch);
LogNet.log.Info("Work SetKey hasMatch:" + rtn);
LogNet.log.Info("模板匹配结果:" + rtn);
WebResultCode webResultCode = null;
if (!BLLCommon.extension.SetKey(null, workCodeKeyword, rtn, out string errmsg))
Dictionary<string,string> keys=new Dictionary<string, string> ();
foreach (var item in workCodeKeyword)
{
// workCodeKeyword[item.Key]= item.Value.Replace("<OCR>", "");
keys.Add(item.Key,item.Value.Replace("<OCR>",""));
}
if (!BLLCommon.extension.SetKey(null, keys, rtn, out string errmsg))
{
webResultCode = new WebResultCode() { ErrorCode = -2, Msg = errmsg };
}
if (webResultCode != null || !rtn)
return webResultCode;
LogNet.log.Info("Work scan is done");
LogNet.log.Info("模板匹配结束");
List<KeyValuePair<string, string>> result = new List<KeyValuePair<string, string>>();
#region 判断是否需要请求http替换数据
if (BLL.Config.isReplaceData)
{
Dictionary<string, string> keyValues = new Dictionary<string, string>();
workCodeKeyword= BLLCommon.extension.ReplaceData(workCodeKeyword);
}
#endregion
workCodeKeyword = WebserverReplaceData(keys);
//bool isReplaceData = ConfigHelper.Config.Get<bool>("WebServer_isReplaceData", false);
//if (isReplaceData)
//{
// LogNet.log.Info("WebServer:开始请求替换数据!");
// InvokePlugin invoke = new InvokePlugin();
// invoke.LoadDLL("DataHandling", LogNet.log);
// if (workCodeKeyword!=null)
// {
// if (workCodeKeyword.Count!=0)
// {
// LogNet.log.Info($"{JsonConvert.SerializeObject(workCodeKeyword)}");
// if (ConfigHelper.Config.Get("WebServer_Isformal", false))
// {
// Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
// if (workCodeKeyword.ContainsKey("PN"))
// {
// keyValuePairs.Add("firmaUrunKodu", workCodeKeyword["PN"]);
// }
// else
// {
// keyValuePairs.Add("firmaUrunKodu", "");
// }
// keyValuePairs.Add("lot", "");
// keyValuePairs.Add("barkodAdet", "1");
// keyValuePairs.Add("userName", "bekoservice");
// keyValuePairs.Add("pass", "beko1209tyu");
// keyValuePairs.Add("printerMacId", "");
// keyValuePairs.Add("basanUserName", "");
// }
// workCodeKeyword = invoke.RequestServer(workCodeKeyword, 1);
// }
// }
//}
#endregion
foreach (var wc in workCodeKeyword)
{
result.Add(new KeyValuePair<string, string>(wc.Key, wc.Value));
......@@ -103,8 +139,154 @@ namespace SmartScan
return new WebResultCode() { ErrorCode = -1, Msg = "扫码失败:" + ex };
}
}
public WebResultCode ProcessBitmaps(BitmapData bitmapData)
{
try
{
if (bitmapData == null)
{
return new WebResultCode() { ErrorCode = -1, Msg = "未接收到任何数据!" };
}
if (bitmapData.ImageData.Length <= 0)
{
return new WebResultCode() { ErrorCode = -1, Msg = "扫码相机未传送图片;" };
}
byte[] imageData = Convert.FromBase64String(bitmapData.ImageData);
Bitmap bitmap = null;
using(MemoryStream stream = new MemoryStream(imageData))
{
bitmap = new Bitmap(stream);
}
if (bitmap==null)
{
return new WebResultCode() { ErrorCode = -1, Msg = "图片解析完成为空;" };
}
List<CameraVisionLib.Model.BarcodeInfo> workCodeInfo = new();
if (bitmapData.BarCodeList == null&&bitmapData.IsIDCamera)
{
return new WebResultCode() { ErrorCode = -1, Msg = "扫码相机未传来条码数据;" };
}
if (bitmapData.IsIDCamera)
{
bitmapData.BarCodeList.ForEach(barcode =>
{
workCodeInfo.Add(new CameraVisionLib.Model.BarcodeInfo
{
Text = barcode.Text,
//Size = barcode.Size,
Angle = barcode.Angle,
Center = new PointF(barcode.X, barcode.Y),
CodeType = barcode.CodeType,
Distance = barcode.Distance,
});
});
}
else
{
workCodeInfo = Camera.GetBarCode(bitmap);
if (workCodeInfo.Count == 0)
return new WebResultCode() { ErrorCode = -1, Msg = "扫码失败" };
}
BLLCommon.mateEdit.CurrntBitmap = bitmap;
Dictionary<string, string> workCodeKeyword;
bool rtn = BLLCommon.mateEdit.MatchingTemplate(workCodeInfo, BLLCommon.config.DefaultMaterialName, false, out string mateName, out workCodeKeyword, out AMatch aMatch);
var point=new Point(-1,-1);
int angle = 0;
if (rtn)
{
string key = ConfigHelper.Config.Get("Label_Key", "");
workCodeKeyword.TryGetValue(key, out String Value);
LogNet.log.Info("模板匹配结果:" + rtn + $";关键字{key}:{Value};匹配成功条码xy:X={aMatch.Points.X};Y={aMatch.Points.Y},中心点x={bitmapData.X};y={bitmapData.Y},角度={aMatch.Angle},料盘尺寸={bitmapData.PlateW};匹配成功条码:{string.Join(", ", aMatch.IsCodeUsed)}" );
point=UsrKeywordlabeling.LabelingAngle(Value, aMatch, new Point(bitmapData.X, bitmapData.Y), bitmapData.IsIDCamera, bitmapData.PlateW, out angle);
//point =UsrCustomlabeling.LabelingAngle_New(mateName, aMatch, new Point(bitmapData.X, bitmapData.Y), bitmapData.IsIDCamera, bitmapData.PlateW, out angle);
}
Dictionary<string, string> keys = new Dictionary<string, string>();
foreach (var item in workCodeKeyword)
{
keys.Add(item.Key, item.Value.Replace("<OCR>", ""));
}
if (!BLLCommon.extension.SetKey(null, keys, rtn, out string errmsg))
{
return new WebResultCode() { ErrorCode = -2, Msg = errmsg };
}
List<KeyValuePair<string, string>> result = new List<KeyValuePair<string, string>>();
workCodeKeyword=WebserverReplaceData(keys);
foreach (var wc in workCodeKeyword)
{
result.Add(new KeyValuePair<string, string>(wc.Key, wc.Value));
}
NewPositionAngle newPosition = new NewPositionAngle
{
X= point.X, Y= point.Y,Angle= angle,IsCodeUsed=aMatch.IsCodeUsed
};
LogNet.log.Info($"返回坐标及角度X={newPosition.X};Y={newPosition.Y};角度={newPosition.Angle}");
return new WebResultCode() { workCodeKeyword = result, workCodeInfo = workCodeInfo, PositionAngle= newPosition };
}
catch (Exception ex)
{
LogNet.log.Error("ProcessBitmaps", ex);
return new WebResultCode() { ErrorCode = -1, Msg = "扫码失败:" + ex };
}
}
public Dictionary<string, string> WebserverReplaceData(Dictionary<string, string> workCodeKeyword)
{
#region 判断是否需要请求http替换数据
bool isReplaceData = ConfigHelper.Config.Get<bool>("WebServer_isReplaceData", false);
if (isReplaceData)
{
LogNet.log.Info("WebServer:开始请求替换数据!");
InvokePlugin invoke = new InvokePlugin();
invoke.LoadDLL("DataHandling", LogNet.log);
if (workCodeKeyword != null)
{
if (workCodeKeyword.Count != 0)
{
//foreach (var item in workCodeKeyword)
//{
// item.Value= item.Value.Replace("<OCR>", "");
//}
LogNet.log.Info($"识别关键字内容:{JsonConvert.SerializeObject(workCodeKeyword)}");
if (ConfigHelper.Config.Get("WebServer_Isformal", true))
{
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
string firmaUrunKoduValue = "";
if (workCodeKeyword.TryGetValue("PN", out string pnValue) && !string.IsNullOrWhiteSpace(pnValue))
{
firmaUrunKoduValue = pnValue;
}
else if (workCodeKeyword.TryGetValue("firmaUrunKodu", out string firmaUrunKodu) && !string.IsNullOrWhiteSpace(firmaUrunKodu))
{
firmaUrunKoduValue = firmaUrunKodu;
}
keyValuePairs.Add("firmaUrunKodu", firmaUrunKoduValue);
keyValuePairs.Add("lot", "");
keyValuePairs.Add("barkodAdet", "1");
keyValuePairs.Add("userName", "bekoservice");
keyValuePairs.Add("pass", "beko1209tyu");
keyValuePairs.Add("printerMacId", "");
keyValuePairs.Add("basanUserName", "");
workCodeKeyword = invoke.RequestServer(keyValuePairs, 1);
}
else
{
workCodeKeyword = invoke.RequestServer(workCodeKeyword, 1);
}
}
}
}
return workCodeKeyword;
#endregion
}
}
}
......@@ -14,7 +14,7 @@
<appender-ref ref="VisionLib"/>
</root>
<appender name="SmartScan" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Logs\\SmartScan.log" />
<param name="File" value="Logs\\NS100.log" />
<param name="Encoding" value="UTF-8"/>
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!