From a63619812862fc788d6fd73b66c7c6d80bf47c44 Mon Sep 17 00:00:00 2001 From: "Infineon\\Mitchem" Date: Thu, 10 Jul 2025 08:26:17 -0700 Subject: [PATCH] Create new services. Commit to switch branches. Fix error text. Fixed CassetteID variable typo. Commit final changes. --- LSL2/STPROC/COMM_WO_MAT_WFR.txt | 7 ++- LSL2/STPROC/NDW_WAFER_COUNTER_EVENTS.txt | 78 ++++++++++++++++-------- LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt | 32 ++++++++++ LSL2/STPROC/WAFERCOUNTER_API.txt | 77 ++++++++++++++++++++++- LSL2/STPROC/WAFER_COUNTER_SERVICES.txt | 5 +- LSL2/STPROC/WO_MAT_QA_SERVICES.txt | 67 +++++++++++++++++++- 6 files changed, 235 insertions(+), 31 deletions(-) diff --git a/LSL2/STPROC/COMM_WO_MAT_WFR.txt b/LSL2/STPROC/COMM_WO_MAT_WFR.txt index 2669532..37a04de 100644 --- a/LSL2/STPROC/COMM_WO_MAT_WFR.txt +++ b/LSL2/STPROC/COMM_WO_MAT_WFR.txt @@ -425,7 +425,7 @@ RejMat: Msg(@window, MsgUp) ;* take down the processing message end end - + IneligibleSlots = '' AllSlotsPermitted = True$ ; // Assume that all slots are permitted to be NCR'd for now. For I = 1 TO SelCnt @@ -434,7 +434,7 @@ RejMat: WfrID = SlotList, COL$WAFER_ID> PrevNCR = SlotList, COL$SLOT_NCR> MUWfrID = SlotList, COL$MU_WAFER_ID> - If (WfrId EQ '') then + If ( (MetNo NE '') or (WfrID EQ '') or (PrevNCR NE '' and MUWfrID EQ '') ) then AllSlotsPermitted = False$ IneligibleSlots<0, -1> = SlotNo end @@ -1233,3 +1233,6 @@ LogRecord: return + + + diff --git a/LSL2/STPROC/NDW_WAFER_COUNTER_EVENTS.txt b/LSL2/STPROC/NDW_WAFER_COUNTER_EVENTS.txt index 22a4a16..63d4eb1 100644 --- a/LSL2/STPROC/NDW_WAFER_COUNTER_EVENTS.txt +++ b/LSL2/STPROC/NDW_WAFER_COUNTER_EVENTS.txt @@ -44,7 +44,7 @@ Equ MSG_WIDTH$ to 650 Equ Comma$ to ',' Declare function MemberOf, Form_Services, Wafer_Counter_Services, SRP_Json, WO_Mat_Services, Wm_Out_Services, Datetime -Declare function Logging_Services, Environment_Services +Declare function Logging_Services, Environment_Services, Wo_Mat_Qa_Services, Return_To_Fab_Services Declare subroutine SRP_Json, PlaceDialog, Wafer_Counter_Services, Logging_Services LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WaferCounter' @@ -97,13 +97,26 @@ Event WINDOW.CREATE(CreateParam) LogData<5> = ToolLoc LogData<6> = @Window:'.CREATE' Logging_Services('AppendLog', objLog, LogData, @RM, @FM) + QAMetComplete = '' + + If CassID NE '' then + If RowExists('WM_OUT', CassID) then + WOMatKey = Xlate('WM_OUT', CassID, 'WO_MAT_KEY', 'X') + end else + WOMatKey = Xlate('RDS', CassID, 'WO_MAT_KEY', 'X') + end + QAMetComplete = Wo_Mat_Qa_Services('GetQAMetComplete', WOMatKey) + end Convert '.' to '*' in CassID ExpectedQty = '' ExpectedWfrMap = '' If WfrCntAdj EQ '' then WfrCntAdj = 0 Set_Property(@Window:'.EDL_CASS_ID', 'TEXT', CassID) + Begin Case + Case (CassID NE '' AND QAMetComplete EQ False$) + ErrorMsg = 'Wafer Counter Operation Not Allowed. QA Metrology Incomplete.' Case ( (CassID EQ '') and (ToolLoc EQ '') ) // Alternate workflow Set_Property(@Window:'.LBL_CASS_ID', 'TEXT', 'Cass ID') @@ -319,36 +332,49 @@ Event EDL_CASS_BARCODE.LOSTFOCUS(Flag, FocusID) Set_Property(@Window:'.EDL_CASS_ID', 'TEXT', CassetteID) Begin Case Case RowExists('RDS', CassetteID) - ExpectedQty = Xlate('RDS', CassetteID, 'WFRS_OUT', 'X') - Set_Property(@Window:'.EDL_EXPECTED_QTY', 'TEXT', ExpectedQty) - Set_Property(@Window:'.LBL_CASS_ID', 'TEXT', 'Cass RDS') - Set_Property(@Window:'.LBL_CASS_BARCODE', 'TEXT', 'Cass RDS 2D') - - WOMatKey = Xlate('RDS', CassetteID, 'WO_MAT_KEY', 'X') - CurrWfrMap = WO_Mat_Services('GetWaferMap', WOMatKey) - If Error_Services('NoError') then - ExpectedWfrMap = CurrWfrMap + WOMatKey = Xlate('RDS', CassetteID, 'WO_MAT_KEY', 'X') + QAMetComplete = Wo_Mat_Qa_Services('GetQAMetComplete', WOMatKey) + If QAMetComplete EQ True$ then + ExpectedQty = Xlate('RDS', CassetteID, 'WFRS_OUT', 'X') + Set_Property(@Window:'.EDL_EXPECTED_QTY', 'TEXT', ExpectedQty) + Set_Property(@Window:'.LBL_CASS_ID', 'TEXT', 'Cass RDS') + Set_Property(@Window:'.LBL_CASS_BARCODE', 'TEXT', 'Cass RDS 2D') + + WOMatKey = Xlate('RDS', CassetteID, 'WO_MAT_KEY', 'X') + CurrWfrMap = WO_Mat_Services('GetWaferMap', WOMatKey) + If Error_Services('NoError') then + ExpectedWfrMap = CurrWfrMap + end else + ErrorMsg = Error_Services('GetMessage') + end end else - ErrorMsg = Error_Services('GetMessage') + ErrorMsg = 'Wafer Counter Operation Not Allowed. QA Metrology Incomplete.' end Case RowExists('WM_OUT', CassetteID) - ExpectedQty = Xlate('WM_OUT', CassetteID, 'WAFER_CNT', 'X') - Set_Property(@Window:'.EDL_EXPECTED_QTY', 'TEXT', ExpectedQty) - Set_Property(@Window:'.LBL_CASS_ID', 'TEXT', 'Cass WMO') - Set_Property(@Window:'.LBL_CASS_BARCODE', 'TEXT', 'Cass WMO 2D') - - CurrWfrMap = WM_Out_Services('GetWaferMap', CassetteID) - If Error_Services('NoError') then - ExpectedWfrMap = CurrWfrMap + WOMatKey = Xlate('WM_OUT', CassetteID, 'WO_MAT_KEY', 'X') + QAMetComplete = Wo_Mat_Qa_Services('GetQAMetComplete', WOMatKey) + If QAMetComplete EQ True$ then + ExpectedQty = Xlate('WM_OUT', CassetteID, 'WAFER_CNT', 'X') + Set_Property(@Window:'.EDL_EXPECTED_QTY', 'TEXT', ExpectedQty) + Set_Property(@Window:'.LBL_CASS_ID', 'TEXT', 'Cass WMO') + Set_Property(@Window:'.LBL_CASS_BARCODE', 'TEXT', 'Cass WMO 2D') + + CurrWfrMap = WM_Out_Services('GetWaferMap', CassetteID) + If Error_Services('NoError') then + ExpectedWfrMap = CurrWfrMap + end else + ErrorMsg = Error_Services('GetMessage') + end end else - ErrorMsg = Error_Services('GetMessage') - end - + ErrorMsg = 'Wafer Counter Operation Not Allowed. QA Metrology Incomplete.' + end End Case - Convert @VM to '' in ExpectedWfrMap - Set_Property(@Window, '@EXPECTED_WFR_MAP', ExpectedWfrMap) + If ErrorMsg EQ '' then + Convert @VM to '' in ExpectedWfrMap + Set_Property(@Window, '@EXPECTED_WFR_MAP', ExpectedWfrMap) + end end else If CassetteID NE VerifyCassID then ErrorMsg = 'Scanned cassette ID does not match cassette to verify!' @@ -598,3 +624,7 @@ ClearForm: return + + + + diff --git a/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt b/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt index febb8f8..a9270ec 100644 --- a/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt +++ b/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt @@ -1141,6 +1141,38 @@ Service OpenOIWizardReturnToFabInBrowser(RTFId) end service +Service GetReturnedToFab(CassID) + If CassID NE '' then + RTFRecords = '' + ErrorMessage = '' + If CassId NE '' then + table = "RETURN_TO_FAB_LOTS" + Open "DICT ":table To @DICT Else + ErrorMessage = 'Error opening RETURN_TO_FAB_LOTS dictionary' + End + If ErrorMessage EQ '' then + srch_strng = "CASS_ID":@VM:CassId:@FM + option = "" + flag = "" + Btree.Extract(srch_strng, table, @DICT, RTFRecords, option, flag) + end + end else + ErrorMessage = 'Error getting return to fab record by cass. ID. Cassette ID was null' + end + end else + ErrorMessage = 'Missing CassID parameter.' + end + If ErrorMessage EQ '' then + If RTFRecords = '' then + Response = False$ + end else + Response = True$ + end + end else + Error_Services('Add', ErrorMessage) + end + +end service Service InitializeReturnToFabLotOperations(LotId) ErrorMessage = '' diff --git a/LSL2/STPROC/WAFERCOUNTER_API.txt b/LSL2/STPROC/WAFERCOUNTER_API.txt index eeb836d..e82d542 100644 --- a/LSL2/STPROC/WAFERCOUNTER_API.txt +++ b/LSL2/STPROC/WAFERCOUNTER_API.txt @@ -39,7 +39,7 @@ Function Wafercounter_API(@API) #pragma precomp SRP_PreCompiler Declare function OI_Wizard_Services, Wafer_Counter_Services, Database_Services, Datetime, Wo_Mat_Services -Declare function Logging_Services, Environment_Services +Declare function Logging_Services, Environment_Services, Wo_Mat_Qa_Services, Return_To_Fab_Services Declare subroutine Logging_Services @@ -127,7 +127,12 @@ API wafercounter.startnewwafercount.POST CassNo = Field(CassId, '*', 3) WoMatKey = WONo : '*' : CassNo End Case + ReturnedToFab = Return_To_Fab_Services('GetReturnedToFab', CassID) + QAMetComplete = Wo_Mat_Qa_Services('GetQAMetComplete', WoMatKey) ExpectedWfrMap = Wo_Mat_Services('GetWaferMap', WoMatKey) + If (ReturnedToFab EQ False$) AND (QAMetComplete EQ False$) then + Error_Services('Add', 'Wafer Counter Operation Not Allowed. QA Metrology Incomplete.') + end ExpectedCassetteArray = '' for i = 25 to 1 step -1 Slot = i @@ -376,3 +381,73 @@ API wafercounter.ID.GET HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage) end api + + +API wafercounter.ID.HEAD +API wafercounter.ID.GET + + ErrorMessage = '' + ResponseCode = '' + WaferCounterId = EndPointSegment + CassId = '' + Body = '' + OIWizardID = '' + UserId = '' + Cookies = HTTP_Services('GetHTTPCookie') + For each Cookie in Cookies using ';' + Key = Field(Cookie, '=', 1) + If Key EQ 'sessionID' then + OIWizardID = Field(Cookie, '=', 2) + end + Next Cookie + ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID) + CassBarcodeData = '' + UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X') + StatusCode = '' + Body = HTTP_Services('GetHTTPPostString', True$) + DecodedJSON = HTTP_Services('DecodePercentString', Body) + + //Log Entry into API - + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = UserId + LogData<3> = OIWizardId + LogData<4> = 'Getting Wafer counter record. Record Id: ' : WaferCounterId + Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$) + + If WaferCounterId NE '' then + WaferCounterJson = Wafer_Counter_Services('ConvertWaferCounterRecToJson', WaferCounterId) + If Error_Services('NoError') then + HTTP_Services('SetResponseBody', WaferCounterJson) + ResponseCode = 200 + end else + ErrorMessage = Error_Services('GetMessage') + ResponseCode = 500 + end + end else + ErrorMessage = 'Null wafer counter passed to endpoint.' + end + + If ErrorMessage EQ '' then + //Log Success + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = UserId + LogData<3> = OIWizardId + LogData<4> = 'Wafer Counter record successfully returned. Wafer Counter Id: ' : WaferCounterId + Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$) + end else + //Log Failure + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = UserId + LogData<3> = OIWizardId + LogData<4> = 'Error returning wafer counter record. Wafer Counter Id: ' : WaferCounterId : ' . Error Message: ' : ErrorMessage + Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$) + end + + HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL) + HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage) + +end api + diff --git a/LSL2/STPROC/WAFER_COUNTER_SERVICES.txt b/LSL2/STPROC/WAFER_COUNTER_SERVICES.txt index c7d6902..d42365c 100644 --- a/LSL2/STPROC/WAFER_COUNTER_SERVICES.txt +++ b/LSL2/STPROC/WAFER_COUNTER_SERVICES.txt @@ -530,8 +530,8 @@ Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID) If SRP_JSON(objJson, 'New', 'Object') then SRP_JSON(objJson, 'SetValue', 'dateTimeFormatted', Datetime(), 'String') SRP_JSON(objJson, 'SetValue', 'equipmentId', 'WC8INCH1', 'String') - SRP_JSON(objJson, 'SetValue', 'total', 25, 'Number') - SRP_JSON(objJson, 'SetValue', 'slotMap', '1111111111111111111111111', 'String') + SRP_JSON(objJson, 'SetValue', 'total', 24, 'Number') + SRP_JSON(objJson, 'SetValue', 'slotMap', '1111111110111111111111111', 'String') Response = SRP_Json(objJson, 'Stringify', 'Styled') SRP_JSON(objJSON, 'Release') end @@ -744,4 +744,3 @@ return - diff --git a/LSL2/STPROC/WO_MAT_QA_SERVICES.txt b/LSL2/STPROC/WO_MAT_QA_SERVICES.txt index 0130e26..c9d6bd3 100644 --- a/LSL2/STPROC/WO_MAT_QA_SERVICES.txt +++ b/LSL2/STPROC/WO_MAT_QA_SERVICES.txt @@ -58,7 +58,7 @@ $Insert PRS_STAGE_EQUATES $Insert PROD_VER_EQUATES $Insert QA_MET_EQUATES ;* Used in GetQAMet data structure return variable -Declare function Database_Services, SRP_JSON, Error_Services, obj_Prod_Spec +Declare function Database_Services, SRP_JSON, Error_Services, obj_Prod_Spec, Wo_Mat_Qa_Services Declare subroutine Database_Services, SRP_JSON, Error_Services GoToService @@ -419,3 +419,68 @@ Service AllWafersWereTested(WoMatQAKey, StageToInspect) end service +Service GetQAMetComplete(WOMatKey) + + If WOMatKey NE '' then + Response = '' + QAMetRec = Xlate('WO_MAT_QA', WOMatKey, '', 'X') + Stages = QAMetRec + Results = QAMetRec + StageCount = Count(Stages, @VM) + For I = 1 to StageCount + If Results<1,I> EQ '' then + Response = False$ + end + Next I + + MUQAComp = Wo_Mat_Qa_Services('GetMUWaferQAComplete', WOMatKey) + If (Response EQ '') AND (MUQAComp EQ True$) then + Response = True$ + end + + end else + Error_Services('Add', 'Missing WOMatKey parameter.') + end + + +end service + + +Service GetMUWaferQAComplete(WOMatKey) + + Response = True$ + WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WoMatKey, True$, 0, False$) + MUBoxes = '' + MUBoxesResults = '' + MUWafers = WOMatRec + If Count(MUWafers, @VM) GT 0 then + for each BoxNumber in MUWafers using @VM setting OrigIndex + if BoxNumber NE '' then + MUCassId = FIELD(BoxNumber,'.',1,2) + Locate MUCassId in MUBoxesResults using @VM setting BoxIndex then + MUThkResult = WOMatRec + If MUThkResult NE '' then + MUBoxesResults = True$ + end + end else + MUBoxNewIndex = DCount(MUBoxesResults, @FM) + MUBoxesResults = MUCassID + MUThkResult = WOMatRec + If MUThkResult NE '' then + MUBoxesResults = True$ + end + end + end + Next BoxNumber + + for each Box in MUBoxesResults using @FM + if Box<1,2> EQ '' then + Response = False$ + end + Until Response = False$ + Next Box + end + +end service + +