cache TW Lot JSON unless changed

This commit is contained in:
Chase Tucker
2025-07-08 17:33:20 -07:00
parent d4ce96337b
commit 269e5f9bd4
2 changed files with 82 additions and 51 deletions

View File

@ -301,6 +301,7 @@ Service ProcessScanData(ScanID, ScanJSON)
Locate LotId in TWLots using @VM setting twPos then Locate LotId in TWLots using @VM setting twPos then
Error_Services('Add', LotID : ' has already been added as a test wafer lot being used.') Error_Services('Add', LotID : ' has already been added as a test wafer lot being used.')
end else end else
ScansRow<SCANS.TW_LOT_CHANGED$> = True$
LotCurrentOperation = Lot_Services('GetLotCurrOperationName', LotId) LotCurrentOperation = Lot_Services('GetLotCurrOperationName', LotId)
If LotCurrentOperation NE 'TW_CREATE' AND LotCurrentOperation NE 'TW_CLOSE' then If LotCurrentOperation NE 'TW_CREATE' AND LotCurrentOperation NE 'TW_CLOSE' then
LotCurrWfrQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$) LotCurrWfrQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$)
@ -573,6 +574,7 @@ Service ProcessScanData(ScanID, ScanJSON)
Locate TWLot in ThisScanTWLots using @VM setting twPOS then Locate TWLot in ThisScanTWLots using @VM setting twPOS then
ScansRow<SCANS.TW_LOT_QTY$, twPos> = TWLotQuantity ScansRow<SCANS.TW_LOT_QTY$, twPos> = TWLotQuantity
ScansRow<SCANS.TW_LOT_CHANGED$> = True$
end end
Case ScanData[1, 17] EQ 'TESTRUNTYPEUPDATE' Case ScanData[1, 17] EQ 'TESTRUNTYPEUPDATE'
@ -684,9 +686,10 @@ Service ProcessScanData(ScanID, ScanJSON)
// "RDS" process. // "RDS" process.
If (CassetteIDs NE '') then If (CassetteIDs NE '') then
TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$> TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$>
TestWaferLotChanged = ScansRow<SCANS.TW_LOT_CHANGED$>
Abort = False$ Abort = False$
TestWaferLotIsValid = False$ TestWaferLotIsValid = False$
If TestWaferLotData NE '' then If TestWaferLotData NE '' and TestWaferLotChanged NE False$ then
ThisTestRunType = ScansRow<SCANS.TEST_RUN_TYPE_ID$> ThisTestRunType = ScansRow<SCANS.TEST_RUN_TYPE_ID$>
If ThisTestRunType NE '' then If ThisTestRunType NE '' then
for each TWLot in TestWaferLotData using @VM setting twPOS for each TWLot in TestWaferLotData using @VM setting twPOS
@ -1218,47 +1221,50 @@ Service ProcessScanData(ScanID, ScanJSON)
end else end else
If ScansRow<SCANS.TW_LOT_ID$> NE '' then If ScansRow<SCANS.TW_LOT_ID$> NE '' then
TestWaferLotChanged = ScansRow<SCANS.TW_LOT_CHANGED$>
ThisTestRunType = ScansRow<SCANS.TEST_RUN_TYPE_ID$> ThisTestRunType = ScansRow<SCANS.TEST_RUN_TYPE_ID$>
ThisUser = ScansRow<SCANS.EMPLOYEE_ID$> ThisUser = ScansRow<SCANS.EMPLOYEE_ID$>
If ThisTestRunType NE '' then If TestWaferLotChanged NE False$ then
If RowExists('LSL_USERS', ThisUser) then If ThisTestRunType NE '' then
TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$> If RowExists('LSL_USERS', ThisUser) then
Abort = False$ TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$>
for each TWLot in TestWaferLotData using @VM setting twPOS Abort = False$
If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then for each TWLot in TestWaferLotData using @VM setting twPOS
TWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_WAFER_QTY$, True$, 0, False$) If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then
ThisCurrUsageQty = ScansRow<SCANS.TW_LOT_QTY$, twPOS> TWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_WAFER_QTY$, True$, 0, False$)
If TWLotCurrQty GT 0 then ThisCurrUsageQty = ScansRow<SCANS.TW_LOT_QTY$, twPOS>
If TWLotCurrQty GE ThisCurrUsageQty then If TWLotCurrQty GT 0 then
TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot) If TWLotCurrQty GE ThisCurrUsageQty then
If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot)
TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$) If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then
If Not(TWLotCurrOpen) then TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$)
If Not(TWLotCurrOpen) then
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.') Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.')
end
end else
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.')
end end
end else end else
Abort = True$ Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' does not have enough wafers. Please select ' : TWLotCurrQty : ' wafers or less.')
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.')
end end
end else end else
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' does not have enough wafers. Please select ' : TWLotCurrQty : ' wafers or less.') Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' has no wafers and cannot be logged for usage.')
end end
end else end else
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' has no wafers and cannot be logged for usage.') Abort = True$
end Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.')
end else end
Abort = True$ Until Abort
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.') Next TWLot
end end else
Until Abort Scan_Services('AddNotAcceptableReason', 'A User ID Scan is required to log test wafer usage.')
Next TWLot end
end else end else
Scan_Services('AddNotAcceptableReason', 'A User ID Scan is required to log test wafer usage.') Scan_Services('AddNotAcceptableReason', 'A test run type is required to log test wafer usage.')
end end
end else
Scan_Services('AddNotAcceptableReason', 'A test run type is required to log test wafer usage.')
end end
end else end else
Scan_Services('AddNotAcceptableReason', 'A cassette must be scanned in order to complete a tool scan.') Scan_Services('AddNotAcceptableReason', 'A cassette must be scanned in order to complete a tool scan.')
@ -1689,6 +1695,8 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
jsonScan = '' jsonScan = ''
mvScanChanged = False$
If ScanID NE '' then If ScanID NE '' then
If mvScan EQ '' then mvScan = Database_Services('ReadDataRow', 'SCANS', ScanID) If mvScan EQ '' then mvScan = Database_Services('ReadDataRow', 'SCANS', ScanID)
@ -1724,17 +1732,39 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
// TestWafer Lot Object. // TestWafer Lot Object.
If SRP_JSON(hTWLotArray, 'New', 'Array') then If SRP_JSON(hTWLotArray, 'New', 'Array') then
Abort = False$ Abort = False$
TestWaferLotsChanged = {TW_LOT_CHANGED}
TW_Lot_Json = {TW_LOT_JSON}
ParsingResult = ''
TestWaferLots = {TW_LOT_ID} TestWaferLots = {TW_LOT_ID}
for each TestWaferLotId in TestWaferLots using @VM setting twPos If TestWaferLots NE '' then
thisTWLotJson = '' If TestWaferLotsChanged NE True$ and TW_Lot_Json NE '' then
If SRP_JSON(thisTWLotJson, 'New', 'Object') then If TW_Lot_Json NE '' then
SRP_JSON(thisTWLotJson, 'SetValue', 'testWaferLotId', {TW_LOT_ID}<1, twPos>) ParsingResult = SRP_JSON(TWLotJSON, 'Parse', TW_Lot_JSON)
SRP_JSON(thisTWLotJson, 'SetValue', 'quantity', {TW_LOT_QTY}<1, twPos>, 'Integer') If ParsingResult EQ '' then
SRP_JSON(hTWLotArray, 'Add', thisTWLotJson) SRP_JSON(objJSONScan, 'Set', 'testWaferLots', TWLotJSON)
SRP_JSON(thisTWLotJson, 'Release') end
end end
Next TestWaferLotId end
SRP_JSON(objJSONScan, 'Set', 'testWaferLots', hTWLotArray)
If TW_Lot_Json EQ '' or TestWaferLotsChanged EQ True$ or ParsingResult NE '' then
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
TW_Lot_Json = SRP_JSON(hTWLotArray, 'Stringify', 'Fast')
mvScan<SCANS.TW_LOT_JSON$> = TW_Lot_Json
mvScan<SCANS.TW_LOT_CHANGED$> = False$
mvScanChanged = True$
SRP_JSON(objJSONScan, 'Set', 'testWaferLots', hTWLotArray)
end
end
SRP_JSON(hTWLotArray, 'Release') SRP_JSON(hTWLotArray, 'Release')
end end
SRP_JSON(objScan, 'SetValue', 'testRunTypeId', {TEST_RUN_TYPE_ID}, 'Integer') SRP_JSON(objScan, 'SetValue', 'testRunTypeId', {TEST_RUN_TYPE_ID}, 'Integer')
@ -1758,14 +1788,6 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
end end
SRP_JSON(hTestRunTypeArray, 'Release') SRP_JSON(hTestRunTypeArray, 'Release')
end end
// Created object.
objCreated = ''
If SRP_JSON(objCreated, 'New', 'Object') then
SRP_JSON(objCreated, 'SetValue', 'date', Oconv({CREATED_DATE}, 'D4/'), 'String')
SRP_JSON(objCreated, 'SetValue', 'time', Oconv({CREATED_TIME}, 'MTH'), 'String')
SRP_JSON(objJSONScan, 'Set', 'created', objCreated)
SRP_JSON(objCreated, 'Release')
end
// Employee object // Employee object
objEmployee = '' objEmployee = ''
If SRP_JSON(objEmployee, 'New', 'Object') then If SRP_JSON(objEmployee, 'New', 'Object') then
@ -2072,6 +2094,10 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
jsonScan = SRP_JSON(objJSONScan, 'Stringify', 'Fast') jsonScan = SRP_JSON(objJSONScan, 'Stringify', 'Fast')
SRP_JSON(objJSONScan, 'Release') SRP_JSON(objJSONScan, 'Release')
If mvScanChanged EQ True$ then
Database_Services('WriteDataRow', 'SCANS', {SCAN_ID}, mvScan, True$, False$, False$)
end
end else end else
Error_Services('Add', 'Unable to create JSON representation in the ' : Service : ' service.') Error_Services('Add', 'Unable to create JSON representation in the ' : Service : ' service.')
end end
@ -2322,3 +2348,5 @@ return

View File

@ -41,8 +41,11 @@ compile insert SCANS_EQUATES
equ SCANS.TEST_RUN_TYPE_ID$ to 32 equ SCANS.TEST_RUN_TYPE_ID$ to 32
equ SCANS.TEST_RUN_TYPE_NAME$ to 33 equ SCANS.TEST_RUN_TYPE_NAME$ to 33
equ SCANS.IS_AUTHORIZED_TO_OVERRIDE_ROTR$ to 34 equ SCANS.IS_AUTHORIZED_TO_OVERRIDE_ROTR$ to 34
equ SCANS.TW_LOT_CHANGED$ to 35
equ SCANS.TW_LOT_JSON$ to 36
#endif #endif