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

View File

@ -1110,7 +1110,7 @@ end service
// MET_TEST key ids.
//
//----------------------------------------------------------------------------------------------------------------------
Service GetMetTests(LotId, LegacyLotId, LotOperationId, ToolId, ExcludeAssociated)
Service GetMetTests(LotId, LegacyLotId, ToolId, ExcludeAssociated, MatchClass, FromDtm, ToDtm)
ErrorMsg = ''
MetTestIds = ''
@ -1119,6 +1119,17 @@ Service GetMetTests(LotId, LegacyLotId, LotOperationId, ToolId, ExcludeAssociate
If RowExists('LOT', LotId) then
Open 'DICT.MET_TEST' to DictVar then
SearchString = ''
If MatchClass NE '' then
If DCount(MatchClass, @VM) GT 1 then
SearchString := 'TOOL_CLASS':@VM:MatchClass<1,1>
for i = 2 to DCount(MatchClass, @VM)
SearchString := @VM : ';':MatchClass<1,i>
Next i
SearchString := @FM
end else
SearchString := 'TOOL_CLASS':@VM:MatchClass:@FM
end
end
If LotId NE '' then
SearchString := 'LOT_ID':@VM:LotId:@FM
end
@ -1128,18 +1139,32 @@ Service GetMetTests(LotId, LegacyLotId, LotOperationId, ToolId, ExcludeAssociate
If ToolId NE '' then
SearchString := 'TOOL':@VM:ToolId:@FM
end
Btree.Extract(SearchString, 'MET_TEST', DictVar, MetTestIds, '', '')
If MetTestIds NE '' then
If ExcludeAssociated then
for each MetTestId in MetTestIds using @VM setting mPos
MetTestLotOperationId = Database_Services('ReadDataColumn', 'MET_TEST', MetTestId, MET_TEST.LOT_OPERATION_ID$, True$, 0, False$)
If MetTestLotOperationId EQ '' then
RespMetTestIds<1,-1> = MetTestId
end
Next MetTestId
if FromDtm NE '' then
FromDtm = FromDtm + 0.000001
If ToDtm NE '' then
ToDtm = ToDtm + 0.000001
end else
RespMetTestIds = MetTestIds
ToDtm = DateTime()
end
SearchString := 'TEST_DTM':@VM:FromDtm:'~':ToDtm:@FM
end
Btree.Extract(SearchString, 'MET_TEST', DictVar, MetTestIds, '', '')
If Not(Get_status(errCode)) then
If MetTestIds NE '' then
If ExcludeAssociated then
for each MetTestId in MetTestIds using @VM setting mPos
MetTestLotOperationId = Database_Services('ReadDataColumn', 'MET_TEST', MetTestId, MET_TEST.LOT_OPERATION_ID$, True$, 0, False$)
If MetTestLotOperationId EQ '' then
RespMetTestIds<1,-1> = MetTestId
end
Next MetTestId
end else
RespMetTestIds = MetTestIds
end
end
end else
ErrorMsg = ErrCode
end
end else
ErrorMsg = 'Error in ' : Service : ' service. Error opening MET_TEST dictionary.'
@ -1252,3 +1277,4 @@ end service