#! UG/KF 18.0
#+
#============================================================================
#
# Copyright 2007 Siemens Product Lifecycle Management Software Inc.
#
# All Rights Reserved.
#
#============================================================================
#-
#
#
#++
This checker template checks if the specified modeling views exist in the file.
(String) model_view_name: - (Required) Specifies the names of the modeling views.
Multiple names must be separated by commas (,).
For example: "drawing1,drawing2".
(Boolean) disabled? - Disables the checker when the value is True.
The default value is False.
(Boolean) save_log_in_part - Saves the checker results to the part file.
The default value is True.
(integer) log_type - Specifies the log type to use to report
a violation:
LOG_ERROR
LOG_WARNING
LOG_INFO
The default is LOG_ERROR.
(String) log_msg - Adds a user-defined message when the system
reports a violation.
The default is an empty string.
Passed -- All specified modeling views were found.
Failed -- One or more specified modeling views were not found.
Note:
The checker checks for views which are not canned system views.
============================================================================================
Follow these steps to customize this checker template:
1. (Required) Change the class name and the category name.
2. (Required) Specify the names of the modeling views to be found.
(String) model_view_name: "drawing1,drawing2";
3. (Optional) Specify a default log option for the checker.
- (Integer) log_type:
1 - LOG_ERROR
2 - LOG_WARNING
3 - LOG_INFO
=============================================================================================
#-
DefClass: %mqc_check_modeling_view_name( %ug_base_checker );
# Check-Mate attributes and parameters
( String ) %test_category: "Template.File Structure";
( String ) %displayed_name: "Check Modeling View";
( Boolean Parameter ) disabled?: false;
( Boolean Parameter ) save_log_in_part: true;
# Checker specific parameters and attributes
( String Parameter ) model_view_name: "";
( String ) model_view_name_label: "Modeling View Name(s)";
# parameter for log_option
( Integer Parameter ) log_type: 1;
( List ) log_type_option: { LOG_ERROR, LOG_WARNING, LOG_INFO };
( String ) log_type_label: "Log Option";
# parameter for log_message
( String Parameter ) log_msg: "";
( String ) log_msg_label: "Log Additional Message";
( Integer ) view_type: 1;
( List ) view_names_to_check:
If -( model_view_name: = "" ) & -( model_view_name: = noValue )
Then Splitstring( model_view_name:, "," )
Else {};
# Checking ...
( Any Uncached ) do_check:
If empty?( view_names_to_check: )
Then
ug_mqc_empty_param_warning()
Else
ug_mqc_checkViewNames( view_type:,
view_names_to_check:,
nth( log_type:, log_type_option: ),
log_msg: );