Commit c4bb2802 刘韬

1

1 个父辈 bc2b9197
...@@ -208,7 +208,11 @@ namespace BLL ...@@ -208,7 +208,11 @@ namespace BLL
get => config.Read<int>(EXTENSION_WIDTH); get => config.Read<int>(EXTENSION_WIDTH);
set => config.Write(EXTENSION_WIDTH, value); set => config.Write(EXTENSION_WIDTH, value);
} }
public string ReelIDKeyWord
{
get => config.Read<string>(REEL_ID_KEYWORD);
set => config.Write(REEL_ID_KEYWORD, value);
}
public string ReelIDMatch public string ReelIDMatch
{ {
get => config.Read<string>(REEL_ID_MATCH); get => config.Read<string>(REEL_ID_MATCH);
...@@ -319,6 +323,7 @@ namespace BLL ...@@ -319,6 +323,7 @@ namespace BLL
private const string IO_TOUCH = "IOTouch"; private const string IO_TOUCH = "IOTouch";
private const string IO_LIGHT = "IOLight"; private const string IO_LIGHT = "IOLight";
private const string EXTENSION_WIDTH = "ExtensionWidth"; private const string EXTENSION_WIDTH = "ExtensionWidth";
private const string REEL_ID_KEYWORD = "ReelIDKeyWord";
private const string REEL_ID_MATCH = "ReelIDMatch"; private const string REEL_ID_MATCH = "ReelIDMatch";
private const string REEL_ID_PLACES = "ReelIDPlaces"; private const string REEL_ID_PLACES = "ReelIDPlaces";
private const string REEL_ID_FILL_ZERO = "ReelIDFillZero"; private const string REEL_ID_FILL_ZERO = "ReelIDFillZero";
......
...@@ -92,20 +92,88 @@ namespace BLL ...@@ -92,20 +92,88 @@ namespace BLL
panel = pnl; panel = pnl;
pnlWidth = pnl.Width; pnlWidth = pnl.Width;
startPoint = new(6, panel.TextHeight + 6); startPoint = new(6, panel.TextHeight + 6);
string json = ""; object[] rows;
if (!System.IO.File.Exists(FilePath.CONFIG_EXTENSION)) { if (!System.IO.File.Exists(FilePath.CONFIG_EXTENSION))
json = "123"; {
List<object[]> listrow = new List<object[]>();
foreach (var key in keywords)
{
Dictionary<string, object> L = new()
{
{ "Type", "Label" },
{
"Attribute",
new Dictionary<string, object>()
{
{ "Name", "clbl_" + key},
{ "Font", "Arial,11,,"},
{"BorderWidth", 0},
{"Width", 82},
{"Height", 42},
{"Text", key},
{"TextAlign", "MiddleRight"}
}
},
};
Dictionary<string, object> R = new() {
{ "Type", "TextBox" },
{ "Key", key },
{ "LinkName", key },
{ "CanClear", "True" },
{
"Attribute",
new Dictionary<string, object>()
{
{ "Name", "ctxt_"+key},
{ "Font", "Arial,11,,"},
{ "Width", -1},
{ "Height",42},
{ "ShowDel","False"},
{ "ShowQuery","False"},
{ "Text",""}
}
}
};
listrow.Add(new object[] { L, R });
}
Dictionary<string, object> B = new()
{
{ "Type", "Button" },
{
"Attribute",
new Dictionary<string, object>()
{
{ "Name", "BtnPrint"},
{ "Font", "Arial,14,B,"},
//{"BorderWidth", 0},
{"Width", -1},
{"Height", 50},
{"Text", "Print Label"},
}
},
{
"Event",
new Dictionary<string, object>()
{
{ "Click", "PrintLabel"}
}
}
};
listrow.Add(new object[] { B });
rows = listrow.ToArray();
} }
else else
{ {
json = System.IO.File.ReadAllText(FilePath.CONFIG_EXTENSION); string json = System.IO.File.ReadAllText(FilePath.CONFIG_EXTENSION);
JavaScriptSerializer serializer = new();
rows = (object[])serializer.DeserializeObject(json);
} }
JavaScriptSerializer serializer = new(); ctlY = startPoint.Y;
object[] rows = (object[])serializer.DeserializeObject(json);
ctlY = startPoint.Y;
for (int i = 0; i < rows.Length; i++) for (int i = 0; i < rows.Length; i++)
LoadRow(rows[i]); LoadRow(rows[i]);
currentExtension.Load(ctlGroup); currentExtension.Load(ctlGroup);
} }
...@@ -114,9 +182,9 @@ namespace BLL ...@@ -114,9 +182,9 @@ namespace BLL
currentExtension.Clear(); currentExtension.Clear();
} }
public void SetKey(string[] originalCode, Dictionary<string, string> key) public void SetKey(string[] originalCode, Dictionary<string, string> key,bool hasMatch)
{ {
currentExtension.SetKey(originalCode, key); currentExtension.SetKey(originalCode, key, hasMatch);
} }
public void Update() public void Update()
......
...@@ -72,7 +72,7 @@ namespace BLL ...@@ -72,7 +72,7 @@ namespace BLL
Update(); Update();
} }
public void SetKey(string[] originalCode, Dictionary<string, string> key) public void SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch)
{ {
LogNet.log.Info("SetKey()"); LogNet.log.Info("SetKey()");
for (int i = 0; i < extensions.Count; i++) for (int i = 0; i < extensions.Count; i++)
...@@ -81,7 +81,7 @@ namespace BLL ...@@ -81,7 +81,7 @@ namespace BLL
extensions[i].Control.Text = key[extensions[i].Key]; extensions[i].Control.Text = key[extensions[i].Key];
} }
int index = extensions.FindIndex(match => match.Control.Name == "TxtSupplierPN"); int index = extensions.FindIndex(match => match.Control.Name == "ctxt_PN");
if (index > -1) PNPress(extensions[index].Control, EventArgs.Empty); if (index > -1) PNPress(extensions[index].Control, EventArgs.Empty);
} }
...@@ -327,6 +327,7 @@ namespace BLL ...@@ -327,6 +327,7 @@ namespace BLL
extensions[i].Control.Text = text; extensions[i].Control.Text = text;
break; break;
} }
} }
int idx = extensions.FindIndex(match => match.Control.Name == "BtnPrint"); int idx = extensions.FindIndex(match => match.Control.Name == "BtnPrint");
......
...@@ -51,18 +51,18 @@ namespace BLL ...@@ -51,18 +51,18 @@ namespace BLL
ReadReelID(); ReadReelID();
} }
static bool mesResult = false; static bool mesResult = false;
public void SetKey(string[] originalCode, Dictionary<string, string> key) public void SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch)
{ {
mesResult = false; mesResult = false;
SaveAddReelID(); SaveAddReelID();
var now = DateTime.Now; var now = DateTime.Now;
var Reelidstr = $"DP{now:yy}{reelID:000000000}"; var Reelidstr =GetReelid();
if (key.ContainsKey("Reelid")) if (key.ContainsKey(config.ReelIDKeyWord))
{ {
key["Reelid"] = Reelidstr; key[config.ReelIDKeyWord] = Reelidstr;
} }
else else
key.Add("Reelid", Reelidstr); key.Add(config.ReelIDKeyWord, Reelidstr);
...@@ -75,19 +75,17 @@ namespace BLL ...@@ -75,19 +75,17 @@ namespace BLL
Application.DoEvents(); Application.DoEvents();
mesResult = GetMESInfo(key); //mesResult = GetMESInfo(key);
//for (int i = 0; i < extensions.Count; i++)
//{
for (int i = 0; i < extensions.Count; i++) // if (key.ContainsKey(extensions[i].Key))
{ // extensions[i].Control.Text = key[extensions[i].Key];
if (key.ContainsKey(extensions[i].Key)) //}
extensions[i].Control.Text = key[extensions[i].Key]; //if (!mesResult)
} //{
if (!mesResult) // return;
{ //}
return; if (config.AutoPrint && hasMatch)
}
if (config.AutoPrint)
{ {
//if (CanPrint()) //if (CanPrint())
PrintLabel(null, EventArgs.Empty); PrintLabel(null, EventArgs.Empty);
...@@ -98,7 +96,40 @@ namespace BLL ...@@ -98,7 +96,40 @@ namespace BLL
{ {
} }
private string GetReelid()
{
LogNet.log.Debug("Enter GetReelid Method");
int idIndex = extensions.FindIndex(match => match.Key == config.ReelIDKeyWord);
if (idIndex == -1) return "";
//读取参数
string matchID = config.ReelIDMatch;
int matchPlace = config.ReelIDPlaces;
bool matchFill = config.ReelIDFillZero;
string matchPrefix = config.ReelIDPrefix;
string matchPostfix = config.ReelIDPostfix;
//把key替换成实际值
string[] keys = ObjConversion.StrGetKey(matchID);
for (int i = 0; i < keys.Length; i++)
{
int index = extensions.FindIndex(match => match.Key == keys[i]);
if (index == -1) continue;
string oldValue = string.Format("[{0}]", keys[i]);
matchID = matchID.Replace(oldValue, extensions[index].Control.Text);
}
SaveAddReelID();
//填充0
string text = matchPrefix;
if (matchFill)
text += string.Format("{0:d" + matchPlace + "}", reelID);
else
text += reelID.ToString();
text += matchPostfix;
return text;
}
private bool CanPrint() private bool CanPrint()
...@@ -168,22 +199,6 @@ namespace BLL ...@@ -168,22 +199,6 @@ namespace BLL
key.Add(extensions[i].Key, extensions[i].Control.Text); key.Add(extensions[i].Key, extensions[i].Control.Text);
} }
if (!mesResult)
{
LogNet.log.Debug("Enter PrintLabel Check mesResult");
mesResult = GetMESInfo(key);
for (int i = 0; i < extensions.Count; i++)
{
if (key.ContainsKey(extensions[i].Key))
extensions[i].Control.Text = key[extensions[i].Key];
}
if (!mesResult)
{
return;
}
}
var keys =new List<string>(key.Keys); var keys =new List<string>(key.Keys);
foreach (var kk in keys) foreach (var kk in keys)
......
...@@ -62,7 +62,7 @@ namespace BLL ...@@ -62,7 +62,7 @@ namespace BLL
} }
} }
public void SetKey(string[] originalCode, Dictionary<string, string> key) public void SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch)
{ {
for (int i = 0; i < extensions.Count; i++) for (int i = 0; i < extensions.Count; i++)
{ {
......
...@@ -51,7 +51,7 @@ namespace BLL ...@@ -51,7 +51,7 @@ namespace BLL
ReadReelID(); ReadReelID();
} }
static bool mesResult = false; static bool mesResult = false;
public void SetKey(string[] originalCode, Dictionary<string, string> key) public void SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch)
{ {
mesResult = false; mesResult = false;
SaveAddReelID(); SaveAddReelID();
......
...@@ -44,7 +44,7 @@ namespace BLL ...@@ -44,7 +44,7 @@ namespace BLL
//mesConn = Http.Ping(mesIP); //mesConn = Http.Ping(mesIP);
} }
public void SetKey(string[] originalCode, Dictionary<string, string> key) public void SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch)
{ {
//SetComboItem("CboSupplier", originalCode); //SetComboItem("CboSupplier", originalCode);
//SetComboItem("CboQuantity", originalCode); //SetComboItem("CboQuantity", originalCode);
......
...@@ -77,7 +77,7 @@ namespace BLL ...@@ -77,7 +77,7 @@ namespace BLL
} }
} }
public void SetKey(string[] originalCode, Dictionary<string, string> key) public void SetKey(string[] originalCode, Dictionary<string, string> key, bool hasMatch)
{ {
for (int i = 0; i < extensions.Count; i++) for (int i = 0; i < extensions.Count; i++)
{ {
......
...@@ -470,6 +470,7 @@ namespace BLL ...@@ -470,6 +470,7 @@ namespace BLL
//匹配CodeType //匹配CodeType
if (codeMatch[i].CheckCodeType && !string.IsNullOrEmpty(codeMatch[i].CodeType) && !string.IsNullOrEmpty(codeinfo.CodeType)) { if (codeMatch[i].CheckCodeType && !string.IsNullOrEmpty(codeMatch[i].CodeType) && !string.IsNullOrEmpty(codeinfo.CodeType)) {
matchCount++;
if (codeinfo.CodeType != codeMatch[i].CodeType) if (codeinfo.CodeType != codeMatch[i].CodeType)
return null; return null;
} }
......
...@@ -13,7 +13,7 @@ namespace Model ...@@ -13,7 +13,7 @@ namespace Model
public void Load(List<ExtensionControl> extensions); public void Load(List<ExtensionControl> extensions);
public void SetKey(string[] originalCode, Dictionary<string, string> key); public void SetKey(string[] originalCode, Dictionary<string, string> key,bool hasMatch);
public void Update(); public void Update();
......
...@@ -45,7 +45,8 @@ namespace SmartScan ...@@ -45,7 +45,8 @@ namespace SmartScan
{ {
this.Invoke(delegate () this.Invoke(delegate ()
{ {
this.Close(); if (!this.IsDisposed)
this.Close();
}); });
} }
......
...@@ -92,11 +92,11 @@ namespace SmartScan ...@@ -92,11 +92,11 @@ namespace SmartScan
AddCodeCenter(); AddCodeCenter();
}); });
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialTemplateMatching"));//模版匹配... Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialTemplateMatching"));//模版匹配...
MatchingTemplate(); bool hasMatch = MatchingTemplate();
Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialProcessing"));//计算结果... Common.frmMain.SetWaittingMsg(Language.Dialog("MaterialProcessing"));//计算结果...
Common.frmMain.Invoke(delegate () Common.frmMain.Invoke(delegate ()
{ {
SetKey(); SetKey(hasMatch);
}); });
isTouch = false; isTouch = false;
...@@ -132,8 +132,8 @@ namespace SmartScan ...@@ -132,8 +132,8 @@ namespace SmartScan
originalCodeText = code; originalCodeText = code;
originalCodeIsUsed = null; originalCodeIsUsed = null;
MatchingTemplate(); var hasMatch = MatchingTemplate();
SetKey(); SetKey(hasMatch);
isTouch = true; isTouch = true;
LogNet.log.Info("Work scan code is done"); LogNet.log.Info("Work scan code is done");
...@@ -264,10 +264,10 @@ namespace SmartScan ...@@ -264,10 +264,10 @@ namespace SmartScan
Application.DoEvents(); Application.DoEvents();
} }
private void MatchingTemplate() private bool MatchingTemplate()
{ {
LogNet.log.Info("Work MatchingTemplate"); LogNet.log.Info("Work MatchingTemplate");
if (workCodeInfo.Count == 0) return; if (workCodeInfo.Count == 0) return false;
originalCodeText = Common.cameraVision.GetBarCodeText(workCodeInfo); originalCodeText = Common.cameraVision.GetBarCodeText(workCodeInfo);
bool rtn = Common.mateEdit.MatchingTemplate(workCodeInfo, Common.config.DefaultMaterialName, out string mateName, out workCodeKeyword, out originalCodeIsUsed); bool rtn = Common.mateEdit.MatchingTemplate(workCodeInfo, Common.config.DefaultMaterialName, out string mateName, out workCodeKeyword, out originalCodeIsUsed);
...@@ -294,12 +294,13 @@ namespace SmartScan ...@@ -294,12 +294,13 @@ namespace SmartScan
} }
} }
}); });
return rtn;
} }
private void SetKey() private void SetKey(bool hasMatch)
{ {
LogNet.log.Info("Work SetKey"); LogNet.log.Info("Work SetKey hasMatch:"+ hasMatch);
Common.extension.SetKey(originalCodeText, workCodeKeyword); Common.extension.SetKey(originalCodeText, workCodeKeyword, hasMatch);
if (workCodeKeyword.Count == 0) return; if (workCodeKeyword.Count == 0) return;
if (Common.config.PromptAfterPrinting && !Common.config.Backgrounder) if (Common.config.PromptAfterPrinting && !Common.config.Backgrounder)
......
...@@ -46,6 +46,9 @@ namespace SmartScan ...@@ -46,6 +46,9 @@ namespace SmartScan
this.BtnAddKey = new Asa.FaceControl.FaceButton(); this.BtnAddKey = new Asa.FaceControl.FaceButton();
this.TxtKey = new Asa.FaceControl.FaceTextBox(); this.TxtKey = new Asa.FaceControl.FaceTextBox();
this.LstKey = new Asa.FaceControl.FaceListBox(); this.LstKey = new Asa.FaceControl.FaceListBox();
this.btn_up = new Asa.FaceControl.FaceButton();
this.btn_down = new Asa.FaceControl.FaceButton();
this.btn_setriid = new Asa.FaceControl.FaceButton();
this.facePanel1.SuspendLayout(); this.facePanel1.SuspendLayout();
this.PnlReelid.SuspendLayout(); this.PnlReelid.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
...@@ -56,6 +59,9 @@ namespace SmartScan ...@@ -56,6 +59,9 @@ namespace SmartScan
this.facePanel1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle; this.facePanel1.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.facePanel1.BorderWidth = 2; this.facePanel1.BorderWidth = 2;
this.facePanel1.Controls.Add(this.PnlReelid); this.facePanel1.Controls.Add(this.PnlReelid);
this.facePanel1.Controls.Add(this.btn_down);
this.facePanel1.Controls.Add(this.btn_up);
this.facePanel1.Controls.Add(this.btn_setriid);
this.facePanel1.Controls.Add(this.BtnAppendKey); this.facePanel1.Controls.Add(this.BtnAppendKey);
this.facePanel1.Controls.Add(this.BtnUpdateKey); this.facePanel1.Controls.Add(this.BtnUpdateKey);
this.facePanel1.Controls.Add(this.BtnDelKey); this.facePanel1.Controls.Add(this.BtnDelKey);
...@@ -67,7 +73,7 @@ namespace SmartScan ...@@ -67,7 +73,7 @@ namespace SmartScan
this.facePanel1.Name = "facePanel1"; this.facePanel1.Name = "facePanel1";
this.facePanel1.Padding = new System.Windows.Forms.Padding(3); this.facePanel1.Padding = new System.Windows.Forms.Padding(3);
this.facePanel1.ShowText = false; this.facePanel1.ShowText = false;
this.facePanel1.Size = new System.Drawing.Size(634, 372); this.facePanel1.Size = new System.Drawing.Size(634, 392);
this.facePanel1.TabIndex = 1; this.facePanel1.TabIndex = 1;
this.facePanel1.Text = "facePanel1"; this.facePanel1.Text = "facePanel1";
this.facePanel1.TitleFont = new System.Drawing.Font("宋体", 12F); this.facePanel1.TitleFont = new System.Drawing.Font("宋体", 12F);
...@@ -162,7 +168,7 @@ namespace SmartScan ...@@ -162,7 +168,7 @@ namespace SmartScan
this.NumReelIDPlaces.Padding = new System.Windows.Forms.Padding(3); this.NumReelIDPlaces.Padding = new System.Windows.Forms.Padding(3);
this.NumReelIDPlaces.Size = new System.Drawing.Size(122, 45); this.NumReelIDPlaces.Size = new System.Drawing.Size(122, 45);
this.NumReelIDPlaces.TabIndex = 24; this.NumReelIDPlaces.TabIndex = 24;
this.NumReelIDPlaces.Text = "faceNumericUpDown1"; this.NumReelIDPlaces.Text = "1";
this.NumReelIDPlaces.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.NumReelIDPlaces.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.NumReelIDPlaces.Value = 1F; this.NumReelIDPlaces.Value = 1F;
// //
...@@ -336,10 +342,55 @@ namespace SmartScan ...@@ -336,10 +342,55 @@ namespace SmartScan
this.LstKey.Name = "LstKey"; this.LstKey.Name = "LstKey";
this.LstKey.Padding = new System.Windows.Forms.Padding(3); this.LstKey.Padding = new System.Windows.Forms.Padding(3);
this.LstKey.SelectedIndex = -1; this.LstKey.SelectedIndex = -1;
this.LstKey.Size = new System.Drawing.Size(170, 325); this.LstKey.Size = new System.Drawing.Size(170, 300);
this.LstKey.TabIndex = 21; this.LstKey.TabIndex = 21;
this.LstKey.SelectedIndexChanged += new System.EventHandler(this.LstKey_SelectedIndexChanged); this.LstKey.SelectedIndexChanged += new System.EventHandler(this.LstKey_SelectedIndexChanged);
// //
// btn_up
//
this.btn_up.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.btn_up.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.btn_up.BorderWidth = 2;
this.btn_up.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.btn_up.HoldPress = false;
this.btn_up.Location = new System.Drawing.Point(6, 312);
this.btn_up.Name = "btn_up";
this.btn_up.Padding = new System.Windows.Forms.Padding(3);
this.btn_up.Size = new System.Drawing.Size(80, 45);
this.btn_up.TabIndex = 34;
this.btn_up.Text = "▲";
this.btn_up.Click += new System.EventHandler(this.btn_up_Click);
//
// btn_down
//
this.btn_down.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.btn_down.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.btn_down.BorderWidth = 2;
this.btn_down.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.btn_down.HoldPress = false;
this.btn_down.Location = new System.Drawing.Point(92, 312);
this.btn_down.Name = "btn_down";
this.btn_down.Padding = new System.Windows.Forms.Padding(3);
this.btn_down.Size = new System.Drawing.Size(84, 45);
this.btn_down.TabIndex = 34;
this.btn_down.Text = "▼";
this.btn_down.Click += new System.EventHandler(this.btn_down_Click);
//
// btn_setriid
//
this.btn_setriid.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.btn_setriid.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.btn_setriid.BorderWidth = 2;
this.btn_setriid.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.btn_setriid.HoldPress = false;
this.btn_setriid.Location = new System.Drawing.Point(182, 261);
this.btn_setriid.Name = "btn_setriid";
this.btn_setriid.Padding = new System.Windows.Forms.Padding(3);
this.btn_setriid.Size = new System.Drawing.Size(168, 45);
this.btn_setriid.TabIndex = 34;
this.btn_setriid.Text = "Toggle Auto ReelID";
this.btn_setriid.Click += new System.EventHandler(this.btn_setriid_Click);
//
// UsrMacro // UsrMacro
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -372,5 +423,8 @@ namespace SmartScan ...@@ -372,5 +423,8 @@ namespace SmartScan
private Asa.FaceControl.FaceButton BtnDelKey; private Asa.FaceControl.FaceButton BtnDelKey;
private Asa.FaceControl.FaceButton BtnAddKey; private Asa.FaceControl.FaceButton BtnAddKey;
private Asa.FaceControl.FaceTextBox TxtKey; private Asa.FaceControl.FaceTextBox TxtKey;
private Asa.FaceControl.FaceButton btn_down;
private Asa.FaceControl.FaceButton btn_up;
private Asa.FaceControl.FaceButton btn_setriid;
} }
} }
...@@ -14,6 +14,7 @@ namespace SmartScan ...@@ -14,6 +14,7 @@ namespace SmartScan
InitializeComponent(); InitializeComponent();
keyCopy = new(Common.macroKey); keyCopy = new(Common.macroKey);
LstKey.Items.AddRange(keyCopy.ToArray()); LstKey.Items.AddRange(keyCopy.ToArray());
setRIkey();
TxtReelIDMatch.Text = Common.config.ReelIDMatch; TxtReelIDMatch.Text = Common.config.ReelIDMatch;
TxtPrefix.Text = Common.config.ReelIDPrefix; TxtPrefix.Text = Common.config.ReelIDPrefix;
TxtPostfix.Text = Common.config.ReelIDPostfix; TxtPostfix.Text = Common.config.ReelIDPostfix;
...@@ -40,12 +41,20 @@ namespace SmartScan ...@@ -40,12 +41,20 @@ namespace SmartScan
Common.config.ReelIDFillZero = ChkReelIDFillZero.Checked; Common.config.ReelIDFillZero = ChkReelIDFillZero.Checked;
Common.config.Save(); Common.config.Save();
} }
void setRIkey() {
LstKey.Items.Clear();
LstKey.Items.AddRange(keyCopy.ToArray());
for (int i = 0; i < LstKey.Items.Count; i++)
{
if (LstKey.Items[i] == Common.config.ReelIDKeyWord)
LstKey.Items[i] = "[RI]" + LstKey.Items[i];
}
}
private void LstKey_SelectedIndexChanged(object sender, EventArgs e) private void LstKey_SelectedIndexChanged(object sender, EventArgs e)
{ {
TxtKey.Text = LstKey.Text; TxtKey.Text = keyCopy[LstKey.SelectedIndex];
} }
private void BtnAddKey_Click(object sender, EventArgs e) private void BtnAddKey_Click(object sender, EventArgs e)
...@@ -81,6 +90,7 @@ namespace SmartScan ...@@ -81,6 +90,7 @@ namespace SmartScan
{ {
keyCopy[LstKey.SelectedIndex] = text; keyCopy[LstKey.SelectedIndex] = text;
LstKey.Items[LstKey.SelectedIndex] = text; LstKey.Items[LstKey.SelectedIndex] = text;
setRIkey();
} }
else else
{ {
...@@ -88,7 +98,7 @@ namespace SmartScan ...@@ -88,7 +98,7 @@ namespace SmartScan
hint = hint.Replace("[name]", text); hint = hint.Replace("[name]", text);
new Asa.FaceControl.FaceMessageBox("", hint, MessageBoxButtons.OK).ShowDialog(); new Asa.FaceControl.FaceMessageBox("", hint, MessageBoxButtons.OK).ShowDialog();
} }
} }
private void BtnAppendKey_Click(object sender, EventArgs e) private void BtnAppendKey_Click(object sender, EventArgs e)
...@@ -98,6 +108,35 @@ namespace SmartScan ...@@ -98,6 +108,35 @@ namespace SmartScan
TxtReelIDMatch.AppendText(key); TxtReelIDMatch.AppendText(key);
} }
private void btn_up_Click(object sender, EventArgs e)
{
if (LstKey.SelectedIndex == -1 || LstKey.SelectedIndex ==0) return;
keyCopy.Insert(LstKey.SelectedIndex - 1, keyCopy[LstKey.SelectedIndex]);
keyCopy.RemoveAt(LstKey.SelectedIndex+1);
LstKey.Items.Clear();
LstKey.Items.AddRange(keyCopy.ToArray());
LstKey.SelectedIndex = LstKey.SelectedIndex - 1;
}
private void btn_down_Click(object sender, EventArgs e)
{
if (LstKey.SelectedIndex == -1 || LstKey.SelectedIndex == keyCopy.Count-1) return;
keyCopy.Insert(LstKey.SelectedIndex+2, keyCopy[LstKey.SelectedIndex]);
keyCopy.RemoveAt(LstKey.SelectedIndex);
LstKey.Items.Clear();
LstKey.Items.AddRange(keyCopy.ToArray());
LstKey.SelectedIndex = LstKey.SelectedIndex + 1;
}
private void btn_setriid_Click(object sender, EventArgs e)
{
if (LstKey.SelectedIndex == -1) return;
if (keyCopy[LstKey.SelectedIndex] == Common.config.ReelIDKeyWord)
Common.config.ReelIDKeyWord = "";
else
Common.config.ReelIDKeyWord = keyCopy[LstKey.SelectedIndex];
setRIkey();
}
} }
} }
[
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblSupplierPN",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Supplier PN",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"PN",
"LinkName":"CboCustomerPN",
"CanClear":"True",
"Attribute":
{
"Name":"TxtSupplierPN",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"42",
"Text":""
},
"Event":
{
"KeyEnterPress":"PNPress"
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblQTY",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Quantity",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"QTY",
"LinkName":"",
"CanClear":"True",
"Attribute":
{
"Name":"TxtQTY",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"42",
"ShowQuery":"False",
"Text":""
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblProductionDate",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Production Date",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"PRODATE",
"LinkName":"",
"CanClear":"True",
"Attribute":
{
"Name":"TxtProductionDate",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"42",
"ShowQuery":"False",
"Text":""
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblBatch",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Batch",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"BATCH",
"LinkName":"",
"CanClear":"True",
"Attribute":
{
"Name":"TxtBatch",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"74",
"ShowQuery":"False",
"Multiline":"True",
"Text":""
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblMemo",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Memo",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"Memo",
"LinkName":"",
"CanClear":"True",
"Attribute":
{
"Name":"TxtMemo",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"74",
"ShowQuery":"False",
"Multiline":"True",
"Text":""
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblCustomerPN",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Customer PN",
"TextAlign":"MiddleRight"
}
},
{
"Type":"ComboBox",
"Key":"PartNumber",
"LinkName":"TxtDescription,TxtSupplierName",
"CanClear":"True",
"Attribute":
{
"Name":"CboCustomerPN",
"Font":"Arial,11,,",
"ReadOnly":"True",
"Width":"-1",
"Height":"42"
},
"Event":
{
"SelectedIndexChanged":"CustomerPNSelected"
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblDescription",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Description",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"Description",
"LinkName":"",
"CanClear":"True",
"Attribute":
{
"Name":"TxtDescription",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"140",
"ShowQuery":"False",
"ShowDel":"False",
"Multiline":"True",
"ReadOnly":"True",
"ForeColor":"220,10,10",
"Text":""
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblSupplierName",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Supplier Name",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"SP",
"LinkName":"",
"CanClear":"True",
"Attribute":
{
"Name":"TxtSupplierName",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"42",
"ShowQuery":"False",
"ShowDel":"False",
"ReadOnly":"True",
"ForeColor":"220,10,10",
"Text":""
}
}
],
[
{
"Type":"Button",
"LinkName":"",
"Attribute":
{
"Name":"BtnSetID",
"Font":"Arial,14,B,",
"Width":"-1",
"Height":"50",
"Text":"Get Barcode"
},
"Event":
{
"Click":"GetReelid"
}
}
],
[
{
"Type":"Label",
"Attribute":
{
"Name":"LblBarcode",
"Font":"Arial,11,,",
"BorderWidth":"0",
"Width":"82",
"Height":"42",
"Text":"Barcode",
"TextAlign":"MiddleRight"
}
},
{
"Type":"TextBox",
"Key":"Reelid",
"LinkName":"",
"CanClear":"True",
"Attribute":
{
"Name":"TxtBarcode",
"Font":"Arial,11,,",
"Width":"-1",
"Height":"42",
"ShowQuery":"False",
"ShowDel":"False",
"ReadOnly":"True",
"ForeColor":"220,10,10",
"Text":""
}
}
],
[
{
"Type":"Button",
"LinkName":"",
"Attribute":
{
"Name":"BtnPrint",
"Font":"Arial,14,B,",
"Width":"-1",
"Height":"50",
"Text":"Print Label"
},
"Event":
{
"Click":"PrintLabel"
}
}
]
]
\ No newline at end of file \ No newline at end of file
Reelid Reelid
PartNumber
PN PN
QTY QTY
PRODATE PRODATE
BATCH BATCH
Memo
Description Description
SP SP
Memo
1417
\ No newline at end of file \ No newline at end of file
1435
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<appSettings> <appSettings>
<Language>English</Language> <Language>简体中文</Language>
<PrinterName>ZDesigner GT800-300dpi EPL</PrinterName> <PrinterName>Microsoft Print to PDF</PrinterName>
<PrintLandscape>False</PrintLandscape> <PrintLandscape>False</PrintLandscape>
<HistoryImage>Original</HistoryImage> <HistoryImage>Original</HistoryImage>
<SelectHttpPN>True</SelectHttpPN> <SelectHttpPN>True</SelectHttpPN>
...@@ -24,11 +24,14 @@ ...@@ -24,11 +24,14 @@
<ReelIDPostfix> <ReelIDPostfix>
</ReelIDPostfix> </ReelIDPostfix>
<LockPassword>12345</LockPassword> <LockPassword>12345</LockPassword>
<ExtensionGroup>Bwit</ExtensionGroup> <ExtensionGroup>General</ExtensionGroup>
<HttpServer>http://localhost/smdbox/rest/api/v2/mes/listPnBySupplierPn?supplierPn=</HttpServer> <HttpServer>http://localhost/smdbox/rest/api/v2/mes/listPnBySupplierPn?supplierPn=</HttpServer>
<HttpReelID>http://localhost/ScopeCVSService/BoxReelIDInfoMaintain</HttpReelID> <HttpReelID>http://localhost/ScopeCVSService/BoxReelIDInfoMaintain</HttpReelID>
<DefaultMaterialName>R1-YAGEO</DefaultMaterialName> <DefaultMaterialName>test</DefaultMaterialName>
<TriggerOpenLight>True</TriggerOpenLight> <TriggerOpenLight>True</TriggerOpenLight>
<WebService> <WebService>
</WebService> </WebService>
<PromptAfterPrinting>False</PromptAfterPrinting>
<AutoPrint>True</AutoPrint>
<ReelIDKeyWord>Reelid</ReelIDKeyWord>
</appSettings> </appSettings>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!