<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_multi_drawing_scale</TITLE><H1>%mqc_check_multi_drawing_scale </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_multi_drawing_scale </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>
    Verify that current drawing view scale is within list of standard drawing view scales.
Parameter:
    (List)   view_scale_map     -  List of strings of paired 'View Name'
                                   and  'View Scale' maps
                                   For example:
                                   {
                                       "ALL   |  1.0";
                                   };
                                   If view name is 'ALL',
                                   then apply the search on all the views.
                                   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 drawing view scales are in a standard scale.
   FAILED  -- if any drawing view scale is not in a standard scale.

<B>See Also:</B>
    %mqc_check_single_drawing_scale
=============================================================================================
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 view  scale mapping strings for interactive selections.
       ( List )   view_scale_map_init:
                      List of paired view and scale specifications.
                      It must have the format like:
                        {
                            "view_name_1  |  view_scale_1",
                            "view_name_2  |  view_scale_2",
                            ...
                            "view_name_n  |  view_scale_n"
                        };
                      The view_name and the view scale must be separated by '|'.
                             e.g. "ALL   |   1.0"
                      If view name is 'ALL', then apply the search on all the views.
                      For example:
                           {
                               "VIEW1    |    1.0",
                               "VIEW2    |    2.0",
                           };
  4. (Optinal) change the default log type
      (integer) log_type:  1;
=============================================================================================
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_multi_drawing_scale( %ug_base_checker );   
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )    %test_category: "Template.Drafting"; 
   ( String )    %displayed_name: "Check Multiple View Scales";
   
</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;
   ( List Parameter )              view_scale_map: view_scale_map_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>   ( List )                        view_scale_map_init:
                                   {
                                   };
   ( String )                      view_scale_map_label: "View Name | View Scale";
 
</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: "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><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )                     log_msg_label: "Log Message";
   
   ( List ) rules_to_check:
   
            If  -Empty?( view_scale_map: )
            
            Then  Loop
            {
                For  $each_sel  In  view_scale_map:;
                
                For  $sel_list  Is  Splitstring( $each_sel, "|" );
                For  $moveblank Is  mqc_removePreSufBlank($sel_list);
                            
                For  $view_name  Is  First ( $moveblank );
                For  $view_scale Is  Second( $moveblank );
                             
                For  $valid_map Is  ( -( $view_name = "" ) ) & ( -( $view_name = noValue ) ) 
                & ( -( $view_scale = "" ) ) & ( -( $view_scale = noValue ) ) ;
                                              
                Do  If ( $valid_map )
                    Then  donothing
                    Else  ug_mqc_log( LOG_WARNING, {}, "Invalid view scale specification: " + $each_sel +" ." );
                If  ( $valid_map )
                  Append { { $view_name,MakeNumber($view_scale) } };
            }
            
            Else
                {};
   
   
   # Checking ...  
   ( Any Uncached ) do_check:
   
           If  Empty?( rules_to_check: )

           Then           
               ug_mqc_empty_param_warning()
               
           Else  Loop
           {
               For  $each_view  In  rules_to_check:;
               
               For  $view_name  Is  First( $each_view );
               
               For  $view_scale  Is  Second( $each_view );
               
               Do
                 ug_mqc_checkViewScale( $view_name, 
                                        $view_scale, 
                                        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>