Merged PR 25502: Test Wafer Stat view

Declare new service GetTestRuns.

Commit final changes.

Related work items: #294890
This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-09-10 21:47:21 +00:00
parent 30372169ba
commit 26198b343a
5 changed files with 2642 additions and 2235 deletions

View File

@ -2,6 +2,7 @@ Compile function TEST_RUN_Services(@Service, @Params)
#pragma precomp SRP_PreCompiler
$insert LOGICAL
$Insert APP_INSERTS
$Insert SERVICE_SETUP
$Insert TEST_WAFER_PROD_EQUATES
$Insert TEST_WAFER_TYPES_DISPO_OPTIONS_EQUATES
$Insert TEST_RUN_EQUATES
@ -10,7 +11,7 @@ $Insert TEST_RUN_OBJ_EQUATES
$Insert LOT_EQUATES
$Insert LOT_OPERATION_EQUATES
Declare function Nextkey, Error_Services, Environment_Services, OConv, Logging_Services, SRP_Hashtable, Lot_Services, GetTickCount
Declare function Nextkey, Error_Services, Environment_Services, OConv, Logging_Services, SRP_Hashtable, Lot_Services, GetTickCount, Xlate
Declare function SRP_Datetime, Database_Services, Test_Run_Services, File_Services, Status, delete, Insert, Datetime, SRP_Json, MemberOf
Declare subroutine Database_Services, Btree.Extract, Error_Services, Logging_Services, Rlist, Test_Run_Services, Lot_Services, SRP_Json
Declare subroutine Mona_Services
@ -331,6 +332,71 @@ Service GetTestWaferLots(ShowOnlyOpenLots)
Response = TestWaferLotKeys
end service
Service GetTestRunsByUsername(Username, StartDTM, StopDTM)
If Username NE '' then
Begin Case
Case StartDTM EQ '' AND StopDTM EQ ''
//Set search date for last 12 hour period
StopDTM = SRP_Datetime('Now')
StartDTM = SRP_Datetime('AddHours', StopDTM, -12)
Case StartDTM EQ '' AND StopDTM NE ''
//Set search start date 12 hours prior to stopDTM
StartDTM = SRP_Datetime('AddHours', StopDTM, -12)
Case StartDTM NE '' AND StopDTM EQ ''
//Set search start date to current dtm
StopDTM = SRP_Datetime('Now')
End Case
table = "TEST_RUN"
Open "DICT ":table To @DICT Else
Error_Services('Add', 'Error opening TEST_RUN dictionary')
End
If Error_Services('NoError') then
srch_strng = "RUN_DTM":@VM:StartDTM:'~':StopDTM:@FM: "LSL_USER_ID":@VM:UserName:@FM
keylist = ""
option = ""
flag = ""
Btree.Extract(srch_strng, table, @DICT, keylist, option, flag)
Swap @VM with @FM in keylist
Response = keylist
end
end else
Error_Services('Add', 'Username missing.')
end
end service
Service GetTestWaferUsageStats(Username, StartDTM, StopDTM)
MostRecentDTM = ''
WafersUsed = 0
If Username NE '' then
KeyList = Test_Run_Services('GetTestRunsByUsername', Username, StartDTM, StopDTM)
If KeyList NE '' then
For Each Key in KeyList
TestRunRec = Xlate('TEST_RUN', Key, '', 'X')
If MostRecentDTM EQ '' then
MostRecentDTM = TestRunRec<TEST_RUN_RUN_DTM$>
end else
If MostRecentDTM LT TestRunRec<TEST_RUN_RUN_DTM$> then
MostRecentDTM = TestRunRec<TEST_RUN_RUN_DTM$>
end
end
WaferQty = Dcount(TestRunRec<TEST_RUN_TEST_RUN_WAFER_IDS$>, @VM)
WafersUsed += WaferQty
Next Key
end
Response = ''
Response<1> = MostRecentDTM
Response<2> = WafersUsed
end else
Error_Services('Add', 'Username missing.')
end
end service
Service CreateTestRunRecord(RunTypeID, EqpType, EqpID, PSNo, RDSNo, UserID, TWLotIds, TWLotQtys, ManualQtyAdjust)
StartTick = GetTickCount()
@ -688,6 +754,7 @@ Service GetTestWaferUsageByDateSpan(StartDtm, StopDtm)
end service
Service GetTestRunKeysByDateSpan(StartDtm, StopDtm)
Begin Case
Case StartDTM EQ '' AND StopDTM EQ ''
//Set search date for last 24 hour period
@ -714,8 +781,6 @@ Service GetTestRunKeysByDateSpan(StartDtm, StopDtm)
Response = keylist
end
end service
Service GetTestRunKeysByEqp(EquipType, EquipID)
@ -819,14 +884,3 @@ Service IsNewTWSystemActive(UserId)
end
end service