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

File diff suppressed because it is too large Load Diff

View File

@ -1618,3 +1618,4 @@ end service
// Internal GoSubs
//----------------------------------------------------------------------------------------------------------------------

View File

@ -219,6 +219,28 @@ Service GetOnShiftUsers()
end service
Service GetCurrentShiftStartDtm()
CurrDate = SRP_Datetime('Date', Datetime())
ShiftTime = SRP_DateTime('Time', CurrDtm)
ShiftStartDtm = ''
Begin Case
Case ShiftTime GE 21600 AND ShiftTime LT 64800
//Day Shift - Same day @ 6AM
ShiftStartDtm = SRP_Datetime('AddHours', CurrDate, 6)
Case ShiftTime LT 21600
//Morning part of night shift - Prior day at 6PM
ShiftStartDtm = SRP_Datetime('AddHours', CurrDate - 1, 18)
Case ShiftTime GT 64800
//Evening Part of Night shift - Same day at 6PM
ShiftStartDtm = SRP_Datetime('AddHours', CurrDate, 18)
End Case
Response = ShiftStartDtm
end service
Service GetShiftByDate(Date, GenerateFlag)
OnShift = ''; *Return Value
@ -549,3 +571,4 @@ Service UpdateSecurityGroups()
end service

View File

@ -50,7 +50,7 @@ Equ HEIGHT$ to 4
Declare function GetCommandLine, MemberOf, obj_Install, obj_Notes_Sent, FindWindow, ShowWindow, Next_Key
Declare function Environment_Services, Reactor_Services, Database_Services, obj_Tool, Messaging_Services, SRP_JSON
Declare function Notes_Services, RTI_Xlate_Controller
Declare function Notes_Services, RTI_Xlate_Controller, Test_Run_Services, LSL_Users_Services, Datetime
Declare subroutine Set_Env, obj_Appwindow, Get_BMP_Info, obj_Login, obj_Calib_List, End_Window, Start_Window, Next_Key
Declare subroutine Database_Services, obj_React_Status, Obj_React_Mode, obj_Tool_Log, RList, Messaging_Services, RTP27
Declare subroutine Notes_Services, Obj_Note_Ptrs, Comm_Note_Ptrs, SRP_Run_Command, PlaceDialog, GetEngineVersion
@ -404,6 +404,16 @@ Event WINDOW.TIMER()
Gosub SetSnoozeButtonState
CurrDtm = Datetime()
CurrShiftStartDtm = LSL_USERS_SERVICES('GetCurrentShiftStartDtm', CurrDtm)
TWStats = Test_Run_Services('GetTestWaferUsageStats', @USER4, CurrShiftStartDtm, Datetime())
LastUsed = TWStats<1>
LastUsed = Oconv(LastUsed, 'DT2/^H')
QtyUsed = TWStats<2>
Set_Property(@Window: '.LBL_LAST_TW_USED', 'TEXT', 'TW Last Used by User: ' :LastUsed)
Set_Property(@Window: '.LBL_TW_USED', 'TEXT', 'TW Used by User: ' :QtyUsed)
Set_Property(@WINDOW:'.CURRENT_TIME','TEXT','Current Time: ':OCONV( TIME(), 'MTHS' ))
Set_Property(@WINDOW:'.CURRENT_DATE','TEXT','Date: ':OCONV( DATE(), 'D2/' ))
If Get_Property(@Window, '@CLOSE') then
@ -853,3 +863,5 @@ return

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