<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_early_chamfer_blend</TITLE><H1>%mqc_check_early_chamfer_blend </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_early_chamfer_blend </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 any chamfer feature or edge blend feature was created early in a model.
   Using the percentage of all the features to measure "early" features in the model.
   The default is 0.5 percent. If the part has 100 features, it means the first 5 features
   will be count as early features.
   Chamfers and edge blends are most often applied to a part after the design is completed
   to give it a finished look and to eliminate sharp edges.
   If they are added to model too early in the design, it may affect the model to add more
   features later.
Parameters:
   (Number)  early_percentage -  Percentage defining the early extent.
                                                   Default value is 10%.
   ( 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_ERROR
                                              Default is 1 to log error.
   ( String )      log_msg    -    User defined message to be added when the system reports the violations.
                                             Default is an empty string.
Results:
   PASS     - Chamfer and edge blend are not found in the early features
   FAILED   - chamfer or edge blend is among early features
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_early_chamfer_blend( %ug_base_checker ); 
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )              %test_category:  "Modeling.Features";
   ( String )              %displayed_name: "Early Chamfer or Edge Blend";

</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\"> parameter for the checker</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( Number Parameter )    early_percentage: 10;
</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 )              early_percentage_label: %ug_MSGTXT("Early Percentage");
   
</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 };
   ( string )               log_type_label: %ug_MSGTXT("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\">  checker specific attributes</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( string )              log_msg_label: %ug_MSGTXT( "Log Message" );
   
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List )    checked_type: { "CHAMFER", "BLEND" };


</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 ( ( early_percentage: < 0.0 ) | ( early_percentage: > 100.0 ) )
   Then
   @{
        $log_msg << "Invalid values given to the parameters.~n"+
                    "The Early Percentage should range between 0 and 100.";
        ug_mqc_log( LOG_WARNING, {}, $log_msg );
   }
   Else
   @{
       $all_feats_tags   << mqc_askFeatures();
       $all_feats_types << mqc_askFeatureTypes( features_tags, $all_feats_tags );
       $count_feats << length( $all_feats_types );

       $early_obj <<
       Loop {
           For $i from 1 To Length( $all_feats_tags );
           For $i_feat_tag   Is Nth( $i, $all_feats_tags );
           For $i_feat_type Is Nth( $i, $all_feats_types );
           
           Append
             If Member( $i_feat_type, checked_type: )
             Then @{
                   $creat_seq << $i/$count_feats;
                   If ($creat_seq <= early_percentage:/100)
                   Then {$i_feat_tag}
                   Else {};
                   }
             Else {};
           };
           
       if -empty?($early_obj)
       then
       @{
           $detail_msg << %ug_MSGTXT("Found ") + Format( "%d", Length( $early_obj ) ) + %ug_MSGTXT( " blend/chamfer as early features");
           $usr_msg << If ( "" = log_msg: ) Then "" Else log_msg: + "~n";                              
    
       
           ug_mqc_log( Nth(log_type:, log_type_option:), $early_obj, $usr_msg + $detail_msg);
       }
       else
           donothing;

   };

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