<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_assembly_clearance_analysis</TITLE><H1>%mqc_check_assembly_clearance_analysis </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_assembly_clearance_analysis </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>
    Check if all assembly clearance analysis have been performed or not.
Parameters:
    (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_INFO,
                                     Default is 1 to log error.
    (String)   log_msg          -  User defined message to be added when the system
                                     reports the violation.
                                     Default is an empty string.
Results:
    INFO    --  The validated part is not an assembly part.
    PASS    --  The validated assembly part has clearance analysis data set(s),
                and the version number of each data set is greater than zero.
    FAILED  --  The assembly part does not have any clearance data set, or
                some clearance analysis data sets have not been performed
                with zero version number.
                List the un-performed data set(s) and the version number
Notes:
    A clearance set is not a displayable object, which contains the list of
    objects to be analyzed, clearance zones, special object or pair inclusions
    and exclusions, and analysis results.
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_assembly_clearance_analysis( %ug_base_checker );
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )               %test_category:  "Assemblies";
   ( String )               %displayed_name: "Check clearance analysis has been run or not";

</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 };
   ( 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>   ( Boolean Parameter )    disabled?: False;
   ( Boolean Parameter )    save_log_in_part: True;
   ( Integer Parameter )   log_type: 1;
   ( string Parameter )    log_msg: "";
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"> checking ...</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>   ( Any Uncached )   do_check:

   If ( -Member( log_type:, { 1, 2, 3, 4 } ) )

   Then ug_mqc_empty_param_warning()
   
   Else If ( mqc_isAssemblyPart( ug_askcurrentworkpart() ) = FALSE )
   
   Then ug_mqc_log( LOG_INFO, {}, "This is not an assembly part, this checker does not run." )

   Else
   @{
        $clearance_analysis_datasets << mqc_askClearanceAnalysisInfo(); 

        $datasets_num << Length( $clearance_analysis_datasets );

        If ( $datasets_num = 0 )
        
        Then ug_mqc_log( LOG_ERROR, {}, "This is an assembly part, but no clearance analysis dataset." )

        Else
        @{
            $unperf_sets  << Loop
            {
                 With $unperf_sets_tags  Is {};
                 With $unperf_sets_names Is {};

                 For  $loop_i     From  1     To  $datasets_num;
                 For  $data_set   Is    Nth( $loop_i, $clearance_analysis_datasets );
                 For  $ds_tag     Is    First ( $data_set );
                 For  $ds_name    Is    Second( $data_set );
                 For  $ds_version Is    Third ( $data_set );
                 

                 For  $unperf_sets_tags  Is If ( $ds_version = 0 )
                                            Then $unperf_sets_tags + { $ds_tag }
                                            Else $unperf_sets_tags;
             
                 For  $unperf_sets_names Is If ( $ds_version = 0 )
                                            Then $unperf_sets_names + { $ds_name }
                                            Else $unperf_sets_names;

                 Return Is { $unperf_sets_tags, $unperf_sets_names };
            };

            If ( $unperf_sets = {{},{}} )
            
            Then donothing
            
            Else
            @{
                 $usr_msg << If ( log_msg: = "" ) Then "" Else log_msg:+"~n";
                 
                 $unperf_sets_tags  << First( $unperf_sets );
                 $unperf_sets_names << Second( $unperf_sets );

                 $names_str  << "~n    " + mqc_list_to_string( $unperf_sets_names, "~n   " );

                 $log_str    << "Find "+Stringvalue(Length($unperf_sets_tags))+
                                " clearance analysis dataset(s) never executed.~n"+
                                "The dataset names:"+
                                $names_str;

                 $log_option << Nth( log_type:, log_type_option: );

                 ug_mqc_log( $log_option, {}, $usr_msg+$log_str );
            };
        };
   };

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