/// <summary> /// 檢查首件是否檢驗完成,檢驗完成回傳 True,未完成回傳 False /// </summary> /// <param name="equipmentName"></param> /// <param name="lot"></param> /// <returns></returns> public static bool CheckFAI(string equipmentName, string lot) { /* * 在CST_EQP_FAI裡沒有資料代表沒有送驗,則視為FAI未完成 * 在CST_EQP_FAI有資料,但是waitCount不等於0,代表FAI未完成 * 在CST_EQP_FAI有資料,且waitCount = 0,代表FAI完成 */ //取得批號資料 var lotData = LotInfo.GetLotByLot(lot); var faiData = CSTEquipmentFAIInfo.GetDataByEquipmentAndDevice(equipmentName, lotData.DeviceName); if (faiData == null) { //找不到首件檢驗的資料,請確認是否已執行調機作業!!! throw new CimesException(RuleMessage.Error.C00026()); } if (faiData != null && faiData.WAITFAICOUNT <= 0) { return(true); } return(false); }
/// <summary> /// 更新FAI,檢驗完成回壓FAICount,第一次首件回壓FAIDevice /// </summary> /// <param name="equipmentName"></param> /// <param name="lot"></param> public static void UpdateFAI(string equipmentName, string lot, bool initFlag, TransactionStamp txs) { //取得批號資料 var lotData = LotInfo.GetLotByLot(lot); var faiData = CSTEquipmentFAIInfo.GetDataByEquipmentAndDevice(equipmentName, lotData.DeviceName); if (faiData == null) { return; } if (faiData.INSPTYPE == FAIType.CN.ToCimesString()) { #region 連N測試,只要一支NG,就要reset檢驗次數,重新送件 //判定NG的時候回壓初始化FAICount,判定OK則WAITFAICOUNT減1 if (initFlag) //NG { //取得料號版本的資料 var deviceVerExData = DeviceVersionInfo.GetDeviceVersion(lotData.DeviceName, lotData.DeviceVersion).ChangeTo <DeviceVersionInfoEx>(); //檢查料號的FAICount有無設定 if (deviceVerExData.FAICount.ToString().IsNullOrTrimEmpty()) { //T00541 //料號:xxx的系統屬性:xxx 未設定,請洽IT人員!) error code:T00031 throw new Exception(TextMessage.Error.T00541(deviceVerExData.DeviceName, "FAICount")); } faiData.WAITFAICOUNT = deviceVerExData.FAICount; } else //OK { faiData.WAITFAICOUNT = faiData.WAITFAICOUNT - 1; } #endregion } else { //首N測試,判定OK將WAITFAICOUNT減1就好,判定NG不須動作 if (!initFlag) { faiData.WAITFAICOUNT = faiData.WAITFAICOUNT - 1; } } faiData.UpdateToDB(txs.UserID, txs.RecordTime); LogCenter.LogToDB(faiData, LogCenter.LogIndicator.Create(ActionType.Set, txs.UserID, txs.RecordTime)); }