From 03e85359d172d254a281d14d36af082ed7a84d55 Mon Sep 17 00:00:00 2001 From: "Infineon\\StieberD" Date: Tue, 17 Jun 2025 17:10:31 -0700 Subject: [PATCH] ready for unit testing --- LSL2/STPROC/COMM_DIALOG_UNLOAD_EPI_PRO.txt | 3 +- LSL2/STPROC/COPY_LOT_EVENT_RECORD_TO_SQL.txt | 45 + .../COPY_LOT_EVENT_TYPE_RECORD_TO_SQL.txt | 35 + .../COPY_LOT_OPERATION_RECORD_TO_SQL.txt | 56 + LSL2/STPROC/COPY_LOT_RECORD_TO_SQL.txt | 50 + LSL2/STPROC/COPY_OPERATION_RECORD_TO_SQL.txt | 43 + LSL2/STPROC/LOT_OPERATION_SERVICES.txt | 535 ++++++++ LSL2/STPROC/LOT_SERVICES.txt | 1191 ++++++++++------- LSL2/STPROC/OBJ_RDS.txt | 21 +- LSL2/STPROC/OBJ_RDS2.txt | 14 +- LSL2/STPROC/QA_SERVICES.txt | 41 +- LSL2/STPROC/RDS_PRE_EPI_EVENTS.txt | 5 - LSL2/STPROC/RDS_SERVICES.txt | 9 +- LSL2/STPROCINS/LOT_EQUATES.txt | 8 +- LSL2/STPROCINS/LOT_EVENT_EQUATES.txt | 2 +- LSL2/STPROCINS/LOT_EVENT_TYPE_EQUATES.txt | 13 + LSL2/STPROCINS/LOT_OPERATION_EQUATES.txt | 40 +- .../METROLOGY_DATA_EXAMPLE_EQUATES.txt | 21 + LSL2/STPROCINS/MET_TEST_DATA_EQUATES.txt | 43 + LSL2/STPROCINS/MET_TEST_EQUATES.txt | 72 + LSL2/STPROCINS/OPERATION_EQUATES.txt | 12 +- 21 files changed, 1713 insertions(+), 546 deletions(-) create mode 100644 LSL2/STPROC/COPY_LOT_EVENT_RECORD_TO_SQL.txt create mode 100644 LSL2/STPROC/COPY_LOT_EVENT_TYPE_RECORD_TO_SQL.txt create mode 100644 LSL2/STPROC/COPY_LOT_OPERATION_RECORD_TO_SQL.txt create mode 100644 LSL2/STPROC/COPY_LOT_RECORD_TO_SQL.txt create mode 100644 LSL2/STPROC/COPY_OPERATION_RECORD_TO_SQL.txt create mode 100644 LSL2/STPROC/LOT_OPERATION_SERVICES.txt create mode 100644 LSL2/STPROCINS/LOT_EVENT_TYPE_EQUATES.txt create mode 100644 LSL2/STPROCINS/METROLOGY_DATA_EXAMPLE_EQUATES.txt create mode 100644 LSL2/STPROCINS/MET_TEST_DATA_EQUATES.txt create mode 100644 LSL2/STPROCINS/MET_TEST_EQUATES.txt diff --git a/LSL2/STPROC/COMM_DIALOG_UNLOAD_EPI_PRO.txt b/LSL2/STPROC/COMM_DIALOG_UNLOAD_EPI_PRO.txt index d14a637..f027cb3 100644 --- a/LSL2/STPROC/COMM_DIALOG_UNLOAD_EPI_PRO.txt +++ b/LSL2/STPROC/COMM_DIALOG_UNLOAD_EPI_PRO.txt @@ -556,8 +556,6 @@ UnloadProduct: Next CassNo end - - RETURN @@ -639,3 +637,4 @@ SlotOverview: RETURN + diff --git a/LSL2/STPROC/COPY_LOT_EVENT_RECORD_TO_SQL.txt b/LSL2/STPROC/COPY_LOT_EVENT_RECORD_TO_SQL.txt new file mode 100644 index 0000000..9dfd48d --- /dev/null +++ b/LSL2/STPROC/COPY_LOT_EVENT_RECORD_TO_SQL.txt @@ -0,0 +1,45 @@ +Compile function Copy_LOT_EVENT_Record_To_SQL(Connection, Key, Record) + +/*****************************************************************************\ + Copies the given LOT_EVENT record to the MSSQL database. + + History + ------- + 06/10/2025 DJS Original Programmer +\*****************************************************************************/ + +$insert LOT_EVENT_EQUATES + +Declare function SQL_Write, SQL_Write_MV, SQL_Format +Ans = "" + +// Parse record into a dimensioned array for speed +Dim Rec(13) +MatParse Record into Rec + +// List of key names and their values +Keys = "LOT_EVENT_ID":@VM:SQL_Format(Key, "STR") + +// List of data fields and their values +DataFields = "LOT_ID" :@VM:SQL_Format(Rec(LOT_EVENT_LOT_ID$), "STR"):@FM +DataFields := "LOT_EVENT_TYPE" :@VM:SQL_Format(Rec(LOT_EVENT_LOT_EVENT_TYPE$), "STR"):@FM +DataFields := "EVENT_DATETIME" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_DATETIME$), "DATETIME"):@FM +DataFields := "EVENT_NOTE" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_NOTE$), "STR"):@FM +DataFields := "EQUIPMENT_ID" :@VM:SQL_Format(Rec(LOT_EVENT_EQUIPMENT_ID$), "STR"):@FM +DataFields := "EVENT_REDUCE_WAFER_QTY" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_REDUCE_WAFER_QTY$), "INT"):@FM +DataFields := "EVENT_BONUS_WAFER_QTY" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_BONUS_WAFER_QTY$), "INT"):@FM +DataFields := "EVENT_BEGIN_WAFER_QTY" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_BEGIN_WAFER_QTY$), "INT"):@FM +DataFields := "EVENT_END_WAFER_QTY" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_END_WAFER_QTY$), "INT"):@FM +DataFields := "EVENT_OPERATION_ID" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_OPERATION_ID$), "STR"):@FM +DataFields := "EVENT_OPERATOR_ID" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_OPERATOR_ID$), "STR"):@FM +DataFields := "SEQUENCE" :@VM:SQL_Format(Rec(LOT_EVENT_SEQUENCE$), "INT") + +// Symbolics + +// Write the data to the SQL database +Ans = SQL_Write(Connection, "LOT_EVENT", Keys, DataFields); + +//------------------------------------------------------------------------------------------------- +// Multi-valued Fields + +Return Ans diff --git a/LSL2/STPROC/COPY_LOT_EVENT_TYPE_RECORD_TO_SQL.txt b/LSL2/STPROC/COPY_LOT_EVENT_TYPE_RECORD_TO_SQL.txt new file mode 100644 index 0000000..7cc5be7 --- /dev/null +++ b/LSL2/STPROC/COPY_LOT_EVENT_TYPE_RECORD_TO_SQL.txt @@ -0,0 +1,35 @@ +Compile function Copy_LOT_EVENT_TYPE_Record_To_SQL(Connection, Key, Record) + +/*****************************************************************************\ + Copies the given OPERATION record to the MSSQL database. + + History + ------- + 06/19/2025 DJS Original Programmer +\*****************************************************************************/ + +$insert LOT_EVENT_TYPE_EQUATES + +Declare function SQL_Write, SQL_Write_MV, SQL_Format +Ans = "" + +// Parse record into a dimensioned array for speed +Dim Rec(2) +MatParse Record into Rec + +// List of key names and their values +Keys = "LOT_EVENT_TYPE_ID":@VM:SQL_Format(Key, "STR") + +// List of data fields and their values +DataFields = "DESCRIPTION" :@VM:SQL_Format(Rec(LOT_EVENT_TYPE.DESCRIPTION$), "STR"):@FM +DataFields := "WIP_TRANS_TYPE" :@VM:SQL_Format(Rec(LOT_EVENT_TYPE.WIP_TRANS_TYPE$), "STR") + +// Symbolics + +// Write the data to the SQL database +Ans = SQL_Write(Connection, "LOT_EVENT_TYPE", Keys, DataFields); + +//------------------------------------------------------------------------------------------------- +// Multi-valued Fields + +Return Ans diff --git a/LSL2/STPROC/COPY_LOT_OPERATION_RECORD_TO_SQL.txt b/LSL2/STPROC/COPY_LOT_OPERATION_RECORD_TO_SQL.txt new file mode 100644 index 0000000..f28c98d --- /dev/null +++ b/LSL2/STPROC/COPY_LOT_OPERATION_RECORD_TO_SQL.txt @@ -0,0 +1,56 @@ +Compile function Copy_LOT_OPERATION_Record_To_SQL(Connection, Key, Record) + +/*****************************************************************************\ + Copies the given LOT_OPERATION record to the MSSQL database. + + History + ------- + 06/19/2025 DJS Original Programmer +\*****************************************************************************/ + +$insert LOT_OPERATION_EQUATES + +Declare function SQL_Write, SQL_Write_MV, SQL_Format +Ans = "" + +// Parse record into a dimensioned array for speed +Dim Rec(24) +MatParse Record into Rec + +// List of key names and their values +Keys = "LOT_OPERATION_ID":@VM:SQL_Format(Key, "STR") + +// List of data fields and their values +DataFields = "LOT_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_LOT_ID$), "STR"):@FM +DataFields := "OPERATION_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_OPERATION_ID$), "STR"):@FM +DataFields := "DATETIME_IN" :@VM:SQL_Format(Rec(LOT_OPERATION_DATETIME_IN$), "DATETIME"):@FM +DataFields := "DATETIME_OUT" :@VM:SQL_Format(Rec(LOT_OPERATION_DATETIME_OUT$), "DATETIME"):@FM +DataFields := "EQUIPMENT_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_EQUIPMENT_ID$), "STR"):@FM +DataFields := "WAFER_IN_QTY" :@VM:SQL_Format(Rec(LOT_OPERATION_WAFER_IN_QTY$), "INT"):@FM +DataFields := "WAFER_OUT_QTY" :@VM:SQL_Format(Rec(LOT_OPERATION_WAFER_OUT_QTY$), "INT"):@FM +DataFields := "OPERATOR_IN_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_OPERATOR_IN_ID$), "STR"):@FM +DataFields := "OPERATOR_OUT_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_OPERATOR_OUT_ID$), "STR"):@FM +DataFields := "OPERATION_SEQUENCE" :@VM:SQL_Format(Rec(LOT_OPERATION_OPERATION_SEQUENCE$), "INT"):@FM +DataFields := "REWORK" :@VM:SQL_Format(Rec(LOT_OPERATION_REWORK$), "BIT"):@FM +DataFields := "DATETIME_START" :@VM:SQL_Format(Rec(LOT_OPERATION_DATETIME_START$), "DATETIME"):@FM +DataFields := "DATETIME_STOP" :@VM:SQL_Format(Rec(LOT_OPERATION_DATETIME_STOP$), "DATETIME"):@FM +DataFields := "CLEAN_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_CLEAN_ID$), "STR"):@FM +DataFields := "PACKAGING_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_PACKAGING_ID$), "STR"):@FM +DataFields := "WAFER_COUNTER_ID" :@VM:SQL_Format(Rec(LOT_OPERATION_WAFER_COUNTER_ID$), "STR"):@FM +DataFields := "OPERATION_TYPE" :@VM:SQL_Format(Rec(LOT_OPERATION_OPERATION_TYPE$), "STR"):@FM +DataFields := "OPERATION_CLASS" :@VM:SQL_Format(Rec(LOT_OPERATION_OPERATION_CLASS$), "STR"):@FM +DataFields := "MET_TEST_TYPE_REQUIRED" :@VM:SQL_Format(Rec(LOT_OPERATION_MET_TEST_TYPE_REQUIRED$), "BIT"):@FM +DataFields := "MET_TEST_REQUIRED" :@VM:SQL_Format(Rec(LOT_OPERATION_MET_TEST_REQUIRED$), "BIT"):@FM +DataFields := "PACKAGING_REQUIRED" :@VM:SQL_Format(Rec(LOT_OPERATION_PACKAGING_REQUIRED$), "BIT"):@FM +DataFields := "CLEAN_REQUIRED" :@VM:SQL_Format(Rec(LOT_OPERATION_CLEAN_REQUIRED$), "BIT"):@FM +DataFields := "WAFER_COUNTER_REQUIRED" :@VM:SQL_Format(Rec(LOT_OPERATION_WAFER_COUNTER_REQUIRED$), "BIT") + +// Symbolics + +// Write the data to the SQL database +Ans = SQL_Write(Connection, "LOT_OPERATION", Keys, DataFields); + +//------------------------------------------------------------------------------------------------- +// Multi-valued Fields + +Return Ans diff --git a/LSL2/STPROC/COPY_LOT_RECORD_TO_SQL.txt b/LSL2/STPROC/COPY_LOT_RECORD_TO_SQL.txt new file mode 100644 index 0000000..fa3f413 --- /dev/null +++ b/LSL2/STPROC/COPY_LOT_RECORD_TO_SQL.txt @@ -0,0 +1,50 @@ +Compile function Copy_LOT_Record_To_SQL(Connection, Key, Record) + +/*****************************************************************************\ + Copies the given LOT record to the MSSQL database. + + History + ------- + 06/10/2025 DJS Original Programmer +\*****************************************************************************/ + +$insert LOT_EQUATES + +Declare function SQL_Write, SQL_Write_MV, SQL_Format +Ans = "" + +// Parse record into a dimensioned array for speed +Dim Rec(23) +MatParse Record into Rec + +// List of key names and their values +Keys = "LOT_ID":@VM:SQL_Format(Key, "STR") + +// List of data fields and their values +DataFields = "TYPE" :@VM:SQL_Format(Rec(LOT_TYPE$), "STR"):@FM +DataFields := "PROD_ID" :@VM:SQL_Format(Rec(LOT_PROD_ID$), "STR"):@FM +DataFields := "ORIG_WAFER_QTY" :@VM:SQL_Format(Rec(LOT_ORIG_WAFER_QTY$), "INT"):@FM +DataFields := "WAFER_QTY" :@VM:SQL_Format(Rec(LOT_WAFER_QTY$), "INT"):@FM +DataFields := "VENDOR_PART_NO" :@VM:SQL_Format(Rec(LOT_VENDOR_PART_NO$), "STR"):@FM +DataFields := "VENDOR_LOT_NO" :@VM:SQL_Format(Rec(LOT_VENDOR_LOT_NO$), "STR"):@FM +DataFields := "VENDOR_CODE" :@VM:SQL_Format(Rec(LOT_VENDOR_CODE$), "STR"):@FM +DataFields := "OPEN" :@VM:SQL_Format(Rec(LOT_OPEN$), "BIT"):@FM +DataFields := "HOLD" :@VM:SQL_Format(Rec(LOT_HOLD$), "BIT"):@FM +DataFields := "HOT" :@VM:SQL_Format(Rec(LOT_HOT$), "BIT"):@FM +DataFields := "LEGACY_LOT_ID" :@VM:SQL_Format(Rec(LOT_LEGACY_LOT_ID$), "STR"):@FM +DataFields := "MOST_RECENT_LOT_EVENT_ID" :@VM:SQL_Format(Rec(LOT_MOST_RECENT_LOT_EVENT_ID$), "STR"):@FM +DataFields := "LEGACY_LOT_TYPE" :@VM:SQL_Format(Rec(LOT_LEGACY_LOT_TYPE$), "STR"):@FM +DataFields := "WO_LOG_ID" :@VM:SQL_Format(Rec(LOT_WO_LOG_ID$), "INT"):@FM +DataFields := "PROD_SPEC_ID" :@VM:SQL_Format(Rec(LOT_PROD_SPEC_ID$), "INT"):@FM +DataFields := "EPI_PART_NO" :@VM:SQL_Format(Rec(LOT_EPI_PART_NO$), "STR"):@FM +DataFields := "PROD_VER_NO" :@VM:SQL_Format(Rec(LOT_PROD_VER_NO$), "STR") + +// Symbolics + +// Write the data to the SQL database +Ans = SQL_Write(Connection, "LOT", Keys, DataFields); + +//------------------------------------------------------------------------------------------------- +// Multi-valued Fields + +Return Ans diff --git a/LSL2/STPROC/COPY_OPERATION_RECORD_TO_SQL.txt b/LSL2/STPROC/COPY_OPERATION_RECORD_TO_SQL.txt new file mode 100644 index 0000000..37dca33 --- /dev/null +++ b/LSL2/STPROC/COPY_OPERATION_RECORD_TO_SQL.txt @@ -0,0 +1,43 @@ +Compile function Copy_OPERATION_Record_To_SQL(Connection, Key, Record) + +/*****************************************************************************\ + Copies the given OPERATION record to the MSSQL database. + + History + ------- + 06/19/2025 DJS Original Programmer +\*****************************************************************************/ + +$insert OPERATION_EQUATES + +Declare function SQL_Write, SQL_Write_MV, SQL_Format +Ans = "" + +// Parse record into a dimensioned array for speed +Dim Rec(10) +MatParse Record into Rec + +// List of key names and their values +Keys = "OPERATION_ID":@VM:SQL_Format(Key, "STR") + +// List of data fields and their values +DataFields = "ACTIVE" :@VM:SQL_Format(Rec(OPERATION_ACTIVE$), "BIT"):@FM +DataFields := "CLASS_ID" :@VM:SQL_Format(Rec(OPERATION_CLASS_ID$), "STR"):@FM +DataFields := "OPERATION_DESCRIPTION" :@VM:SQL_Format(Rec(OPERATION_OPERATION_DESCRIPTION$), "STR"):@FM +DataFields := "TYPE" :@VM:SQL_Format(Rec(OPERATION_TYPE$), "STR"):@FM +DataFields := "REWORK" :@VM:SQL_Format(Rec(OPERATION_REWORK$), "BIT"):@FM +DataFields := "MET_TEST_TYPE_REQUIRED" :@VM:SQL_Format(Rec(OPERATION_MET_TEST_TYPE_REQUIRED$), "BIT"):@FM +DataFields := "MET_TEST_REQUIRED" :@VM:SQL_Format(Rec(OPERATION_MET_TEST_REQUIRED$), "BIT"):@FM +DataFields := "PACKAGING_REQUIRED" :@VM:SQL_Format(Rec(OPERATION_PACKAGING_REQUIRED$), "BIT"):@FM +DataFields := "CLEAN_REQUIRED" :@VM:SQL_Format(Rec(OPERATION_CLEAN_REQUIRED$), "BIT"):@FM +DataFields := "WAFER_COUNTER_REQUIRED" :@VM:SQL_Format(Rec(OPERATION_WAFER_COUNTER_REQUIRED$), "BIT") + +// Symbolics + +// Write the data to the SQL database +Ans = SQL_Write(Connection, "OPERATION", Keys, DataFields); + +//------------------------------------------------------------------------------------------------- +// Multi-valued Fields + +Return Ans diff --git a/LSL2/STPROC/LOT_OPERATION_SERVICES.txt b/LSL2/STPROC/LOT_OPERATION_SERVICES.txt new file mode 100644 index 0000000..357fa6e --- /dev/null +++ b/LSL2/STPROC/LOT_OPERATION_SERVICES.txt @@ -0,0 +1,535 @@ +Compile function Lot_Operation_Services(@Service, @Params) +#pragma precomp SRP_PreCompiler + +Declare function Lot_Services, Database_Services, Error_Services, Srp_Sort_Array, Lot_Operation_Services +Declare function RTI_CreateGUID, MemberOf, SRP_JSON, Operation_Services, Datetime, Met_Test_Services, PSN_Services +Declare subroutine Database_Services, Error_Services, SRP_JSON, Lot_Services, Lot_Event_Services, Lot_Operation_Services + +$insert LOGICAL +$insert LOT_EQUATES +$Insert LOT_OPERATION_EQUATES +$Insert METROLOGY_DATA_EXAMPLE_EQUATES +$Insert OPERATION_EQUATES +$Insert MET_TEST_EQUATES +$Insert WAFER_COUNTER_EQUATES + +Options OPERATION_TYPE = 'CLEAN', 'THICK_METROLOGY', 'RES_METROLOGY', 'SURFACE_METROLOGY', 'VISUAL_INSPECTION', 'PACKAGING' + +GoToService + +Return Response or "" + +//----------------------------------------------------------------------------- +// SERVICES +//----------------------------------------------------------------------------- + +Service AddOperationToLot(LotId, OperationId, PrescribedSequence, UserId) + + Operation = '' + ErrorMessage = '' + If RowExists('LOT', LotId) then + If RowExists('OPERATION', OperationId) then + If PrescribedSequence AND Num(PrescribedSequence) then + If Lot_Operation_Services('CanUserAddLotOperation', UserId) then + LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId) + CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X') + If CurrOperationSequence LT PrescribedSequence then + //Get Curr Operation Sequence + Done = False$ + LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId) + for each Operation in LotCurrOperationSequence using @Fm setting OpPos + ThisOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', Operation) + ThisOperationSequence = ThisOperationRec + If ThisOperationSequence GE PrescribedSequence then + NewOperationSequence = ThisOperationSequence + 1 + ThisOperationRec = NewOperationSequence + Database_Services('WriteDataRow', 'LOT_OPERATION', Operation, ThisOperationRec) + If Error_Services('HasError') then + Done = True$ + ErrorMessage = Error_Services('GetMessage') + end + end + Until Done + Next Operation + If ErrorMessage EQ '' then + LotOperationRecID = RTI_CreateGUID() + If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then + OperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) + Class = OperationRec + Type = OperationRec + Rework = OperationRec + ThisNewOperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) + LotOperationRec = '' + LotOperationRec = LotId + LotOperationRec = OperationId + LotOperationRec = PrescribedSequence + LotOperationRec = Rework + LotOperationRec = Type + LotOperationRec = Class + LotOperationRec = OperationRec + LotOperationRec = OperationRec + LotOperationRec = OperationRec + LotOperationRec = OperationRec + LotOperationRec = OperationRec + IsOperationRework = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_REWORK$) + Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec) + If Error_Services('NoError') then + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ADD_LOT_OPERATION', 'Added operation ' : Operation : ' to lot.', '', UserId) + end else + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Lot Operation already existed, cannot overwrite' + end + end + end else + ErrorMessage = 'Not allowed to add new operations prior to current operation' + end + end else + ErrorMessage = 'User ' : UserId : ' does not have permission to add operations to lots.' + end + end else + ErrorMessage = 'Invalid operation sequence entered.' + end + end else + ErrorMessage = 'Operation ' : OperationId : 'not found in OPERATION table.' + end + end else + ErrorMessage = 'Lot ' : LotId : ' not found in LOT table.' + end + + If ErrorMessage EQ '' then + Response = Operation + end else + Error_Services('Add', 'Error in ' : Service : '.' : ErrorMessage) + // todo: add logging + end + +end service + +Service RemoveLotOperation(LotOperationId, UserId) + + //Todo User permission check + ErrorMessage = '' + Success = False$ + + If RowExists('LOT_OPERATION', LotOperationId) then + LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + LotId = LotOperationRec + MoveInTime = LotOperationRec + MoveOutTime = LotOperationRec + Sequence = LotOperationRec + OperationId = LotOperationRec + OperationClass = XLATE('OPERATION', OperationId, OPERATION_CLASS_ID$, 'X') + If OperationClass NE 'RTF_DEFAULT' AND OperationClass NE 'RTF_DEFAULT_END' then + If MoveInTime EQ '' AND MoveOutTime EQ '' then + LotOperationRec = '';//Nulling this value out should disassociated the lot operation record from the lot. + Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, LotOperationRec) + If Error_Services('NoError') then + Lot_Operation_Services('UpdateLotOperationSequence', LotId, Sequence) + If Error_Services('NoError') then + Success = True$ + end else + ErrorMessage = Error_Services('GetMessage') + end + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REMOVE_LOT_OPERATION', 'Removed operation ' : OperationId : ' from lot.', '', UserId) + end else + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Lot has already started processing on operation ' : OperationId + end + end else + ErrorMessage = 'Unable to remove default operations.' + end + end else + ErrorMessage = 'Lot Operation record not found' + end + + If ErrorMessage NE '' then + Error_Services('Add', 'Error in service ': Service : ' : ' : ErrorMessage) + end + + Response = Success + + +end service + +Service UpdateLotOperationSequence(LotId, StartSequence) + ErrorMessage = '' + If StartSequence EQ '' then + StartSequence = 1 + end + + If RowExists('LOT', LotId) then + LotOperationSequence = Lot_Services('GetLotOperationSequence', LotId) + Offset = 0 + for each LotOperationId in LotOperationSequence using @FM setting SeqPos + If LotOperationId NE '' then + ThisLotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + OrigSeq = ThisLotOperationRec + NewSeq = OrigSeq - Offset + ThisLotOperationRec = NewSeq + Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, ThisLotOperationRec) + If Error_Services('HasError') then + ErrorMessage = Error_Services('GetMessage') + end + end else + Offset += 1 + end + Until ErrorMessage NE '' + Next LotOperation + end else + ErrorMessage = 'Lot Id not found' + end + + If ErrorMessage NE '' then + Error_Services('Add', 'Error in ' : Service : ' : ' : ErrorMessage) + end + +end service + +Service ModifyLotOperationSequence(LotOperationId, NewSequence, UserId) + + ErrorMessage = '' + + If ErrorMessage NE '' then + + + end + +end service + +Service GetAvailableSequences(LotId) + AvailableSequences = '' + + If RowExists('LOT', LotId) then + CurrentLotOperations = Lot_Services('GetLotOperationSequence', LotId) + For each LotOperationId in CurrentLotOperations using @FM setting Sequence + LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + OperationId = LotOperationRec + OperationClass = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_CLASS_ID$) + StartDtm = LotOperationRec + If StartDTM EQ '' then + If OperationClass NE 'RTF_DEFAULT' then + AvailableSequences<1, -1> = Sequence + 1 + end + end + Next LotOperationId + end + + Response = AvailableSequences +end service + + +Service AddSpecsToLotOperation(LotOperationId) + +end service + +Service CanUserAddLotOperation(UserId) + + If UserId NE '' then + Begin Case + Case MemberOf(UserId, 'LEAD') + Response = True$ + Case MemberOf(UserId, 'SUPERVISOR') + Response = True$ + Case MemberOf(UserId, 'ENGINEER') + Response = True$ + Case MemberOf(UserId, 'ENG_TECH') + Response = True$ + Case Otherwise$ + Response = False$ + End Case + end + +end service + +Service ConvertRecordToJson(LotOperationId) + + JsonString = '' + objJSON = '' + LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + If SRP_JSON(objJSON, 'New', 'Object') then + SRP_JSON(objJSON, 'SetValue', 'LotOperationId', LotOperationId) + LotId = LotOperationRec + LegacyLotId = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_LEGACY_LOT_ID$, True$, 0, False$) + SRP_JSON(objJSON, 'SetValue', 'LotOperationId', LotOperationId) + SRP_JSON(objJSON, 'SetValue', 'LotId', LotId, 'String') + SRP_JSON(objJSON, 'SetValue', 'LegacyLotId', LegacyLotId, 'String') + SRP_JSON(objJSON, 'SetValue', 'OperationId', LotOperationRec, 'String') + SRP_JSON(objJSON, 'SetValue', 'DateTimeIn', OConv(LotOperationRec, 'DT'), 'String') + SRP_JSON(objJSON, 'SetValue', 'DateTimeOut', OConv(LotOperationRec, 'DT'), 'String') + EquipmentId = LotOperationRec + SRP_JSON(objJSON, 'SetValue', 'EquipmentId', EquipmentId) + SRP_JSON(objJSON, 'SetValue', 'WaferInQty', LotOperationRec, 'Number') + SRP_JSON(objJSON, 'SetValue', 'WaferOutQty', LotOperationRec, 'Number') + SRP_JSON(objJSON, 'SetValue', 'OperatorInId', LotOperationRec) + SRP_JSON(objJSON, 'SetValue', 'OperatorOutId', LotOperationRec) + SRP_JSON(objJSON, 'SetValue', 'OperationSequence', LotOperationRec) + SRP_JSON(objJSON, 'SetValue', 'DateTimeStart', OConv(LotOperationRec, 'DT'), 'String') + SRP_JSON(objJSON, 'SetValue', 'DateTimeStop', OConv(LotOperationRec, 'DT'), 'String') + SRP_JSON(objJSON, 'SetValue', 'MetTestId', LotOperationRec) + SRP_JSON(objJSON, 'SetValue', 'CleanId', LotOperationRec) + SRP_JSON(objJSON, 'SetValue', 'PackagingId', LotOperationRec) + SRP_JSON(objJSON, 'SetValue', 'WaferCounterId', LotOperationRec) + SRP_JSON(objJson, 'SetValue', 'MetTestTypeRequired', LotOperationRec, 'STRING') + SRP_JSON(objJson, 'SetValue', 'MetTestRequired', LotOperationRec, 'Boolean') + SRP_JSON(objJson, 'SetValue', 'PackagingRequired', LotOperationRec, 'Boolean') + SRP_JSON(objJson, 'SetValue', 'CleanRequired', LotOperationRec, 'Boolean') + SRP_JSON(objJson, 'SetValue', 'WaferCounterRequired', LotOperationRec, 'Boolean') + + SRP_JSON(objJSON, 'SetValue', 'OperationType', LotOperationRec) + //Add OPERATION Object + OperationJson = Operation_Services('ConvertRecordToJSON', LotOperationRec) + If SRP_JSON(objOperationJson, 'Parse', OperationJson) EQ '' then + SRP_Json(objJSON, 'Set', 'OperationInfo',objOperationJson) + SRP_Json(objOperationJson, 'Release') + end + //Add Associated MET_TEST JSON Object + AssocMetTestIds = LotOperationRec + objAssocMetTest = '' + If SRP_Json(objAssocMetTest, 'New', 'Array') then + for each MetTestId in AssocMetTestIds using @VM + MetTestJson = Met_Test_Services('ConvertRecordToJson', MetTestId) + If SRP_Json(objMetTest, 'Parse', MetTestJson) EQ '' then + SRP_Json(objAssocMetTest, 'Add', objMetTest) + SRP_Json(objMetTest, 'Release') + end + Next MetTestId + SRP_Json(objJSON, 'Set', 'AssociatedMetTests', objAssocMetTest) + SRP_Json(objAssocMetTest, 'Release') + end + + //Add Available Met Test Record + AvailMetTestIds = Met_Test_Services('GetMetTests', LotId, LegacyLotId, '', EquipmentId, True$) + objAvailMetTest = '' + If SRP_Json(objAvailMetTest, 'New', 'Array') then + for each MetTestId in AvailMetTestIds using @VM + MetTestJson = Met_Test_Services('ConvertRecordToJson', MetTestId) + If SRP_Json(objMetTest, 'Parse', MetTestJson) EQ '' then + SRP_Json(objAvailMetTest, 'Add', objMetTest) + SRP_Json(objMetTest, 'Release') + end + Next MetTestId + SRP_Json(objJSON, 'Set', 'AvailMetTests', objAvailMetTest) + SRP_Json(objAvailMetTest, 'Release') + end + //Add in relevant recipes + //OperationType = LotOperationRec + //MetTestTypeRequired = LotOperationRec + Recipes = '' + ShowThickRecipes = False$ + ShowResRecipes = False$ + ShowCleanRecipes = False$ + ShowSurfscanRecipes = False$ + IsMetTestReqd = LotOperationRec + IsCleanRequired = LotOperationRec + If IsMetTestReqd then + MetTestTypeRequired = LotOperationRec + Begin Case + Case MetTestTypeRequired EQ 'TENCOR' + ShowSurfscanRecipes = True$ + Case MetTestTypeRequired EQ 'THICK' + ShowThickRecipes = True$ + Case MetTestTypeRequired EQ 'RES' + ShowResRecipes = True$ + End Case + end + If IsCleanRequired then + ShowCleanRecipes = True$ + end + ProdSpecNo = XLATE('LOT', LotId, LOT_PROD_SPEC_ID$, 'X') + Recipes = PSN_Services('GetAllMetrologoyRecipes', ProdSpecNo, ShowSurfscanRecipes, ShowCleanRecipes, ShowResRecipes, ShowThickRecipes) + If SRP_JSON(objRecipes, 'New', 'Array') then + for each Recipe in Recipes using @FM + //ToolClass : @VM : Recipe : @VM : Stage + ToolClass = Recipe<1,1> + RecipeName = Recipe<1,2> + Stage = Recipe<1,3> + If SRP_JSON(objRecipe, 'New', 'Object') then + SRP_JSON(objRecipe, 'SetValue', 'ToolClass', ToolClass, 'String') + SRP_JSON(objRecipe, 'SetValue', 'RecipeName', RecipeName, 'String') + SRP_JSON(objRecipe, 'SetValue', 'StageName', Stage, 'String') + SRP_JSON(objRecipes, 'Add', objRecipe) + SRP_JSON(objRecipe, 'Release') + end + Next Recipe + SRP_JSON(objJSON, 'Set', 'RecipeParams', objRecipes) + SRP_JSON(objRecipes, 'Release') + end + JsonString = SRP_JSON(objJSON, 'Stringify', 'Styled') + SRP_JSON(objJSON, 'Release') + + end + + Response = JsonString +end service + + + +Service StartLotOperation(LotOperationId, UserId) + + //1. Validate that it can be moved into the operation passed in. + + //2. Move in the lot + //3. Return true is move in successfully + //4. Return false if error moving in + + ErrorMessage = '' + + If RowExists('LOT_OPERATION', LotOperationId) then + If RowExists('LSL_USERS', UserId) then + //We can also add additional checks like security checks, training checks, etc here if needed. + LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + LotId = LotOperationRec + LotCurrentLotOpId = Lot_Services('GetLotCurrOperationId', LotId) + If LotOperationId EQ LotCurrentLotOpId then + LotMovedIn = Lot_Services('IsLotMovedIn', LotId) + If Not(LotMovedIn) then + Lot_Services('MoveInLot', LotId, UserId) + If Error_Services('HasError') then + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Lot is already moved into this operation.' + end + end else + + end + end else + ErrorMessage = 'Invalid user passed to routine.' + end + end else + ErrorMessage = 'Invalid Lot Operation passed to routine.' + end + + If ErrorMessage EQ '' then + Response = True$ + end else + Response = False$ + Error_Services('Add', 'Error in ' : Service : '. ' : ErrorMessage) + end + +end service + +Service CompleteLotOperation(LotOperationId, UserId) + + //1. Validate that the lot is moved into the operation + //2. Validate that the lot + ErrorMessage = '' + + If RowExists('LOT_OPERATION', LotOperationId) then + If RowExists('LSL_USERS', UserId) then + //We can also add additional checks like security checks, training checks, etc here if needed. + LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + LotId = LotOperationRec + LotCurrentLotOpId = Lot_Services('GetLotCurrOperationId', LotId) + If LotOperationId EQ LotCurrentLotOpId then + LotMovedIn = Lot_Services('IsLotMovedIn', LotId) + If LotMovedIn then + //Perform Validation for the particular operation here. + OperationValid = Lot_Operation_Services('ValidateLotOperation', LotOperationId) + If OperationValid then + Lot_Services('MoveOutLot', LotId, UserId) + If Error_Services('HasError') then + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Lot Operation has not finished processing and cannot be moved out.' + end + end else + ErrorMessage = 'Lot is already moved into this operation.' + end + end else + + end + end else + ErrorMessage = 'Invalid user passed to routine.' + end + end else + ErrorMessage = 'Invalid Lot Operation passed to routine.' + end + + If ErrorMessage EQ '' then + Response = True$ + end else + Response = False$ + Error_Services('Add', 'Error in ' : Service : '. ' : ErrorMessage) + end + +end service + +Service ValidateLotOperation(LotOperationId) + + ErrorMessage = '' + IsValid = True$ + If RowExists('LOT_OPERATION', LotOperationId) then + LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + OperationId = LotOperationRec + MetTestRequired = LotOperationRec + MetTestTypeRequired = LotOperationRec + PackagingRequired = LotOperationRec + CleanRequired = LotOperationRec + WaferCountRequired = LotOperationRec + If MetTestRequired then + MetTestsInSpec = True$ + AssociatedMetTestIds = LotOperationRec + If AssociatedMetTestIds NE '' then + for each MetTestId in AssociatedMetTestIds using @VM + MetTestOoS = Database_Services('ReadDataColumn', 'MET_TEST', MetTestId, MET_TEST.OUT_OF_SPEC$, True$, 0, False) + If MetTestOoS then + //ToDo Check that the met tests meet the requirements. + MetTestsInSpec = False$ + ErrorMessage = 'An associated Met test record is out of spec.' + end + Until MetTestsInSpec EQ False$ + Next MetTestId + end else + IsValid = False$ + ErrorMessage = 'Met tests are required and none are assigned.' + end + end + If PackagingRequired then + + end + If CleanRequired then + + end + If WaferCountRequired then + + end + end else + ErrorMessage = 'Lot Operation not found' + end + If ErrorMessage NE '' then + IsValid = False$ + Error_Services('Add', ErrorMessage) + end + Response = IsValid + +end service + +Service ValidateFQA(LotOperationId) + + Response = False$ + LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) + LotId = LotOperationRec + OperationStartDtm = LotOperationRec + RelevantMetTests = '' + MetTests = Met_Test_Services('GetMetTestsByLotId', LotId) + For each MetTestId in MetTests using @VM + ThisMetTestRec = Database_Services('ReadDataRow', 'MET_TEST', MetTestId, True$, 0, False$) + + Next MetTestId + +end service + +Service AssociateClean(LotOperationId, CleanId, UserId) + +end service + +Service GetFinalQAOperationJson(LotId, Stage) + +end service + diff --git a/LSL2/STPROC/LOT_SERVICES.txt b/LSL2/STPROC/LOT_SERVICES.txt index ae2cfcf..1ede712 100644 --- a/LSL2/STPROC/LOT_SERVICES.txt +++ b/LSL2/STPROC/LOT_SERVICES.txt @@ -1,10 +1,6 @@ Compile function Lot_Services(@Service, @Params) #pragma precomp SRP_PreCompiler -Declare function TEST_WAFER_PROD_SERVICES, SRP_Datetime, Datetime, Database_Services, Lot_Services, Error_Services, RTI_CREATEGUID -Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services, MemberOf, Lot_Event_Services, GetTickCount -Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services -Declare subroutine SRP_Run_Command, Service_Services, obj_notes, Lot_Event_Services, Mona_Services $insert APP_INSERTS $Insert LOT_EQUATES $Insert TEST_WAFER_PROD_EQUATES @@ -14,6 +10,11 @@ $Insert LOT_EVENT_EQUATES $Insert NOTIFICATION_EQUATES $Insert VOIDED_LOT_EQUATES +Declare function TEST_WAFER_PROD_SERVICES, SRP_Datetime, Datetime, Database_Services, Lot_Services, Error_Services, RTI_CREATEGUID +Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services, MemberOf, Lot_Event_Services, GetTickCount +Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services +Declare subroutine SRP_Run_Command, Service_Services, obj_notes, Lot_Event_Services, Mona_Services + LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Lot' LogDate = Oconv(Date(), 'D4/') LogTime = Oconv(Time(), 'MTS') @@ -23,6 +24,14 @@ LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Headers = 'Logging DTM' : @FM : 'Product Name' : @FM : 'Username' : @FM : 'Message' objTWCreationLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$) +LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotStart.csv' +Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Message' +objLotStartLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$) + +LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotRun.csv' +Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Tool Id' : @FM : 'Message' +objRunLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$) + LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotMove.csv' Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Message' objLotMoveLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$) @@ -40,9 +49,9 @@ Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN', 'WO_MAT', 'LOT' IsProd = Environment_Services('IsProd') If IsProd EQ True$ then - MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_LOTSERVICES' + MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_LOTSERVICES' end else - MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_LOTSERVICES' + MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_LOTSERVICES' end GoToService @@ -54,6 +63,7 @@ Return Response or "" //----------------------------------------------------------------------------- Service GenerateNewLotId(LotType) + NewLotID = '' RightNow = Datetime() If LotType NE '' then @@ -62,7 +72,7 @@ Service GenerateNewLotId(LotType) Begin Case Case LotType EQ 'TW' Loop - Until ValidLotNum EQ True$ + Until ValidLotNum EQ True$ LotPrefix = 'TW' LotYear = SRP_Datetime('Year', RightNow) LotMonth = SRP_Datetime('Month', RightNow) @@ -78,18 +88,18 @@ Service GenerateNewLotId(LotType) end Repeat Case LotType EQ 'RDS' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT' OR LotType EQ 'WO_MAT' - Loop - Until ValidLotNum EQ True$ + Loop + Until ValidLotNum EQ True$ LotPrefix = '' Begin Case - Case LotType EQ 'RDS' - LotPrefix = 'R' - Case LotType EQ 'WM_IN' - LotPrefix = 'I' - Case LotType EQ 'WM_OUT' - LotPrefix = 'O' - Case LotType EQ 'WO_MAT' - LotPrefix = 'M' + Case LotType EQ 'RDS' + LotPrefix = 'R' + Case LotType EQ 'WM_IN' + LotPrefix = 'I' + Case LotType EQ 'WM_OUT' + LotPrefix = 'O' + Case LotType EQ 'WO_MAT' + LotPrefix = 'M' End Case HaveLockLotIdSequence = Database_Services('GetKeyIDLock', 'CONFIG', 'LOT_KEY_SEQUENCE_PROD') If HaveLockLotIdSequence then @@ -117,13 +127,16 @@ Service GenerateNewLotId(LotType) end end Response = NewLotID + end service + Service GetLotIdByLegacyLotIdAndType(LegacyLotId, LegacyLotType) - StartTick = GetTickCount() - MetricName = 'GetLotIdByLegacyLotIdAndType' - - Open 'DICT.LOT' to DictLot then + + StartTick = GetTickCount() + MetricName = 'GetLotIdByLegacyLotIdAndType' + + Open 'DICT.LOT' to DictLot then SearchString = '' SearchString := 'LEGACY_LOT_ID':@VM:LegacyLotId:@FM @@ -143,138 +156,140 @@ Service GetLotIdByLegacyLotIdAndType(LegacyLotId, LegacyLotType) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID, LotId) - StartTick = GetTickCount() - MetricName = 'CreateNewLot' - + + StartTick = GetTickCount() + MetricName = 'CreateNewLot' + CreatedLotNumber = '' ErrorMessage = '' Begin Case - Case LotType EQ 'RDS' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT' OR LotType EQ 'WO_MAT' - //Case statement for legacy lot entity types - NewLotId = Lot_Services('GenerateNewLotId', LotType) - If NewLotId NE '' then - If RowExists('LOT', NewLotId) NE False$ then - LotRec = '' - LotRec = LotType - LotRec = '' - LotRec = LotQty - LotRec = LotQty - LotRec = VendorPartNo - LotRec = VendorLotNo - LotRec = VendorCode - LotRec = LotId - Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec) - If Error_Services('HasError') then - ErrorMessage = 'Error in ':Service:' service. ':Error_Services('GetMessage') - end else - CreatedLotNumber = NewLotId - end - end else - ErrorMessage = 'Error in ':Service:' service. LOT record "':NewLotId:'" already exists.' - end - end else - ErrorMessage = 'Error in ':Service:' service. No lot ID passed in.' - end - Case LotType EQ 'TW' - If ProdName NE '' then - TWProdID = Test_Wafer_Prod_Services('GetTestWaferProdIDsByPartName', ProdName) - If TWProdID NE '' then - If DCount(TWProdID, @VM) EQ 1 then - NewLotId = Lot_Services('GenerateNewLotId', 'TW');//Don't use this - If NewLotId NE '' then - If RowExists('LOT', NewLotId) then - LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId) - //Ensure the lot record is empty - If LotRec EQ '' AND LotRec EQ '' AND LotRec EQ '' AND LotRec EQ '' then - LotRec = LotType - LotRec = TWProdID - LotRec = LotQty - LotRec = LotQty - LotRec = VendorPartNo - LotRec = VendorLotNo - LotRec = VendorCode - Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec) - //Now Ensure that the written lot matches what was just written - LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId) - If LotRecCheck EQ LotRec then - //Lot Created successfully - CreatedLotNumber = NewLotId - If RowExists('LOT', CreatedLotNumber) then - Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber) - If Error_Services('NoError') then - //Check in at first operation - //Get Curr Operation(Should be first one in sequence) - ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber) - If ThisLotCurrOpId NE '' then - //Set lot to open - Lot_Services('OpenLot', CreatedLotNumber) + Case LotType EQ 'RDS' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT' OR LotType EQ 'WO_MAT' + //Case statement for legacy lot entity types + NewLotId = Lot_Services('GenerateNewLotId', LotType) + If NewLotId NE '' then + If RowExists('LOT', NewLotId) NE False$ then + LotRec = '' + LotRec = LotType + LotRec = '' + LotRec = LotQty + LotRec = LotQty + LotRec = VendorPartNo + LotRec = VendorLotNo + LotRec = VendorCode + LotRec = LotId + Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec) + If Error_Services('HasError') then + ErrorMessage = 'Error in ':Service:' service. ':Error_Services('GetMessage') + end else + CreatedLotNumber = NewLotId + end + end else + ErrorMessage = 'Error in ':Service:' service. LOT record "':NewLotId:'" already exists.' + end + end else + ErrorMessage = 'Error in ':Service:' service. No lot ID passed in.' + end + Case LotType EQ 'TW' + If ProdName NE '' then + TWProdID = Test_Wafer_Prod_Services('GetTestWaferProdIDsByPartName', ProdName) + If TWProdID NE '' then + If DCount(TWProdID, @VM) EQ 1 then + NewLotId = Lot_Services('GenerateNewLotId', 'TW');//Don't use this + If NewLotId NE '' then + If RowExists('LOT', NewLotId) then + LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId) + //Ensure the lot record is empty + If LotRec EQ '' AND LotRec EQ '' AND LotRec EQ '' AND LotRec EQ '' then + LotRec = LotType + LotRec = TWProdID + LotRec = LotQty + LotRec = LotQty + LotRec = VendorPartNo + LotRec = VendorLotNo + LotRec = VendorCode + Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec) + //Now Ensure that the written lot matches what was just written + LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId) + If LotRecCheck EQ LotRec then + //Lot Created successfully + CreatedLotNumber = NewLotId + If RowExists('LOT', CreatedLotNumber) then + Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber) + If Error_Services('NoError') then + //Check in at first operation + //Get Curr Operation(Should be first one in sequence) + ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber) + If ThisLotCurrOpId NE '' then + //Set lot to open + Lot_Services('OpenLot', CreatedLotNumber) if Error_Services('NoError') then - //Move lot in + //Move lot in Lot_Services('MoveInLot', CreatedLotNumber, Username) - if Error_Services('NoError') then - If PrinterID NE 'WEB' then - //If PrinterID is set to WEB this means the request comes from OI_Wizard and the client is going to handle printing. - Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID) - If Error_Services('HasError') then - ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage') - end - end - Lot_Services('MoveOutLot', NewLotId, Username) - If Error_Services('NoError') then - Lot_Services('MoveInLot', NewLotId, Username) - If Error_Services('HasError') then - ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') - end - end else - //Close LOT record as there was an error - Lot_Services('CloseLot', NewLotId) - ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') - end - end else - //Close LOT record as there was an error - Lot_Services('CloseLot', NewLotId) - ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId - end - end else - //Close LOT record as there was an error - //Database_Services('DeleteDataRow', 'LOT', NewLotId, True$, False$) - Lot_Services('CloseLot', NewLotId) - ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') - end - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot attributes did not write correctly for lot: ' : NewLotId - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot already had data, lot: ' : NewLotId - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, Created lot: ' : NewLotId : ' not found in LOT table.' - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, no lot id returned.' - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, ambiguous product passed to routine OR no matching products found.' - end - end else - ErrorMessage = 'Error in Create New Test Wafer Lot Process, product(':ProdName:') passed to routine not found.' - end - end else - ErrorMessage = 'Null value passed in for ProdID' - end - Case Otherwise$ - ErrorMessage = 'Error in ':Service:' service. Lot Type "':LotType:'" is not currently supported.' + if Error_Services('NoError') then + If PrinterID NE 'WEB' then + //If PrinterID is set to WEB this means the request comes from OI_Wizard and the client is going to handle printing. + Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID) + If Error_Services('HasError') then + ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage') + end + end + Lot_Services('MoveOutLot', NewLotId, Username) + If Error_Services('NoError') then + Lot_Services('MoveInLot', NewLotId, Username) + If Error_Services('HasError') then + ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') + end + end else + //Close LOT record as there was an error + Lot_Services('CloseLot', NewLotId) + ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') + end + end else + //Close LOT record as there was an error + Lot_Services('CloseLot', NewLotId) + ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId + end + end else + //Close LOT record as there was an error + //Database_Services('DeleteDataRow', 'LOT', NewLotId, True$, False$) + Lot_Services('CloseLot', NewLotId) + ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage') + end + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot attributes did not write correctly for lot: ' : NewLotId + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot already had data, lot: ' : NewLotId + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, Created lot: ' : NewLotId : ' not found in LOT table.' + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, no lot id returned.' + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, ambiguous product passed to routine OR no matching products found.' + end + end else + ErrorMessage = 'Error in Create New Test Wafer Lot Process, product(':ProdName:') passed to routine not found.' + end + end else + ErrorMessage = 'Null value passed in for ProdID' + end + Case Otherwise$ + ErrorMessage = 'Error in ':Service:' service. Lot Type "':LotType:'" is not currently supported.' End Case If ErrorMessage EQ '' then @@ -297,10 +312,12 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + End Service Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID) + CreatedLotNumber = '' ErrorMessage = '' If LotType EQ 'TW' then @@ -409,9 +426,12 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$) end Response = CreatedLotNumber + End Service + Service GenerateInitialLotOperationRecords(LotId) + ErrorMessage = '' If LotID NE '' then if RowExists('LOT', LotId) then @@ -442,25 +462,31 @@ Service GenerateInitialLotOperationRecords(LotId) If ErrorMessage NE '' then Error_Services('Add', ErrorMessage) end + end service + Service GetPrescribedOperationsByProdId(ProdId, ProdType) + ProdOperationKeys = '' - If ProdId NE '' then - Begin Case - Case ProdType = 'TW' - ProdRec = Database_Services('ReadDataRow', 'TEST_WAFER_PROD', ProdId) - ProdOperationKeys = ProdRec - Case Otherwise$ - //error, no matching prod type. - End Case - end else - //Error: ProdID was null - end + If ProdId NE '' then + Begin Case + Case ProdType = 'TW' + ProdRec = Database_Services('ReadDataRow', 'TEST_WAFER_PROD', ProdId) + ProdOperationKeys = ProdRec + Case Otherwise$ + //error, no matching prod type. + End Case + end else + //Error: ProdID was null + end Response = ProdOperationKeys + end service + Service CreateInitialLotOperationRecords(LotId) + ErrorMessage = '' If LotId NE '' then LotRec = Database_Services('ReadDataRow', 'LOT', LotId) @@ -469,7 +495,7 @@ Service CreateInitialLotOperationRecords(LotId) ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType) If Error_Services('NoError') AND ThisInitialProdOperations NE '' then For each ProdOperation in ThisInitialProdOperations using @VM - + ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation) OperationID = ProdOperationRec OperationSequence = ProdOperationRec @@ -491,20 +517,23 @@ Service CreateInitialLotOperationRecords(LotId) end else ErrorMessage = 'Error getting prescribed operations for lot# ' : LotId end - + end else ErrorMessage = 'Lot ID was null' end If ErrorMessage NE '' then Error_Services('Add', ErrorMessage) end + end service + //Returns a @FM delimited list of operations in sequence Service GetLotOperationSequence(LotId) - StartTick = GetTickCount() + + StartTick = GetTickCount() MetricName = 'GetLotOperationSequence' - + LotOperationsInSequence = '' If LotID NE '' then //Get Operations @@ -520,12 +549,15 @@ Service GetLotOperationSequence(LotId) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service GetLotCurrOperationId(LotId) - StartTick = GetTickCount() + + StartTick = GetTickCount() MetricName = 'GetLotCurrOperationId' - + CurrOperation = '' If LotID NE '' then //Get them in sequence first @@ -545,12 +577,15 @@ Service GetLotCurrOperationId(LotId) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service GetLotCurrOperationName(LotId) - StartTick = GetTickCount() + + StartTick = GetTickCount() MetricName = 'GetLotCurrOperationName' - + CurrOperationId = '' CurrOperationName = '' If LotID NE '' then @@ -572,9 +607,12 @@ Service GetLotCurrOperationName(LotId) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework) + ErrorMessage = '' If LotId NE '' then If NewSequence NE '' AND Num(NewSequence) then @@ -624,12 +662,15 @@ Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework) If ErrorMessage NE '' then Error_Services('Add', ErrorMessage) end + end service + Service IsLotMovedIn(LotId) - StartTick = GetTickCount() - MetricName = 'IsLotMovedIn' - + + StartTick = GetTickCount() + MetricName = 'IsLotMovedIn' + Response = '' If RowExists('LOT', LotId) then CurrOperId = Lot_Services('GetLotCurrOperationId', LotId) @@ -643,149 +684,260 @@ Service IsLotMovedIn(LotId) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service IsOperationCompleted(LotOperationId) - OperationCompleted = False$ - ErrorMessage = '' - If RowExists('LOT_OPERATION', LotOperationId) then - LotOperationDateTimeOut = Database_Services('ReadDataColumn', 'LOT_OPERATION', LotOperationId, LOT_OPERATION_DATETIME_OUT$, True$, 0, False$) - If LotOperationDateTimeOut NE '' then OperationCompleted = true$ - end else - ErrorMessage = 'Invalid lot operation id passed to routine.' - end - If ErrorMessage NE '' then - Error_Services('Add', 'Error in ' : service : ' with Lot OperationId ' : LotOperationId : ' : ' : ErrorMessage) - end - response = OperationCompleted + + OperationCompleted = False$ + ErrorMessage = '' + If RowExists('LOT_OPERATION', LotOperationId) then + LotOperationDateTimeOut = Database_Services('ReadDataColumn', 'LOT_OPERATION', LotOperationId, LOT_OPERATION_DATETIME_OUT$, True$, 0, False$) + If LotOperationDateTimeOut NE '' then OperationCompleted = true$ + end else + ErrorMessage = 'Invalid lot operation id passed to routine.' + end + If ErrorMessage NE '' then + Error_Services('Add', 'Error in ' : service : ' with Lot OperationId ' : LotOperationId : ' : ' : ErrorMessage) + end + response = OperationCompleted + end service -Service MoveInLot(LotID, Operator) - StartTick = GetTickCount() - MetricName = 'MoveInLot' +Service StartLot(LotId, Operator) + + StartTick = GetTickCount() + ErrorMessage = '' + If LotId NE '' then + If RowExists('LOT', LotId) then + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'LOT_START', 'Lot started.', '', Operator) + If Error_Services('NoError') then + Lot_Services('MoveInLot', LotId, Operator) + If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage') + end else + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Error in ':Service:' process for Lot id ' : LotId : '. Lot ID not found in LOT table.' + end + end else + ErrorMessage = 'Error in ':Service:' process. Lot id was not passed to routine.' + end + If ErrorMessage NE '' then + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotID + LogData<3> = Operator + LogData<4> = 'Successfully started lot.' + Logging_Services('AppendLog', objLotStartLog, LogData, @RM, @FM, False$) + Error_Services('Add', ErrorMessage) + end + EndTick = GetTickCount() + Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick) + +end service + + +Service BeginRun(LotId, Operator, ToolId) + + StartTick = GetTickCount() + ErrorMessage = '' + If ( (LotId NE '') and (Operator NE '') and (ToolId NE '') ) then + If RowExists('LOT', LotId) then + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'BEGIN_RUN', 'Begin run', ToolId, Operator) + If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage') + end else + ErrorMessage = 'Error in ':Service:' process for Lot id ' : LotId : '. Lot ID not found in LOT table.' + end + end else + ErrorMessage = 'Error in ':Service:' process. Lot id, Operator, or ToolId was not passed to routine.' + end + If ErrorMessage NE '' then + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotID + LogData<3> = Operator + LogData<4> = ToolId + LogData<4> = 'Successfully began run.' + Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$) + Error_Services('Add', ErrorMessage) + end + EndTick = GetTickCount() + Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick) + +end service + + +Service EndRun(LotId, Operator, ToolId) + + StartTick = GetTickCount() + ErrorMessage = '' + If ( (LotId NE '') and (Operator NE '') and (ToolId NE '') ) then + If RowExists('LOT', LotId) then + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'END_RUN', 'End run', ToolId, Operator) + If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage') + end else + ErrorMessage = 'Error in ':Service:' process for Lot id ' : LotId : '. Lot ID not found in LOT table.' + end + end else + ErrorMessage = 'Error in ':Service:' process. Lot id, Operator, or ToolId was not passed to routine.' + end + If ErrorMessage NE '' then + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotID + LogData<3> = Operator + LogData<4> = ToolId + LogData<4> = 'Successfully edned run.' + Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$) + Error_Services('Add', ErrorMessage) + end + EndTick = GetTickCount() + Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick) + +end service + + +Service MoveInLot(LotID, Operator) + + StartTick = GetTickCount() + MetricName = 'MoveInLot' + ErrorMessage = '' ThisLotCurrOperationID = '' If LotId NE '' then - If RowExists('LOT', LotId) then - ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId) - WaferQty = ThisLotRec - //Possibly Add locking here - If Error_Services('NoError') then - ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId) - If ThisLotCurrOperationID NE '' then - ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID) - ThisLotCurrOperationRec = Datetime() - ThisLotCurrOperationRec = WaferQty - ThisLotCurrOperationRec = Operator + If RowExists('LOT', LotId) then + ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId) + WaferQty = ThisLotRec + //Possibly Add locking here + If Error_Services('NoError') then + ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId) + If ThisLotCurrOperationID NE '' then + ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID) + ThisLotCurrOperationRec = Datetime() + ThisLotCurrOperationRec = WaferQty + ThisLotCurrOperationRec = Operator + Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec) + If Error_Services('NoError') then + LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X') + CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X') + If Error_Services('NoError') then + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_IN', 'Lot moved into operation ' : CurrOperation : '.', '', Operator) + If Error_Services('NoError') then + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ARRIVAL', 'Lot arrived at operation ' : CurrOperation : '.', '', Operator) + If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage') + end else + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage') + end + end else + ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage') + end + end else + ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error getting lots current operation.' + end + end else + ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage') + end + end else + ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot ID not found in LOT table.' + end + end else + ErrorMessage = 'Error in Move In process. Lot id was not passed to routine.' + end + If ErrorMessage NE '' then + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotID + LogData<3> = Operator + LogData<4> = 'Successfully Moved Lot into operation ' : ThisLotCurrOperationID : '.' + Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$) + Error_Services('Add', ErrorMessage) + end + + EndTick = GetTickCount() + Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + +end service + + +Service MoveOutLot(LotID, Operator) + + StartTick = GetTickCount() + MetricName = 'MoveOutLot' + + ErrorMessage = '' + ThisLotCurrOperationID = '' + If LotId NE '' then + If RowExists('LOT', LotId) then + ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId) + WaferQty = ThisLotRec + If Error_Services('NoError') then + ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId) + If ThisLotCurrOperationID NE '' then + If Lot_Services('IsLotMovedIn', LotId) then + ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID) + ThisLotCurrOperationRec = Datetime() + ThisLotCurrOperationRec = WaferQty + ThisLotCurrOperationRec = Operator Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec) If Error_Services('NoError') then LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X') CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X') If Error_Services('NoError') then - Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_IN', 'Lot moved into operation ' : CurrOperation : '.', '', Operator) + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_OUT', 'Lot moved out of operation ' : CurrOperation : '.', '', Operator) end else ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage') end end else - ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage') + ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage') end end else - ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error getting lots current operation.' + CurrOperationName = Field(ThisLotCurrOperationID, '*', 2) + ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Cannot move out lot from ' :CurrOperationName: ' because it is not moved in.' end end else - ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage') + ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error getting lots current operation.' end end else - ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot ID not found in LOT table.' + ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. ' : Error_Services('GetMessage') end - end else - ErrorMessage = 'Error in Move In process. Lot id was not passed to routine.' - end - If ErrorMessage NE '' then - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = LotID - LogData<3> = Operator - LogData<4> = 'Successfully Moved Lot into operation ' : ThisLotCurrOperationID : '.' - Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$) - Error_Services('Add', ErrorMessage) - end - + end else + ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot ID not found in LOT table.' + end + end else + ErrorMessage = 'Error in Move Out process. Lot id was not passed to routine.' + end + If ErrorMessage NE '' then + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotID + LogData<3> = Operator + LogData<4> = 'Successfully Moved Lot out of operation ' : ThisLotCurrOperationID : '.' + Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$) + Error_Services('Add', ErrorMessage) + end else + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotID + LogData<3> = Operator + LogData<4> = 'Error in Move Out process for Lot id ' : LotId : '. ' : ErrorMessage + Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$) + Error_Services('Add', ErrorMessage) + end + EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service -Service MoveOutLot(LotID, Operator) - StartTick = GetTickCount() - MetricName = 'MoveOutLot' - - ErrorMessage = '' - ThisLotCurrOperationID = '' - If LotId NE '' then - If RowExists('LOT', LotId) then - ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId) - WaferQty = ThisLotRec - If Error_Services('NoError') then - ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId) - If ThisLotCurrOperationID NE '' then - If Lot_Services('IsLotMovedIn', LotId) then - ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID) - ThisLotCurrOperationRec = Datetime() - ThisLotCurrOperationRec = WaferQty - ThisLotCurrOperationRec = Operator - Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec) - If Error_Services('NoError') then - LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X') - CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X') - If Error_Services('NoError') then - Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_OUT', 'Lot moved out of operation ' : CurrOperation : '.', '', Operator) - end else - ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage') - end - end else - ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage') - end - end else - CurrOperationName = Field(ThisLotCurrOperationID, '*', 2) - ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Cannot move out lot from ' :CurrOperationName: ' because it is not moved in.' - end - end else - ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error getting lots current operation.' - end - end else - ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. ' : Error_Services('GetMessage') - end - end else - ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot ID not found in LOT table.' - end - end else - ErrorMessage = 'Error in Move Out process. Lot id was not passed to routine.' - end - If ErrorMessage NE '' then - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = LotID - LogData<3> = Operator - LogData<4> = 'Successfully Moved Lot out of operation ' : ThisLotCurrOperationID : '.' - Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$) - Error_Services('Add', ErrorMessage) - end else - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = LotID - LogData<3> = Operator - LogData<4> = 'Error in Move Out process for Lot id ' : LotId : '. ' : ErrorMessage - Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$) - Error_Services('Add', ErrorMessage) - end - - EndTick = GetTickCount() - Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) -end service Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN) - + ErrorMessage = '' JsonString = '' If FullObject EQ '' then @@ -797,7 +949,7 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN) LotRec = Database_Services('ReadDataRow', 'LOT', LotId) If Error_Services('NoError') then If SRP_JSON(objLot, 'New', 'Object') then - + SRP_JSON(objLot, 'SetValue', 'LotId', LotId) SRP_JSON(objLot, 'SetValue', 'Type', LotRec) SRP_JSON(objLot, 'SetValue', 'ProdId', LotRec) @@ -905,21 +1057,24 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN) Error_Services('Add', ErrorMessage) end Response = JsonString + end service + Service OpenLot(LotId) - StartTick = GetTickCount() + + StartTick = GetTickCount() MetricName = 'OpenLot' - + ErrorMessage = '' If RowExists('LOT', LotId) then LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$) LotRec = True$ Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$) If Error_Services('NoError') then - Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'OPEN', 'Lot status set to Open.', '', 'SYSTEM') + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'OPEN', 'Lot status set to Open.', '', 'SYSTEM') end else - ErrorMessage = 'Error setting lot ' : LotId : ' to open.' : Error_Services('GetMessage') + ErrorMessage = 'Error setting lot ' : LotId : ' to open.' : Error_Services('GetMessage') end end else ErrorMessage = 'Unable to Open Lot ' : LotId : '. Lot ID was not found in LOT table.' @@ -930,12 +1085,15 @@ Service OpenLot(LotId) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service CloseLot(LotId) - StartTick = GetTickCount() + + StartTick = GetTickCount() MetricName = 'CloseLot' - + ErrorMessage = '' If RowExists('LOT', LotId) then LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$) @@ -955,179 +1113,193 @@ Service CloseLot(LotId) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service AutoCloseTestWaferLot(LotId, CloseUserId) - AutoCloseTime = Datetime() - ErrorMessage = '' - If MemberOf(CloseUserId, 'LEAD') OR MemberOf(CloseUserId, 'SUPERVISOR') OR CloseUserId EQ 'SYSTEM' then - LotOperations = Lot_Services('GetLotOperationSequence', LotId) - for LotOperationIndex = 1 to DCount(LotOperations, @FM) - ThisLotOperationId = LotOperations - ThisOperationCompleted = Lot_Services('IsOperationCompleted', ThisLotOperationId) - If Error_Services('NoError') then - if Not(ThisOperationCompleted) then - ThisLotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotOperationId) - if Error_Services('NoError') then - CurrLotQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$) - If ThisLotOperationRec EQ '' then - ThisLotOperationRec = AutoCloseTime - end - If ThisLotOperationRec EQ '' then - ThisLotOperationRec = AutoCloseTime - end - if ThisLotOperationRec EQ '' then - ThisLotOperationRec = CloseUserId - end - if ThisLotOperationRec EQ '' then - ThisLotOperationRec = CloseUserId - end - if ThisLotOperationRec EQ '' then - ThisLotOperationRec = AutoCloseTime - end - if ThisLotOperationRec EQ '' then - ThisLotOperationRec = AutoCloseTime - end - If ThisLotOperationRec EQ '' then - ThisLotOperationRec = CurrLotQty - end - If ThisLotOperationRec EQ '' then - ThisLotOperationRec = CurrLotQty - end - Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotOperationId, ThisLotOperationRec, True$, False$, False$) - If Error_Services('HasError') then - ErrorMessage = Error_Services('GetMessage') - end - end else - ErrorMessage = Error_Services('GetMessage') - end - end - end else - ErrorMessage = Error_Services('GetMessage') - end - Next LotOperationIndex - end else - ErrorMessage = CloseUserId : ' does not have permission to close this lot.' - end - If ErrorMessage EQ '' then - //Close Lot as there were no validation failures. - Lot_Services('CloseLot', LotId) - If Error_Services('NoError') then - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = LotId - LogData<3> = CloseUserId - LogData<4> = 'Successfully marked lot as closed.' - Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$) - end else - ErrorMessage = Error_Services('GetMessage') - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = LotId - LogData<3> = CloseUserId - LogData<4> = 'Error marking lot as closed.' : ErrorMessage - Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$) - //Send a message to FI - Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X') - SentFrom = 'SYSTEM' - Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE' - Message = 'Error in ' : service : ' with lot id ' : LotId : ' attempting to set CLOSE flag on lot. ' : ErrorMessage - Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message) - Error_Services('Add', 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage) - end - end else - ErrorMessage = 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = LotId - LogData<3> = CloseUserId - LogData<4> = 'Error marking lot as closed.' : ErrorMessage - Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$) - //Send a message to FI - Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X') - SentFrom = 'SYSTEM' - Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE' - Message = 'Error in ' : service : ' with lot id ' : LotId : ' attempting to Auto Close Lot. ' : ErrorMessage - Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message) - Error_Services('Add', 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage) - end + + AutoCloseTime = Datetime() + ErrorMessage = '' + If MemberOf(CloseUserId, 'LEAD') OR MemberOf(CloseUserId, 'SUPERVISOR') OR CloseUserId EQ 'SYSTEM' then + LotOperations = Lot_Services('GetLotOperationSequence', LotId) + for LotOperationIndex = 1 to DCount(LotOperations, @FM) + ThisLotOperationId = LotOperations + ThisOperationCompleted = Lot_Services('IsOperationCompleted', ThisLotOperationId) + If Error_Services('NoError') then + if Not(ThisOperationCompleted) then + ThisLotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotOperationId) + if Error_Services('NoError') then + CurrLotQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$) + If ThisLotOperationRec EQ '' then + ThisLotOperationRec = AutoCloseTime + end + If ThisLotOperationRec EQ '' then + ThisLotOperationRec = AutoCloseTime + end + if ThisLotOperationRec EQ '' then + ThisLotOperationRec = CloseUserId + end + if ThisLotOperationRec EQ '' then + ThisLotOperationRec = CloseUserId + end + if ThisLotOperationRec EQ '' then + ThisLotOperationRec = AutoCloseTime + end + if ThisLotOperationRec EQ '' then + ThisLotOperationRec = AutoCloseTime + end + If ThisLotOperationRec EQ '' then + ThisLotOperationRec = CurrLotQty + end + If ThisLotOperationRec EQ '' then + ThisLotOperationRec = CurrLotQty + end + Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotOperationId, ThisLotOperationRec, True$, False$, False$) + If Error_Services('HasError') then + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = Error_Services('GetMessage') + end + end + end else + ErrorMessage = Error_Services('GetMessage') + end + Next LotOperationIndex + end else + ErrorMessage = CloseUserId : ' does not have permission to close this lot.' + end + If ErrorMessage EQ '' then + //Close Lot as there were no validation failures. + Lot_Services('CloseLot', LotId) + If Error_Services('NoError') then + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotId + LogData<3> = CloseUserId + LogData<4> = 'Successfully marked lot as closed.' + Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$) + end else + ErrorMessage = Error_Services('GetMessage') + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotId + LogData<3> = CloseUserId + LogData<4> = 'Error marking lot as closed.' : ErrorMessage + Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$) + //Send a message to FI + Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X') + SentFrom = 'SYSTEM' + Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE' + Message = 'Error in ' : service : ' with lot id ' : LotId : ' attempting to set CLOSE flag on lot. ' : ErrorMessage + Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message) + Error_Services('Add', 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage) + end + end else + ErrorMessage = 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = LotId + LogData<3> = CloseUserId + LogData<4> = 'Error marking lot as closed.' : ErrorMessage + Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$) + //Send a message to FI + Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X') + SentFrom = 'SYSTEM' + Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE' + Message = 'Error in ' : service : ' with lot id ' : LotId : ' attempting to Auto Close Lot. ' : ErrorMessage + Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message) + Error_Services('Add', 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage) + end + end service + Service HoldLot(LotId, OperatorId) + StartTick = GetTickCount() MetricName = 'HoldLot' EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service UnholdLot(LotId, OperatorId) + StartTick = GetTickCount() MetricName = 'UnholdLot' EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId) - StartTick = GetTickCount() + + StartTick = GetTickCount() MetricName = 'ReduceLotWaferCount' - - ErrorMessage = '' - If RowExists('LOT', LotId) then - LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$) - LotType = LotRec - LotHold = LotRec - LotOpen = LotRec - LotCurrWfrQty = LotRec - LotNewWfrQty = LotCurrWfrQty - ReductionQty - If LotNewWfrQty LE 25 AND LotNewWfrQty GE 0 then - LotRec = LotNewWfrQty - Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$) - If Error_Services('NoError') then - //Write Lot Event - Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '') - if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then - ServiceParms = 'AutoCloseTestWaferLot' : @VM : LotId : @VM : 'SYSTEM' - Service_Services('PostProcedure', 'LOT_SERVICES', ServiceParms) - If Error_Services('HasError') then - Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X') - SentFrom = 'SYSTEM' - Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE' - Message = 'Error in ' : service : ' attempting to add auto lot closure for lot id ' : LotId : ' to the service queue.' - AttachWindow = '' - AttachKeys = '' - SendToGroup = '' - Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message) - end - end - end else - ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.' - end - end else - Begin Case - Case LotNewWfrQty GT 25 - ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity great than 25.' - Case LotNewWfrQty LT 0 - ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity less than 0.' - End Case - end - end else - ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.' - end - if ErrorMessage NE '' then - Error_Services('Add', ErrorMessage) - end - - EndTick = GetTickCount() + + ErrorMessage = '' + If RowExists('LOT', LotId) then + LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$) + LotType = LotRec + LotHold = LotRec + LotOpen = LotRec + LotCurrWfrQty = LotRec + LotNewWfrQty = LotCurrWfrQty - ReductionQty + If LotNewWfrQty LE 25 AND LotNewWfrQty GE 0 then + LotRec = LotNewWfrQty + Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$) + If Error_Services('NoError') then + //Write Lot Event + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '') + if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then + ServiceParms = 'AutoCloseTestWaferLot' : @VM : LotId : @VM : 'SYSTEM' + Service_Services('PostProcedure', 'LOT_SERVICES', ServiceParms) + If Error_Services('HasError') then + Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X') + SentFrom = 'SYSTEM' + Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE' + Message = 'Error in ' : service : ' attempting to add auto lot closure for lot id ' : LotId : ' to the service queue.' + AttachWindow = '' + AttachKeys = '' + SendToGroup = '' + Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message) + end + end + end else + ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.' + end + end else + Begin Case + Case LotNewWfrQty GT 25 + ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity great than 25.' + Case LotNewWfrQty LT 0 + ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity less than 0.' + End Case + end + end else + ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.' + end + if ErrorMessage NE '' then + Error_Services('Add', ErrorMessage) + end + + EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service IncreaseLotWaferCount(LotId, IncreaseQty, OperatorId) - StartTick = GetTickCount() + + StartTick = GetTickCount() MetricName = 'IncreaseLotWaferCount' - + ErrorMessage = '' If RowExists('LOT', LotId) then LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$) @@ -1143,7 +1315,7 @@ Service IncreaseLotWaferCount(LotId, IncreaseQty, OperatorId) Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$) If Error_Services('NoError') then //Write Lot Event - Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'INCREASE_WAFER_QTY', 'Increased wafer count by ' : IncreaseQty, '', OperatorId, False$, '') + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'INCREASE_WAFER_QTY', 'Increased wafer count by ' : IncreaseQty, '', OperatorId, False$, '') end else ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.' end @@ -1163,7 +1335,7 @@ Service IncreaseLotWaferCount(LotId, IncreaseQty, OperatorId) end end else - ErrorMessage = 'Error in Increase Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.' + ErrorMessage = 'Error in Increase Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.' end if ErrorMessage NE '' then Error_Services('Add', ErrorMessage) @@ -1171,89 +1343,96 @@ Service IncreaseLotWaferCount(LotId, IncreaseQty, OperatorId) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service + Service OpenOIWizardCreateTWLotInBrowser() + Command = 'explorer https://goto.infineon.com/oiwizard/Lot/CreateTestWaferLot/' SRP_Run_Command(Command) + end service + Service CreateNewVoidedLotRecord(LotId, LegacyLotId, LotType=LOT_TYPES, Username) - StartTick = GetTickCount() - MetricName = 'CreateNewVoidedLotRecord' - - ErrorMessage = '' - If RowExists('LSL_USERS', Username) then - If LotType NE '' then - NewVoidedLotRecordId = RTI_CreateGUID() - If Not(RowExists('VOIDED_LOT', NewVoidedLotRecordId)) then - NewVoidedLotRec = '' - Begin Case - Case LotType EQ 'RDS' - WONo = XLate('RDS', LegacyLotId, RDS_WO$, 'X') - CassNo = XLATE('RDS', LotId, RDS_CASS_NO$, 'X') - WoMatKey = WONo : '*' : CassNo - If RowExists('RDS', LegacyLotId) then - WoNo = Field(LotId, '*', 1) - NewVoidedLotRec = WoNo - NewVoidedLotRec = 'RDS' - NewVoidedLotRec = LegacyLotId - end else - ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. RDS record not found.' - end - Case LotType EQ 'WO_MAT' - If RowExists('WO_MAT', LegacyLotId) then - WoNo = Field(LotId, '*', 1) - NewVoidedLotRec = WoNo - NewVoidedLotRec = 'WO_MAT' - NewVoidedLotRec = LegacyLotId - end else - ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. WoMat record not found.' - end - Case LotType EQ 'WM_IN' - If RowExists('WM_IN', LegacyLotId) then - WoNo = Field(LotId, '*', 1) - NewVoidedLotRec = WoNo - NewVoidedLotRec = 'WM_IN' - NewVoidedLotRec = LegacyLotId - end else - ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. WM_IN record not found.' - end - Case LotType EQ 'WM_OUT' - If RowExists('WM_OUT', LegacyLotId) then - WoNo = Field(LotId, '*', 1) - NewVoidedLotRec = WoNo - NewVoidedLotRec = 'WM_OUT' - NewVoidedLotRec = LegacyLotId - end else - ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. WM_OUT record not found.' - end - Case Otherwise$ - ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. Non supported lot type.' - End Case - If ErrorMessage EQ '' then - NewVoidedLotRec = Username - NewVoidedLotRec = Datetime() - NewVoidedLotRec = LotId - Database_Services('WriteDataRow', 'VOIDED_LOT', NewVoidedLotRecordId, NewVoidedLotRec) - If Error_Services('HasError') then - ErrorMessage = Error_Services('GetMessage') - end - end - end else - ErrorMessage = 'Go buy a lottery ticket, we ran into a GUID collision with an existing GUID ' : NewVoidedLotRecordId : ' when trying to create a Voided Lot record for ' : LotId - end - end else - ErrorMessage = 'Null lot type of passed to CreateVoidedLotRecord routine.' - end - end else - ErrorMessage = 'Username ' : Username : ' passed to CreateVoidedLotRecord routine does not exist.' - end - If ErrorMessage NE '' then - //Todo Log Error Message - end - - EndTick = GetTickCount() + + StartTick = GetTickCount() + MetricName = 'CreateNewVoidedLotRecord' + + ErrorMessage = '' + If RowExists('LSL_USERS', Username) then + If LotType NE '' then + NewVoidedLotRecordId = RTI_CreateGUID() + If Not(RowExists('VOIDED_LOT', NewVoidedLotRecordId)) then + NewVoidedLotRec = '' + Begin Case + Case LotType EQ 'RDS' + WONo = XLate('RDS', LegacyLotId, RDS_WO$, 'X') + CassNo = XLATE('RDS', LotId, RDS_CASS_NO$, 'X') + WoMatKey = WONo : '*' : CassNo + If RowExists('RDS', LegacyLotId) then + WoNo = Field(LotId, '*', 1) + NewVoidedLotRec = WoNo + NewVoidedLotRec = 'RDS' + NewVoidedLotRec = LegacyLotId + end else + ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. RDS record not found.' + end + Case LotType EQ 'WO_MAT' + If RowExists('WO_MAT', LegacyLotId) then + WoNo = Field(LotId, '*', 1) + NewVoidedLotRec = WoNo + NewVoidedLotRec = 'WO_MAT' + NewVoidedLotRec = LegacyLotId + end else + ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. WoMat record not found.' + end + Case LotType EQ 'WM_IN' + If RowExists('WM_IN', LegacyLotId) then + WoNo = Field(LotId, '*', 1) + NewVoidedLotRec = WoNo + NewVoidedLotRec = 'WM_IN' + NewVoidedLotRec = LegacyLotId + end else + ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. WM_IN record not found.' + end + Case LotType EQ 'WM_OUT' + If RowExists('WM_OUT', LegacyLotId) then + WoNo = Field(LotId, '*', 1) + NewVoidedLotRec = WoNo + NewVoidedLotRec = 'WM_OUT' + NewVoidedLotRec = LegacyLotId + end else + ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. WM_OUT record not found.' + end + Case Otherwise$ + ErrorMessage = 'Error when creating a voided lot record for ' : LotId : ' of type ' : LotType : '. Non supported lot type.' + End Case + If ErrorMessage EQ '' then + NewVoidedLotRec = Username + NewVoidedLotRec = Datetime() + NewVoidedLotRec = LotId + Database_Services('WriteDataRow', 'VOIDED_LOT', NewVoidedLotRecordId, NewVoidedLotRec) + If Error_Services('HasError') then + ErrorMessage = Error_Services('GetMessage') + end + end + end else + ErrorMessage = 'Go buy a lottery ticket, we ran into a GUID collision with an existing GUID ' : NewVoidedLotRecordId : ' when trying to create a Voided Lot record for ' : LotId + end + end else + ErrorMessage = 'Null lot type of passed to CreateVoidedLotRecord routine.' + end + end else + ErrorMessage = 'Username ' : Username : ' passed to CreateVoidedLotRecord routine does not exist.' + end + If ErrorMessage NE '' then + //Todo Log Error Message + end + + EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service diff --git a/LSL2/STPROC/OBJ_RDS.txt b/LSL2/STPROC/OBJ_RDS.txt index ef0091a..50dbee3 100644 --- a/LSL2/STPROC/OBJ_RDS.txt +++ b/LSL2/STPROC/OBJ_RDS.txt @@ -17,8 +17,8 @@ COMPILE FUNCTION obj_RDS(Method,Parms) DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, obj_WO_Verify, obj_Prod_Spec, Send_Dyn, obj_RDS_Makeup -DECLARE FUNCTION obj_RDS2, obj_RDS_Test, obj_WO_Mat, obj_Clean_Insp, obj_PRS_Prop, Database_Services -DECLARE FUNCTION Logging_Services, Environment_Services, Error_Services, Signature_Services, Supplement_Services +DECLARE FUNCTION obj_RDS2, obj_RDS_Test, obj_WO_Mat, obj_Clean_Insp, obj_PRS_Prop, Database_Services, RDS_Services +DECLARE FUNCTION Logging_Services, Environment_Services, Error_Services, Signature_Services, Lot_Services, Supplement_Services DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, obj_WM_In DECLARE SUBROUTINE Btree.Extract, RDS_React_Run, Environment_Services, Logging_Services, Error_Services, Send_Info DECLARE SUBROUTINE SRP_Stopwatch, Database_Services, Lot_Services, Supplement_Services @@ -475,7 +475,21 @@ Create: Logging_Services('AppendLog', objLog, LoggingDTM : ',' : @USER4 : ',' : RDSNo : ',' : 'Error writing new RDS record. Error code: ':errCode) Result = '' END ELSE - Lot_Services('CreateNewLot', 'RDS', '', WaferQty, SubPartNo, LotNo, SubVendCd, @User4, '', RDSNo) + + NewLotId = Lot_Services('CreateNewLot', 'RDS', '', WaferQty, SubPartNo, LotNo, SubVendCd, @User4, '', RDSNo) + + If Rds_Services('IsEpiPro', RDSNo) then + Lot_Services('AddLotOperationIntoSequence', NewLotId, 'RDS_CREATE', 1, False$) + Lot_Services('AddLotOperationIntoSequence', NewLotId, 'PRE_EPI', 2, False$) + Lot_Services('AddLotOperationIntoSequence', NewLotId, 'REACTOR_RUN', 3, False$) + Lot_Services('AddLotOperationIntoSequence', NewLotId, 'POST_EPI', 4, False$) + Lot_Services('AddLotOperationIntoSequence', NewLotId, 'RDS_CLOSE', 5, False$) + + Lot_Services('StartLot', NewLotId, @User4) ; // LOT_START event and move in to RDS_CREATE operation + Lot_Services('MoveOutLot', NewLotId, @User4) ; // Move out of RDS_CREATE operation + Lot_Services('MoveInLot', NewLotId, @User4) ; // Move in to PRE_EPI operation + end + Result = RDSNo ******************************** *Automatically Apply Supplement* @@ -1478,4 +1492,3 @@ RETURN - diff --git a/LSL2/STPROC/OBJ_RDS2.txt b/LSL2/STPROC/OBJ_RDS2.txt index fe72a3a..875e5af 100644 --- a/LSL2/STPROC/OBJ_RDS2.txt +++ b/LSL2/STPROC/OBJ_RDS2.txt @@ -26,10 +26,10 @@ COMPILE FUNCTION obj_RDS2(Method,Parms) DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, obj_Prod_Spec, Dialog_Box, obj_RDS_Test DECLARE FUNCTION obj_React_Status, Logging_Services, Environment_Services, Database_Services, Error_Services -DECLARE FUNCTION Material_Services, SRP_Array +DECLARE FUNCTION Material_Services, SRP_Array, Lot_Services DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, obj_React_Status, obj_WO_Wfr DECLARE SUBROUTINE RDS_React_Run, obj_WM_Out, obj_WM_In, ErrMsg, Send_Info, obj_Clean_Insp, Database_Services -DECLARE SUBROUTINE Logging_Services +DECLARE SUBROUTINE Logging_Services, Lot_Services $INSERT MSG_EQUATES $INSERT WO_VERIFY_EQU @@ -769,7 +769,14 @@ IF NOT(UnloadFailed) THEN // Clear REACT_RUN data (copy cleared RDS data to REACT_RUN) RDS_React_Run(RDSNo) - end + end else + LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSNo, 'RDS') + If Error_Services('NoError') then + Lot_Services('MoveOutLot', LotId, @User4) ; // Move out of POST_EPI operation + Lot_Services('MoveInLot', LotId, @User4) ; // Move into RDS_CLOSE operation + Lot_Services('CloseLot', LotId) + end + end END ELSE obj_Tables('UnlockRec',RTParms) @@ -1675,3 +1682,4 @@ RETURN + diff --git a/LSL2/STPROC/QA_SERVICES.txt b/LSL2/STPROC/QA_SERVICES.txt index f100997..0ea8e7d 100644 --- a/LSL2/STPROC/QA_SERVICES.txt +++ b/LSL2/STPROC/QA_SERVICES.txt @@ -151,7 +151,7 @@ Declare function Min, Max, SRPSendMail, Btree.Extract, GetTickCount, HTTPClie Declare function SRP_Encode, SRP_Decode, SRP_COM, QA_Services, RDS_Services, Obj_NCR, Logging_Services, Obj_Reactor Declare function Get_Status, Set_Status, obj_WO_Mat, NextKey, MemberOf, FieldCount, obj_React_Status, Obj_Clean_Insp Declare function Schedule_Services, Signature_Services, Date, Time, Datetime, Date_Services, SRP_Array, Math_Services -Declare function Supplement_Services, Reactor_Services +Declare function Supplement_Services, Reactor_Services, Lot_Services LogDate = Oconv(Date(), 'D4/') LogTime = Oconv(Time(), 'MTS') @@ -1797,6 +1797,7 @@ end service // Reponse - True$ if PRE stage was successfully signed, False$ otherwise. //---------------------------------------------------------------------------------------------------------------------- Service SignPreEpiStage(RDSNo, Username, WaferQty, Reactor, ScanEntry) + StartTick = GetTickCount() MetricName = 'SignPreEpiStage' @@ -1970,6 +1971,16 @@ Service SignPreEpiStage(RDSNo, Username, WaferQty, Reactor, ScanEntry) If (FirstParmsComp EQ False$) then RDS_Services('CopyRDSLayerParameters', RDSNo) end + If Error_Services('NoError') then + If RDS_Services('IsEpiPro', RDSNo) then + LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSNo, 'RDS') + If Error_Services('NoError') then + Lot_Services('MoveOutLot', LotId, Username) ; // Move out of PRE_EPI operation + Lot_Services('MoveInLot', LotId, Username) ; // Move into REACTOR_RUN operation + end + end + end + If Error_Services('NoError') then Response = True$ end else @@ -1978,6 +1989,7 @@ Service SignPreEpiStage(RDSNo, Username, WaferQty, Reactor, ScanEntry) EndTick = GetTickCount() Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) + end service @@ -2534,6 +2546,15 @@ Service SignLoadStage(RDSNo, Username, WaferQty, LLSide, ScanEntry) // Set LOAD signature in RDS record Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$) + If Error_Services('NoError') then + If RDS_Services('IsEpiPro', RDSNo) then + LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSNo, 'RDS') + If Error_Services('NoError') then + Lot_Services('BeginRun', LotId, Username, Reactor) ; // Begin run at REACTOR_RUN operation + end + end + end + If Error_Services('NoError') then Rds_Services('AddComment', RDSNo, 'Load Stage signed onto Reactor ' : Reactor, Username) If ReactorType EQ 'EPP' then @@ -2985,6 +3006,23 @@ Service SignUnloadStage(RDSNo, Username, ScanEntry) end end + If Error_Services('NoError') then + If RDS_Services('IsEpiPro', RDSNo) then + LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSNo, 'RDS') + If Error_Services('NoError') then + Lot_Services('EndRun', LotId, Username, Reactor) ; // End run at REACTOR_RUN operation + Lot_Services('MoveOutLot', LotId, Username) ; // Move out of REACTOR_RUN operation + Lot_Services('MoveInLot', LotId, Username) ; // Move into POST_EPI operation + // If no production wafers in this run, then move out of POST_EPI and close the lot. + If Rds_Services('IsEpiProTestRun', RDSNo) then + Lot_Services('MoveOutLot', LotId, Username) ; // Move out of POST_EPI operation + Lot_Services('MoveInLot', LotId, Username) ; // Move into RDS_CLOSE operation + Lot_Services('CloseLot', LotId) + end + end + end + end + If Error_Services('NoError') then Rds_Services('AddComment', RDSNo, 'Unload Stage signed onto Reactor ' : Reactor, Username) Response = True$ @@ -3646,4 +3684,3 @@ return - diff --git a/LSL2/STPROC/RDS_PRE_EPI_EVENTS.txt b/LSL2/STPROC/RDS_PRE_EPI_EVENTS.txt index e95bdd8..3107485 100644 --- a/LSL2/STPROC/RDS_PRE_EPI_EVENTS.txt +++ b/LSL2/STPROC/RDS_PRE_EPI_EVENTS.txt @@ -168,9 +168,6 @@ Event PUB_SIGN.CLICK() Set_Property(@Window, 'SAVEWARN', False$) Set_Status(0) Send_Event(@Window, 'READ') -* RDSNo = Get_Property(@Window:'.RDS_NO', 'TEXT', 'X') -* CombStatus = Xlate('RDS', RDSNo, 'COMB_STATUS_STATIC', 'X') -* Set_Property(@Window:'.COMB_STATUS', 'TEXT', CombStatus) end event @@ -179,5 +176,3 @@ end event // Internal GoSubs //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/LSL2/STPROC/RDS_SERVICES.txt b/LSL2/STPROC/RDS_SERVICES.txt index 1c76161..d9fccfe 100644 --- a/LSL2/STPROC/RDS_SERVICES.txt +++ b/LSL2/STPROC/RDS_SERVICES.txt @@ -650,12 +650,8 @@ end service //---------------------------------------------------------------------------------------------------------------------- Service IsEpiPro(RDSNo) - IsEpiPro = False$ - ReactorKey = Xlate('RDS', RDSNo, 'REACTOR', 'X') - ReactorType = Xlate('REACTOR', ReactorKey, 'REACT_TYPE', 'X') - If ReactorType _EQC 'EPP' or ReactorType _EQC 'P' or ReactorType _EQC 'EpiPro' then - IsEpiPro = True$ - end + ReactorType = Xlate('RDS', RDSNo, 'PS_REACTOR_TYPE', 'X') + IsEpiPro = ( (ReactorType _EQC 'EPP') or (ReactorType _EQC 'P') or (ReactorType _EQC 'EpiPro') ) Response = IsEpiPro End Service @@ -1988,6 +1984,7 @@ Service PushSigProfileToWoMat(RDSNo) end service + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal GoSubs //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/LSL2/STPROCINS/LOT_EQUATES.txt b/LSL2/STPROCINS/LOT_EQUATES.txt index 669df62..5fb7210 100644 --- a/LSL2/STPROCINS/LOT_EQUATES.txt +++ b/LSL2/STPROCINS/LOT_EQUATES.txt @@ -1,7 +1,7 @@ compile insert LOT_EQUATES /*---------------------------------------- Author : Table Create Insert Routine - Written : 01/04/2025 + Written : 17/06/2025 Description : Insert for Table LOT ----------------------------------------*/ #ifndef __LOT_EQUATES__ @@ -23,5 +23,11 @@ compile insert LOT_EQUATES equ LOT_LEGACY_LOT_ID$ to 14 equ LOT_VOIDED_LOT_RECORDS$ to 15 equ LOT_MOST_RECENT_LOT_EVENT_ID$ to 16 + equ LOT_LEGACY_LOT_TYPE$ to 17 + equ LOT_WO_LOG_ID$ to 18 + equ LOT_PROD_SPEC_ID$ to 19 + equ LOT_EPI_PART_NO$ to 20 + equ LOT_PROD_VER_NO$ to 21 + equ LOT_MET_TEST_IDS$ to 22 #endif diff --git a/LSL2/STPROCINS/LOT_EVENT_EQUATES.txt b/LSL2/STPROCINS/LOT_EVENT_EQUATES.txt index b164ca2..7d353c0 100644 --- a/LSL2/STPROCINS/LOT_EVENT_EQUATES.txt +++ b/LSL2/STPROCINS/LOT_EVENT_EQUATES.txt @@ -1,7 +1,7 @@ compile insert LOT_EVENT_EQUATES /*---------------------------------------- Author : Table Create Insert Routine - Written : 16/10/2024 + Written : 17/06/2025 Description : Insert for Table LOT_EVENT ----------------------------------------*/ #ifndef __LOT_EVENT_EQUATES__ diff --git a/LSL2/STPROCINS/LOT_EVENT_TYPE_EQUATES.txt b/LSL2/STPROCINS/LOT_EVENT_TYPE_EQUATES.txt new file mode 100644 index 0000000..8c5b26c --- /dev/null +++ b/LSL2/STPROCINS/LOT_EVENT_TYPE_EQUATES.txt @@ -0,0 +1,13 @@ +compile insert LOT_EVENT_TYPE_EQUATES +/*---------------------------------------- + Author : Table Create Insert Routine + Written : 20/06/2025 + Description : Insert for Table LOT_EVENT_TYPE +----------------------------------------*/ +#ifndef __LOT_EVENT_TYPE_EQUATES__ +#define __LOT_EVENT_TYPE_EQUATES__ + + equ LOT_EVENT_TYPE.DESCRIPTION$ to 1 + equ LOT_EVENT_TYPE.WIP_TRANS_TYPE$ to 2 + +#endif diff --git a/LSL2/STPROCINS/LOT_OPERATION_EQUATES.txt b/LSL2/STPROCINS/LOT_OPERATION_EQUATES.txt index fa800d8..7f2ed8a 100644 --- a/LSL2/STPROCINS/LOT_OPERATION_EQUATES.txt +++ b/LSL2/STPROCINS/LOT_OPERATION_EQUATES.txt @@ -1,25 +1,35 @@ compile insert LOT_OPERATION_EQUATES /*---------------------------------------- Author : Table Create Insert Routine - Written : 14/10/2024 + Written : 17/06/2025 Description : Insert for Table LOT_OPERATION ----------------------------------------*/ #ifndef __LOT_OPERATION_EQUATES__ #define __LOT_OPERATION_EQUATES__ - equ LOT_OPERATION_LOT_ID$ to 1 - equ LOT_OPERATION_OPERATION_ID$ to 2 - equ LOT_OPERATION_DATETIME_IN$ to 3 - equ LOT_OPERATION_DATETIME_OUT$ to 4 - equ LOT_OPERATION_EQUIPMENT_ID$ to 5 - equ LOT_OPERATION_WAFER_IN_QTY$ to 6 - equ LOT_OPERATION_WAFER_OUT_QTY$ to 7 - equ LOT_OPERATION_OPERATOR_IN_ID$ to 8 - equ LOT_OPERATION_OPERATOR_OUT_ID$ to 9 - equ LOT_OPERATION_OPERATION_SEQUENCE$ to 10 - equ LOT_OPERATION_REWORK$ to 11 - equ LOT_OPERATION_DATETIME_START$ to 12 - equ LOT_OPERATION_DATETIME_STOP$ to 13 + equ LOT_OPERATION_LOT_ID$ to 1 + equ LOT_OPERATION_OPERATION_ID$ to 2 + equ LOT_OPERATION_DATETIME_IN$ to 3 + equ LOT_OPERATION_DATETIME_OUT$ to 4 + equ LOT_OPERATION_EQUIPMENT_ID$ to 5 + equ LOT_OPERATION_WAFER_IN_QTY$ to 6 + equ LOT_OPERATION_WAFER_OUT_QTY$ to 7 + equ LOT_OPERATION_OPERATOR_IN_ID$ to 8 + equ LOT_OPERATION_OPERATOR_OUT_ID$ to 9 + equ LOT_OPERATION_OPERATION_SEQUENCE$ to 10 + equ LOT_OPERATION_REWORK$ to 11 + equ LOT_OPERATION_DATETIME_START$ to 12 + equ LOT_OPERATION_DATETIME_STOP$ to 13 + equ LOT_OPERATION_MET_TEST_ID$ to 14 + equ LOT_OPERATION_CLEAN_ID$ to 15 + equ LOT_OPERATION_PACKAGING_ID$ to 16 + equ LOT_OPERATION_WAFER_COUNTER_ID$ to 17 + equ LOT_OPERATION_OPERATION_TYPE$ to 18 + equ LOT_OPERATION_OPERATION_CLASS$ to 19 + equ LOT_OPERATION_MET_TEST_TYPE_REQUIRED$ to 20 + equ LOT_OPERATION_MET_TEST_REQUIRED$ to 21 + equ LOT_OPERATION_PACKAGING_REQUIRED$ to 22 + equ LOT_OPERATION_CLEAN_REQUIRED$ to 23 + equ LOT_OPERATION_WAFER_COUNTER_REQUIRED$ to 24 #endif - diff --git a/LSL2/STPROCINS/METROLOGY_DATA_EXAMPLE_EQUATES.txt b/LSL2/STPROCINS/METROLOGY_DATA_EXAMPLE_EQUATES.txt new file mode 100644 index 0000000..74ce3da --- /dev/null +++ b/LSL2/STPROCINS/METROLOGY_DATA_EXAMPLE_EQUATES.txt @@ -0,0 +1,21 @@ +compile insert METROLOGY_DATA_EXAMPLE_EQUATES +/*---------------------------------------- + Author : Table Create Insert Routine + Written : 07/04/2025 + Description : Insert for Table METROLOGY_DATA_EXAMPLE +----------------------------------------*/ +#ifndef __METROLOGY_DATA_EXAMPLE_EQUATES__ +#define __METROLOGY_DATA_EXAMPLE_EQUATES__ + + equ METROLOGY_DATA_EXAMPLE_INSPECTION_TYPE$ to 1 + equ METROLOGY_DATA_EXAMPLE_TOOL_ID$ to 2 + equ METROLOGY_DATA_EXAMPLE_DATA_ENTRY_DTM$ to 3 + equ METROLOGY_DATA_EXAMPLE_DATA_ENTRY_USER$ to 4 + equ METROLOGY_DATA_EXAMPLE_RAW_DATA_POINTS$ to 5 + equ METROLOGY_DATA_EXAMPLE_DATA_AVERAGE$ to 6 + equ METROLOGY_DATA_EXAMPLE_SPEC_LIMIT_UPPER$ to 7 + equ METROLOGY_DATA_EXAMPLE_IN_SPEC$ to 8 + equ METROLOGY_DATA_EXAMPLE_SPEC_LIMIT_LOWER$ to 9 + +#endif + diff --git a/LSL2/STPROCINS/MET_TEST_DATA_EQUATES.txt b/LSL2/STPROCINS/MET_TEST_DATA_EQUATES.txt new file mode 100644 index 0000000..9c43994 --- /dev/null +++ b/LSL2/STPROCINS/MET_TEST_DATA_EQUATES.txt @@ -0,0 +1,43 @@ +compile insert MET_TEST_DATA_EQUATES +/*---------------------------------------- + Author : Table Create Insert Routine + Written : 16/06/2025 + Description : Insert for Table MET_TEST_DATA +----------------------------------------*/ +#ifndef __MET_TEST_DATA_EQUATES__ +#define __MET_TEST_DATA_EQUATES__ + + equ MET_TEST_DATA.MET_TEST_ID$ to 1 + equ MET_TEST_DATA.POSITION$ to 2 + equ MET_TEST_DATA.PROPERTY_1_VALUE$ to 3 + equ MET_TEST_DATA.PROPERTY_1_OUT_OF_SPEC$ to 4 + equ MET_TEST_DATA.PROPERTY_2_VALUE$ to 5 + equ MET_TEST_DATA.PROPERTY_2_OUT_OF_SPEC$ to 6 + equ MET_TEST_DATA.PROPERTY_3_VALUE$ to 7 + equ MET_TEST_DATA.PROPERTY_3_OUT_OF_SPEC$ to 8 + equ MET_TEST_DATA.PROPERTY_4_VALUE$ to 9 + equ MET_TEST_DATA.PROPERTY_4_OUT_OF_SPEC$ to 10 + equ MET_TEST_DATA.PROPERTY_5_VALUE$ to 11 + equ MET_TEST_DATA.PROPERTY_5_OUT_OF_SPEC$ to 12 + equ MET_TEST_DATA.PROPERTY_6_VALUE$ to 13 + equ MET_TEST_DATA.PROPERTY_6_OUT_OF_SPEC$ to 14 + equ MET_TEST_DATA.PROPERTY_7_VALUE$ to 15 + equ MET_TEST_DATA.PROPERTY_7_OUT_OF_SPEC$ to 16 + equ MET_TEST_DATA.PROPERTY_8_VALUE$ to 17 + equ MET_TEST_DATA.PROPERTY_8_OUT_OF_SPEC$ to 18 + equ MET_TEST_DATA.PROPERTY_9_VALUE$ to 19 + equ MET_TEST_DATA.PROPERTY_9_OUT_OF_SPEC$ to 20 + equ MET_TEST_DATA.PROPERTY_10_VALUE$ to 21 + equ MET_TEST_DATA.PROPERTY_10_OUT_OF_SPEC$ to 22 + equ MET_TEST_DATA.PROPERTY_11_VALUE$ to 23 + equ MET_TEST_DATA.PROPERTY_11_OUT_OF_SPEC$ to 24 + equ MET_TEST_DATA.PROPERTY_12_VALUE$ to 25 + equ MET_TEST_DATA.PROPERTY_12_OUT_OF_SPEC$ to 26 + equ MET_TEST_DATA.PROPERTY_13_VALUE$ to 27 + equ MET_TEST_DATA.PROPERTY_13_OUT_OF_SPEC$ to 28 + equ MET_TEST_DATA.PROPERTY_14_VALUE$ to 29 + equ MET_TEST_DATA.PROPERTY_14_OUT_OF_SPEC$ to 30 + equ MET_TEST_DATA.PROPERTY_15_VALUE$ to 31 + equ MET_TEST_DATA.PROPERTY_15_OUT_OF_SPEC$ to 32 + +#endif diff --git a/LSL2/STPROCINS/MET_TEST_EQUATES.txt b/LSL2/STPROCINS/MET_TEST_EQUATES.txt new file mode 100644 index 0000000..d62574a --- /dev/null +++ b/LSL2/STPROCINS/MET_TEST_EQUATES.txt @@ -0,0 +1,72 @@ +compile insert MET_TEST_EQUATES +/*---------------------------------------- + Author : Table Create Insert Routine + Written : 16/06/2025 + Description : Insert for Table MET_TEST +----------------------------------------*/ +#ifndef __MET_TEST_EQUATES__ +#define __MET_TEST_EQUATES__ + + equ MET_TEST.MET_TEST_DATA_IDS$ to 1 + equ MET_TEST.LOT_ID$ to 2 + equ MET_TEST.LEGACY_LOT_ID$ to 3 + equ MET_TEST.LOT_OPERATION_ID$ to 4 + equ MET_TEST.TEST_DTM$ to 5 + equ MET_TEST.TOOL_CLASS$ to 6 + equ MET_TEST.TOOL_RECIPE$ to 7 + equ MET_TEST.TOOL_PATTERN$ to 8 + equ MET_TEST.INSPECTION_RECIPE$ to 9 + equ MET_TEST.SAMPLE_SIZE$ to 10 + equ MET_TEST.TOOL$ to 11 + equ MET_TEST.LAYER$ to 12 + equ MET_TEST.ZONE$ to 13 + equ MET_TEST.SLOT$ to 14 + equ MET_TEST.OUT_OF_SPEC$ to 15 + equ MET_TEST.COMPLETE$ to 16 + equ MET_TEST.PROPERTY_1$ to 17 + equ MET_TEST.PROPERTY_1_SPEC_MIN$ to 18 + equ MET_TEST.PROPERTY_1_SPEC_MAX$ to 19 + equ MET_TEST.PROPERTY_2$ to 20 + equ MET_TEST.PROPERTY_2_SPEC_MIN$ to 21 + equ MET_TEST.PROPERTY_2_SPEC_MAX$ to 22 + equ MET_TEST.PROPERTY_3$ to 23 + equ MET_TEST.PROPERTY_3_SPEC_MIN$ to 24 + equ MET_TEST.PROPERTY_3_SPEC_MAX$ to 25 + equ MET_TEST.PROPERTY_4$ to 26 + equ MET_TEST.PROPERTY_4_SPEC_MIN$ to 27 + equ MET_TEST.PROPERTY_4_SPEC_MAX$ to 28 + equ MET_TEST.PROPERTY_5$ to 29 + equ MET_TEST.PROPERTY_5_SPEC_MIN$ to 30 + equ MET_TEST.PROPERTY_5_SPEC_MAX$ to 31 + equ MET_TEST.PROPERTY_6$ to 32 + equ MET_TEST.PROPERTY_6_SPEC_MIN$ to 33 + equ MET_TEST.PROPERTY_6_SPEC_MAX$ to 34 + equ MET_TEST.PROPERTY_7$ to 35 + equ MET_TEST.PROPERTY_7_SPEC_MIN$ to 36 + equ MET_TEST.PROPERTY_7_SPEC_MAX$ to 37 + equ MET_TEST.PROPERTY_8$ to 38 + equ MET_TEST.PROPERTY_8_SPEC_MIN$ to 39 + equ MET_TEST.PROPERTY_8_SPEC_MAX$ to 40 + equ MET_TEST.PROPERTY_9$ to 41 + equ MET_TEST.PROPERTY_9_SPEC_MIN$ to 42 + equ MET_TEST.PROPERTY_9_SPEC_MAX$ to 43 + equ MET_TEST.PROPERTY_10$ to 44 + equ MET_TEST.PROPERTY_10_SPEC_MIN$ to 45 + equ MET_TEST.PROPERTY_10_SPEC_MAX$ to 46 + equ MET_TEST.PROPERTY_11$ to 47 + equ MET_TEST.PROPERTY_11_SPEC_MIN$ to 48 + equ MET_TEST.PROPERTY_11_SPEC_MAX$ to 49 + equ MET_TEST.PROPERTY_12$ to 50 + equ MET_TEST.PROPERTY_12_SPEC_MIN$ to 51 + equ MET_TEST.PROPERTY_12_SPEC_MAX$ to 52 + equ MET_TEST.PROPERTY_13$ to 53 + equ MET_TEST.PROPERTY_13_SPEC_MIN$ to 54 + equ MET_TEST.PROPERTY_13_SPEC_MAX$ to 55 + equ MET_TEST.PROPERTY_14$ to 56 + equ MET_TEST.PROPERTY_14_SPEC_MIN$ to 57 + equ MET_TEST.PROPERTY_14_SPEC_MAX$ to 58 + equ MET_TEST.PROPERTY_15$ to 59 + equ MET_TEST.PROPERTY_15_SPEC_MIN$ to 60 + equ MET_TEST.PROPERTY_15_SPEC_MAX$ to 61 + +#endif diff --git a/LSL2/STPROCINS/OPERATION_EQUATES.txt b/LSL2/STPROCINS/OPERATION_EQUATES.txt index e3e4cde..5200f1a 100644 --- a/LSL2/STPROCINS/OPERATION_EQUATES.txt +++ b/LSL2/STPROCINS/OPERATION_EQUATES.txt @@ -1,11 +1,21 @@ compile insert OPERATION_EQUATES /*---------------------------------------- Author : Table Create Insert Routine - Written : 10/10/2024 + Written : 17/06/2025 Description : Insert for Table OPERATION ----------------------------------------*/ #ifndef __OPERATION_EQUATES__ #define __OPERATION_EQUATES__ + equ OPERATION_ACTIVE$ to 1 + equ OPERATION_CLASS_ID$ to 2 + equ OPERATION_OPERATION_DESCRIPTION$ to 3 + equ OPERATION_TYPE$ to 4 + equ OPERATION_REWORK$ to 5 + equ OPERATION_MET_TEST_TYPE_REQUIRED$ to 6 + equ OPERATION_MET_TEST_REQUIRED$ to 7 + equ OPERATION_PACKAGING_REQUIRED$ to 8 + equ OPERATION_CLEAN_REQUIRED$ to 9 + equ OPERATION_WAFER_COUNTER_REQUIRED$ to 10 #endif