Commit 37eab955 贾鹏旭

tmp

1 个父辈 8e47d0b4
...@@ -244,7 +244,10 @@ namespace BLL ...@@ -244,7 +244,10 @@ namespace BLL
{ {
return currentExtension.SetKey(originalCode, key, hasMatch, out errmsg); return currentExtension.SetKey(originalCode, key, hasMatch, out errmsg);
} }
public void Print()
{
//currentExtension.Printing
}
public void DrawTextBackground(Dictionary<string, string> key) public void DrawTextBackground(Dictionary<string, string> key)
{ {
currentExtension.DrawTextBackground(key); currentExtension.DrawTextBackground(key);
......
...@@ -147,18 +147,19 @@ namespace BLL ...@@ -147,18 +147,19 @@ namespace BLL
return false; return false;
Application.DoEvents(); Application.DoEvents();
if (extensions != null && !extensions[0].Control.InvokeRequired)
{ //if (extensions != null && !extensions[0].Control.InvokeRequired)
if (config.AutoPrint && hasMatch) //{
{ // if ( && hasMatch)
//if (CanPrint()) // {
PrintLabel(null, EventArgs.Empty); // //if (CanPrint())
} // PrintLabel(null, EventArgs.Empty);
} // }
else //}
{ //else
//PrintLabel(null, EventArgs.Empty); //{
} // //PrintLabel(null, EventArgs.Empty);
//}
SaveRetrospect?.Invoke(key); SaveRetrospect?.Invoke(key);
return true; return true;
} }
...@@ -248,7 +249,7 @@ namespace BLL ...@@ -248,7 +249,7 @@ namespace BLL
try try
{ {
var reelidfile = FilePath.CONFIG_REELID; var reelidfile = FilePath.CONFIG_REELID;
if (Config.REEL_ID_AutoResetStrategy==1) if (Config.REEL_ID_AutoResetStrategy == 1)
{ {
Directory.CreateDirectory(reelidfile + "_dir"); Directory.CreateDirectory(reelidfile + "_dir");
reelidfile = Path.Combine(FilePath.CONFIG_REELID + "_dir", DateTime.Now.ToString("yyyyMMdd")); reelidfile = Path.Combine(FilePath.CONFIG_REELID + "_dir", DateTime.Now.ToString("yyyyMMdd"));
...@@ -285,8 +286,9 @@ namespace BLL ...@@ -285,8 +286,9 @@ namespace BLL
{ {
updatereelid(lastkey, out _); updatereelid(lastkey, out _);
} }
private void PrintLabel(object sender, EventArgs e) public void PrintLabel(object sender, EventArgs e)
{ {
if (!config.AutoPrint) return;
LogNet.log.Debug("Enter PrintLabel Method"); LogNet.log.Debug("Enter PrintLabel Method");
if (lastkey == null) return; if (lastkey == null) return;
//Dictionary<string, string> key = new(); //Dictionary<string, string> key = new();
...@@ -368,7 +370,7 @@ namespace BLL ...@@ -368,7 +370,7 @@ namespace BLL
// 定义动态按钮点击事件处理方法 // 定义动态按钮点击事件处理方法
private void DynamicButtonClick(object sender, EventArgs e) private void DynamicButtonClick(object sender, EventArgs e)
{ {
var listexten= extensions.Where(a => a.Type == "TextBox").ToDictionary(kvp => kvp.Key, kvp => kvp.Control.Text); var listexten = extensions.Where(a => a.Type == "TextBox").ToDictionary(kvp => kvp.Key, kvp => kvp.Control.Text);
string jsondata = Replacekeywordss(listexten); string jsondata = Replacekeywordss(listexten);
ResponseDatas lists = JsonConvert.DeserializeObject<ResponseDatas>(jsondata); ResponseDatas lists = JsonConvert.DeserializeObject<ResponseDatas>(jsondata);
foreach (var responseItems in lists.Items) foreach (var responseItems in lists.Items)
......
...@@ -74,7 +74,8 @@ namespace SmartScan ...@@ -74,7 +74,8 @@ namespace SmartScan
if (!isRun) return; if (!isRun) return;
if (isTouch) return; if (isTouch) return;
isTouch = true; isTouch = true;
btnMatchedName.Invoke(delegate() { btnMatchedName.Invoke(delegate ()
{
if (!BLL.Config.Backgrounder) if (!BLL.Config.Backgrounder)
btnMatchedName.Visible = false; btnMatchedName.Visible = false;
BLLCommon.extension.Clear(); BLLCommon.extension.Clear();
...@@ -106,6 +107,17 @@ namespace SmartScan ...@@ -106,6 +107,17 @@ namespace SmartScan
Common.frmMain.Invoke(delegate () Common.frmMain.Invoke(delegate ()
{ {
SetKey(hasMatch); 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.pri BLLCommon.extension.DrawTextBackground(workCodeKeyword);
}
}
});
}); });
isTouch = false; isTouch = false;
...@@ -116,7 +128,8 @@ namespace SmartScan ...@@ -116,7 +128,8 @@ namespace SmartScan
{ {
LogNet.log.Error("Scan", ex); LogNet.log.Error("Scan", ex);
} }
finally { finally
{
isTouch = false; isTouch = false;
Common.frmMain.CloseWaittingDialog(); Common.frmMain.CloseWaittingDialog();
} }
...@@ -236,7 +249,7 @@ namespace SmartScan ...@@ -236,7 +249,7 @@ namespace SmartScan
else else
{ {
string filename = ""; string filename = "";
Common.frmMain.Invoke(delegate() Common.frmMain.Invoke(delegate ()
{ {
OpenFileDialog dlg = new() { Filter = "图片文件|*.jpg;*.png;*.bmp;*.jpeg" }; OpenFileDialog dlg = new() { Filter = "图片文件|*.jpg;*.png;*.bmp;*.jpeg" };
DialogResult dr = dlg.ShowDialog(); DialogResult dr = dlg.ShowDialog();
...@@ -286,19 +299,9 @@ namespace SmartScan ...@@ -286,19 +299,9 @@ namespace SmartScan
if (workCodeInfo.Count == 0) return false; if (workCodeInfo.Count == 0) return false;
originalCodeText = BLLCommon.cameraVision.GetBarCodeText(workCodeInfo); originalCodeText = BLLCommon.cameraVision.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 originalCodeIsUsed);
BLL.MatchAnalysis.ShowResult(); BLL.MatchAnalysis.ShowResult();
Common.frmMain.Invoke(delegate ()
{
if (workCodeKeyword.Any(a => a.Value.StartsWith("<OCR>")))
{
FrmDrawText frmDraw = new FrmDrawText();
if (frmDraw.ShowDialog() == DialogResult.OK)
{
BLLCommon.extension.DrawTextBackground(workCodeKeyword);
}
}
});
Common.frmMain.Invoke(delegate () Common.frmMain.Invoke(delegate ()
{ {
if (rtn) if (rtn)
...@@ -327,8 +330,8 @@ namespace SmartScan ...@@ -327,8 +330,8 @@ namespace SmartScan
private void SetKey(bool hasMatch) private void SetKey(bool hasMatch)
{ {
LogNet.log.Info("Work SetKey hasMatch:"+ hasMatch); LogNet.log.Info("Work SetKey hasMatch:" + hasMatch);
BLLCommon.extension.SetKey(originalCodeText, workCodeKeyword, hasMatch,out _); BLLCommon.extension.SetKey(originalCodeText, workCodeKeyword, hasMatch, out _);
if (workCodeKeyword.Count == 0) return; if (workCodeKeyword.Count == 0) return;
if (BLLCommon.config.PromptAfterPrinting && !BLL.Config.Backgrounder) if (BLLCommon.config.PromptAfterPrinting && !BLL.Config.Backgrounder)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!