Commit 70e21b44 张东亮

UI更新-逻辑还未同步

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