Commit 70e21b44 张东亮

UI更新-逻辑还未同步

1 个父辈 8d153a0a
......@@ -113,10 +113,10 @@ namespace BLL
new Dictionary<string, object>()
{
{ "Name", "clbl_" + key},
{ "Font", "Arial,11,,"},
{ "Font", "Arial,9,,"},
{"BorderWidth", 0},
{"Width", 82},
{"Height", 42},
{"Width", 100},
{"Height", 40},
{"Text", key},
{"TextAlign", "MiddleRight"}
}
......@@ -132,9 +132,9 @@ namespace BLL
new Dictionary<string, object>()
{
{ "Name", "ctxt_"+key},
{ "Font", "Arial,11,,"},
{ "Font", "Arial,9,,"},
{ "Width", -1},
{ "Height",42},
{ "Height",40},
{ "ShowDel","False"},
{ "ShowQuery","False"},
{ "Text",""}
......@@ -151,10 +151,10 @@ namespace BLL
new Dictionary<string, object>()
{
{ "Name", "BtnGetReelID"},
{ "Font", "Arial,14,B,"},
{ "Font", "Arial,12,B,"},
//{"BorderWidth", 0},
{"Width", -1},
{"Height", 50},
{"Height", 40},
{"Text", "Get ReelID"},
}
......@@ -175,11 +175,11 @@ namespace BLL
new Dictionary<string, object>()
{
{ "Name", "BtnPrint"},
{ "Font", "Arial,14,B,"},
{ "Font", "Arial,12,B,"},
//{"BorderWidth", 0},
{"Width", -1},
{"Height", 50},
{"Text", Asa.FaceControl.Language.Dialog("PrintLabel","Print Label")},//"Print Label"
{"Height", 40},
{"Text", Asa.FaceControl.Language.Dialog("PrintLabel","Label Printing")},//"Print Label"
}
},
......
......@@ -670,12 +670,19 @@ namespace BLL
matchCount++;
//bool ismatch = true;
string str = MaterialAsciiCode.GetAsciiCode(codeMatch[i].SplitText);
string[] arr = codeText.Split(new string[] { str }, StringSplitOptions.RemoveEmptyEntries);
index = codeMatch[i].SplitPart - 1;
if (index >= arr.Length)
ismatch = false;
if(codeText.Contains(str))
{
string[] arr = codeText.Split(new string[] { str }, StringSplitOptions.RemoveEmptyEntries);
index = codeMatch[i].SplitPart - 1;
if (index >= arr.Length)
ismatch = false;
else
code = arr[index];
}
else
code = arr[index];
{
ismatch = false;
}
MatchAnalysis.AddMatch(codeMatch[i].Keyword, ismatch, codeMatch[i].CodeID, $"分割符:{codeMatch[i].SplitText},第:{codeMatch[i].SplitPart}位", $"NG");
//if (!ismatch) return null;
......
......@@ -17,5 +17,6 @@ namespace Model
public const string MATERIAL_TEMPLATE_RENAME = "MaterialTemplateRename";
public const string SAVE_SUCCEED = "SaveSucceed";
public const string REMIND_CLEARTEMPLATE = "RemindClearTemplate";
public const string REMIND_SELECTCODE = "RemindSelectCode";
}
}
......@@ -21,6 +21,7 @@ namespace SmartScan
public readonly Dictionary<FaceButton, UsrCodeExtractList> matchButton = new();
int windowHeight = 0;
MaterialCodeMatch matchShared = new MaterialCodeMatch();
public FrmCodeExtract(string codeText, int codeID,string codeType, List<MaterialCodeMatch> match)
{
InitializeComponent();
......@@ -29,6 +30,28 @@ namespace SmartScan
this.codeText = codeText.Replace("\n", "");
this.codeID = codeID;
this.codeType = codeType;
TxtMatchingEndText.Tag = "not";
TxtMatchingMiddleText.Tag = "not";
TxtMatchingStartText.Tag = "not";
Language.SetLanguage(this);
ChoMatchMiddleType.Items.Add(Language.Dialog("MatchType_max"));
ChoMatchMiddleType.Items.Add(Language.Dialog("MatchType_equals"));
ChoMatchMiddleType.Items.Add(Language.Dialog("MatchType_min"));
if(match.Count > 0)
{
matchShared = match[0];
}
ChkMatchingStart.Checked = matchShared.MatchStart;
TxtMatchingStartText.Text = matchShared.StartText;
ChkMatchingEnd.Checked = matchShared.MatchEnd;
TxtMatchingEndText.Text = matchShared.EndText;
ChkMatchingMiddle.Checked = matchShared.MatchMiddle;
TxtMatchingMiddleText.Text = matchShared.MiddleText;
NudMiddleTextCount.Value = matchShared.MiddleTextCount;
ChkCaseSensitivity.Checked = matchShared.CaseSensitive;
ChoMatchMiddleType.SelectedIndex = matchShared.MatchMiddleType + 1;
ChkCheckCodeType.Checked = matchShared.CheckCodeType;
LblCodeType.Text = codeType;
for (int i = 0; i < match.Count; i++)
AddMatch(match[i]);
......@@ -52,6 +75,7 @@ namespace SmartScan
UsrCodeExtractList list = new(codeText,codeType, codeText.Length, match);
list.DelClick += List_DelClick;
list.AddClick += List_AddClick;
list.KeyChanged += List_KeyChanged;
matchButton.Add(btn, list);
......@@ -66,23 +90,29 @@ namespace SmartScan
clacWindowHeight();
}
private void List_AddClick(object sender, EventArgs e)
{
BtnAddMatch_Click(sender, e);
}
void clacWindowHeight() {
if (flowLayoutPanel1.Controls.Count > 14)
{
matchButton.Values.ToList().ForEach((x)=> {x.GetPanel().Top = 184 + 56 * 2; });
matchButton.Values.ToList().ForEach((x)=> {x.GetPanel().Top = 418 + 56 * 2; });//184
flowLayoutPanel1.Height = 56 * 3;
this.Height = windowHeight + 56 * 2 - 4;
}
else if (flowLayoutPanel1.Controls.Count > 7)
{
matchButton.Values.ToList().ForEach((x) => { x.GetPanel().Top = 184 + 56 * 1; });
matchButton.Values.ToList().ForEach((x) => { x.GetPanel().Top = 418 + 56 * 1; });
flowLayoutPanel1.Height = 56 * 2 - 4;
this.Height = windowHeight + 56;
}
else
{
matchButton.Values.ToList().ForEach((x) => { x.GetPanel().Top = 184; });
matchButton.Values.ToList().ForEach((x) => { x.GetPanel().Top = 418; });
flowLayoutPanel1.Height = 56 - 4;
this.Height = windowHeight;
}
......
......@@ -364,7 +364,10 @@ namespace SmartScan
private void BtnSet_Click(object sender, EventArgs e)
{
monitor.Pause = true;
new FrmSet().ShowDialog();
FrmSet set =new FrmSet();
set.Width=PicShow.Width;
set.Height=PicShow.Height;
set.ShowDialog();
monitor.Pause = false;
}
......
......@@ -29,8 +29,7 @@ namespace SmartScan
/// </summary>
private void InitializeComponent()
{
this.BtnWorkMode = new Asa.FaceControl.FaceButton();
this.BtnIdentify = new Asa.FaceControl.FaceButton();
this.BtnGenneralSetting = new Asa.FaceControl.FaceButton();
this.BtnLabel = new Asa.FaceControl.FaceButton();
this.BtnMaterial = new Asa.FaceControl.FaceButton();
this.BtnKeyword = new Asa.FaceControl.FaceButton();
......@@ -41,35 +40,20 @@ namespace SmartScan
this.BtnDataSource = new Asa.FaceControl.FaceButton();
this.SuspendLayout();
//
// BtnWorkMode
//
this.BtnWorkMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnWorkMode.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnWorkMode.BorderWidth = 2;
this.BtnWorkMode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnWorkMode.HoldPress = false;
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.TabIndex = 3;
this.BtnWorkMode.Text = "Work";
this.BtnWorkMode.Click += new System.EventHandler(this.BtnMenu_Click);
//
// BtnIdentify
//
this.BtnIdentify.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnIdentify.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.BtnIdentify.BorderWidth = 2;
this.BtnIdentify.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnIdentify.HoldPress = false;
this.BtnIdentify.Location = new System.Drawing.Point(11, 111);
this.BtnIdentify.Name = "BtnIdentify";
this.BtnIdentify.Padding = new System.Windows.Forms.Padding(3);
this.BtnIdentify.Size = new System.Drawing.Size(160, 50);
this.BtnIdentify.TabIndex = 4;
this.BtnIdentify.Text = "Identify";
this.BtnIdentify.Click += new System.EventHandler(this.BtnMenu_Click);
// BtnGenneralSetting
//
this.BtnGenneralSetting.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.BtnGenneralSetting.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
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.Name = "BtnGenneralSetting";
this.BtnGenneralSetting.Padding = new System.Windows.Forms.Padding(3);
this.BtnGenneralSetting.Size = new System.Drawing.Size(160, 50);
this.BtnGenneralSetting.TabIndex = 3;
this.BtnGenneralSetting.Text = "GeneralSetting";
this.BtnGenneralSetting.Click += new System.EventHandler(this.BtnMenu_Click);
//
// BtnLabel
//
......@@ -93,7 +77,7 @@ 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, 223);
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);
......@@ -108,7 +92,7 @@ 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, 279);
this.BtnKeyword.Location = new System.Drawing.Point(11, 55);
this.BtnKeyword.Name = "BtnKeyword";
this.BtnKeyword.Padding = new System.Windows.Forms.Padding(3);
this.BtnKeyword.Size = new System.Drawing.Size(160, 50);
......@@ -124,7 +108,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(641, 717);
this.BtnOK.Name = "BtnOK";
this.BtnOK.Padding = new System.Windows.Forms.Padding(3);
this.BtnOK.Size = new System.Drawing.Size(120, 40);
......@@ -140,7 +124,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(767, 717);
this.BtnCancel.Name = "BtnCancel";
this.BtnCancel.Padding = new System.Windows.Forms.Padding(3);
this.BtnCancel.Size = new System.Drawing.Size(120, 40);
......@@ -160,7 +144,7 @@ namespace SmartScan
this.PnlTemp.Location = new System.Drawing.Point(177, 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(836, 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)));
......@@ -174,7 +158,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(893, 717);
this.BtnApply.Name = "BtnApply";
this.BtnApply.Padding = new System.Windows.Forms.Padding(3);
this.BtnApply.Size = new System.Drawing.Size(120, 40);
......@@ -189,18 +173,18 @@ 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, 335);
this.BtnDataSource.Location = new System.Drawing.Point(11, 223);
this.BtnDataSource.Name = "BtnDataSource";
this.BtnDataSource.Padding = new System.Windows.Forms.Padding(3);
this.BtnDataSource.Size = new System.Drawing.Size(160, 50);
this.BtnDataSource.TabIndex = 7;
this.BtnDataSource.Text = "数据源";
this.BtnDataSource.Text = "Datasource";
this.BtnDataSource.Click += new System.EventHandler(this.BtnMenu_Click);
//
// FrmSet
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1274, 878);
this.ClientSize = new System.Drawing.Size(1024, 768);
this.Controls.Add(this.BtnApply);
this.Controls.Add(this.PnlTemp);
this.Controls.Add(this.BtnCancel);
......@@ -209,15 +193,13 @@ namespace SmartScan
this.Controls.Add(this.BtnKeyword);
this.Controls.Add(this.BtnMaterial);
this.Controls.Add(this.BtnLabel);
this.Controls.Add(this.BtnIdentify);
this.Controls.Add(this.BtnWorkMode);
this.Controls.Add(this.BtnGenneralSetting);
this.Icon = global::SmartScan.Properties.Resources.NEO_64;
this.Name = "FrmSet";
this.ShowIcon = false;
this.Text = "FrmSet";
this.Load += new System.EventHandler(this.FrmSet_Load);
this.Controls.SetChildIndex(this.BtnWorkMode, 0);
this.Controls.SetChildIndex(this.BtnIdentify, 0);
this.Controls.SetChildIndex(this.BtnGenneralSetting, 0);
this.Controls.SetChildIndex(this.BtnLabel, 0);
this.Controls.SetChildIndex(this.BtnMaterial, 0);
this.Controls.SetChildIndex(this.BtnKeyword, 0);
......@@ -232,8 +214,7 @@ namespace SmartScan
#endregion
private Asa.FaceControl.FaceButton BtnWorkMode;
private Asa.FaceControl.FaceButton BtnIdentify;
private Asa.FaceControl.FaceButton BtnGenneralSetting;
private Asa.FaceControl.FaceButton BtnLabel;
private Asa.FaceControl.FaceButton BtnMaterial;
private Asa.FaceControl.FaceButton BtnKeyword;
......
......@@ -21,12 +21,14 @@ namespace SmartScan
}
private void FrmSet_Load(object sender, EventArgs e)
{
menu.Add(BtnWorkMode, new UsrWorkMode());
menu.Add(BtnIdentify, new UsrCamera());
menu.Add(BtnLabel, new UsrPrintTemplate());
menu.Add(BtnMaterial, new UsrMaterialTemplate());
menu.Add(BtnKeyword, new UsrMacro());
menu.Add(BtnMaterial, new UsrMaterialTemplate());
menu.Add(BtnLabel, new UsrPrintTemplate());
menu.Add(BtnDataSource, new UsrDataSource());
menu.Add(BtnGenneralSetting, new UsrWorkMode());
// menu.Add(BtnIdentify, new UsrCamera());
foreach (FaceButton button in menu.Keys)
{
......@@ -40,8 +42,8 @@ namespace SmartScan
Controls.Add(pnl);
}
BtnWorkMode.HoldPress = true;
menu[BtnWorkMode].GetPanel().Visible = true;
BtnKeyword.HoldPress = true;
menu[BtnKeyword].GetPanel().Visible = true;
}
private void BtnMenu_Click(object sender, EventArgs e)
......
using Asa.FaceControl;
using BLL;
using Model;
using System;
using System.Windows.Forms;
......@@ -11,6 +12,7 @@ namespace SmartScan
private readonly string codeText;
private readonly string codeType;
public event EventHandler DelClick;
public event EventHandler AddClick;
public event KeyChangedHandler KeyChanged;
public delegate void KeyChangedHandler(object sender, string key);
......@@ -18,15 +20,9 @@ namespace SmartScan
{
InitializeComponent();
faceTextBox1.Tag = "not";
TxtMatchingEndText.Tag = "not";
TxtMatchingMiddleText.Tag = "not";
TxtMatchingStartText.Tag = "not";
Language.SetLanguage(this);
changed = true;
ChoMatchMiddleType.Items.Add(Language.Dialog("MatchType_max"));
ChoMatchMiddleType.Items.Add(Language.Dialog("MatchType_equals"));
ChoMatchMiddleType.Items.Add(Language.Dialog("MatchType_min"));
changed = true;
Language.SetLanguage(this);
this.codeText = codeText;
......@@ -35,17 +31,11 @@ namespace SmartScan
CboMatchingSplit.Items.AddRange(BLLCommon.CODE_SPLIT);
NudStart.Maximum = codeLength;
NudLength.Maximum = codeLength;
ChkMatchingStart.Checked = match.MatchStart;
TxtMatchingStartText.Text = match.StartText;
ChkMatchingEnd.Checked = match.MatchEnd;
TxtMatchingEndText.Text = match.EndText;
ChkMatchingMiddle.Checked = match.MatchMiddle;
TxtMatchingMiddleText.Text = match.MiddleText;
NudMiddleTextCount.Value = match.MiddleTextCount;
ChkMatchingSplit.Checked = match.MatchSplit;
CboMatchingSplit.Text = match.SplitText;
NudSplitPart.Value = match.SplitPart;
ChkCaseSensitivity.Checked = match.CaseSensitive;
ChkMinLength.Checked = match.MatchMinLength;
NudMinLength.Value = match.MinLength;
ChkMaxLength.Checked = match.MatchMaxLength;
......@@ -54,11 +44,9 @@ namespace SmartScan
CboKeyword.SelectedText = match.Keyword;
NudStart.Value = match.SubstringStart;
match.CodeType = codeType;
ChoMatchMiddleType.SelectedIndex = match.MatchMiddleType+1;
ChkMatchisnumber.Checked = match.MatchISNumber;
ChkCheckCodeType.Checked = match.CheckCodeType;
LblCodeType.Text = codeType;
if (match.SubstringLength == -1)
{
ChkLengthEnd.Checked = true;
......@@ -80,17 +68,17 @@ namespace SmartScan
{
Model.MaterialCodeMatch match = new()
{
MatchStart = ChkMatchingStart.Checked,
StartText = TxtMatchingStartText.Text,
MatchEnd = ChkMatchingEnd.Checked,
EndText = TxtMatchingEndText.Text,
MatchMiddle = ChkMatchingMiddle.Checked,
MiddleText = TxtMatchingMiddleText.Text,
MiddleTextCount = Convert.ToInt32(NudMiddleTextCount.Value),
//MatchStart = ChkMatchingStart.Checked,
//StartText = TxtMatchingStartText.Text,
//MatchEnd = ChkMatchingEnd.Checked,
//EndText = TxtMatchingEndText.Text,
//MatchMiddle = ChkMatchingMiddle.Checked,
//MiddleText = TxtMatchingMiddleText.Text,
//MiddleTextCount = Convert.ToInt32(NudMiddleTextCount.Value),
MatchSplit = ChkMatchingSplit.Checked,
SplitText = CboMatchingSplit.Text,
SplitPart = Convert.ToInt32(NudSplitPart.Value),
CaseSensitive = ChkCaseSensitivity.Checked,
//CaseSensitive = ChkCaseSensitivity.Checked,
MatchMinLength = ChkMinLength.Checked,
MinLength = Convert.ToInt32(NudMinLength.Value),
MatchMaxLength = ChkMaxLength.Checked,
......@@ -98,9 +86,9 @@ namespace SmartScan
Keyword = CboKeyword.SelectedText,
SubstringStart = Convert.ToInt32(NudStart.Value),
SubstringLength = ChkLengthEnd.Checked ? -1 : Convert.ToInt32(NudLength.Value),
CheckCodeType = ChkCheckCodeType.Checked,
CodeType = LblCodeType.Text,
MatchMiddleType = ChoMatchMiddleType.SelectedIndex - 1,
//CheckCodeType = ChkCheckCodeType.Checked,
// CodeType = LblCodeType.Text,
// MatchMiddleType = ChoMatchMiddleType.SelectedIndex - 1,
MatchISNumber = ChkMatchisnumber.Checked
};
return match;
......@@ -119,28 +107,28 @@ namespace SmartScan
if (changed) return;
string text = codeText;
if (ChkMatchingMiddle.Checked) {
int textcount=1;
int.TryParse(NudMiddleTextCount.Text, out textcount);
var t = ChoMatchMiddleType.SelectedIndex - 1;
int index = 0;
int count = 0;
while ((index = text.IndexOf(TxtMatchingMiddleText.Text, index)) != -1 && !string.IsNullOrEmpty(TxtMatchingMiddleText.Text))
{
count++;
index += TxtMatchingMiddleText.Text.Length;
}
if (t == -1 && count > textcount)
text = "";
if (t == 0 && count != textcount)
text = "";
if (t == 1 && count < textcount)
text = "";
faceTextBox1.Text = text;
if (string.IsNullOrEmpty(text))
return;
}
//if (ChkMatchingMiddle.Checked) {
// int textcount=1;
// int.TryParse(NudMiddleTextCount.Text, out textcount);
// var t = ChoMatchMiddleType.SelectedIndex - 1;
// int index = 0;
// int count = 0;
// while ((index = text.IndexOf(TxtMatchingMiddleText.Text, index)) != -1 && !string.IsNullOrEmpty(TxtMatchingMiddleText.Text))
// {
// count++;
// index += TxtMatchingMiddleText.Text.Length;
// }
// if (t == -1 && count > textcount)
// text = "";
// if (t == 0 && count != textcount)
// text = "";
// if (t == 1 && count < textcount)
// text = "";
// faceTextBox1.Text = text;
// if (string.IsNullOrEmpty(text))
// return;
//}
if (ChkMatchingSplit.Checked)
{
......@@ -257,5 +245,10 @@ namespace SmartScan
if (e.KeyCode == Keys.Enter)
e.Handled = false;
}
private void BtnAdd_Click(object sender, EventArgs e)
{
AddClick?.Invoke(this, new EventArgs());
}
}
}
......@@ -18,7 +18,7 @@ namespace SmartScan
public UsrMaterialTemplate()
{
InitializeComponent();
//BtnOcrCode.Enabled = Config.Func_EnabledOCR;
BtnOcrCode.Visible = Config.Func_EnabledOCR;
LstMate.Items.AddRange(BLLCommon.mateEdit.Name);
mateCopy = BLLCommon.mateEdit.ToCopy();
Language.SetLanguage(this);
......@@ -68,16 +68,16 @@ namespace SmartScan
text = text.Replace("\n", "");
//主键
string s = string.Format("({0}) ", index + 1) + text;
string s = string.Format("({0}) ", index + 1);
if (code.ID == mateCopy[mateIndex].PrimaryCode)
s += " <P>";
s += "<P> ";
//条码的关键字
List<string> arr = new();
if (mateCopy[mateIndex].Code[index].CodeType.Equals(Setting_Str.OCR))
{
s += " <OCR>";
s += "<OCR> ";
}
s += text;
arr = new();
for (int i = 0; i < mateCopy[mateIndex].Match.Count; i++)
{
......@@ -309,7 +309,12 @@ namespace SmartScan
private void BtnExtractCode_Click(object sender, EventArgs e)
{
if (codeIndex == -1) return;
if (codeIndex == -1)
{
string text = Language.Dialog(LanguageDialogKey.REMIND_SELECTCODE,"请选择一个条码!");
new FaceMessageBox("", text, MessageBoxButtons.OK).ShowDialog();
return;
}
MaterialCode code = mateCopy[mateIndex].Code[codeIndex];
List<MaterialCodeMatch> match = mateCopy[mateIndex].Match.FindAll(s => s.CodeID == code.ID);
......@@ -419,5 +424,27 @@ namespace SmartScan
{
codeIndex = LstCode.SelectedIndex;
}
private void BtnSaveImage_Click(object sender, EventArgs e)
{
if (bmp == null) return;
SaveFileDialog dlg = new() { Filter = "JPEG图片|*.jpg|BMP图片|*.bmp|PNG图片|*.png" };
if (dlg.ShowDialog() != DialogResult.OK) return;
switch (dlg.FilterIndex)
{
case 0: bmp.Save(dlg.FileName, System.Drawing.Imaging.ImageFormat.Jpeg); break;
case 1: bmp.Save(dlg.FileName, System.Drawing.Imaging.ImageFormat.Bmp); break;
case 2: bmp.Save(dlg.FileName, System.Drawing.Imaging.ImageFormat.Png); break;
}
string text = Asa.FaceControl.Language.Dialog(LanguageDialogKey.SAVE_SUCCEED);
new Asa.FaceControl.FaceMessageBox("", text, MessageBoxButtons.OK).ShowDialog();
}
private void BtnTemplateValite_Click(object sender, EventArgs e)
{
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!