Add errors last

This commit is contained in:
Chase Tucker
2025-08-26 09:10:15 -07:00
parent 47405863d7
commit a196bffd41
7 changed files with 152 additions and 163 deletions

View File

@ -214,19 +214,22 @@ Service GetScansRow(ScanID, ReturnJSON)
ScansRow = ''
ErrMsg = ''
If ScanID NE '' then
ScansRow = Database_Services('ReadDataRow', 'SCANS', ScanID)
If ReturnJSON EQ True$ then
ScansRow = Scan_Services('ConvertMVScanToJSON', ScanID, ScansRow)
end
end else
Error_Services('Add', 'ScanID argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID argument was missing in the ' : Service : ' service.'
end
Response = ScansRow
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -239,14 +242,17 @@ Service SetScansRow(ScanID, ScansRow)
StartTick = GetTickCount()
MetricName = 'SetScansRow'
ErrMsg = ''
If (ScanID NE '') AND (ScansRow NE '') then
Database_Services('WriteDataRow', 'SCANS', ScanID, ScansRow)
end else
Error_Services('Add', 'ScanID or ScansRow argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID or ScansRow argument was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -262,6 +268,7 @@ Service ProcessScanData(ScanID, ScanJSON)
StartTick = GetTickCount()
MetricName = 'ProcessScanData'
ErrMsg = ''
If ( (ScanID NE '') AND (ScanJSON NE '') ) then
hScanJSON = ''
ParseResponse = SRP_JSON(hScanJSON, 'PARSE', ScanJSON)
@ -300,7 +307,7 @@ Service ProcessScanData(ScanID, ScanJSON)
If RowExists('LOT', LotId) then
TWLots = ScansRow<SCANS.TW_LOT_ID$>
Locate LotId in TWLots using @VM setting twPos then
Error_Services('Add', LotID : ' has already been added as a test wafer lot being used.')
ErrMsg = LotID : ' has already been added as a test wafer lot being used.'
end else
ScansRow<SCANS.TW_LOT_CHANGED$> = True$
LotCurrentOperation = Lot_Services('GetLotCurrOperationName', LotId)
@ -316,14 +323,14 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.TW_LOT_QTY$, twPos> = 1
end
end else
Error_Services('Add', LotID : ' does not have enough wafers to be used.')
ErrMsg = LotID : ' does not have enough wafers to be used.'
end
end else
Error_Services('Add', LotID : ' is not at a valid operation for use.')
ErrMsg = LotID : ' is not at a valid operation for use.'
end
end
end else
Error_Services('Add', LotID : ' is not a valid test wafer lot ID.')
ErrMsg = LotID : ' is not a valid test wafer lot ID.'
end
Case Otherwise$
@ -350,9 +357,9 @@ Service ProcessScanData(ScanID, ScanJSON)
Case EmployeeAuthorized NE True$
// Regardless of the not authorized reason, the scan data will be considered invalid.
EmployeeNotAuthorizedReason = {EMPLOYEE_NOT_AUTHORIZED_REASON}
Error_Services('Add', EmployeeNotAuthorizedReason)
ErrMsg = EmployeeNotAuthorizedReason
Case EmployeeActive NE True$
Error_Services('Add', 'Inactive employee.')
ErrMsg = 'Inactive employee.'
Case Otherwise$
ScansRow<SCANS.EMPLOYEE_ID$> = {EMPLOYEE_ID}
@ -395,7 +402,7 @@ Service ProcessScanData(ScanID, ScanJSON)
If (EmployeeAuthorized NE True$) AND ({EMPLOYEE_ID} NE '') then
// Regardless of the not authorized reason, the scan data will be considered invalid.
EmployeeNotAuthorizedReason = {EMPLOYEE_NOT_AUTHORIZED_REASON}
Error_Services('Add', EmployeeNotAuthorizedReason)
ErrMsg = EmployeeNotAuthorizedReason
end else
* If LoadLock EQ '' then LoadLock = 'NA' ; // NA means Not Applicable.
ReactorID = ToolID[2, 999]
@ -415,10 +422,10 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.TOOL_ID$> = ToolID
ScansRow<SCANS.LOAD_LOCK$> = LoadLock
end else
Error_Services('Add', 'Invalid load lock value "':LoadLock:'".')
ErrMsg = 'Invalid load lock value "':LoadLock:'".'
end
end else
Error_Services('Add', 'A load lock side "L" or "R" is required for reactor ':ReactorID:'.')
ErrMsg = 'A load lock side "L" or "R" is required for reactor ':ReactorID:'.'
end
Case (LoadLockReq EQ False$)
If ScansRow<SCANS.LOCATION_ID$> NE '' then
@ -433,17 +440,17 @@ Service ProcessScanData(ScanID, ScanJSON)
end
Case ToolType _EQC 'Transfer'
Error_Services('Add', 'Tool type ':ToolType:' is not currently supported by the barcode application.')
ErrMsg = 'Tool type ':ToolType:' is not currently supported by the barcode application.'
// Code below may be implemented down the road.
// This is a transfer tool. Just update the scan resource.
* ScansRow<SCANS.LOCATION_ID$> = '' ; // Make sure the Location ID is cleared.
* ScansRow<SCANS.CASSETTE_IDS$> = ScansRow<SCANS.CASSETTE_IDS$, 1> ; // Make sure only the first Cassette ID is tracked.
* ScansRow<SCANS.TRANSFER_TOOL_ID$> = ToolID
Case Otherwise$
Error_Services('Add', 'Tool type ':ToolType:' is not currently supported by the barcode application.')
ErrMsg = 'Tool type ':ToolType:' is not currently supported by the barcode application.'
End Case
end else
Error_Services('Add', ToolID : ' is not a valid tool ID.')
ErrMsg = ToolID : ' is not a valid tool ID.'
end
Case ScanData[1, 2] EQ '1L'
@ -461,7 +468,7 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.TRANSFER_TOOL_ID$> = '' ; // Make sure the Transfer Tool ID is cleared.
ScansRow<SCANS.LOCATION_ID$> = LocationID
end else
Error_Services('Add', LocationID : ' is not a valid location ID.')
ErrMsg = LocationID : ' is not a valid location ID.'
end
Case ScanData[1, 2] EQ '1B'
@ -476,7 +483,7 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.BOAT_ID$> = BoatID
ScansRow<SCANS.PL_NUMBER$> = PLNo
end else
Error_Services('Add', ScanData : ' is not a valid boat ID.')
ErrMsg = ScanData : ' is not a valid boat ID.'
end
Case ScanData[1, 3] EQ 'PWD'
// Password/Signature scan. If the scan is not ready to be accepted or the password does
@ -491,14 +498,14 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.AUTHENTICATED$> = 1
end else
ScansRow<SCANS.AUTHENTICATED$> = 0
Error_Services('Add', 'Invalid password for user ':EmployeeID:'.')
ErrMsg = 'Invalid password for user ':EmployeeID:'.'
end
ScansRow<SCANS.EMPLOYEE_CHANGED$> = True$
end else
Error_Services('Add', 'An employee ID must be scanned before scanning a password.')
ErrMsg = 'An employee ID must be scanned before scanning a password.'
end
end else
Error_Services('Add', 'Invalid password scanned.')
ErrMsg = 'Invalid password scanned.'
end
Case ScanData[1, 8] EQ 'OVERRIDE'
@ -565,7 +572,7 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end else
Error_Services('Add', 'Selected Employee is not authorized to perform an override')
ErrMsg = 'Selected Employee is not authorized to perform an override'
end
end
Case ScanData[1, 2] EQ '5T'
@ -651,11 +658,11 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.CASSETTE_IDS$> = CassetteID
end
end else
Error_Services('Add', CassetteID : ' is not a valid Cassette ID.')
ErrMsg = CassetteID : ' is not a valid Cassette ID.'
end
End Case
If Error_Services('NoError') then
If ErrMsg EQ '' then
// Process Scan row data here to determine the type of scan (i.e. Location, Pre-Epi + Load, or Unload).
ScanType = ScansRow<SCANS.SCAN_TYPE$>
CassetteIDs = ScansRow<SCANS.CASSETTE_IDS$>
@ -682,7 +689,7 @@ Service ProcessScanData(ScanID, ScanJSON)
LastCassScanned = CassetteIDs<0, NumCass>
CurrStage = Xlate('RDS', LastCassScanned, 'CURR_STAGE', 'X')
If CurrStage EQ 'UNLOAD' then
Error_Services('Add', '(':LastCassScanned:') Cassette is currently loaded on a tool and is ineligble for a location scan.')
ErrMsg = '(':LastCassScanned:') Cassette is currently loaded on a tool and is ineligble for a location scan.'
end
Case ScanType EQ 'TOOL'
@ -756,7 +763,9 @@ Service ProcessScanData(ScanID, ScanJSON)
CassNo = Xlate('RDS', CassetteID, 'CASS_NO', 'X')
WOMatKey = WONo:'*':CassNo
WOMatLocs = Xlate('WO_MAT', WOMatKey, WO_MAT_INV_LOCATION$, 'X')
If Index(WOMatLocs,'PTI',1) else Error_Services('Add', 'Cassette ':CassetteID:' failed due to missing PTI.')
If Index(WOMatLocs,'PTI',1) else
ErrMsg = 'Cassette ':CassetteID:' failed due to missing PTI.'
end
end else
// EpiPro RDS
OutCassNos = Xlate('RDS', CassetteID, 'OUT_CASS_NO', 'X')
@ -766,11 +775,13 @@ Service ProcessScanData(ScanID, ScanJSON)
CassNo = OutCassNo
WOMatKey = WONo:'*':CassNo
WOMatLocs = Xlate('WO_MAT', WOMatKey, WO_MAT_INV_LOCATION$, 'X')
If Index(WOMatLocs,'PTI',1) else Error_Services('Add', 'Cassette ':CassetteID:' failed due to missing PTI.')
If Index(WOMatLocs,'PTI',1) else
ErrMsg = 'Cassette ':CassetteID:' failed due to missing PTI.'
end
Next OutCassNo
end
If Error_Services('NoError') then
If ErrMsg EQ '' then
If CurrStatus NE 'HOLD' then
If (EmployeeID NE '') then
* SupplInstAckReq = Xlate('RDS', RDSNo, 'SUPPL_ACK_REQ' , 'X')
@ -1033,17 +1044,17 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end else
ScansRow<SCANS.SUPPLIER_LOT$> = ''
Error_Services('Add', '(':CassetteID:') Supplier lot mismatch.')
ErrMsg = '(':CassetteID:') Supplier lot mismatch.'
end
end else
Scan_Services('AddNotAcceptableReason', 'Supplier lot scan required in order to complete a tool scan.')
end
end else
Error_Services('Add', '(':CassetteID:') The first run must be completed using the OpenInsight user interface.')
ErrMsg = '(':CassetteID:') The first run must be completed using the OpenInsight user interface.'
end
end else
Error_Services('Add', '(':CassetteID:') A pre-clean is required for this RDS. The OpenInsight user interface must be used to proceed.')
ErrMsg = '(':CassetteID:') A pre-clean is required for this RDS. The OpenInsight user interface must be used to proceed.'
end
Case CurrStage _EQC 'LOAD'
Action = 'LOAD'
@ -1103,7 +1114,7 @@ Service ProcessScanData(ScanID, ScanJSON)
Scan_Services('AddNotAcceptableReason', ErrorMessage)
end
end else
Error_Services('Add', 'Scanned tool ':ScanTool:' does not match the scheduled tool ':SchedTool:'. (':RDSNo:')')
ErrMsg = 'Scanned tool ':ScanTool:' does not match the scheduled tool ':SchedTool:'. (':RDSNo:')'
end
end else
Scan_Services('AddNotAcceptableReason', 'Test wafers are required to be logged with this run.')
@ -1111,7 +1122,7 @@ Service ProcessScanData(ScanID, ScanJSON)
end else
ScansRow<SCANS.SUPPLIER_LOT$> = ''
Error_Services('Add', '(':CassetteID:') Supplier lot mismatch.')
ErrMsg = '(':CassetteID:') Supplier lot mismatch.'
end
end else
Scan_Services('AddNotAcceptableReason', 'Supplier lot scan required in order to complete a tool scan.')
@ -1195,12 +1206,10 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end
end else
ErrorMessage = 'WO_MAT record was null.'
Error_Services('Add', ErrorMessage)
ErrMsg = 'WO_MAT record was null.'
end
end else
ErrorMessage = 'Failure to read cassette record. ' : Error_Services('GetMessage')
Error_Services('Add', ErrorMessage)
ErrMsg = 'Failure to read cassette record. ' : Error_Services('GetMessage')
end
end
end
@ -1218,24 +1227,23 @@ Service ProcessScanData(ScanID, ScanJSON)
end
Case CurrStage _EQC 'COMP'
Action = 'COMP'
Error_Services('Add', '(':CassetteID:") Cassette has already been FQA'd.")
ErrMsg = '(':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.')
ErrMsg = '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.'
End Case
end else
Scan_Services('AddNotAcceptableReason', 'EmployeeID required to complete a tool scan.')
end
end else
Error_Services('Add', '(':CassetteID:') Process Error: cassette is on Hold and may not be signed off.')
ErrMsg = '(':CassetteID:') Process Error: cassette is on Hold and may not be signed off.'
end
end
end else
Error_Services('Add', '(':CassetteID:') WMI/WMO cassette are not currently supported for tool scans. The OpenInsight user interface must be used in order to proceed.')
ErrMsg = '(':CassetteID:') WMI/WMO cassette are not currently supported for tool scans. The OpenInsight user interface must be used in order to proceed.'
end
end else
// Currently we are only supporting loading one cassette onto a tool at a time.
Error_Services('Add', '(':CassetteID:') Only one cassette can be loaded onto a tool at a time.')
ErrMsg = '(':CassetteID:') Only one cassette can be loaded onto a tool at a time.'
end
end
@ -1296,7 +1304,7 @@ Service ProcessScanData(ScanID, ScanJSON)
End Case
end
// If the the scan data is valid, update the scan log before returning to the calling process.
If Error_Services('NoError') then
If ErrMsg EQ '' then
If Scan_Services('NoNotAcceptableReason') then
ScansRow<SCANS.ACCEPTABLE$> = True$
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = ''
@ -1306,7 +1314,7 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end else
ScansRow<SCANS.ACCEPTABLE$> = False$
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = Error_Services('GetMessage')
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = ErrMsg
end
If ScanData NE '' then
ScansRow<SCANS.SCANNED_DATES$, -1> = Date()
@ -1314,25 +1322,21 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.SCANNED_DATA$, -1> = ScanData
end
ScansRow<SCANS.ACTION$> = Action
// Save error message if present as Database_Services will clear any errors.
ErrorMessage = ''
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
Database_Services('WriteDataRow', 'SCANS', ScanID, ScansRow, True$, False$, True$)
// Restore pre-existing error message if present.
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
Database_Services('WriteDataRow', 'SCANS', ScanID, ScansRow, True$, False$, True$)
end
end else
Error_Services('Add', 'Unable to parse the JSON scan data in the ':Service:' service.')
ErrMsg = 'Unable to parse the JSON scan data in the ':Service:' service.'
end
SRP_JSON(hScanJSON, 'Release')
end else
Error_Services('Add', 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -1344,6 +1348,7 @@ Service AcceptScan(ScanID, ScanJSON)
StartTick = GetTickCount()
MetricName = 'AcceptScan'
ErrMsg = ''
If ( (ScanID NE '') and (ScanJSON NE '') ) then
hBody = ''
ParseResponse = SRP_JSON(hBody, 'PARSE', ScanJSON)
@ -1376,7 +1381,7 @@ Service AcceptScan(ScanID, ScanJSON)
If Error_Services('NoError') AND SendStatus EQ 'Success' then
Result = 'Tencor Data Sent Successfully'
end else
Error_Services('Add', SendStatus)
ErrMsg = SendStatus
end
Case ScanType _EQC 'LOCATION'
@ -1481,8 +1486,7 @@ Service AcceptScan(ScanID, ScanJSON)
end
IF Get_Status(errCode) THEN
ErrorMsg = 'Error calling obj_WO_Mat_Log("Create"). Error code: ':errCode
Error_Services('Add', ErrorMsg)
ErrMsg = 'Error calling obj_WO_Mat_Log("Create"). Error code: ':errCode
END else
NumCass = DCount(CassetteIDs, @VM)
If NumCass EQ 1 then
@ -1545,8 +1549,7 @@ Service AcceptScan(ScanID, ScanJSON)
If Error_Services('NoError') then
Continue = True$
end else
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
Continue = False$
end
If Continue then
@ -1590,8 +1593,7 @@ Service AcceptScan(ScanID, ScanJSON)
If Error_Services('NoError') then
Continue = True$
end else
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
Continue = False$
end
If Continue then
@ -1627,8 +1629,7 @@ Service AcceptScan(ScanID, ScanJSON)
PSNo = Xlate('RDS', RDSNo, RDS_PROD_SPEC_ID$, True$, 'X')
NewTestRunId = Test_Run_Services('CreateTestRunRecord', TestRunType, 'R', Reactor, PSNo, RDSNo,Username , TestWaferLots, TestWaferLotQtys)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
Continue = False$
end
end
@ -1645,10 +1646,10 @@ Service AcceptScan(ScanID, ScanJSON)
end
Case CurrStage _EQC 'COMP'
Action = 'COMP'
Error_Services('Set', '(':CassetteID:") Cassette has already been FQA'd.")
ErrMsg = '(':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.')
ErrMsg = '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.'
End Case
Case CassetteID EQ '' AND TestWaferLots NE ''
//Tool scan with ONLY test wafers being logged.
@ -1661,12 +1662,10 @@ Service AcceptScan(ScanID, ScanJSON)
If NewTestRunId NE '' then
Result = 'Test run logged successfully'
end else
ErrorMessage = 'Error while logging creating test run.'
Error_Services('Set', ErrorMessage)
ErrMsg = 'Error while logging creating test run.'
end
end else
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
end
Case Otherwise$
//null
@ -1674,34 +1673,30 @@ Service AcceptScan(ScanID, ScanJSON)
End Case
end
If Error_Services('NoError') then
If ErrMsg EQ '' then
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = 'This scan has already been accepted.'
end else
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = Error_Services('GetMessage')
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = ErrMsg
end
ScansRow<SCANS.ACCEPTABLE$> = False$
If Assigned(Result) then ScansRow<SCANS.RESULT$> = Result
// Save error message if present as Database_Services will clear any errors.
ErrorMessage = ''
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
Scan_Services('SetScansRow', ScanID, ScansRow)
// Restore pre-existing error message if present.
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
Scan_Services('SetScansRow', ScanID, ScansRow)
end else
Error_Services('Add', 'The accepted.status field is missing from the JSON object in the ':Service:' service.')
ErrMsg = 'The accepted.status field is missing from the JSON object in the ':Service:' service.'
end
SRP_JSON(hBody, 'Release')
end else
Error_Services('Add', 'Unable to parse the JSON scan resource in the ':Service:' service.')
ErrMsg = 'Unable to parse the JSON scan resource in the ':Service:' service.'
end
end else
Error_Services('Add', 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
//----------------------------------------------------------------------------------------------------------------------
@ -1719,6 +1714,7 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
mvScanChanged = False$
ErrMsg = ''
If ScanID NE '' then
If mvScan EQ '' then mvScan = Database_Services('ReadDataRow', 'SCANS', ScanID)
@ -2172,17 +2168,19 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
Database_Services('WriteDataRow', 'SCANS', {SCAN_ID}, mvScan, True$, False$, False$)
end
end else
Error_Services('Add', 'Unable to create JSON representation in the ' : Service : ' service.')
ErrMsg = 'Unable to create JSON representation in the ' : Service : ' service.'
end
end
end else
Error_Services('Add', 'ScanID argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID argument was missing in the ' : Service : ' service.'
end
Response = jsonScan
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
//----------------------------------------------------------------------------------------------------------------------
@ -2421,3 +2419,5 @@ return