Add PSN MET test recipes and patterns to JSON

This commit is contained in:
Chase Tucker
2025-09-18 08:30:39 -07:00
committed by Tucker Chase (CSC FI SPS MESLEO)
parent 8c11300455
commit a0897d19df
3 changed files with 125 additions and 1 deletions

View File

@ -34,11 +34,12 @@ $Insert QA_MET_EQUATES
$Insert RDS_TEST_EQUATES
$Insert RDS_TEST_PROP_EQUATES
$Insert PRS_LAYER_EQU
$Insert PRS_PROP_EQUATES
Options SpecTypes = 'CLEAN', 'SURFSCAN', 'THICK', 'THICKA', 'RES', 'SRES', 'CRES', 'CONC'
Declare function Database_Services, Psn_Services, obj_Prod_Spec, Error_Services, SRP_JSON, Cust_Epi_Part_Services
Declare function Prod_Ver_Services, PRS_Stage_Services, SRP_Array
Declare function Prod_Ver_Services, PRS_Stage_Services, SRP_Array, Tool_Class_Services
Declare subroutine Database_Services, Psn_Services, Error_Services, SRP_JSON, Extract_Si_Keys
GoToService else
@ -104,6 +105,69 @@ Service GetRecipes(PSNo)
end service
Service GetMetrologyRecipesAndPatterns(PSNo)
ErrorMsg = ''
RecipesAndPatterns = ''
CurrIdx = 1
If PSNo NE '' then
If RowExists('PROD_SPEC', PSNo) then
PropKeys = ''
Extract_Si_Keys('PRS_PROP', 'PS_NO', PSNo, PropKeys)
for each PropKey in PropKeys using @VM setting pPos
Recipe = Xlate('PRS_PROP', PropKey, PRS_PROP_RECIPE$, 'X')
Pattern = Xlate('PRS_PROP', PropKey, PRS_PROP_PATTERN$, 'X')
Tool = Xlate('PRS_PROP', PropKey, PRS_PROP_TOOL$, 'X')
Convert @LOWER_CASE to @UPPER_CASE in Tool
If Recipe NE '' and Pattern NE '' and Tool NE '' then
PatternSize = Tool_Class_Services('GetNumberOfPointsForPattern', Tool, Pattern)
If Error_Services('NoError') then
Entry = Recipe:@VM:Pattern:@VM:PatternSize:@VM:Tool
RecipesAndPatterns<CurrIdx> = Entry
CurrIdx = CurrIdx + 1
end
end
Next PropKey
PRSStageKeys = ''
Extract_Si_Keys('PRS_STAGE', 'PS_NO', PSNo, PRSStageKeys)
for each PRSStageKey in PRSStageKeys using @VM setting sPos
Recipes = Xlate('PRS_STAGE', PRSStageKey, PRS_STAGE_MET_RECIPE$, 'X')
for each Recipe in Recipes using @VM setting rPos
Pattern = Xlate('PRS_STAGE', PRSStageKey, PRS_STAGE_MET_RECIPE_PATTERN$, 'X')<1, rPos>
Tool = Xlate('PRS_STAGE', PRSStageKey, PRS_STAGE_MET_TOOL_CLASS$, 'X')<1, rPos>
Convert @LOWER_CASE to @UPPER_CASE in Tool
If Recipe NE '' and Tool NE '' and Pattern NE '' then
PatternSize = Tool_Class_Services('GetNumberOfPointsForPattern', Tool, Pattern)
If Error_Services('NoError') then
Entry = Recipe:@VM:Pattern:@VM:PatternSize:@VM:Tool
RecipesAndPatterns<CurrIdx> = Entry
CurrIdx = CurrIdx + 1
end
end
Next Recipe
Next PRSStageKey
RecipesAndPatterns = SRP_Array('Clean', RecipesAndPatterns, 'TrimAndMakeUnique')
end else
ErrorMsg = 'Error in ':Service:' service. PROD_SPEC record "':PSNo:'" does not exist.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null PSNo passed into service.'
end
If ErrorMsg EQ '' then
Response = RecipesAndPatterns
end else
Error_Services('Add', ErrorMsg)
end
end service
Service GetAllMetrologyRecipes(PSNo, GetSurfscan, GetClean, GetRes, GetThick)
Recipes = ''
@ -1085,6 +1149,22 @@ Service ConvertRecordToJSON(KeyID, Record, ItemURL)
SRP_JSON(objStageArray, 'Release')
end
RecipesAndPatterns = PSN_Services('GetMetrologyRecipesAndPatterns', KeyID)
If SRP_JSON(objRecipesAndPatternsArray, 'New', 'Array') then
for each RecipeAndPattern in RecipesAndPatterns using @FM setting rpPos
If SRP_JSON(objRecipeAndPattern, 'New', 'Object') then
SRP_JSON(objRecipeAndPattern, 'SetValue', 'recipe', RecipeAndPattern<1, 1>, 'String')
SRP_JSON(objRecipeAndPattern, 'SetValue', 'pattern', RecipeAndPattern<1, 2>, 'String')
SRP_JSON(objRecipeAndPattern, 'SetValue', 'patternSize', RecipeAndPattern<1, 3>, 'Number')
SRP_JSON(objRecipeAndPattern, 'SetValue', 'tool', RecipeAndPattern<1, 4>, 'String')
SRP_JSON(objRecipesAndPatternsArray, 'Add', objRecipeAndPattern)
SRP_JSON(objRecipeAndPattern, 'Release')
end
Next RecipeAndPattern
SRP_JSON(objProdSpec, 'Set', 'recipesAndPatterns', objRecipesAndPatternsArray)
SRP_JSON(objRecipesAndPatternsArray, 'Release')
end
SRP_JSON(objJSON, 'Set', 'prodSpec', objProdSpec)
SRP_JSON(objProdSpec, 'Release')
end
@ -1167,3 +1247,4 @@ return

