<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_multi_required_cat</TITLE><H1>%mqc_check_multi_required_cat </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_multi_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>
  Validate existing category names according to list of standard category name.
Parameters:
       (List) required_category_spec:   -  List of the required category names.
                                           For example:
                                           {
                                             "SOLID",
                                             "WIREFRAME",
                                           };
                                           This is the 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
                                           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 all required categories exist.
  FAILED  --  If any required category does not exist.

<B>See Also:</B>
    %mqc_check_single_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 names strings for interactive selections.
       ( List )  required_category_spec_init:
                    List of strings of the required category names.
                    It must have the format like:
                     {
                         "category_name_1 ",
                         "category_name_2 ",
                         ...
                         "category_name_n "
                     };
                    For example:
                        {
                            "SOLID",
                            "WIREFRAME",
                            "CENTERLINE",
                            "PART"
                        };
  4. (Optinal) change the default log type
      (integer) log_type:  1;
=============================================================================================
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_multi_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 Multiple Required Categories";

</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\">   Attributes for selecting spec to check</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( List Parameter )              required_category_spec: required_category_spec_init:;
</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 )                      required_category_spec_label: "Required Category Names";
( List )                        required_category_spec_init:
                                {
                                };

</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 Empty?( required_category_spec:)

    Then  {}

    Else  required_category_spec:;
};


</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>