..
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.ServiceModel.Configuration;
|
||||
using System.Text;
|
||||
using AR;
|
||||
using Project.Class;
|
||||
@@ -16,6 +17,7 @@ namespace Project
|
||||
Wait = 0,
|
||||
Complete,
|
||||
TimeOut,
|
||||
MultiSID,
|
||||
}
|
||||
public EResultKeyence KEYENCE_READ(eWorkPort target, eSMStep cmdIndex)
|
||||
{
|
||||
@@ -67,6 +69,8 @@ namespace Project
|
||||
}
|
||||
|
||||
VAR.BOOL[eVarBool.Need_UserConfirm_Data] = false;
|
||||
VAR.STR[eVarString.MULTISID_FIELDS] = string.Empty;
|
||||
VAR.STR[eVarString.MULTISID_QUERY] = string.Empty;
|
||||
VAR.TIME.Update(eVarTime.KEYENCEWAIT);
|
||||
PUB.sm.seq.Update(cmdIndex);
|
||||
return EResultKeyence.Wait;
|
||||
@@ -92,35 +96,41 @@ namespace Project
|
||||
//동작중이아니라면 처리하지 않음
|
||||
if (PUB.sm.getNewStep != eSMStep.RUN) return EResultKeyence.Wait;
|
||||
|
||||
//var k1 = UpLoadBarcodeConfig(PUB.keyenceF);
|
||||
|
||||
//바이패스라면 무조건ok한다.
|
||||
var systembypassmode = SETTING.Data.SystemBypass;
|
||||
if (systembypassmode && PUB.flag.get(eVarBool.FG_RDY_PORT_PC))
|
||||
{
|
||||
vdata.VisionData.SetRID("BP" + DateTime.Now.ToString("yyyyMMddHHmmss"), "bp");
|
||||
vdata.VisionData.SID = ("100000000");
|
||||
vdata.VisionData.VNAME = "BYPASS";
|
||||
vdata.VisionData.MFGDATE = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
vdata.VisionData.VLOT = "BYPASS";
|
||||
vdata.VisionData.CUSTCODE = "0000";
|
||||
vdata.VisionData.CUSTNAME = "BYPASS";
|
||||
vdata.VisionData.QTY = "10000";
|
||||
vdata.VisionData.ConfirmUser = true;
|
||||
vdata.VisionData.PrintPositionData = "1";
|
||||
vdata.VisionData.PrintPositionCheck = true;
|
||||
vdata.SetRID("BP" + DateTime.Now.ToString("yyyyMMddHHmmss"), "bp");
|
||||
vdata.SID = ("100000000");
|
||||
vdata.VNAME = "BYPASS";
|
||||
vdata.MFGDATE = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
vdata.VLOT = "BYPASS";
|
||||
vdata.CUSTCODE = "0000";
|
||||
vdata.CUSTNAME = "BYPASS";
|
||||
vdata.QTY = "10000";
|
||||
vdata.ConfirmUser = true;
|
||||
vdata.PrintPositionData = "1";
|
||||
vdata.PrintPositionCheck = true;
|
||||
vdata.MFGDATE_Trust = true;
|
||||
vdata.PARTNO_Trust = true;
|
||||
vdata.QTY_Trust = true;
|
||||
vdata.RID_Trust = true;
|
||||
vdata.SID_Trust = true;
|
||||
vdata.VLOT_Trust = true;
|
||||
vdata.VNAME_Trust = true;
|
||||
return EResultKeyence.Complete;
|
||||
}
|
||||
|
||||
|
||||
//로더정보를 사용자가 처리중이면 동작 안함
|
||||
if (PUB.flag.get(eVarBool.FG_WAIT_LOADERINFO)) return EResultKeyence.TimeOut;
|
||||
if (VAR.BOOL[eVarBool.FG_WAIT_LOADERINFO]) return EResultKeyence.TimeOut;
|
||||
|
||||
//다중SID환경에서 데이터를 선택하고 있다.
|
||||
if (VAR.BOOL[eVarBool.FG_WAIT_INFOSELECT]) return EResultKeyence.Wait;
|
||||
|
||||
//데이터 처리 시간을 넘어서면 사용자 확인 창을 띄운다 220621
|
||||
var ts = VAR.TIME.RUN((int)eVarTime.KEYENCEWAIT);
|
||||
if (PUB.flag.get(eVarBool.FG_RDY_PORT_PC) && ts.TotalMilliseconds > AR.SETTING.Data.Timeout_VisionProcessL)
|
||||
if (VAR.BOOL[eVarBool.FG_RDY_PORT_PC] && ts.TotalMilliseconds > AR.SETTING.Data.Timeout_VisionProcessL)
|
||||
{
|
||||
|
||||
//화면업데이트를 종료한다
|
||||
if (PUB.keyenceF != null) PUB.keyenceF.Trigger(false);
|
||||
if (PUB.keyenceR != null) PUB.keyenceR.Trigger(false);
|
||||
@@ -142,18 +152,10 @@ namespace Project
|
||||
itemC.VisionData.SetImage(
|
||||
new Emgu.CV.Mat(tempfiF.FullName, Emgu.CV.CvEnum.ImreadModes.Grayscale),
|
||||
new Emgu.CV.Mat(tempfiR.FullName, Emgu.CV.CvEnum.ImreadModes.Grayscale));
|
||||
//using (var tempimg = new Emgu.CV.Image<Emgu.CV.Structure.Gray, byte>(tempfi.FullName))
|
||||
//{
|
||||
// itemC.VisionData.SetImage(tempimg);
|
||||
//}
|
||||
}
|
||||
else if (CurImageF)
|
||||
{
|
||||
itemC.VisionData.SetImage(new Emgu.CV.Mat(tempfiF.FullName, Emgu.CV.CvEnum.ImreadModes.Grayscale));
|
||||
//using (var tempimg = new Emgu.CV.Image<Emgu.CV.Structure.Gray, byte>(tempfi.FullName))
|
||||
//{
|
||||
// itemC.VisionData.SetImage(tempimg);
|
||||
//}
|
||||
}
|
||||
PUB.keyenceF.Trigger(true);
|
||||
PUB.keyenceR.Trigger(true);
|
||||
@@ -184,7 +186,6 @@ namespace Project
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//기본 벤더이름
|
||||
if (OPT_BYPASS == false && PUB.Result.vModel.Def_Vname.isEmpty() == false)
|
||||
{
|
||||
@@ -206,10 +207,87 @@ namespace Project
|
||||
PUB.log.Add($"Defaul MFGDATE Set to {PUB.Result.vModel.Def_MFG}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//옵션설정에 따른 외부데이터 가져오기 작업
|
||||
bool NewBarcodeUpdated = false;
|
||||
|
||||
|
||||
|
||||
//[WMS] SID정보테이블에서 정보 추출(프린트정보는 없음)
|
||||
//[WMS] 에서 중복검색되면 팝업을 해야하므로 이것을 먼저 처리한다.
|
||||
if (VAR.BOOL[eVarBool.Opt_ApplySIDInfo] && vdata.BarcodeDirty == true)
|
||||
{
|
||||
Boolean Apply = true;
|
||||
|
||||
//select columns
|
||||
List<string> fields = new List<string>();
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Apply_CustCode] && vdata.CUSTCODE.isEmpty()) fields.Add("CUST_CODE");
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Apply_PartNo] && (vdata.PARTNO.isEmpty() || vdata.PARTNO_Trust == false)) fields.Add("PART_NO");
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Apply_VenderName] && (vdata.VNAME_Trust == false || vdata.VNAME.isEmpty())) fields.Add("VENDOR_NM");
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Apply_SID] && (vdata.SID_Trust == false || vdata.SID.isEmpty())) fields.Add("SID");
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Apply_batch] && (vdata.SID_Trust == false || vdata.BATCH.isEmpty())) fields.Add("BATCH_NO"); //220921
|
||||
|
||||
//where coluns
|
||||
List<string> wheres = new List<string>();
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_CustCode])
|
||||
{
|
||||
if (vdata.CUSTCODE.isEmpty() == false) wheres.Add($"CUST_CODE='{vdata.CUSTCODE}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_PartNo])
|
||||
{
|
||||
if (vdata.PARTNO_Trust && vdata.PARTNO.isEmpty() == false) wheres.Add($"PART_NO='{vdata.PARTNO}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_SID])
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.Opt_SIDConvert]) //if sid convert logic
|
||||
{
|
||||
if (vdata.SID_Trust && vdata.SID0.isEmpty() == false && vdata.SID.isEmpty() == false) wheres.Add($"SID='{vdata.SID}'");
|
||||
else Apply = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vdata.SID_Trust && vdata.SID.isEmpty() == false) wheres.Add($"SID='{vdata.SID}'");
|
||||
else Apply = false;
|
||||
}
|
||||
}
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_VLOT]) //221013
|
||||
{
|
||||
if (vdata.VLOT_Trust && vdata.VLOT.isEmpty() == false) wheres.Add($"VENDER_LOT = '{vdata.VLOT}'");
|
||||
else Apply = false;
|
||||
}
|
||||
|
||||
//if query data . no error
|
||||
if (Apply && fields.Count > 0 && wheres.Count > 0)
|
||||
{
|
||||
var mcname = VAR.BOOL[eVarBool.Use_Conveyor] ? PUB.MCCode : SETTING.Data.McName;
|
||||
|
||||
var TableName = "VW_GET_MAX_QTY_VENDOR_LOT";
|
||||
var whereState = " where " + string.Join(" and ", wheres);
|
||||
var selectFields = string.Join(",", fields);
|
||||
|
||||
var SQL = $"select top 1 {selectFields} from {TableName} WITH(NOLOCK) {whereState}";
|
||||
var SQLC = $"select count(*) from {TableName} WITH(NOLOCK) {whereState}";
|
||||
|
||||
//정보가 여러개 존재하면 선택화면으로 처리해야한다
|
||||
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_FIELDS] = selectFields;
|
||||
return EResultKeyence.MultiSID;
|
||||
}
|
||||
|
||||
if (PUB.Result.ItemDataC.VisionData.LastQueryStringWMS.Equals(SQL) == false) //같은 쿼리는 처리하지 않는다
|
||||
{
|
||||
if (PUB.GetSIDInfo_And_SetData(fields, ref vdata, SQL, SQLC))
|
||||
NewBarcodeUpdated = true;
|
||||
|
||||
PUB.Result.ItemDataC.VisionData.LastQueryStringWMS = SQL;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//SID정보테이블에서 정보 추출
|
||||
if (VAR.BOOL[eVarBool.Opt_ApplySIDInfo] && vdata.BarcodeDirty == true)
|
||||
@@ -230,20 +308,19 @@ namespace Project
|
||||
//where coluns
|
||||
List<string> wheres = new List<string>();
|
||||
//wheres.Add($"MC='{COMM.SETTING.Data.McName}");
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Where_CustCode])
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_CustCode])
|
||||
{
|
||||
if (vdata.CUSTCODE.isEmpty() == false) wheres.Add($"CustCode='{vdata.CUSTCODE}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Where_PartNo])
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_PartNo])
|
||||
{
|
||||
if (vdata.PARTNO_Trust && vdata.PARTNO.isEmpty() == false) wheres.Add($"PartNo='{vdata.PARTNO}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Where_SID])
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_SID])
|
||||
{
|
||||
//if sid convert logic
|
||||
if (VAR.BOOL[eVarBool.Opt_SIDConvert])
|
||||
if (VAR.BOOL[eVarBool.Opt_SIDConvert]) //if sid convert logic
|
||||
{
|
||||
if (vdata.SID_Trust && vdata.SID0.isEmpty() == false && vdata.SID.isEmpty() == false)
|
||||
wheres.Add($"SID='{vdata.SID}'");
|
||||
@@ -255,16 +332,18 @@ namespace Project
|
||||
else Apply = false;
|
||||
}
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Where_VLOT]) //221013
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_VLOT]) //221013
|
||||
{
|
||||
if (vdata.VLOT_Trust && vdata.VLOT.isEmpty() == false)
|
||||
wheres.Add($"(VenderLot like '{vdata.VLOT}' or VenderLot like '%,{vdata.VLOT}' or VenderLot like '{vdata.VLOT},%' or VenderLot like '%,{vdata.VLOT},%')");
|
||||
else Apply = false;
|
||||
}
|
||||
|
||||
if (VAR.BOOL[eVarBool.Opt_SID_Where_MC]) //231006
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_SID_Where_MC]) //231006
|
||||
{
|
||||
wheres.Add($"attach='{AR.SETTING.Data.McName}'");
|
||||
if (AR.SETTING.Data.McName.isEmpty() == false)
|
||||
wheres.Add($"attach='{AR.SETTING.Data.McName}'");
|
||||
else Apply = false;
|
||||
}
|
||||
|
||||
//if query data . no error
|
||||
@@ -285,54 +364,151 @@ namespace Project
|
||||
|
||||
if (PUB.Result.ItemDataC.VisionData.LastQueryStringSID.Equals(SQL) == false)
|
||||
{
|
||||
if (PUB.GetSIDInfo_And_SetData(fields, ref vdata, SQL, SQLC) == true)
|
||||
NewBarcodeUpdated = true;
|
||||
|
||||
PUB.log.Add($"DATABAES : SID INFORMATIION QUERY");
|
||||
PUB.log.Add(SQL);
|
||||
var CS = Properties.Settings.Default.CS;
|
||||
var CN = new System.Data.SqlClient.SqlConnection(CS);
|
||||
var CMD = new System.Data.SqlClient.SqlCommand(SQL, CN);
|
||||
if (CN.State == System.Data.ConnectionState.Closed) CN.Open();
|
||||
|
||||
//데이터가 중복으로 존재하는지 확인한다. 231006
|
||||
CMD.CommandText = SQLC;
|
||||
var cnt = int.Parse(CMD.ExecuteScalar().ToString());
|
||||
if (cnt == 1)
|
||||
{
|
||||
CMD.CommandText = SQL;
|
||||
var DAR = CMD.ExecuteReader();
|
||||
while (DAR.Read())
|
||||
{
|
||||
//loop select columns
|
||||
for (int i = 0; i < fields.Count; i++)
|
||||
{
|
||||
var colName = fields[i];
|
||||
var v = DAR[colName];
|
||||
if (v != null)
|
||||
{
|
||||
var vStr = v.ToString().RemoveNoneASCII().Trim();
|
||||
if (vStr.isEmpty()) continue;
|
||||
|
||||
if (PUB.UpdateSIDInfoData(ref vdata, colName, vStr)) NewBarcodeUpdated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
DAR.Close();
|
||||
}
|
||||
CMD.Dispose();
|
||||
if (CN.State == System.Data.ConnectionState.Open) CN.Close();
|
||||
CN.Dispose();
|
||||
PUB.Result.ItemDataC.VisionData.LastQueryStringSID = SQL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//시드변환정보에서 정보 추출
|
||||
if (VAR.BOOL[eVarBool.Opt_ApplySIDConv] && vdata.BarcodeDirty == true)
|
||||
{
|
||||
Boolean Apply = true;
|
||||
|
||||
//select columns
|
||||
List<string> fields = new List<string>();
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Apply_CustCode] && vdata.CUSTCODE.isEmpty()) fields.Add("CustCode");
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Apply_PartNo] && (vdata.PARTNO.isEmpty() || vdata.PARTNO_Trust == false)) fields.Add("PartNo");
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Apply_PrintPos] && vdata.PrintPositionData.isEmpty()) fields.Add("PrintPosition");
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Apply_VenderName] && (vdata.VNAME_Trust == false || vdata.VNAME.isEmpty())) fields.Add("VenderName");
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Apply_SID] && (vdata.SID_Trust == false || vdata.SID.isEmpty())) fields.Add("SID");
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Apply_Batch] && (vdata.SID_Trust == false || vdata.BATCH.isEmpty())) fields.Add("batch"); //220921
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Apply_QtyMax] && (vdata.SID_Trust == false || vdata.QTYMAX.isEmpty())) fields.Add("qtymax"); //220921
|
||||
|
||||
|
||||
//WMS정보테이블에서 정보 추출
|
||||
//where coluns
|
||||
List<string> wheres = new List<string>();
|
||||
//wheres.Add($"MC='{COMM.SETTING.Data.McName}");
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_Conv_Where_CustCode])
|
||||
{
|
||||
if (vdata.CUSTCODE.isEmpty() == false) wheres.Add($"CustCode='{vdata.CUSTCODE}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_Conv_Where_PartNo])
|
||||
{
|
||||
if (vdata.PARTNO_Trust && vdata.PARTNO.isEmpty() == false) wheres.Add($"PartNo='{vdata.PARTNO}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (Apply && VAR.BOOL[eVarBool.Opt_Conv_Where_SID])
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.Opt_SIDConvert]) //if sid convert logic
|
||||
{
|
||||
if (vdata.SID_Trust && vdata.SID0.isEmpty() == false && vdata.SID.isEmpty() == false)
|
||||
wheres.Add($"SIDTo='{vdata.SID}'");
|
||||
else Apply = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vdata.SID_Trust && vdata.SID.isEmpty() == false) wheres.Add($"SIDTo='{vdata.SID}'");
|
||||
else Apply = false;
|
||||
}
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.Opt_Conv_Where_VLOT]) //221013
|
||||
{
|
||||
if (vdata.VLOT_Trust && vdata.VLOT.isEmpty() == false)
|
||||
wheres.Add($"(VenderLot like '{vdata.VLOT}' or VenderLot like '%,{vdata.VLOT}' or VenderLot like '{vdata.VLOT},%' or VenderLot like '%,{vdata.VLOT},%')");
|
||||
else Apply = false;
|
||||
}
|
||||
|
||||
//SID변환정보에서 정보 추출
|
||||
|
||||
//기존 작업내역에서 정보 추출
|
||||
//if query data . no error
|
||||
if (Apply && fields.Count > 0 && wheres.Count > 0)
|
||||
{
|
||||
|
||||
var mcname = SETTING.Data.McName;
|
||||
if (VAR.BOOL[eVarBool.Use_Conveyor]) mcname = PUB.MCCode;
|
||||
|
||||
var SQL = "select top 1 " + string.Join(",", fields) +
|
||||
" from K4EE_Component_Reel_SID_Convert WITH(NOLOCK)" +
|
||||
" where " + string.Join(" and ", wheres) +
|
||||
" order by wdate desc";
|
||||
|
||||
var SQLC = "select count(*)" +
|
||||
" from K4EE_Component_Reel_SID_Convert WITH(NOLOCK)" +
|
||||
" where " + string.Join(" and ", wheres);
|
||||
|
||||
if (PUB.Result.ItemDataC.VisionData.LastQueryStringCNV.Equals(SQL) == false)
|
||||
{
|
||||
if (PUB.GetSIDInfo_And_SetData(fields, ref vdata, SQL, SQLC) == true)
|
||||
NewBarcodeUpdated = true;
|
||||
|
||||
PUB.Result.ItemDataC.VisionData.LastQueryStringCNV = SQL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//기존 작업에서 데이터를 찾아서 쓴다
|
||||
if (VAR.BOOL[eVarBool.Opt_ApplyJobInfo] && vdata.BarcodeDirty == true)
|
||||
{
|
||||
Boolean Apply = true;
|
||||
|
||||
//select columns
|
||||
List<string> fields = new List<string>();
|
||||
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Apply_CustCode] && vdata.CUSTCODE.isEmpty()) fields.Add("CUSTCODE");
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Apply_PartNo] && (vdata.PARTNO.isEmpty() || vdata.PARTNO_Trust == false)) fields.Add("PARTNO");
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Apply_PrintPos] && vdata.PrintPositionData.isEmpty()) fields.Add("POS");
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Apply_VenderName] && (vdata.VNAME_Trust == false || vdata.VNAME.isEmpty())) fields.Add("VNAME");
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Apply_SID] && (vdata.SID_Trust == false || vdata.SID.isEmpty())) fields.Add("SID");
|
||||
|
||||
//where coluns
|
||||
List<string> wheres = new List<string>();
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Where_CustCode])
|
||||
{
|
||||
if (vdata.CUSTCODE.isEmpty() == false) wheres.Add($"CUSTCODE='{vdata.CUSTCODE}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Where_PartNo])
|
||||
{
|
||||
if (vdata.PARTNO_Trust && vdata.PARTNO.isEmpty() == false) wheres.Add($"PARTNO='{vdata.PARTNO}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Where_SID])
|
||||
{
|
||||
if (vdata.SID_Trust && vdata.SID.isEmpty() == false) wheres.Add($"SID='{vdata.SID}'");
|
||||
else Apply = false;
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.Opt_Job_Where_VLOT])
|
||||
{
|
||||
if (vdata.VLOT_Trust && vdata.VLOT.isEmpty() == false) wheres.Add($"VenderLot='{vdata.VLOT}'");
|
||||
else Apply = false;
|
||||
}
|
||||
|
||||
//if query data . no error
|
||||
if (Apply && fields.Count > 0 && wheres.Count > 0)
|
||||
{
|
||||
PUB.log.Add($"DATABAES : RESULT QUERY");
|
||||
|
||||
var SQL = "select top 1 " + string.Join(",", fields) +
|
||||
" from K4EE_Component_Reel_Result WITH(NOLOCK) " +
|
||||
$" where mc = '{AR.SETTING.Data.McName}'" +
|
||||
$" and prnattach = 1 and stime >= '{DateTime.Now.AddHours(-3).ToString("yyyy-MM-dd HH:mm:ss")}'" +
|
||||
$" and " + string.Join(" and ", wheres) +
|
||||
$" order by wdate desc";
|
||||
|
||||
if (PUB.Result.ItemDataC.VisionData.LastQueryStringJOB.Equals(SQL) == false)
|
||||
{
|
||||
if (PUB.GetSIDInfo_And_SetData(fields, ref vdata, SQL, ""))
|
||||
NewBarcodeUpdated = true;
|
||||
|
||||
PUB.Result.ItemDataC.VisionData.LastQueryStringJOB = SQL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//해당 바코드작업이 완료되었는지 확인한다. 신규 바코드값이 업데이트되면 한번더 동작하도록 한다
|
||||
if (itemC.VisionData.BarcodeDirty == true && NewBarcodeUpdated == false)
|
||||
{
|
||||
itemC.VisionData.BarcodeDirty = false;
|
||||
@@ -377,7 +553,6 @@ namespace Project
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//데이터확정 및 완료처리
|
||||
if (itemC.VisionData.Confirm)
|
||||
{
|
||||
@@ -421,7 +596,6 @@ namespace Project
|
||||
return EResultKeyence.Wait;
|
||||
}
|
||||
|
||||
|
||||
//####################################################
|
||||
//###
|
||||
//####################################################
|
||||
|
||||
Reference in New Issue
Block a user