Added filtering criteria to only return available met tests relevant to the current operation
This commit is contained in:
committed by
Ouellette Jonathan (CSC FI SPS MESLEO)
parent
a48f47ddc9
commit
71daf317f0
@ -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 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 RTI_CreateGUID, MemberOf, SRP_JSON, Operation_Services, Datetime, Met_Test_Services, PSN_Services
|
||||||
Declare function Date_Services
|
Declare function Date_Services, SRP_Stopwatch
|
||||||
Declare subroutine Database_Services, Error_Services, SRP_JSON, Lot_Services, Lot_Event_Services, Lot_Operation_Services
|
Declare subroutine Database_Services, Error_Services, SRP_JSON, Lot_Services, Lot_Event_Services, Lot_Operation_Services, SRP_Stopwatch
|
||||||
|
|
||||||
$insert LOGICAL
|
$insert LOGICAL
|
||||||
$insert LOT_EQUATES
|
$insert LOT_EQUATES
|
||||||
@ -296,18 +296,29 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
SRP_Json(objJSON, 'Set', 'AssociatedMetTests', objAssocMetTest)
|
SRP_Json(objJSON, 'Set', 'AssociatedMetTests', objAssocMetTest)
|
||||||
SRP_Json(objAssocMetTest, 'Release')
|
SRP_Json(objAssocMetTest, 'Release')
|
||||||
end
|
end
|
||||||
|
|
||||||
//Add Available Met Test Record
|
//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 = ''
|
objAvailMetTest = ''
|
||||||
If SRP_Json(objAvailMetTest, 'New', 'Array') then
|
If SRP_Json(objAvailMetTest, 'New', 'Array') then
|
||||||
for each MetTestId in AvailMetTestIds using @VM
|
if AvailMetTestIds NE '' then
|
||||||
MetTestJson = Met_Test_Services('ConvertRecordToJson', MetTestId)
|
for each MetTestId in AvailMetTestIds using @VM
|
||||||
If SRP_Json(objMetTest, 'Parse', MetTestJson) EQ '' then
|
|
||||||
SRP_Json(objAvailMetTest, 'Add', objMetTest)
|
SRP_Stopwatch('Start', 'MetTestJson')
|
||||||
SRP_Json(objMetTest, 'Release')
|
MetTestJson = Met_Test_Services('ConvertRecordToJson', MetTestId)
|
||||||
end
|
SRP_Stopwatch('Stop', 'MetTestJson')
|
||||||
Next MetTestId
|
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(objJSON, 'Set', 'AvailMetTests', objAvailMetTest)
|
||||||
SRP_Json(objAvailMetTest, 'Release')
|
SRP_Json(objAvailMetTest, 'Release')
|
||||||
end
|
end
|
||||||
@ -510,3 +521,4 @@ Service ValidateLotOperation(LotOperationId)
|
|||||||
Response = IsValid
|
Response = IsValid
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
@ -994,7 +994,7 @@ Service ConvertRecordToJson(MetTestId)
|
|||||||
SRP_JSON(objJSON, 'SetValue', 'outOfSpec', {OUT_OF_SPEC}, 'Boolean')
|
SRP_JSON(objJSON, 'SetValue', 'outOfSpec', {OUT_OF_SPEC}, 'Boolean')
|
||||||
SRP_JSON(objJSON, 'SetValue', 'complete', {COMPLETE}, 'Boolean')
|
SRP_JSON(objJSON, 'SetValue', 'complete', {COMPLETE}, 'Boolean')
|
||||||
objMetPropArray = ''
|
objMetPropArray = ''
|
||||||
If SRP_JSON(objMetPropArray, 'New', 'Array') then
|
If SRP_JSON(objMetPropArray, 'New', 'Array') then
|
||||||
For PropIndex = 1 to NUM_PROPERTIES$
|
For PropIndex = 1 to NUM_PROPERTIES$
|
||||||
PropName = Xlate('MET_TEST', MetTestId, 'PROPERTY_':PropIndex, 'X')
|
PropName = Xlate('MET_TEST', MetTestId, 'PROPERTY_':PropIndex, 'X')
|
||||||
PropVals = Xlate('MET_TEST_DATA', MetTestDataIds, 'PROPERTY_':PropIndex:'_VALUE', 'X')
|
PropVals = Xlate('MET_TEST_DATA', MetTestDataIds, 'PROPERTY_':PropIndex:'_VALUE', 'X')
|
||||||
@ -1110,7 +1110,7 @@ end service
|
|||||||
// MET_TEST key ids.
|
// MET_TEST key ids.
|
||||||
//
|
//
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
Service GetMetTests(LotId, LegacyLotId, LotOperationId, ToolId, ExcludeAssociated)
|
Service GetMetTests(LotId, LegacyLotId, ToolId, ExcludeAssociated, MatchClass, FromDtm, ToDtm)
|
||||||
|
|
||||||
ErrorMsg = ''
|
ErrorMsg = ''
|
||||||
MetTestIds = ''
|
MetTestIds = ''
|
||||||
@ -1119,6 +1119,17 @@ Service GetMetTests(LotId, LegacyLotId, LotOperationId, ToolId, ExcludeAssociate
|
|||||||
If RowExists('LOT', LotId) then
|
If RowExists('LOT', LotId) then
|
||||||
Open 'DICT.MET_TEST' to DictVar then
|
Open 'DICT.MET_TEST' to DictVar then
|
||||||
SearchString = ''
|
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
|
If LotId NE '' then
|
||||||
SearchString := 'LOT_ID':@VM:LotId:@FM
|
SearchString := 'LOT_ID':@VM:LotId:@FM
|
||||||
end
|
end
|
||||||
@ -1128,19 +1139,33 @@ Service GetMetTests(LotId, LegacyLotId, LotOperationId, ToolId, ExcludeAssociate
|
|||||||
If ToolId NE '' then
|
If ToolId NE '' then
|
||||||
SearchString := 'TOOL':@VM:ToolId:@FM
|
SearchString := 'TOOL':@VM:ToolId:@FM
|
||||||
end
|
end
|
||||||
Btree.Extract(SearchString, 'MET_TEST', DictVar, MetTestIds, '', '')
|
if FromDtm NE '' then
|
||||||
If MetTestIds NE '' then
|
FromDtm = FromDtm + 0.000001
|
||||||
If ExcludeAssociated then
|
If ToDtm NE '' then
|
||||||
for each MetTestId in MetTestIds using @VM setting mPos
|
ToDtm = ToDtm + 0.000001
|
||||||
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
|
end else
|
||||||
RespMetTestIds = MetTestIds
|
ToDtm = DateTime()
|
||||||
end
|
end
|
||||||
|
SearchString := 'TEST_DTM':@VM:FromDtm:'~':ToDtm:@FM
|
||||||
end
|
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
|
end else
|
||||||
ErrorMsg = 'Error in ' : Service : ' service. Error opening MET_TEST dictionary.'
|
ErrorMsg = 'Error in ' : Service : ' service. Error opening MET_TEST dictionary.'
|
||||||
end
|
end
|
||||||
@ -1252,3 +1277,4 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user