<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_single_cat_layermask</TITLE><H1>%mqc_check_single_cat_layermask </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_single_cat_layermask </B></P><P CLASS="Paragraph">Inherits from: <B><A href=..\checkmate\xug_base_checker.html>%ug_base_checker </A></B></P><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"> </PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">
<B>Description:</B>
    Validate the layer category.  This function will check if the secified layer category
    collects all specified layers, including empty layers.
Parameters:
  (String)  opt_category:        - Name of the layer category to be checked
                                   This is a mandatory parameter.
  (String)  opt_layermask:       - Special format of a string specifying layer range.
                                   This is a mandatory parameter.
                                   The layer range description string may contain
                                   multiple range descriptions separated by commas,
                                   e.g.
                                     "1,3-5,7,9"
                                   means layer 1, plus layers 3 to 5
                                   plus layer 7, and layer 9.
     (Boolean)  disabled?        - If it is true, the checker is disabled.
                                   Default is False.
     (Boolean)  save_log_in_part - The flag indicates whether the checking results can
                                   be saved to the part file
                                   Default is True.
  (Integer) log_type:            - Indicate which logging type to use to report
                                   the violation
                                   1 - log error
                                   2 - log warning
                                   3 - log information
                                   The default value is 1 which is to log error.
  (String)  log_msg:             - User defined message to be added when the system
                                   reports the violation.
                                   The default is an empty string.
Results:
    PASS    --  If the queried category collects and only collects the specified layers.
    FAILED  --  If the queried category collects improper layers.
    The system will generate a warning if the given layer category does not exist.

<B>See Also:</B>
    %mqc_check_multi_cat_layermask
============================================================================================
Create a new checker from this template by providing the mandatory parameters:
  1. (Must) change the class name and the category name
  2. (Must) specify the category / layer mask mapping rules:
      (String)    opt_category:         "CATEGORY_TO_BE_CHECKED";
      (String)    opt_layermask:        "1-5,20-30";
  3. (Optional) change log type:
      (Integer)    log_type:   1;
=============================================================================================
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_single_cat_layermask( %ug_base_checker );
</FONT></PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Check-Mate attributes and parameters  </PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                      %test_category: "Template.File Structure";
( String )                      %displayed_name: "Check Single Category / Layer Mask Mapping";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( Boolean Parameter )           disabled?: false;
( Boolean Parameter )           save_log_in_part: true;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Checker specific parameters and attributes</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                      opt_category_label: "Category";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                      opt_layermask_label: "Layer Mask";

 # parameter for log_option                                       
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( List )                    log_type_option: { LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_ANY };
( String )                  log_type_label: "Log Option";
    
 # parameter for log_message     
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String Parameter )            opt_category: "";
( String Parameter  )           opt_layermask: "";
( Integer Parameter )        log_type: 1;
( String Parameter )        log_msg: "";
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Attribute for check rules:</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                  log_msg_label: "Log Message";
    
( Boolean )   is_valid_layer?: If ( opt_layermask: = "" | opt_layermask: = noValue )
                                 Then  false
                                 Else  ug_rexp_match( opt_layermask: , "[0-9][0-9,\-]{0,}" );


</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( list ) rules_to_check:
@{
    If ( ( -( opt_category: = "" ) ) & ( -( opt_category: = noValue ) ) & ( -( opt_layermask: = "" ) ) & ( -( opt_layermask: = noValue ) ) )

    Then  { opt_category:, opt_layermask: }

    Else  {};
};



</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  checking ...</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( any uncached ) do_check: 

      If  ( -is_valid_layer?: )
      
      Then  ug_mqc_log( LOG_WARNING, {}, "Invalid layer string." )
      
      Else  If ( Empty?( rules_to_check: ) )

            Then
                 ug_mqc_empty_param_warning()

            Else
            @{
                 $rules_table << If ( mqc_is_nestedList( rules_to_check: ) )    
                                 Then rules_to_check:    
                                 Else { rules_to_check: };     

                 $check_rules << Loop    
                 {    
                     For  $each_rule  In  $rules_table;    

                     For  $is_param_list_right  Is  mqc_check_param_list( $each_rule, true, { STRING, STRING } );    

                     do    

                       If ( $is_param_list_right )    

                       Then    
                       @{    
                           $category_name << First( $each_rule );    

                           $layer_array << Second( $each_rule );    

                           If ( 0 = ug_mqc_checkRequiredCategory( { $category_name }, LOG_WARNING, "" ) )    

                           Then    
                               ug_mqc_checkLayerOfCategory( $category_name,     
                                                            4,     
                                                            $layer_array,    
                                                            nth( log_type:, log_type_option: ),     
                                                            log_msg:)    

                           Else    
                               category_not_exist;    
                       }    

                       Else    
                           param_list_false;    
                  };    
               };

</SPAN></FONT></PRE></DIV></TABLE><p class=EndLine>&nbsp;</p><p class=blank>&nbsp;</p></BODY></HTML>