Added filtering criteria to only return available met tests relevant to the current operation

This commit is contained in:
Infineon\Ouellette
2025-07-25 11:05:34 -07:00
committed by Ouellette Jonathan (CSC FI SPS MESLEO)
parent a48f47ddc9
commit 71daf317f0
2 changed files with 61 additions and 23 deletions

View File

@ -3,8 +3,8 @@ Compile function Lot_Operation_Services(@Service, @Params)
Declare function Lot_Services, Database_Services, Error_Services, Srp_Sort_Array, Lot_Operation_Services
Declare function RTI_CreateGUID, MemberOf, SRP_JSON, Operation_Services, Datetime, Met_Test_Services, PSN_Services
Declare function Date_Services
Declare subroutine Database_Services, Error_Services, SRP_JSON, Lot_Services, Lot_Event_Services, Lot_Operation_Services
Declare function Date_Services, SRP_Stopwatch
Declare subroutine Database_Services, Error_Services, SRP_JSON, Lot_Services, Lot_Event_Services, Lot_Operation_Services, SRP_Stopwatch
$insert LOGICAL
$insert LOT_EQUATES
@ -296,18 +296,29 @@ Service ConvertRecordToJson(LotOperationId)
SRP_Json(objJSON, 'Set', 'AssociatedMetTests', objAssocMetTest)
SRP_Json(objAssocMetTest, 'Release')
end
//Add Available Met Test Record
AvailMetTestIds = Met_Test_Services('GetMetTests', LotId, LegacyLotId, '', '', True$)
RequiredClasses = LotOperationRec<LOT_OPERATION_MET_TEST_TYPE_REQUIRED$>
AvailMetTestIds = ''
ThisOperationDTMIn = LotOperationRec<LOT_OPERATION_DATETIME_IN$>
ThisOperationDTMOut = LotOperationRec<LOT_OPERATION_DATETIME_OUT$>
if RequiredClasses NE '' AND DatetimeIn NE '' AND DatetimeOut EQ '' then
AvailMetTestIds = Met_Test_Services('GetMetTests', LotId, LegacyLotId, '', True$, RequiredClasses, ThisOperationDTMIn, ThisOperationDTMOut)
end
objAvailMetTest = ''
If SRP_Json(objAvailMetTest, 'New', 'Array') then
for each MetTestId in AvailMetTestIds using @VM
MetTestJson = Met_Test_Services('ConvertRecordToJson', MetTestId)
If SRP_Json(objMetTest, 'Parse', MetTestJson) EQ '' then
SRP_Json(objAvailMetTest, 'Add', objMetTest)
SRP_Json(objMetTest, 'Release')
end
Next MetTestId
if AvailMetTestIds NE '' then
for each MetTestId in AvailMetTestIds using @VM
SRP_Stopwatch('Start', 'MetTestJson')
MetTestJson = Met_Test_Services('ConvertRecordToJson', MetTestId)
SRP_Stopwatch('Stop', 'MetTestJson')
totalTime = SRP_Stopwatch('GetBenchmark', 'MetTestJson')
If SRP_Json(objMetTest, 'Parse', MetTestJson) EQ '' then
SRP_Json(objAvailMetTest, 'Add', objMetTest)
SRP_Json(objMetTest, 'Release')
end
Next MetTestId
end
SRP_Json(objJSON, 'Set', 'AvailMetTests', objAvailMetTest)
SRP_Json(objAvailMetTest, 'Release')
end
@ -510,3 +521,4 @@ Service ValidateLotOperation(LotOperationId)
Response = IsValid
end service