From 3eac3927f85929dcad6766fd9dbbcf3357da66b5 Mon Sep 17 00:00:00 2001 From: atvstdla Date: Thu, 2 Oct 2025 11:36:48 +0900 Subject: [PATCH] QR validation and WMS info processing improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Enhanced QR vision trigger logging with detailed command/data output - Added JSON data extraction for barcode processing - Improved WMS info query with data completeness check - Updated SID information form with trust flags for user inputs - Added auto-resize columns and UI improvements to SID selection dialog - Fixed barcode data processing to handle JSON wrapped responses - Added pick retry reset and timing control on form close πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Handler/Project/Dialog/fSelectJob.Designer.cs | 52 ++--- .../Dialog/fSelectSIDInformation.Designer.cs | 182 +++++++++--------- .../Project/Dialog/fSelectSIDInformation.cs | 47 ++++- .../Project/Dialog/fSelectSIDInformation.resx | 3 + .../Project/RunCode/RunSequence/9_QRValid.cs | 2 +- .../StateMachine/_SPS_RecvQRProcess.cs | 47 ++--- Handler/Project/Util/BarcodeDataProcessing.cs | 23 ++- Handler/Project/fMain.cs | 2 +- keyence_front.ptc | Bin 21668 -> 21668 bytes keyence_rear.ptc | Bin 21668 -> 21668 bytes run_claude.bat | 1 + 11 files changed, 203 insertions(+), 156 deletions(-) create mode 100644 run_claude.bat diff --git a/Handler/Project/Dialog/fSelectJob.Designer.cs b/Handler/Project/Dialog/fSelectJob.Designer.cs index 473eff6..00f3f10 100644 --- a/Handler/Project/Dialog/fSelectJob.Designer.cs +++ b/Handler/Project/Dialog/fSelectJob.Designer.cs @@ -92,6 +92,8 @@ this.chkInfoApplyCust = new System.Windows.Forms.CheckBox(); this.chkInfoApplyPart = new System.Windows.Forms.CheckBox(); this.grpApplyWMSinfo = new System.Windows.Forms.GroupBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); this.checkBox36 = new System.Windows.Forms.CheckBox(); this.chkWMSApplyBatch = new System.Windows.Forms.CheckBox(); this.label22 = new System.Windows.Forms.Label(); @@ -110,8 +112,6 @@ this.btCancle = new arCtl.arLabel(); this.dataSet11 = new Project.DataSet1(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.checkBox2 = new System.Windows.Forms.CheckBox(); this.panel2.SuspendLayout(); this.panel5.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -992,6 +992,30 @@ this.grpApplyWMSinfo.TabStop = false; this.grpApplyWMSinfo.Text = "WMS Information Application"; // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.ForeColor = System.Drawing.Color.Black; + this.checkBox2.Location = new System.Drawing.Point(431, 24); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(92, 23); + this.checkBox2.TabIndex = 39; + this.checkBox2.Tag = "13"; + this.checkBox2.Text = "MFG Date"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.ForeColor = System.Drawing.Color.Blue; + this.checkBox1.Location = new System.Drawing.Point(379, 50); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(92, 23); + this.checkBox1.TabIndex = 38; + this.checkBox1.Tag = "12"; + this.checkBox1.Text = "MFG Date"; + this.checkBox1.UseVisualStyleBackColor = true; + // // checkBox36 // this.checkBox36.AutoSize = true; @@ -1249,30 +1273,6 @@ this.dataSet11.DataSetName = "DataSet1"; this.dataSet11.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // - // checkBox1 - // - this.checkBox1.AutoSize = true; - this.checkBox1.ForeColor = System.Drawing.Color.Blue; - this.checkBox1.Location = new System.Drawing.Point(379, 50); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(92, 23); - this.checkBox1.TabIndex = 38; - this.checkBox1.Tag = "12"; - this.checkBox1.Text = "MFG Date"; - this.checkBox1.UseVisualStyleBackColor = true; - // - // checkBox2 - // - this.checkBox2.AutoSize = true; - this.checkBox2.ForeColor = System.Drawing.Color.Black; - this.checkBox2.Location = new System.Drawing.Point(431, 24); - this.checkBox2.Name = "checkBox2"; - this.checkBox2.Size = new System.Drawing.Size(92, 23); - this.checkBox2.TabIndex = 39; - this.checkBox2.Tag = "13"; - this.checkBox2.Text = "MFG Date"; - this.checkBox2.UseVisualStyleBackColor = true; - // // fSelectJob // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F); diff --git a/Handler/Project/Dialog/fSelectSIDInformation.Designer.cs b/Handler/Project/Dialog/fSelectSIDInformation.Designer.cs index 0274742..165c3f0 100644 --- a/Handler/Project/Dialog/fSelectSIDInformation.Designer.cs +++ b/Handler/Project/Dialog/fSelectSIDInformation.Designer.cs @@ -30,7 +30,7 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fSelectSIDInformation)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.tbSID = new System.Windows.Forms.TextBox(); this.tbLot = new System.Windows.Forms.TextBox(); this.tbMFG = new System.Windows.Forms.TextBox(); @@ -50,6 +50,8 @@ this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.lbExecuteSQL = new System.Windows.Forms.ToolStripStatusLabel(); this.bn = new System.Windows.Forms.BindingNavigator(this.components); + this.bs = new System.Windows.Forms.BindingSource(this.components); + this.dsWMS = new Project.dsWMS(); this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel(); this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton(); @@ -60,13 +62,6 @@ this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.dv1 = new System.Windows.Forms.DataGridView(); - this.panDv = new System.Windows.Forms.Panel(); - this.btOK = new System.Windows.Forms.Button(); - this.panel3 = new System.Windows.Forms.Panel(); - this.bs = new System.Windows.Forms.BindingSource(this.components); - this.dsWMS = new Project.dsWMS(); - this.ta = new Project.dsWMSTableAdapters.VW_GET_MAX_QTY_VENDOR_LOTTableAdapter(); - this.tam = new Project.dsWMSTableAdapters.TableAdapterManager(); this.idxDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.sIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewButtonColumn(); this.pARTNODataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -76,14 +71,19 @@ this.vENDORLOTDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.mFGDATEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.qTYDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.panDv = new System.Windows.Forms.Panel(); + this.btOK = new System.Windows.Forms.Button(); + this.panel3 = new System.Windows.Forms.Panel(); + this.ta = new Project.dsWMSTableAdapters.VW_GET_MAX_QTY_VENDOR_LOTTableAdapter(); + this.tam = new Project.dsWMSTableAdapters.TableAdapterManager(); this.statusStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit(); this.bn.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dsWMS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dv1)).BeginInit(); this.panDv.SuspendLayout(); this.panel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dsWMS)).BeginInit(); this.SuspendLayout(); // // tbSID @@ -314,10 +314,20 @@ this.bn.TabIndex = 12; this.bn.Text = "bindingNavigator1"; // + // bs + // + this.bs.DataMember = "VW_GET_MAX_QTY_VENDOR_LOT"; + this.bs.DataSource = this.dsWMS; + // + // dsWMS + // + this.dsWMS.DataSetName = "dsWMS"; + this.dsWMS.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; + // // bindingNavigatorCountItem // this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem"; - this.bindingNavigatorCountItem.Size = new System.Drawing.Size(27, 22); + this.bindingNavigatorCountItem.Size = new System.Drawing.Size(26, 22); this.bindingNavigatorCountItem.Text = "/{0}"; this.bindingNavigatorCountItem.ToolTipText = "Total item count"; // @@ -400,14 +410,15 @@ this.mFGDATEDataGridViewTextBoxColumn, this.qTYDataGridViewTextBoxColumn}); this.dv1.DataSource = this.bs; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle1.Font = new System.Drawing.Font("맑은 κ³ λ”•", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dv1.DefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("맑은 κ³ λ”•", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(0, 3, 0, 3); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dv1.DefaultCellStyle = dataGridViewCellStyle2; this.dv1.Dock = System.Windows.Forms.DockStyle.Fill; this.dv1.Location = new System.Drawing.Point(0, 0); this.dv1.Name = "dv1"; @@ -417,75 +428,6 @@ this.dv1.TabIndex = 35; this.dv1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.vW_GET_MAX_QTY_VENDOR_LOTDataGridView_CellClick); // - // panDv - // - this.panDv.Controls.Add(this.dv1); - this.panDv.Controls.Add(this.bn); - this.panDv.Dock = System.Windows.Forms.DockStyle.Fill; - this.panDv.Location = new System.Drawing.Point(0, 157); - this.panDv.Name = "panDv"; - this.panDv.Size = new System.Drawing.Size(1031, 405); - this.panDv.TabIndex = 36; - // - // btOK - // - this.btOK.BackColor = System.Drawing.Color.DarkSeaGreen; - this.btOK.Dock = System.Windows.Forms.DockStyle.Right; - this.btOK.Font = new System.Drawing.Font("맑은 κ³ λ”•", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - this.btOK.Location = new System.Drawing.Point(791, 10); - this.btOK.Name = "btOK"; - this.btOK.Size = new System.Drawing.Size(230, 137); - this.btOK.TabIndex = 4; - this.btOK.Text = "SAVE"; - this.btOK.UseVisualStyleBackColor = false; - this.btOK.Click += new System.EventHandler(this.btOK_Click); - // - // panel3 - // - this.panel3.Controls.Add(this.btOK); - this.panel3.Controls.Add(this.button5); - this.panel3.Controls.Add(this.button4); - this.panel3.Controls.Add(this.linkLabel7); - this.panel3.Controls.Add(this.tbVName); - this.panel3.Controls.Add(this.linkLabel5); - this.panel3.Controls.Add(this.linkLabel6); - this.panel3.Controls.Add(this.tbSID); - this.panel3.Controls.Add(this.linkLabel8); - this.panel3.Controls.Add(this.TbCustCode); - this.panel3.Controls.Add(this.tbBatch); - this.panel3.Controls.Add(this.linkLabel3); - this.panel3.Controls.Add(this.tbLot); - this.panel3.Controls.Add(this.lnkBatch); - this.panel3.Controls.Add(this.tbPart); - this.panel3.Controls.Add(this.tbMFG); - this.panel3.Controls.Add(this.linkLabel2); - this.panel3.Dock = System.Windows.Forms.DockStyle.Top; - this.panel3.Location = new System.Drawing.Point(0, 0); - this.panel3.Name = "panel3"; - this.panel3.Padding = new System.Windows.Forms.Padding(0, 10, 10, 10); - this.panel3.Size = new System.Drawing.Size(1031, 157); - this.panel3.TabIndex = 37; - // - // bs - // - this.bs.DataMember = "VW_GET_MAX_QTY_VENDOR_LOT"; - this.bs.DataSource = this.dsWMS; - // - // dsWMS - // - this.dsWMS.DataSetName = "dsWMS"; - this.dsWMS.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; - // - // ta - // - this.ta.ClearBeforeFill = true; - // - // tam - // - this.tam.BackupDataSetBeforeUpdate = false; - this.tam.Connection = null; - this.tam.UpdateOrder = Project.dsWMSTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete; - // // idxDataGridViewTextBoxColumn // this.idxDataGridViewTextBoxColumn.DataPropertyName = "idx"; @@ -551,6 +493,65 @@ this.qTYDataGridViewTextBoxColumn.Name = "qTYDataGridViewTextBoxColumn"; this.qTYDataGridViewTextBoxColumn.ReadOnly = true; // + // panDv + // + this.panDv.Controls.Add(this.dv1); + this.panDv.Controls.Add(this.bn); + this.panDv.Dock = System.Windows.Forms.DockStyle.Fill; + this.panDv.Location = new System.Drawing.Point(0, 157); + this.panDv.Name = "panDv"; + this.panDv.Size = new System.Drawing.Size(1031, 405); + this.panDv.TabIndex = 36; + // + // btOK + // + this.btOK.BackColor = System.Drawing.Color.DarkSeaGreen; + this.btOK.Dock = System.Windows.Forms.DockStyle.Right; + this.btOK.Font = new System.Drawing.Font("맑은 κ³ λ”•", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.btOK.Location = new System.Drawing.Point(791, 10); + this.btOK.Name = "btOK"; + this.btOK.Size = new System.Drawing.Size(230, 137); + this.btOK.TabIndex = 4; + this.btOK.Text = "SAVE"; + this.btOK.UseVisualStyleBackColor = false; + this.btOK.Click += new System.EventHandler(this.btOK_Click); + // + // panel3 + // + this.panel3.Controls.Add(this.btOK); + this.panel3.Controls.Add(this.button5); + this.panel3.Controls.Add(this.button4); + this.panel3.Controls.Add(this.linkLabel7); + this.panel3.Controls.Add(this.tbVName); + this.panel3.Controls.Add(this.linkLabel5); + this.panel3.Controls.Add(this.linkLabel6); + this.panel3.Controls.Add(this.tbSID); + this.panel3.Controls.Add(this.linkLabel8); + this.panel3.Controls.Add(this.TbCustCode); + this.panel3.Controls.Add(this.tbBatch); + this.panel3.Controls.Add(this.linkLabel3); + this.panel3.Controls.Add(this.tbLot); + this.panel3.Controls.Add(this.lnkBatch); + this.panel3.Controls.Add(this.tbPart); + this.panel3.Controls.Add(this.tbMFG); + this.panel3.Controls.Add(this.linkLabel2); + this.panel3.Dock = System.Windows.Forms.DockStyle.Top; + this.panel3.Location = new System.Drawing.Point(0, 0); + this.panel3.Name = "panel3"; + this.panel3.Padding = new System.Windows.Forms.Padding(0, 10, 10, 10); + this.panel3.Size = new System.Drawing.Size(1031, 157); + this.panel3.TabIndex = 37; + // + // ta + // + this.ta.ClearBeforeFill = true; + // + // tam + // + this.tam.BackupDataSetBeforeUpdate = false; + this.tam.Connection = null; + this.tam.UpdateOrder = Project.dsWMSTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete; + // // fSelectSIDInformation // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -565,18 +566,19 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Multi SID Information"; this.Load += new System.EventHandler(this.fLoaderInfo_Load); + this.Shown += new System.EventHandler(this.fSelectSIDInformation_Shown); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.bn)).EndInit(); this.bn.ResumeLayout(false); this.bn.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bs)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dsWMS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dv1)).EndInit(); this.panDv.ResumeLayout(false); this.panDv.PerformLayout(); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bs)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dsWMS)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/Handler/Project/Dialog/fSelectSIDInformation.cs b/Handler/Project/Dialog/fSelectSIDInformation.cs index c99a126..da636cb 100644 --- a/Handler/Project/Dialog/fSelectSIDInformation.cs +++ b/Handler/Project/Dialog/fSelectSIDInformation.cs @@ -34,9 +34,12 @@ namespace Project.Dialog private void FLoaderInfo_FormClosed(object sender, FormClosedEventArgs e) { + AR.VAR.I32[AR.eVarInt32.PickOnRetry] = 0; + VAR.TIME[eVarTime.KEYENCEWAIT] = DateTime.Now; + VAR.BOOL[eVarBool.FG_WAIT_INFOSELECT] = false; PUB.Result.ItemDataC.VisionData.PropertyChanged -= VisionData_PropertyChanged; - + ////μ‚¬μš©μžκ°€ 정보λ₯Ό μ •ν™•νžˆ μž…λ ₯ν•˜μ§€ μ•Šκ³  λ‹«μ•˜λ‹€ //if (PUB.Result.ItemDataC.VisionData.Confirm == false) //{ @@ -114,7 +117,6 @@ namespace Project.Dialog tbPart.Text = item.VisionData.PARTNO; TbCustCode.Text = item.VisionData.CUSTCODE; tbBatch.Text = item.VisionData.BATCH; - selectInput(this.tbSID); @@ -369,12 +371,36 @@ namespace Project.Dialog itemC.VisionData.SID0 = itemC.VisionData.SID; //κ°’μ΄μžˆλŠ”κ²ƒλ“€λ§Œ 기둝해쀀닀. - if (tbSID.Text.isEmpty() == false) itemC.VisionData.SID = tbSID.Text.Trim(); - if (tbBatch.Text.isEmpty() == false) itemC.VisionData.BATCH = tbBatch.Text.Trim(); - if (tbLot.Text.isEmpty() == false) itemC.VisionData.VLOT = tbLot.Text.Trim(); - if (tbMFG.Text.isEmpty() == false) itemC.VisionData.MFGDATE = tbMFG.Text.Trim(); - if (tbVName.Text.isEmpty() == false) itemC.VisionData.VNAME = tbVName.Text.Trim(); - if (tbPart.Text.isEmpty() == false) itemC.VisionData.PARTNO = tbPart.Text.Trim(); + if (tbSID.Text.isEmpty() == false) + { + itemC.VisionData.SID = tbSID.Text.Trim(); + itemC.VisionData.SID_Trust = true; + } + if (tbBatch.Text.isEmpty() == false) + { + itemC.VisionData.BATCH = tbBatch.Text.Trim(); + + } + if (tbLot.Text.isEmpty() == false) + { + itemC.VisionData.VLOT = tbLot.Text.Trim(); + itemC.VisionData.VLOT_Trust = true; + } + if (tbMFG.Text.isEmpty() == false) + { + itemC.VisionData.MFGDATE = tbMFG.Text.Trim(); + itemC.VisionData.MFGDATE_Trust = true; + } + if (tbVName.Text.isEmpty() == false) + { + itemC.VisionData.VNAME = tbVName.Text.Trim(); + itemC.VisionData.VNAME_Trust = true; + } + if (tbPart.Text.isEmpty() == false) + { + itemC.VisionData.PARTNO = tbPart.Text.Trim(); + itemC.VisionData.PARTNO_Trust = true; + } this.TopMost = topmost; this.Close(); @@ -883,5 +909,10 @@ namespace Project.Dialog ValueUpdate(tbMFG, dr.MFG_DATE, "MFG_DATE"); ValueUpdate(tbBatch, dr.BATCH_NO, "BATCH_NO"); } + + private void fSelectSIDInformation_Shown(object sender, EventArgs e) + { + this.dv1.AutoResizeColumns(); + } } } \ No newline at end of file diff --git a/Handler/Project/Dialog/fSelectSIDInformation.resx b/Handler/Project/Dialog/fSelectSIDInformation.resx index 8bd6858..6b66aec 100644 --- a/Handler/Project/Dialog/fSelectSIDInformation.resx +++ b/Handler/Project/Dialog/fSelectSIDInformation.resx @@ -170,6 +170,9 @@ 8l/FYwIYQ4UGBWBgAAC+0b+zuQxOnAAAAABJRU5ErkJggg== + + 364, 17 + 525, 17 diff --git a/Handler/Project/RunCode/RunSequence/9_QRValid.cs b/Handler/Project/RunCode/RunSequence/9_QRValid.cs index 7995907..85c0781 100644 --- a/Handler/Project/RunCode/RunSequence/9_QRValid.cs +++ b/Handler/Project/RunCode/RunSequence/9_QRValid.cs @@ -50,7 +50,7 @@ namespace Project { //카메라 트리거 전솑 var sendok = WS_Send(target, WS, item.guid, "TRIG", item.VisionData.PrintQRData); - PUB.log.Add($"Barcode trigger transmission ({target}) = {sendok}"); + PUB.log.Add($"Send QR Vision trigger ({target}) = {sendok} CMD=TRIG,DATA={item.VisionData.PrintQRData}"); if(sendok==false) //230512 μ „μ†‘μ‹€νŒ¨μ‹œ 였λ₯˜λ‘œ ν•œλ‹€ { PUB.Result.SetResultMessage(eResult.HARDWARE, eECode.VISION_TRIGERROR, eNextStep.PAUSE); diff --git a/Handler/Project/RunCode/StateMachine/_SPS_RecvQRProcess.cs b/Handler/Project/RunCode/StateMachine/_SPS_RecvQRProcess.cs index 983ff4f..603e6ea 100644 --- a/Handler/Project/RunCode/StateMachine/_SPS_RecvQRProcess.cs +++ b/Handler/Project/RunCode/StateMachine/_SPS_RecvQRProcess.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text.RegularExpressions; +using Newtonsoft.Json.Linq; namespace Project { @@ -23,8 +24,24 @@ namespace Project foreach (var datas in qrdatas) { + // JSON κ΅¬μ‘°μ—μ„œ "data" ν•„λ“œ μΆ”μΆœ + string barcodeData = datas; + try + { + var jobj = JObject.Parse(datas); + if (jobj["data"] != null) + { + barcodeData = jobj["data"].ToString(); + } + } + catch + { + // JSON νŒŒμ‹± μ‹€νŒ¨ μ‹œ 원본 데이터 μ‚¬μš© + barcodeData = datas; + } + //μ›λ³Έμžλ£Œλ₯Ό μ²΄ν¬ν•œλ‹€ - if (datas.Equals(idata.VisionData.PrintQRData)) + if (barcodeData.Equals(idata.VisionData.PrintQRData)) { //μΈμ‡„ν•œ μžλ£Œμ™€ λ™μΌν•œ μžλ£Œμ΄λ‹€ FindData = true; @@ -39,10 +56,10 @@ namespace Project foreach (var pt in pats) { var regx = new Regex(pt.Pattern, RegexOptions.IgnoreCase, new TimeSpan(0, 0, 10)); - if (regx.IsMatch(datas)) //νŒ¨ν„΄μ΄ μΌμΉ˜ν•˜λ‹€λ©΄ μ΄κ²ƒλ§Œ μ‚¬μš©ν•œλ‹€ + if (regx.IsMatch(barcodeData)) //νŒ¨ν„΄μ΄ μΌμΉ˜ν•˜λ‹€λ©΄ μ΄κ²ƒλ§Œ μ‚¬μš©ν•œλ‹€ { //find data - var matchs = regx.Matches(datas); + var matchs = regx.Matches(barcodeData); foreach (System.Text.RegularExpressions.Match mat in matchs) { foreach (var matchdata in pt.Groups) @@ -81,30 +98,6 @@ namespace Project } } } - - - - - - - - - //var bcdData = new StdLabelPrint.CAmkorSTDBarcode(datas); - //PUB.Result.ItemData[vIdx].VisionData.QTY2 = bcdData.QTY.ToString(); - //PUB.Result.ItemData[vIdx].VisionData.RID2 = bcdData.RID; - //PUB.Result.ItemData[vIdx].VisionData.SID2 = bcdData.SID; - //PUB.Result.ItemData[vIdx].VisionData.VLOT2 = bcdData.VLOT; - //PUB.Result.ItemData[vIdx].VisionData.VNAME2 = bcdData.VENDERNAME; - //PUB.Result.ItemData[vIdx].VisionData.MFGDATE2 = bcdData.MFGDate;//.ToString("yyyyMMdd"); - //PUB.Result.ItemData[vIdx].VisionData.PARTNO2 = bcdData.PARTNO; - //PUB.Result.ItemData[vIdx].VisionData.Ready = true; - ////Pub.Result.ItemData[vIdx].VisionData.ETime = DateTime.Now; - ////Pub.Result.ItemData[vIdx].VisionData.Angle = 5; - //PUB.Result.ItemData[vIdx].VisionData.Complete = true; - //PUB.log.Add("BARCODE", $"{vIdx}λ°”μ½”λ“œ 읽기 성곡 ID:{bcdData.RID},QTY:{bcdData.QTY}"); - - ////데이터λ₯Ό μ½μ—ˆμœΌλ©°, 검증기λŠ₯이 μΌœμ Έμžˆλ‹€λ©΄ κ²€μ¦μ„ν•œλ‹€ - //if (FindData) break; } } diff --git a/Handler/Project/Util/BarcodeDataProcessing.cs b/Handler/Project/Util/BarcodeDataProcessing.cs index 36d8b65..fffac2b 100644 --- a/Handler/Project/Util/BarcodeDataProcessing.cs +++ b/Handler/Project/Util/BarcodeDataProcessing.cs @@ -43,7 +43,7 @@ namespace Project //[WMS] SIDμ •λ³΄ν…Œμ΄λΈ”μ—μ„œ 정보 μΆ”μΆœ(ν”„λ¦°νŠΈμ •λ³΄λŠ” μ—†μŒ) //[WMS] μ—μ„œ μ€‘λ³΅κ²€μƒ‰λ˜λ©΄ νŒμ—…μ„ ν•΄μ•Όν•˜λ―€λ‘œ 이것을 λ¨Όμ € μ²˜λ¦¬ν•œλ‹€. - if (VAR.BOOL[eVarBool.Opt_ApplyWMSInfo] && (CompleteCheck || itemC.VisionData.BarcodeTouched == true)) + if (VAR.BOOL[eVarBool.Opt_ApplyWMSInfo] && (CompleteCheck || itemC.VisionData.BarcodeTouched == true)) { var rlt_FindWMD = BCDProcess_FindWMSInfo(itemC); if (rlt_FindWMD.NewBarcodeUpdated) NewBarcodeUpdated = true; @@ -316,8 +316,25 @@ namespace Project if (vdata.MFGDATE_Trust && vdata.MFGDATE.isEmpty() == false) wheres.Add($"MFG_DATE = '{vdata.MFGDATE}'"); else Apply = false; } + + //데이터가 μ™„μ„±λ˜μ—ˆλ‹€λ©΄ μ²˜λ¦¬ν•˜μ§€ μ•ŠλŠ”λ‹€. + bool DataOK = true; + foreach (var data in fields) + { + var column = data.ToLower(); + if (DataOK && column.Equals("sid") && (vdata.SID.isEmpty() || vdata.SID_Trust == false)) DataOK = false; + else if (DataOK && column.Equals("part_no") && (vdata.PARTNO.isEmpty() || vdata.PARTNO_Trust)) DataOK = false; + else if (DataOK && column.Equals("mfg_data") && (vdata.MFGDATE.isEmpty() || vdata.MFGDATE_Trust)) DataOK = false; + else if (DataOK && column.Equals("vendor_nm") && (vdata.VNAME.isEmpty() || vdata.VNAME_Trust)) DataOK = false; + else if (DataOK && column.Equals("batch_no") && (vdata.BATCH.isEmpty())) DataOK = false; + else if (DataOK && column.Equals("qty") && (vdata.QTY.isEmpty() || vdata.QTY_Trust)) DataOK = false; + else if (DataOK && column.Equals("cust_code") && (vdata.CUSTCODE.isEmpty())) DataOK = false; + else if (DataOK && column.Equals("vendor_lot") && (vdata.VLOT.isEmpty() || vdata.VLOT_Trust)) DataOK = false; + if (DataOK == false) break; + } + //if query data . no error - if (Apply && fields.Count > 0 && wheres.Count > 0) + if (DataOK == false && Apply && fields.Count > 0 && wheres.Count > 0) { var TableName = "VW_GET_MAX_QTY_VENDOR_LOT"; var whereState = " where " + string.Join(" and ", wheres); @@ -330,7 +347,7 @@ namespace Project var cntvalue = (DBHelper.ExecuteScalar(SQLC)?.ToString() ?? "0").toInt(); if (cntvalue > 1) { - VAR.STR[eVarString.MULTISID_QUERY] = $"select {selectFields} from {TableName} WITH(NOLOCK) {whereState}"; + VAR.STR[eVarString.MULTISID_QUERY] = $"select * from {TableName} WITH(NOLOCK) {whereState}"; VAR.STR[eVarString.MULTISID_FIELDS] = selectFields; rlt = EResultKeyence.MultiSID; } diff --git a/Handler/Project/fMain.cs b/Handler/Project/fMain.cs index 1afd0a0..3064aa3 100644 --- a/Handler/Project/fMain.cs +++ b/Handler/Project/fMain.cs @@ -2222,7 +2222,7 @@ namespace Project //If multiple information exists, it should be handled with selection screen - VAR.STR[eVarString.MULTISID_QUERY] = $"select {selectFields} from {TableName} WITH(NOLOCK) {whereState}"; + VAR.STR[eVarString.MULTISID_QUERY] = $"select * from {TableName} WITH(NOLOCK) {whereState}"; VAR.STR[eVarString.MULTISID_FIELDS] = selectFields; PUB.Result.ItemDataC.VisionData.CUSTCODE = VAR.STR[eVarString.JOB_CUSTOMER_CODE]; diff --git a/keyence_front.ptc b/keyence_front.ptc index 388100de9a28c190274cdee02c7af8eede7dce62..8128d53a7b742fbfe2a0c64ccbfa5e48347dc8fa 100644 GIT binary patch delta 41 zcmV+^0M`GcsR5*^0kB91laK=lvrq@fJOM0|8AM-`SV0t%fI$?aphOS^e^2&9IARW- delta 36 scmZ3ol5xpO#tk0qlejrH2e6;8VdR}G=@LJ=#6@HA0v7?6IsV_A0q)KW-T(jq diff --git a/keyence_rear.ptc b/keyence_rear.ptc index 183771f59a7f1e282aaefe8241f0769917dd0027..ea785fca2bb07c72266d1bc2182bf94fbaf2a719 100644 GIT binary patch delta 54 zcmV-60LlNPsR5*^0kB91laK=lvrq@TIFoz_2m+uFlNLahlf*z6lh8m6v(P|D0|6|v M8AOK=1Saoy3?IA_@&Et; delta 68 zcmZ3ol5xpO#tk0qlejrH2e9w4m>k2-F?oSK%VY_MDS}K43=9oOn0@j_2l>r+9Bh~w Qc{fYCv