Re-adding from old branch

This commit is contained in:
Infineon\Ouellette
2024-11-19 15:51:39 -07:00
committed by Ouellette Jonathan (CSC FI SPS MESLEO)
parent ef1744c8b1
commit 3a2ff00722
14 changed files with 2821 additions and 1783 deletions

View File

@ -38,14 +38,18 @@ $INSERT REACT_LL_EQUATES
$insert RLIST_EQUATES
$Insert ROTR_OVERRIDE_COMMENT_OPTIONS_EQUATES
$Insert SUPPLEMENTS_EQUATES
$Insert Lot_Equates
$Insert Test_Run_Type_Equates
Common /ScanServices/ NotAcceptableReasons@, Unused2@, Unused3@, Unused4@, Unused5@, Unused6@, Unused7@, Unused8@
Declare Function Scan_Services, Memory_Services, Database_Services, SRP_JSON, RTI_CreateGUID, Rds_Services, Datetime
Declare Function QA_Services, Error_Services, Security_Services, SRP_Array, obj_WO_Mat, Memberof, Override_Log_Services
Declare Function Keyboard_Sim_Services, Environment_Services, Logging_Services, Reactor_Services, Supplement_Services
Declare function Test_Run_Services, Lot_Services
Declare Subroutine Scan_Services, Memory_Services, Database_Services, SRP_JSON, QA_Services, Error_Services
Declare Subroutine obj_WO_Mat_Log, Tool_Parms_Services, RDS_Services, Logging_Services, Supplement_Services
Declare Subroutine Test_Run_Services
Equ CRLF$ to \0D0A\
@ -268,15 +272,32 @@ Service ProcessScanData(ScanID, ScanJSON)
Case ( (ScanData[1, 2] EQ '1T') or (ScanData[1, 2] EQ '2T') )
// Supplier lot scan.
Convert '_' to '-' in ScanData
SupplierLotID = ScanData[3, 999]
If ( RowExists('RDS', SupplierLotID) EQ True$ AND ScanData[1, 2] EQ '1T') then
ScansRow<SCANS.CASSETTE_IDS$> = SupplierLotID
//If ( RowExists('RDS', SupplierLotID) EQ True$ ) then
// Error_Services('Add', 'Not a valid supplier lot')
end else
ScansRow<SCANS.SUPPLIER_LOT$> = SupplierLotID
end
LotID = ScanData[3, 999]
Begin Case
Case ( RowExists('RDS', LotId) EQ True$ AND ScanData[1, 2] EQ '1T')
ScansRow<SCANS.CASSETTE_IDS$> = LotID
Case ScanData[1, 4] EQ '1TTW'
ValidTWLot = False$
If RowExists('LOT', LotId) then
LotCurrentOperation = Lot_Services('GetLotCurrOperationName', LotId)
If LotCurrentOperation NE 'TW_CREATE' AND LotCurrentOperation NE 'TW_CLOSE' then
LotCurrWfrQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$)
If LotCurrWfrQty GT 0 then
ScansRow<SCANS.TW_LOT_ID$, -1> = LotID
end else
Error_Services('Add', LotID : ' does not have enough wafers to be used.')
end
end else
Error_Services('Add', LotID : ' is not at a valid operation for use.')
end
end else
Error_Services('Add', LotID : ' is not a valid test wafer lot ID.')
end
Case Otherwise$
ScansRow<SCANS.SUPPLIER_LOT$> = LotID
End Case
Case ScanData[1, 5] EQ 'RESET'
ScansRow<SCANS.SCAN_TYPE$> = 'RESET'
@ -500,6 +521,16 @@ Service ProcessScanData(ScanID, ScanJSON)
//Tencor Scan - Note this is only for loading cassette ID into Tencor tool
ScansRow<SCANS.SCAN_TYPE$> = 'TENCOR_LOAD'
ScansRow<SCANS.TOOL_ID$>= ScanData[3,99]
Case ScanData[1, 16] EQ 'TWQUANTITYUPDATE'
TWLot = Field(ScanData, '|', 2)
TWLotQuantity = Field(ScanData, '|', 3)
ThisScanTWLots = ScansRow<SCANS.TW_LOT_ID$>
Locate TWLot in ThisScanTWLots using @VM setting twPOS then
ScansRow<SCANS.TW_LOT_QTY$> = TWLotQuantity
end
Case ScanData[1, 17] EQ 'TESTRUNTYPEUPDATE'
TestRunTypeId = Field(ScanData, '|', 2)
ScansRow<SCANS.TEST_RUN_TYPE_ID$> = TestRunTypeId
Case ScanData EQ ''
// Most likely receiving RDS data, so nothing to do here.
Null
@ -1009,7 +1040,24 @@ Service ProcessScanData(ScanID, ScanJSON)
Error_Services('Add', '(':CassetteID:') Only one cassette can be loaded onto a tool at a time.')
end
end else
Scan_Services('AddNotAcceptableReason', 'A cassette must be scanned in order to complete a tool scan.')
If ScansRow<SCANS.TW_LOT_ID$> NE '' then
//Test Wafer Lot Loading
TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$>
Abort = False$
for each TWLot in TestWaferLotData using @VM setting twPOS
If ScansRow<SCANS.TW_LOT_QTY$, twPOS> EQ '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> LE 0 then
Scan_Services('AddNotAcceptableReason', 'Each test wafer lot logged must have a quantity associated with it.')
end else
ThisUser = ScansRow<SCANS.EMPLOYEE_ID$>
If Not(RowExists('LSL_USERS', ThisUser)) then
Scan_Services('AddNotAcceptableReason', 'A User ID Scan is required to log test wafer usage.')
end
end
Until False$
Next TWLot
end else
Scan_Services('AddNotAcceptableReason', 'A cassette must be scanned in order to complete a tool scan.')
end
end
Case Otherwise$
@ -1218,68 +1266,87 @@ Service AcceptScan(ScanID, ScanJSON)
Case ScanType _EQC 'TOOL'
// Check if cassette field is populated. If so, then check the cassette's current status to
// determine what the next action will be (i.e. Pre-Epi+Load, Unload, etc.)
CassetteID = CassetteIDs<0, 1>
RDSNo = CassetteID
RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo)
ToolID = ScansRow<SCANS.TOOL_ID$>
Reactor = ToolID[-1, 'BR']
Username = ScansRow<SCANS.EMPLOYEE_ID$>
LLSide = ScansRow<SCANS.LOAD_LOCK$>
WaferQty = RDSRec<RDS_CASS_WAFER_QTY$>
// Check signature fields to determine where the lot is in the RDS process. The service should
// use the signatures in the RDS table, not the WO_MAT table, so that we can support both
// EpiPro and non-EpiPro lots.
CurrStage = Xlate('RDS', RDSNo, 'CURR_STAGE', 'X')
CurrDTM = Datetime()
LogData = ''
LogData<1> = OConv(CurrDTM, 'DT')
LogData<2> = RDSNo
LogData<3> = Username
LogData<4> = CurrStage
LogData<5> = ScanID
Begin Case
Case CurrStage _EQC 'VER'
Action = 'LOAD'
// Check if both the PRE and LOAD stages are ready to sign
PreStageSigned = False$
LoadStageSigned = False$
PreStageSigned = QA_Services('SignPreEpiStage', RDSNo, Username, WaferQty, Reactor, 1)
If PreStageSigned EQ True$ then
LoadStageSigned = QA_Services('SignLoadStage', RDSNo, USername, WaferQty, LLSide, 1)
end
If ( (PreStageSigned EQ True$) and (LoadStageSigned EQ True$) ) then
Result = '(':CassetteID:') Load stage signed.'
end
LogData<6> = Action
LogData<7> = Result
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Case CurrStage _EQC 'LOAD'
Action = 'LOAD'
// Check if LOAD stage is ready to sign
LoadStageSigned = QA_Services('SignLoadStage', RDSNo, Username, WaferQty, LLSide, 1)
If LoadStageSigned EQ True$ then
Result = '(':CassetteID:') Load stage signed.'
end
LogData<6> = Action
LogData<7> = Result
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Case CurrStage _EQC 'UNLOAD'
Action = 'UNLOAD'
// Check if UNLOAD stage is ready to sign
UnloadStageSigned = QA_Services('SignUnloadStage', RDSNo, Username, 1)
If UnloadStageSigned EQ True$ then
Result = '(':CassetteID:') Unload stage signed.'
end
LogData<6> = Action
LogData<7> = Result
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Case CurrStage _EQC 'COMP'
Action = 'COMP'
Error_Services('Set', '(':CassetteID:") Cassette has already been FQA'd.")
Case Otherwise$
Action = CurrStage
Error_Services('Set', '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.')
End Case
CassetteID = CassetteIDs<0, 1>
TestWaferLots = ScansRow<SCANS.TW_LOT_ID$>
Begin Case
Case CassetteID NE ''
//Tool Cassette scan, check for test wafers after everything is signed.
RDSNo = CassetteID
RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo)
ToolID = ScansRow<SCANS.TOOL_ID$>
Reactor = ToolID[-1, 'BR']
Username = ScansRow<SCANS.EMPLOYEE_ID$>
LLSide = ScansRow<SCANS.LOAD_LOCK$>
WaferQty = RDSRec<RDS_CASS_WAFER_QTY$>
// Check signature fields to determine where the lot is in the RDS process. The service should
// use the signatures in the RDS table, not the WO_MAT table, so that we can support both
// EpiPro and non-EpiPro lots.
CurrStage = Xlate('RDS', RDSNo, 'CURR_STAGE', 'X')
CurrDTM = Datetime()
LogData = ''
LogData<1> = OConv(CurrDTM, 'DT')
LogData<2> = RDSNo
LogData<3> = Username
LogData<4> = CurrStage
LogData<5> = ScanID
Begin Case
Case CurrStage _EQC 'VER'
Action = 'LOAD'
// Check if both the PRE and LOAD stages are ready to sign
PreStageSigned = False$
LoadStageSigned = False$
PreStageSigned = QA_Services('SignPreEpiStage', RDSNo, Username, WaferQty, Reactor, 1)
If PreStageSigned EQ True$ then
LoadStageSigned = QA_Services('SignLoadStage', RDSNo, USername, WaferQty, LLSide, 1)
end
If ( (PreStageSigned EQ True$) and (LoadStageSigned EQ True$) ) then
Result = '(':CassetteID:') Load stage signed.'
end
LogData<6> = Action
LogData<7> = Result
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Case CurrStage _EQC 'LOAD'
Action = 'LOAD'
// Check if LOAD stage is ready to sign
LoadStageSigned = QA_Services('SignLoadStage', RDSNo, Username, WaferQty, LLSide, 1)
If LoadStageSigned EQ True$ then
Result = '(':CassetteID:') Load stage signed.'
end
LogData<6> = Action
LogData<7> = Result
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Case CurrStage _EQC 'UNLOAD'
Action = 'UNLOAD'
// Check if UNLOAD stage is ready to sign
UnloadStageSigned = QA_Services('SignUnloadStage', RDSNo, Username, 1)
If UnloadStageSigned EQ True$ then
Result = '(':CassetteID:') Unload stage signed.'
end
LogData<6> = Action
LogData<7> = Result
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Case CurrStage _EQC 'COMP'
Action = 'COMP'
Error_Services('Set', '(':CassetteID:") Cassette has already been FQA'd.")
Case Otherwise$
Action = CurrStage
Error_Services('Set', '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.')
End Case
Case CassetteID EQ '' AND TestWaferLots NE ''
debug
//Tool scan with ONLY test wafers being logged.
ToolID = ScansRow<SCANS.TOOL_ID$>
Reactor = ToolID[-1, 'BR']
Username = ScansRow<SCANS.EMPLOYEE_ID$>
TestWaferLotQtys = ScansRow<SCANS.TW_LOT_QTY$>
NewTestRunId = Test_Run_Services('CreateTestRunRecord', 3, 'REACTOR', Reactor, '', '',Username , TestWaferLots, TestWaferLotQtys)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
end
Case Otherwise$
//null
End Case
End Case
end
@ -1336,6 +1403,8 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
SRP_JSON(objScan, 'SetValue', 'ID', @ID, 'String')
SRP_JSON(objScan, 'SetValue', 'type', {SCAN_TYPE}, 'String')
SRP_JSON(objScan, 'SetValue', 'action', {ACTION}, 'String')
SRP_JSON(objScan, 'SetValue', 'testRunTypeId', {TEST_RUN_TYPE_ID}, 'Integer')
SRP_JSON(objScan, 'SetValue', 'testRunTypeName', XLate('TEST_RUN_TYPE', {TEST_RUN_TYPE_ID}, TEST_RUN_TYPE_RUN_TYPE$, 'X'), 'String')
SRP_JSON(objScan, 'SetValue', 'acceptable', {ACCEPTABLE}, 'Boolean')
SRP_JSON(objScan, 'SetValue', 'notAcceptableReason', {NOT_ACCEPTABLE_REASON}, 'String')
SRP_JSON(objScan, 'SetValue', 'result', {RESULT}, 'String')
@ -1367,6 +1436,43 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
SRP_JSON(objJSONScan, 'Set', 'supplierLot', objSupplierLot)
SRP_JSON(objSupplierLot, 'Release')
end
// TestWafer Lot Object.
If SRP_JSON(hTWLotArray, 'New', 'Array') then
Abort = False$
TestWaferLots = {TW_LOT_ID}
for each TestWaferLotId in TestWaferLots using @VM setting twPos
thisTWLotJson = ''
If SRP_JSON(thisTWLotJson, 'New', 'Object') then
SRP_JSON(thisTWLotJson, 'SetValue', 'testWaferLotId', {TW_LOT_ID}<1, twPos>)
SRP_JSON(thisTWLotJson, 'SetValue', 'quantity', {TW_LOT_QTY}<1, twPos>, 'Integer')
SRP_JSON(hTWLotArray, 'Add', thisTWLotJson)
SRP_JSON(thisTWLotJson, 'Release')
end
Next TestWaferLotId
SRP_JSON(objJSONScan, 'Set', 'testWaferLots', hTWLotArray)
SRP_JSON(hTWLotArray, 'Release')
end
SRP_JSON(objScan, 'SetValue', 'testRunTypeId', {TEST_RUN_TYPE_ID}, 'Integer')
// TestRun Type Option Array
TestRunTypeList = Test_Run_Services('GetAllTestRunTypes')
If SRP_JSON(hTestRunTypeArray, 'New', 'Array') then
For each TestRunTypeId in TestRunTypeList<1> using @VM setting fPos
hTestRunTypeObj = ''
If SRP_JSON(hTestRunTypeObj, 'New', 'Object') then
SRP_JSON(hTestRunTypeObj, 'SetValue', 'testRunTypeId', TestRunTypeId, 'Number')
SRP_JSON(hTestRunTypeObj, 'SetValue', 'testRunTypeName', TestRunTypeList<2, fPos>, 'String')
SRP_JSON(hTestRunTypeArray, 'Add', hTestRunTypeObj)
SRP_JSON(hTestRunTypeObj, 'Release')
end else
Abort = True$
end
Until Abort
Next TestRunTypeId
If Abort EQ False$ then
SRP_JSON(objJSONScan, 'Set', 'testRunTypeOptions', hTestRunTypeArray)
end
SRP_JSON(hTestRunTypeArray, 'Release')
end
// Created object.
objCreated = ''
If SRP_JSON(objCreated, 'New', 'Object') then
@ -2011,14 +2117,3 @@ ClearCursors:
Next counter
return