<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_single_required_cat</TITLE><H1>%mqc_check_single_required_cat </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_single_required_cat </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>
  Verify that the required layer category exists.
Parameters:
    (String) opt_required_category   -  The required layer category name.
                                        This is a mandatory parameter for the checker.
    (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
                                           4 - log any
                                           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 no additional message.
Results:
  PASS    --  If the required category exists.
  FAILED  --  If the required category does not exist.

<B>See Also:</B>
    %mqc_check_multi_required_cat
=============================================================================================
Create a new checker from this template by specifying the values of the mandatory parameters:
  1. (Must)     change the class name, and the category name
  2. (Optional) change the display name. (optional)
  3. (Must)     specify the required category name string.
       ( String )  opt_required_category: "REQUIRED_CATEGORY_NAME";
  4. (Optinal) change the default log type
      (integer) log_type:  1;
=============================================================================================
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_single_required_cat( %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 Required Category";

</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 Parameter )            opt_required_category: "";
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  parameter for log_option                                       </PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                      opt_required_category_label: "Required Category Name";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( Integer Parameter )           log_type: 1;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  parameter for log_message     </PRE><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";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( 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";

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

    Then  Splitstring( opt_required_category:, "," )

    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 ) do_check:

        If  Empty?( rules_to_check: )

        Then
            ug_mqc_empty_param_warning()

        Else
            ug_mqc_checkRequiredCategory( rules_to_check:,
                                          nth( log_type:, log_type_option: ), 
                                          log_msg:);

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