Commit 27df0cbb 贾鹏旭

同步

2 个父辈 e3128339 d758d3a9
......@@ -40,9 +40,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedDll\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.Face.Control, Version=1.0.8636.38287, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\asa\FaceControl\Test\bin\Debug\Asa.Face.Control.dll</HintPath>
<Reference Include="Asa.Face.Control">
<HintPath>..\SharedDll\Asa.Face.Control.dll</HintPath>
</Reference>
<Reference Include="ClosedXML, Version=0.96.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.0.96.0\lib\net46\ClosedXML.dll</HintPath>
......
......@@ -244,9 +244,9 @@ namespace BLL
{
return currentExtension.SetKey(originalCode, key, hasMatch, out errmsg);
}
public void Print()
public void Print(bool hasMatch, Dictionary<string, string> key)
{
//currentExtension.Printing
currentExtension.Print(hasMatch, key);
}
public void DrawTextBackground(Dictionary<string, string> key)
{
......
......@@ -385,5 +385,10 @@ namespace BLL
public void DrawTextBackground(Dictionary<string, string> key)
{
}
public void Print(bool match, Dictionary<string, string> key)
{
}
}
}
......@@ -150,7 +150,7 @@ namespace BLL
//if (extensions != null && !extensions[0].Control.InvokeRequired)
//{
// if ( && hasMatch)
// if (config.AutoPrint && hasMatch)
// {
// //if (CanPrint())
// PrintLabel(null, EventArgs.Empty);
......@@ -160,7 +160,7 @@ namespace BLL
//{
// //PrintLabel(null, EventArgs.Empty);
//}
SaveRetrospect?.Invoke(key);
//SaveRetrospect?.Invoke(key);
return true;
}
bool updatereelid(Dictionary<string, string> key, out string errmsg)
......@@ -286,9 +286,8 @@ namespace BLL
{
updatereelid(lastkey, out _);
}
public void PrintLabel(object sender, EventArgs e)
private void PrintLabel(object sender, EventArgs e)
{
if (!config.AutoPrint) return;
LogNet.log.Debug("Enter PrintLabel Method");
if (lastkey == null) return;
//Dictionary<string, string> key = new();
......@@ -558,6 +557,23 @@ namespace BLL
}
Application.DoEvents();
}
public void Print(bool match, Dictionary<string, string> key)
{
if (extensions != null && !extensions[0].Control.InvokeRequired)
{
if (config.AutoPrint && match)
{
//if (CanPrint())
PrintLabel(null, EventArgs.Empty);
}
}
else
{
//PrintLabel(null, EventArgs.Empty);
}
SaveRetrospect?.Invoke(key);
}
}
}
......@@ -386,5 +386,10 @@ namespace BLL
public void DrawTextBackground(Dictionary<string, string> key)
{
}
public void Print(bool match, Dictionary<string, string> key)
{
}
}
}
......@@ -275,6 +275,11 @@ namespace BLL
{
}
public void Print(bool match, Dictionary<string, string> key)
{
}
public class InitPPID_Request_DPS
{
/*
......
......@@ -534,5 +534,10 @@ namespace BLL
public void DrawTextBackground(Dictionary<string, string> key)
{
}
public void Print(bool match, Dictionary<string, string> key)
{
}
}
}
......@@ -365,6 +365,11 @@ namespace BLL
public void DrawTextBackground(Dictionary<string, string> key)
{
}
public void Print(bool match, Dictionary<string, string> key)
{
}
}
}
......@@ -12,7 +12,7 @@ namespace BLL
//请求处理关键字
public class Replacekeywords
{
public static string Replacekeywordss(Dictionary<string,string> macroKey)
public static string Replacekeywordss(Dictionary<string, string> macroKey)
{
string jsondata = null;
Config config = new Config();
......@@ -34,12 +34,12 @@ namespace BLL
LogNet.log.Error("更换关键字:需要请求token,请填写tokenurl!");
throw new Exception("需要请求token,请填写tokenurl!");
}
if (string.IsNullOrWhiteSpace(config.Url) || config.KeyWords.Length<0)
if (string.IsNullOrWhiteSpace(config.Url) || config.KeyWords.Length < 0)
{
LogNet.log.Error("更换关键字:URL和关键字不能为空");
throw new Exception("URL和关键字不能为空");
}
config.filteredData= macroKey
config.filteredData = macroKey
.Where(kvp => config.KeyWords.Contains(kvp.Key))
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
//判断结果中是否包含指定关键字
......@@ -100,7 +100,7 @@ namespace BLL
}
string parstring = string.Join(",", parstringParts);
//parstring = "Y023070966,WPG0001,1,infobar";
config.Url+= $"&customloadmethodparms={parstring}&loadtype=NEXT&readonly=true&rowcap=-1";
config.Url += $"&customloadmethodparms={parstring}&loadtype=NEXT&readonly=true&rowcap=-1";
var client = new RestClient(config.Url);
LogNet.log.Error($"更换关键字:请求Url:{config.Url}");
// 禁用自动重定向
......@@ -127,17 +127,17 @@ namespace BLL
public class Config
{
//是否需要请求token
public Method Method { get; set; } = ConfigurationManager.AppSettings["RequestMethod"] == "POST" ? Method.POST : Method.GET;
public Method Method { get; set; } = ConfigHelper.Config.Get("SelectHttpPN_RequestMethod", "GET") == "POST" ? Method.POST : Method.GET;
//是否需要请求token
public string ContentType { get; set; } = ConfigurationManager.AppSettings["ContentType"];
public string ContentType { get; set; } = ConfigHelper.Config.Get("SelectHttpPN_ContentType", "application/json");
//是否需要请求token
public bool IsTokenRequired { get; set; } = Convert.ToBoolean(ConfigurationManager.AppSettings["IsTokenRequired"]);
public bool IsTokenRequired { get; set; } = ConfigHelper.Config.Get("SelectHttpPN_IsTokenRequired", true);
//请求tokenurl
public string Tokenurl { get; set; } = ConfigurationManager.AppSettings["Tokenurl"];
public string Tokenurl { get; set; } = ConfigHelper.Config.Get("SelectHttpPN_Tokenurl", "");
//请求正常数据
public string Url { get; set; } = ConfigurationManager.AppSettings["Url"];
public string Url { get; set; } = ConfigHelper.Config.Get("SelectHttpPN_Url", "");
//关键字,请用,号分割
public string[] KeyWords { get; set; } = ConfigurationManager.AppSettings["KeyWords"].Split(',');
public string[] KeyWords { get; set; } = ConfigHelper.Config.Get("SelectHttpPN_KeyWords", "grn_num,vend_num,grn_line,infobar=0").Split(',');
/// <summary>
......
......@@ -37,7 +37,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.Face.Control">
<HintPath>..\..\..\asa\FaceControl\Test\bin\Debug\Asa.Face.Control.dll</HintPath>
<HintPath>..\SharedDll\Asa.Face.Control.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.2.3\lib\net46\NLog.dll</HintPath>
......
......@@ -534,8 +534,42 @@ namespace ExtensionGroup
// return false;
// }
//}
public event IExtension.PrintDelegate Printing;
public event IExtension.PrintDelegate SaveRetrospect;
public void Clear()
{
throw new NotImplementedException();
}
public void Dispose()
{
throw new NotImplementedException();
}
public void DrawTextBackground(Dictionary<string, string> key)
{
throw new NotImplementedException();
}
public void Load(List<ExtensionControl> extensions)
{
throw new NotImplementedException();
}
public void Print(bool match, Dictionary<string, string> key)
{
}
public bool SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch, out string errmsg)
{
throw new NotImplementedException();
}
public void Update()
{
throw new NotImplementedException();
}
}
}
......@@ -20,6 +20,7 @@ namespace Model
public void Dispose();
public void Print(bool match, Dictionary<string, string> key);
public abstract void DrawTextBackground(Dictionary<string, string> key);
}
}
......@@ -44,9 +44,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedDll\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.Face.Control, Version=1.0.8621.29649, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\asa\FaceControl\FaceControl\bin\Debug\Asa.Face.Control.dll</HintPath>
<Reference Include="Asa.Face.Control">
<HintPath>..\SharedDll\Asa.Face.Control.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>
......
......@@ -5,22 +5,6 @@
</startup>
<appSettings>
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true"/>
<!--服务器查询PN_开始-->
<!--请求方式;大写POSTGET-->
<add key="CustomerName" value="1181"/>
<add key="RequestMethod" value="GET"/>
<add key="ContentType" value="application/json"/>
<add key="IsTokenRequired" value="TRUE"/>
<!--isTokenRequiredtrue时,tokenurl必填-->
<add key="Tokenurl" value=""/>
<add key="Url" value=""/>
<!--关键字value请用,号隔开-->
<add key="KeyWords" value="grn_num,vend_num,grn_line,infobar=0"/>
<!--服务器查询PN_结束-->
<!--启动服务路由地址-->
<add key="StartServiceName" value=""/>
<add key="StartServicePath" value=""/>
</appSettings>
<system.serviceModel>
<bindings>
......
......@@ -45,7 +45,7 @@ namespace SmartScan
this.LstRecord = new Asa.FaceControl.FaceListBox();
this.LblCode = new Asa.FaceControl.FaceLabel();
this.LblDateRange = new Asa.FaceControl.FaceLabel();
this.butt_startservice = new Asa.FaceControl.FaceButton();
this.butt_getData = new Asa.FaceControl.FaceButton();
((System.ComponentModel.ISupportInitialize)(this.PicLabel)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
......@@ -309,28 +309,28 @@ namespace SmartScan
this.LblDateRange.Text = "日期";
this.LblDateRange.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// butt_startservice
//
this.butt_startservice.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.butt_startservice.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.butt_startservice.BorderWidth = 2;
this.butt_startservice.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.butt_startservice.HoldPress = false;
this.butt_startservice.Location = new System.Drawing.Point(17, 505);
this.butt_startservice.Name = "butt_startservice";
this.butt_startservice.Padding = new System.Windows.Forms.Padding(3);
this.butt_startservice.Size = new System.Drawing.Size(292, 56);
this.butt_startservice.TabIndex = 22;
this.butt_startservice.Text = "启动服务";
this.butt_startservice.Visible = false;
this.butt_startservice.Click += new System.EventHandler(this.butt_startservice_Click);
// 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(17, 505);
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);
//
// FrmRetrospect
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1617, 788);
this.Controls.Add(this.butt_startservice);
this.Controls.Add(this.butt_getData);
this.Controls.Add(this.LblDateRange);
this.Controls.Add(this.LblCode);
this.Controls.Add(this.tableLayoutPanel1);
......@@ -357,7 +357,7 @@ namespace SmartScan
this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);
this.Controls.SetChildIndex(this.LblCode, 0);
this.Controls.SetChildIndex(this.LblDateRange, 0);
this.Controls.SetChildIndex(this.butt_startservice, 0);
this.Controls.SetChildIndex(this.butt_getData, 0);
((System.ComponentModel.ISupportInitialize)(this.PicLabel)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
......@@ -382,6 +382,6 @@ namespace SmartScan
private Asa.FaceControl.FaceLabel LblAllCode;
private Asa.FaceControl.FaceLabel LblAllLabel;
private Asa.FaceControl.FaceLabel LblDateRange;
private Asa.FaceControl.FaceButton butt_startservice;
private Asa.FaceControl.FaceButton butt_getData;
}
}
\ No newline at end of file
......@@ -133,9 +133,9 @@ namespace SmartScan
{
DtpLower.Value = DateTime.Now.Date;
DtpUpper.Value = DateTime.Now.Date;
if (ConfigurationManager.AppSettings["CustomerName"] == "1181")
if (ConfigHelper.Config.Get("Func_EnableGetData",false))
{
butt_startservice.Visible=true;
butt_getData.Visible = true;
LstRecord.Height = 206;
}
}
......@@ -424,11 +424,11 @@ namespace SmartScan
private void butt_startservice_Click(object sender, EventArgs e)
{
Process p = new Process();
var pss = Process.GetProcessesByName(ConfigurationManager.AppSettings["StartServiceName"]);
var pss = Process.GetProcessesByName(ConfigHelper.Config.Get("GetDataAppName"));
if (pss.Length > 0)
return;
var f = ConfigurationManager.AppSettings["StartServicePath"];
var f = ConfigurationManager.AppSettings["GetDataAppPath"];
if (!File.Exists(f))
throw new Exception("未找到服务文件!");
p.StartInfo = new ProcessStartInfo
......
......@@ -291,6 +291,7 @@
<BtnSelect Text="Search" Font="Arial,12,," />
<BtnExport Text="Export" Font="Arial,12,," />
<BtnExportAll Text="Export All" Font="Arial,12,," />
<butt_getData Text="Get Data" Font="Arial,12,," />
<LblAllCode Text="Original" Font="Arial,12,," />
<LblAllLabel Text="Extracted Info." Font="Arial,12,," />
</FrmRetrospect>
......
......@@ -307,6 +307,7 @@
<BtnSelect Text="查询" Font="微软雅黑,12,," />
<BtnExport Text="导出" Font="微软雅黑,12,," />
<BtnExportAll Text="导出所有" Font="微软雅黑,12,," />
<butt_getData Text="获取数据" Font="微软雅黑,12,," />
<LblAllCode Text="物料条码" Font="微软雅黑,12,," />
<LblAllLabel Text="标签内容" Font="微软雅黑,12,," />
</FrmRetrospect>
......
......@@ -107,19 +107,17 @@ namespace SmartScan
Common.frmMain.Invoke(delegate ()
{
SetKey(hasMatch);
Common.frmMain.Invoke(delegate ()
{
if (workCodeKeyword.Any(a => a.Value.StartsWith("<OCR>")))
{
FrmDrawText frmDraw = new FrmDrawText();
if (frmDraw.ShowDialog() == DialogResult.OK)
{
//打印
BLLCommon.extension.Print(hasMatch,workCodeKeyword);
BLLCommon.extension.DrawTextBackground(workCodeKeyword);
//BLLCommon.extension.pri BLLCommon.extension.DrawTextBackground(workCodeKeyword);
}
}
});
});
isTouch = false;
......
......@@ -63,13 +63,11 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.Camera.VisionLib, Version=1.3.8479.24297, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\相机操作类\Camera\CameraVisionLibSetting\bin\Debug\Asa.Camera.VisionLib.dll</HintPath>
<Reference Include="Asa.Camera.VisionLib">
<HintPath>..\SharedDll\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.Face.Control, Version=1.0.8636.38287, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\asa\FaceControl\Test\bin\Debug\Asa.Face.Control.dll</HintPath>
<Reference Include="Asa.Face.Control">
<HintPath>..\SharedDll\Asa.Face.Control.dll</HintPath>
</Reference>
<Reference Include="ClosedXML, Version=0.96.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.0.96.0\lib\net46\ClosedXML.dll</HintPath>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!