View File

@ -0,0 +1,40 @@
Compile function Test_PSN_Services(@Test)
#pragma precomp SRP_PreCompiler
$Insert LOGICAL
Declare function PSN_Services, Error_Services
Declare subroutine PSN_Services, Error_Services
Error_Services('Clear')
GotoTest
// TODO: Code to run after each test goes here
Return TestResult or 1
//-----------------------------------------------------------------------------
// TESTS
//-----------------------------------------------------------------------------
Test GetMetrologyRecipesAndPatternsWithNullPsnNoShouldThrowError
PSN_Services('GetMetrologyRecipesAndPatterns', '')
Assert Error_Services('HasError') equals True$
end test
Test GetMetrologyRecipesAndPatternsWithInvalidPsnNoShouldThrowError
PSN_Services('GetMetrologyRecipesAndPatterns', 'potato')
Assert Error_Services('HasError') equals True$
end test
Test GetMetrologyRecipesAndPatternsWithValidPsnNoShouldReturnPrescribedValues
Values = PSN_Services('GetMetrologyRecipesAndPatterns', 4609)
Assert DCount(Values, @FM) equals 5
Values = PSN_Services('GetMetrologyRecipesAndPatterns', 5159)
Assert DCount(Values, @FM) equals 4
Values = PSN_Services('GetMetrologyRecipesAndPatterns', 4830)
Assert DCount(Values, @FM) equals 5
end test

View File

@ -27,6 +27,8 @@ Service GetNumberOfPointsForPattern(ToolClass, PatternName)
end
end
Convert @LOWER_CASE to @UPPER_CASE in ToolClass
If Error_Services('NoError') then
ToolClassRecord = Database_Services('ReadDataRow', 'TOOL_CLASS', ToolClass)
If Error_Services('HasError') then
@ -48,3 +50,4 @@ Service GetNumberOfPointsForPattern(ToolClass, PatternName)
end
end
End Service