<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_sewnsheet_tolerance</TITLE><H1>%mqc_check_sewnsheet_tolerance </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_sewnsheet_tolerance </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 sewn sheet bodies can be updated with the input tolerance.
Parameters:
   (Number)   tol                 -  Sew tolerance.
                                      Default is 0.254.
   (Name)     tol_unit            -   Unit of tol.
                                      Default is mm.
    (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:
    FAILED: -  If any sewn sheet body can not be updated with the new tolerance.
    PASS:   -  All sewn sheet bodies can be updated with the new tolerance.
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_sewnsheet_tolerance( %ug_base_checker );
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )               %test_category: "Modeling.Features";
   ( String )               %displayed_name: "Check Sewing Tolerance";
</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 this class</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )            tol_label: "Sew Tolerance";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )            tol_unit_label: "Sew Tolerance Unit";
   ( List )              tol_unit_option: {mm, inch};

</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";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( Number Parameter )  tol: 0.254;
   ( Name Parameter )    tol_unit: mm;
   ( Integer Parameter ) Log_Type: 1;
   ( String Parameter )  Log_Msg: "";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )            Log_Msg_Label: "Log Message";

   (Any Uncached)   Do_Check: 

   If ( -Member( log_type:, { 1, 2, 3 } ) ) 
   Then 
       ug_mqc_empty_param_warning( )
   Else
   @{
       $usr_msg << If ( "" = log_msg: ) Then "" Else "~n"+log_msg: ;

       # inqure all sew sheet feature from sew features
       $sew_sheet_feats << 
       Loop{
           For $each_feat In mqc_askFeatures( feature_type, SEW );
           For $each_body Is mqc_askBodyOfFeature( $each_feat );
           If (ug_body_isSheet(%mqc_askHostpointerOfTag($each_body)))
             Append { $each_feat };
       };
       
       If ( Empty?($sew_sheet_feats) )
       Then
           ug_mqc_log( LOG_INFO, {}, $usr_msg + "This part has no SEWN feature." )
       Else
       @{
           $part_unit << ug_askPartUnits( "" );
           $sew_tol << 
               If ( ( tol_unit: = mm ) & ( $part_unit = pounds_and_inches ) )
               Then tol:/25.4
               Else If ( ( tol_unit: = inch ) & ( $part_unit = grams_and_millimeters ) )
               Then tol:*25.4
               Else tol:;

           # inqure sewn sheet body/ies which can not be update with the new tolerance
           $sew_sheets_not_update <<
           Loop
           {
               For $each_sheet in $sew_sheet_feats;
               If(!mqc_checkSewTolerance($each_sheet, $sew_tol))
                   Append {$each_sheet};
           };

           $num_not_update << Length( $sew_sheets_not_update );

           If($num_not_update >0)Then
           @{
               $detail_msg << 
                   if($num_not_update = 1) 
                   then
                       "One sewn sheet body can not be updated with the new sew tolerance.~n"
                   else
                      
                       stringvalue($num_not_update)
                       + " sewn sheet bodies can not be updated with the new sew tolerance.~n";
        
               ug_mqc_log( Nth( log_type:, log_type_option: ), 
                       $sew_sheets_not_update, $usr_msg + $detail_msg );
           }
           Else Donothing;
       };
   };


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