<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_report_feature_count</TITLE><H1>%mqc_report_feature_count </H1><P CLASS="Paragraph">Classname: <B>%mqc_report_feature_count </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>
  Report number of features.
  All Features included internal ones will be reported.
  NOTE: Internal features are invisible and not editable for the end user.
Parameter:
    (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.
    (String)   log_msg          -  User defined message to be added when the system
                                   reports the violation.
                                   Default is an empty string.
    (Boolean)  report_feature_name - Report feature name or not.
                                     Default is true.
Results:
  Report the number of features in part.
See also:
  mqc_report_browseable_features
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_report_feature_count( %ug_base_checker );
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )               %test_category: "Get information.Modeling";
   ( String )               %displayed_name: "Number of features";

</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 log_message     </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>   ( string Parameter )     log_msg: "";
   ( Boolean Parameter )   report_feature_name: true;
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )              report_feature_name_label: "Report feature name";

   ( Any Uncached ) do_check:
                    @{
                         $feat_list << mqc_askFeatures();
                         $num_features << Length( $feat_list );
                         if ( $num_features = 0 )
                         then
                             ug_mqc_log( LOG_INFO, {}, "The part has no features." )
                         else
                         @{
                             $detail_msg << "Found " + Stringvalue( $num_features ) + " feature(s) in part. In them:";

                             $usr_msg << If ( "" = log_msg: ) Then "" Else log_msg: + "~n";

                             ug_mqc_log( LOG_INFO, $feat_list, $usr_msg + $detail_msg );

                             #+
                             Sort features by type.
                             #-
                             $feature_types << Loop
			     {
			         With $type_list  Is  {};
			         With $name_type_list Is {};
			     
			         For  $each_feat  In  $feat_list;
			     
			         For  $name_type  Is  mqc_askFeatureNameAndType($each_feat);
			     
			         For  $feat_type  Is  Second($name_type);
			         For  $feat_posi  Is  Position( $feat_type, $type_list );
			     
			         For  $type_list  Is  If ( $feat_posi=Novalue )
			                          Then $type_list +{$feat_type}
			                          Else $type_list;
			     
			         For  $name_type_list Is $name_type_list+{$name_type};
			     
			         Return Is {$type_list, $name_type_list};
                             };
  
			     $all_types << First ($feature_types);
			     $name_types<< Second($feature_types);
			 
			     $write_log << Loop
			     {
			       For  $each_type  In  $all_types;
			       For  $type_feat  Is  Loop
			       {
			          With $name_str   Is  "";
			          With $feat_count Is  0;
			          For  $each_feat  In  $name_types;
			          
			          For  $name_str   Is  If ( Second($each_feat)=$each_type )
			                               Then $name_str+"~n    "+First($each_feat)
			                               Else $name_str;
			          For  $feat_count Is  If ( Second($each_feat)=$each_type )
			                               Then $feat_count+1
			                               Else $feat_count;
			          
			          Return Is {$name_str, $feat_count};
			       };
			     
			       For  $message Is "~n "+Stringvalue(Second($type_feat))+" "+$each_type+
			                      " features"+
			                      If (report_feature_name: = true)
			                      Then First($type_feat)
			                      Else "";
			     
			       Do ug_mqc_log( LOG_INFO, {},  $message ); 
			     };
                         };
                    };
  

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