pre cutover push

This commit is contained in:
Infineon\StieberD
2024-09-04 20:33:41 -07:00
parent 6ea6969f4b
commit 7762b129af
2072 changed files with 130000 additions and 95295 deletions

View File

@ -25,19 +25,26 @@ Function Wafer_Counter_Services(@Service, @Params)
#pragma precomp SRP_PreCompiler
$insert LOGICAL
$insert SERVICE_SETUP
$insert RDS_EQUATES
$insert WO_LOG_EQUATES
$insert WM_OUT_EQUATES
$Insert LOGICAL
$Insert SERVICE_SETUP
$Insert RDS_EQUATES
$Insert WO_LOG_EQUATES
$Insert WM_OUT_EQUATES
$Insert RLIST_EQUATES
$Insert WAFER_COUNTER_EQUATES
Equ Tab$ to \09\
Equ CRLF$ to \0D0A\
Equ LF$ to \0A\
Equ Comma$ to ','
Equ Tab$ to \09\
Equ CRLF$ to \0D0A\
Equ LF$ to \0A\
Equ Comma$ to ','
* Reduce Modes
Equ new_exist$ To 0
Equ next_cur$ To 1
Equ add_exist$ to 2
Declare subroutine Error_Services, Database_Services, Logging_Services
Declare function Database_Services, Environment_Services, Logging_Services
Declare subroutine Error_Services, Database_Services, Logging_Services, Httpclient_Services, Reduce, SRP_JSON
Declare function Database_Services, Environment_Services, Logging_Services, Httpclient_Services
Declare function RTI_CreateGuid, SRP_JSON
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WaferCounter'
LogDate = Oconv(Date(), 'D4/')
@ -53,6 +60,13 @@ end
Return Response else ''
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Service Parameter Options
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Options BOOLEAN = True$, False$
Options WAFER_SIZES = '6INCH', '8INCH'
Options LOCATIONS = 'MU', 'QA', 'EPR-EAST', 'EPR-WEST'
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Services
@ -140,17 +154,256 @@ Service ImportWaferCounterFiles()
OSDelete DataPath : File
end
Next File
Unlock hSysLists, ServiceKeyID else Null
end
end service
Service ConvertWaferData(FileData)
ErrorMsg = ''
WaferArray = ''
If FileData NE '' then
Swap CRLF$ with @FM in FileData
WaferTotal = FileData<1>
WaferData = FileData<2>
If ( (Len(WaferTotal) EQ 3) and (WaferTotal[1, 1] EQ 'T') and (Len(WaferData) EQ 8 ) and (WaferData[1, 1] EQ 'P') ) then
Convert 'T' to '' in WaferTotal
WaferArray = ''
For CharIndex = 2 to 8
Val = IConv(WaferData[CharIndex, 1], 'MX')
Val = OConv(Val, 'MB')
If CharIndex GT 2 then Val = Fmt(Val, 'R(0)#4')
WaferArray := Val
Next CharIndex
If (Len(WaferArray) NE 25) then
ErrorMsg = 'Error in ':Service:' service. Invalid wafer array length.'
end else
// Reverse the array so it is in order from slot 1 to 25
WaferArray = WaferArray[-1, -25]
// Return @VM delimited array for ease of use in OI BASIC+
DelimArray = ''
For CharIndex = 1 to 25
DelimArray<0, CharIndex> = WaferArray[CharIndex, 1]
Next CharIndex
If (Sum(DelimArray) EQ WaferTotal) then
Response = DelimArray
end else
ErrorMsg = 'Error in ':Service:' service. Wafer total does not match array total.'
end
end
end else
ErrorMsg = 'Error in ':Service:' service. Invalid data format passed in FileData variable.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null FileData passed into service.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
end service
Service GetWaferCounterJSON(WaferSize, ToolLocation, CassID)
If ( (WaferSize NE '') and (ToolLocation NE '') and (CassID NE '') ) then
URL = 'https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/WaferCounter/{waferSize}/last-quantity-and-slot-map/?area={area}&text={cassID}'
Swap '{waferSize}' with WaferSize in URL
Swap '{area}' with ToolLocation in URL
Swap '{cassID}' with CassID in URL
// Set timeout to 24 seconds. This value was decided upon with Mike Phares to allow time
// for EAF to receive the new wafer counter file from the tool and serve it up.
Httpclient_Services('SetTimeoutDuration', 24)
Response = Httpclient_Services('SendHTTPRequest', 'GET', URL, '', '', '', '', False$, False$, '')
If Error_Services('NoError') then
StatusCode = Httpclient_Services('GetResponseStatusCode')
If StatusCode NE 200 then
Begin Case
Case Response EQ ''
ErrorMsg = 'Unexpected server error.'
Case Response EQ 'No files!'
ErrorMsg = 'No data. Please re-seat cassette and try again.'
Case Otherwise$
// Use message in response body to populate error services
ErrorMsg = Response
End Case
Error_Services('Add', ErrorMsg)
end
end
end
end service
Service AddScan(LotID, ScanQty, ScanDtm, ScanTool, ScanUser, ScanLocation, WaferMap)
KeyID = RTI_CreateGuid()
Record = ''
Record<WAFER_COUNTER.LOT_ID$> = LotID
Record<WAFER_COUNTER.SCAN_QTY$> = ScanQty
If Not(Num(ScanDtm)) then
ScanYear = ScanDtm[1, 'F-']
ScanMonth = ScanDtm[Col2() + 1, 'F-']
ScanDay = ScanDtm[Col2() + 1, 'F ']
ScanTime = ScanDtm[Col2() + 1, 999]
Convert ' ' to '' in ScanTime
ScanDtm = ScanMonth:'/':ScanDay:'/':ScanYear:' ':ScanTime
ScanDtm = IConv(ScanDtm, 'DT')
end
Record<WAFER_COUNTER.SCAN_DTM$> = ScanDtm
Record<WAFER_COUNTER.SCAN_TOOL$> = ScanTool
Record<WAFER_COUNTER.SCAN_USER$> = ScanUser
If ScanLocation EQ 'FQA' then ScanLocation = 'QA'
Record<WAFER_COUNTER.SCAN_LOCATION$> = ScanLocation
Record<WAFER_COUNTER.SCAN_WAFER_MAP$> = WaferMap
Database_Services('WriteDataRow', 'WAFER_COUNTER', KeyID, Record)
end service
Service GetLastScan(LotID, ScanLocation=LOCATIONS)
ErrorMsg = ''
WCRec = ''
If LotID NE '' then
Tablename = "WAFER_COUNTER"
Flag = ""
Done = False$
CursorVar = ""
GoSub ClearCursors
SortList = "#SCAN_DTM"
ReduceScript = 'WITH {LOT_ID} EQ ':Quote(LotID)
If ScanLocation NE '' then
ReduceScript := ' AND WITH {SCAN_LOCATION} EQ ':Quote(ScanLocation)
end
Mode = NEXT_CUR$
Reduce(ReduceScript, SortList, Mode, Tablename, Cursorvar, Flag)
If Flag then
Select Tablename By SortList Using Cursorvar then
Open Tablename To hTable then
KeyID = ''
Loop
ReadNext KeyID Using Cursorvar By AT Else Done = TRUE$
If KeyID NE '' then
Done = True$
Read WCRec from hTable, KeyID then
WCRec<WAFER_COUNTER.SCAN_DTM$> = OConv(WCRec<WAFER_COUNTER.SCAN_DTM$>, 'DT/^2H')
end else
ErrorMsg = 'Error in ':Service:' service. Error reading ':KeyID:' from ':Tablename:' table.'
end
end
Until Done or (KeyID NE '')
Repeat
End Else
ErrorMsg = 'Error in ':Service:' service. Error in opening ':Tablename:'.'
End
End Else
ErrorMsg = 'Error in ':Service:' service. Error in selecting ':Tablename:'.'
end
End Else
ErrorMsg = 'Error in ':Service:' service. Error in Reduce call.'
End
end else
ErrorMsg = 'Error in ':Service:' service. Null LotID passed into service.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
Response = WCRec
end service
Service GetProdWaferCounter(WaferSize=WAFER_SIZES, Location=LOCATIONS)
ToolID = ''
ErrorMsg = ''
If ( (WaferSize NE '') and (Location NE '') ) then
Query = "SELECT TOOL WITH @ID CONTAINING 'WC":WaferSize:"' AND WITH TOOL_LOC EQ '":Location:"' AND WITH CURR_MODE EQ 'PROD'"
GoSub ClearCursors
RList(Query, TARGET_ACTIVELIST$, '', '', '')
ErrCode = ''
If Not(Get_Status(ErrCode)) then
Begin Case
Case @RecCount EQ 0
ErrorMsg = 'Error in ':Service:' service. No production wafer counter found!'
Case @RecCount EQ 1
ReadNext ToolID else
ErrorMsg = 'Error in ':Service:' service. Error reading production wafer counter tool ID!'
end
Case @RecCount GT 1
ErrorMsg = 'Error in ':Service:' service. More than one production wafer counter found!'
End Case
GoSub ClearCursors
end else
ErrorMsg = 'Error in ':Service:' service. Error calling RList. Error code: ':ErrCode:'.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null WaferSize or Location passed into service.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
Response = ToolID
end service
Service GetWaferCounterToolID(WaferSize=WAFER_SIZES, Location=LOCATIONS)
ToolID = ''
ErrorMsg = ''
If ( (WaferSize NE '') and (Location NE '') ) then
Query = "SELECT TOOL WITH @ID CONTAINING 'WC":WaferSize:"' AND WITH TOOL_LOC EQ '":Location:"'"
GoSub ClearCursors
RList(Query, TARGET_ACTIVELIST$, '', '', '')
ErrCode = ''
If Not(Get_Status(ErrCode)) then
Begin Case
Case @RecCount EQ 0
ErrorMsg = 'Error in ':Service:' service. No wafer counter tool found for ':WaferSize:' ':Location:'.'
Case @RecCount EQ 1
ReadNext ToolID else
ErrorMsg = 'Error in ':Service:' service. Error reading wafer counter tool ID!'
end
Case @RecCount GT 1
ErrorMsg = 'Error in ':Service:' service. More than one wafer counter tool found for ':WaferSize:' ':Location:'.'
End Case
GoSub ClearCursors
end else
ErrorMsg = 'Error in ':Service:' service. Error calling RList. Error code: ':ErrCode:'.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null WaferSize or Location passed into service.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
Response = ToolID
end service
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ClearCursors:
For counter = 0 to 8
ClearSelect counter
Next counter
return