Commit 37eab955 贾鹏旭

tmp

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