|
FUNCTION get_template_arrangement (input : SET [0:?] OF template_location_in_structured_template) : template_arrangement; LOCAL tlist : SET OF template_location_in_structured_template := ( QUERY ( inx <* input | ( 'part_template_2d_shape_xim.multi_stratum_structured_template_armx' IN TYPEOF ( inx . template ) ) ) ) ; pabt : BAG OF STRING := [ ] ; pabb : BAG OF STRING := [ ] ; pabs : BAG OF STRING := [ ] ; END_LOCAL ; REPEAT i := 1 TO SIZEOF ( tlist ) BY 1 ; IF ( tlist [ i ] . template \ multi_stratum_structured_template_armx . location = template_arrangement . top ) THEN pabt := pabt + 'top' ; END_IF ; IF ( tlist [ i ] . template \ multi_stratum_structured_template_armx . location = template_arrangement . bottom ) THEN pabb := pabb + 'bottom' ; END_IF ; IF ( tlist [ i ] . template \ multi_stratum_structured_template_armx . location = template_arrangement . symmetrical ) THEN pabs := pabs + 'symmetrical' ; END_IF ; END_REPEAT ; IF ( ( SIZEOF ( pabt ) > 0 ) AND ( SIZEOF ( pabb ) = 0 ) ) THEN RETURN ( template_arrangement . top ) ; END_IF ; IF ( ( SIZEOF ( pabb ) > 0 ) AND ( SIZEOF ( pabt ) = 0 ) ) THEN RETURN ( template_arrangement . bottom ) ; END_IF ; IF ( ( SIZEOF ( pabb ) = 0 ) AND ( SIZEOF ( pabt ) = 0 ) AND ( SIZEOF ( pabs ) > 0 ) ) THEN RETURN ( template_arrangement . symmetrical ) ; END_IF ; RETURN ( ? ) ; END_FUNCTION; -- get_template_arrangement |
|
public class FGet_template_arrangement public static Value run(SdaiContext _context, Value input) |