Results Postprocessing > Introduction to Results Postprocessing > 1.6 Results Title Editor
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
1.6 Results Title Editor
Results attributes forms that contain the Title Editor… or Results Title Editor button shown below open the Results Title Editor form when the button is pressed. If the Lock Titles checkbox is checked, the Title Editor button label changes to indicate that the Results Title Editor form will be opened in a readonly mode. In readonly mode the title may be viewed but not edited and the only active button is Cancel.
The readonly version of the Results Title Editor form is shown below.
The writable version of the Results Title Editor form is shown below.
The Results Title Editor form has three main regions. Each region, and its usage are described below.
The Sample Title textbox shows the current title similar to how it will look on the Results plot. If the Main Title variable is enabled, the string <Main Title> is shown to indicate that the main title will appear. The Main Title is the first title line. It includes the Patran version and the date and time of the plot.
Any enabled Results variables, are replaced by the Variable description shown in the Title Selection region. Any enabled pre-text or post-text is shown as it appears in the Title Selection region. Any variables with enabled As Is/NA have (AsIs/NA) appended to the variable description. Any enabled new lines cause a new line to be started.
The text in this region is updated each time a change is made in the Title Selection region, either by switching a toggle or by pressing the keyboard Enter button while focus is in one of the databoxes.
This textbox is readonly, however the cursor may be used to set the insertion position, which is then used as the insertion point for subsequently enabled variables. This procedure is explained in the Variable Insert Location section.
The Title Selection region is where most of the user interaction will occur. Control over which variables and text are included in the title is provided here. At the top of this region a set of column headings describe the meaning of the items in the rows below. Due to the number of items, a scrollframe is used to keep the form size reasonable. The scrollframe has three regions each with a line separator. At the top there are controls to set all of the toggles in the middle region either ON or OFF. Controls for all variables except Main Title are in the middle region. The bottom region provides control for the Main Title and two General Text entries.
The toggles in the Show column control the display of the information in each row. If the toggle is off in a row, none of the information in that row is shown. If a toggle is on, the enabled information in that row is shown. The toggles in the Show Pre-text column control the display of any text entered in the corresponding Pre-text databox. The databoxes in the Pre-text column provide a means of entering text to precede each variable. In a given row, if the Show toggle and the Show Pre-text toggle are enabled, the text in the Pre-text databox will be inserted before the variable. The text in the Variable column provides an easy-to-recognize meaning for the variable in each row. It is also the text that appears in the Sample Title as the variable value.
The toggles in the Show Post-text column control the display of any text entered in the corresponding Post-text databox. The databoxes in the Post-text column provide a means of entering text to follow each variable. In a given row, if the Show toggle and the Show Post-text toggle are enabled, the text in the Post-text databox will be inserted after the variable.
Show As Is/NA only comes into consideration if a variable’s value is AsIs or blank “”. The toggles in the Show As Is/NA column control the display of the value of certain variables depending on their value. For example, if the Averaging Domain value is blank "" or AsIs, its value will not be shown unless its Show As Is/NA toggle is enabled. Note that many of the variables do not have a Show As Is/NA toggle. This is because a value of AsIs has no meaning for these variables.
The toggles in the New Line column control the insertion of new line control variables. In a given row, if the Show toggle and the New Line toggle are enabled, a new line will be inserted after the variable and its post-text. Note that there is a 10-line limit to Results titles, which limits the number of new lines to nine. A counter is provided next to the New Line column heading for reference. No more than nine new lines will ever be entered into the title. No more than nine New Line toggles will ever be enabled in rows that also have the Show toggle enabled. Enabled New Line toggles in rows with disabled Show toggles do not affect the count.
All of the Show, Show Pre-text, Show Post-text and Show As Is/NA toggles in the middle region of the scrollframe may be turned ON or OFF by using the toggles labeled All in the top scrollframe region.
The bottom scrollframe region provides control for the Main Title and two General Text entries. The Main Title has already been described. The General Text entries provide a means of adding text to the title that is not associated to any variable. The General Text Start entry will appear at the start of the title while the General Text End entry will appear at the end of the title. Their Show toggles control their display.
When its parent form opens the Results Title Editor form, the current title is decoded and the Title Selection region toggles and databoxes are set. If no variables are found, the entire title is entered into the General Text Start databox.
The Action region has five buttons. The Defaults button sets the title to the default variables, pre-text’s, post-text’s, AsIs/NA and new line settings for the Results tool type. All current settings are overwritten. The Apply button applies the current title selection to the Results tool and leaves the form open. The OK button applies the current title selection to the Results tool and closes the form. The Apply button on the Attributes form must be selected to see the title update in the graphics viewport. The Reset button resets the title to the variables, pre-text’s, post-text’s, AsIs and new line settings it had when the form was last opened or when the Apply button was last selected. The Cancel button closes the form with no effect.
The settings.pcl preference:
pref_env_set_string( "results_title_editor_defaults", "my_defaults" )
may be used to override the standard defaults. If defined, and the function specified exists, the function will be called whenever the Defaults button is pressed. The prototype for this function is given below. An example of this function will be provided.
Variable Insert Location
Variables are inserted based on the current insert location. The insert location can be changed by placing the cursor into the Sample Title textbox and clicking to set the insertion point. The insertion point is indicated by a vertical bar. The editor determines which variable the insertion point is in. The insertion of a new variable will be immediately after the variable containing the insertion point. If the insertion point is never set, it will be at the end. If the insertion point is placed at the beginning of the textbox, the next variable inserted will be at the beginning. Turning a variable off and then on will remove it and then insert it back into its previous location. The insertion point is automatically updated such that subsequent insertions are placed after the previously inserted variable.
User-defined Defaults Function
To provide maximum flexibility to the user, a user-defined function may be provided to override any and all of the default title settings. Placing the following definition in the Patran settings.pcl file specifies a user-defined function.
pref_env_set_string( "results_title_editor_defaults", "my_defaults" )
Where my_defaults is the name of a function. If the results_title_editor_defaults preference is defined, and the specified function exists, the function will be called whenever the Defaults button is pressed. The prototype for this function is shown below. An example of this function will be provided.
FUNCTION my_defaults( tool_class, var, description, show, showPrefix, prefix, @
                       showSuffix, suffix, asIs, position, newLine )
/*
 * FUNCTION my_defaults
 * Returns default values for a given input variable.
 * All output variable values will already have been set to the Patran defaults.
 * This function needs only to modify those that the user wants modified.
 *
 * Input
 *   tool_class_in     class name of tool type (default == Fringe)
 *                     One of the following from "res_1_5_include.h":
 *
 * #define RES_TOOL_DEFORM_ATTR_CLASS_Q      "res_display_def_attr"
 * #define RES_TOOL_FRINGE_ATTR_CLASS_Q      "res_display_fri_attr"
 * #define RES_TOOL_2DCONTOUR_ATTR_CLASS_Q   "res_display_cont_attr"
 * #define RES_TOOL_3DCONTOUR_ATTR_CLASS_Q   "res_display_cont_3d_attr"
 * #define RES_TOOL_VECTOR_ATTR_CLASS_Q      "res_display_vec_attr"
 * #define RES_TOOL_TENSOR_ATTR_CLASS_Q      "res_display_ten_attr"
 * #define RES_TOOL_CURSOR_ATTR_CLASS_Q      "res_display_cur_attr"
 *
 *   var               A variable name
 *                     One of the following from "res_display.h":
 * 
 * #define RES_DISP_TITL_VAR_DATE2                "$DATE2"
 * #define RES_DISP_TITL_VAR_DATE                 "$DATE"
 * #define RES_DISP_TITL_VAR_TIME                 "$TIME"
 * #define RES_DISP_TITL_VAR_PRODUCT              "$PRODUCT"
 * #define RES_DISP_TITL_VAR_PROD                 "$PROD"
 * #define RES_DISP_TITL_VAR_DB_NAME              "$DB_NAME"
 * #define RES_DISP_TITL_VAR_DB_PATH              "$DB_PATH"
 * #define RES_DISP_TITL_VAR_JOB_NAME             "$JOB_NAME"
 * #define RES_DISP_TITL_VAR_CODE_NAME            "$CODE_NAME"
 * #define RES_DISP_TITL_VAR_GV                   "$GV"
 * #define RES_DISP_TITL_VAR_LC_NAME              "$LC_NAME"
 * #define RES_DISP_TITL_VAR_SC_NAME              "$SC_NAME"
 * #define RES_DISP_TITL_VAR_PRES_NAME            "$PRES_NAME"
 * #define RES_DISP_TITL_VAR_SRES_NAME            "$SRES_NAME"
 * #define RES_DISP_TITL_VAR_LYR_NAME             "$LYR_NAME"
 * #define RES_DISP_TITL_VAR_LOCATION             "$LOCATION"
 * #define RES_DISP_TITL_VAR_PLOT_TYPE            "$PLOT_TYPE"
 * #define RES_DISP_TITL_VAR_DATA_TYPE            "$DATA_TYPE"
 * #define RES_DISP_TITL_VAR_DERIVATION_L         "$DERIVATION_L"
 * #define RES_DISP_TITL_VAR_DERIVATION           "$DERIVATION"
 * #define RES_DISP_TITL_VAR_COORD_TRANS          "$COORD_TRANS"
 * #define RES_DISP_TITL_VAR_EXTRAP_METH          "$EXTRAP_METH"
 * #define RES_DISP_TITL_VAR_AVG_DOM              "$AVG_DOM"
 * #define RES_DISP_TITL_VAR_AVG_METH             "$AVG_METH"
 * #define RES_DISP_TITL_VAR_SCALE_FACT           "$SCALE_FACT"
 * #define RES_DISP_TITL_VAR_FILTER               "$FILTER"
 * #define RES_DISP_TITL_VAR_CUR_GROUP            "$CUR_GROUP"
 * #define RES_DISP_TITL_VAR_FRINGE_STYLE         "$FRINGE_STYLE"
 *
 * Output
 *   description       description (text that appears under "Variable" label)
 *   show              controls whether variable is shown
 *   showPrefix        controls whether prefix is shown
 *   prefix            prefix
 *   showSuffix        controls whether suffix is shown
 *   suffix            suffix string
 *   asIs              controls whether asIs is shown
 *   position          position of variable in title starting with 1
 *   newLine           controls whether a new line will follow the variable
 */
   STRING tool_class_in[], var[], description[], prefix[], suffix[]
   LOGICAL show, showPrefix, showSuffix, asIs, newLine
   INTEGER position
Examples of User-defined Defaults Function
Two examples of user-defined functions are given in this section. The first is simple and changes only a few defaults. The second is more complex, and is similar to the function used by Patran. See the section User-defined Defaults Function, 42 for a description of the function arguments.
To use the simple function, place the following definition in the Patran settings.pcl file:
pref_env_set_string( "results_title_editor_defaults", @
" simple_user_default_function " )
and make the function available by either compiling it in Patran using !!input or compiling it outside of Patran into a .plb and using !!library in Patran.
FUNCTION simple_user_default_function( @
tool_class_in, var, description, show, @
            showPrefix, prefix, showSuffix, suffix, @
            asIs, position, newLine )
 
   STRING tool_class_in[], var[], description[], prefix[], suffix[]
   LOGICAL show, showPrefix, showSuffix, asIs, newLine
   INTEGER position
   
   /*
    * Simply change the prefix and description of
    * some of the variables.
    */
   SWITCH( var )
      CASE( RES_DISP_TITL_VAR_CODE_NAME )
         prefix = "My Language A Code:"
         description = " My Language Code Name"
      CASE( RES_DISP_TITL_VAR_CUR_GROUP )
         prefix = " My Language Group:"
         description = " My Language Group"
      CASE( RES_DISP_TITL_VAR_DB_NAME )
         prefix = " My Language DbName:"
         description = " My Language Database Name"
      CASE( RES_DISP_TITL_VAR_DB_PATH )
         prefix = " My Language DbPath:"
         description = " My Language Path Name"
   END SWITCH
 
END FUNCTION
 
To use the complex function, place the following definition in the Patran settings.pcl file:
 
pref_env_set_string( "results_title_editor_defaults", @
" complex_user_default_function " )
 
and make the function available by either compiling it in Patran using !!input or compiling it outside of Patran into a .plb and using !!library in Patran.
 
 
FUNCTION complex_user_default_function( tool_class_in, var, description, show, @
                                        showPrefix, prefix, showSuffix, suffix, @
                                        asIs, position, newLine )
   STRING tool_class_in[], var[], description[], prefix[], suffix[]
   LOGICAL show, showPrefix, showSuffix, asIs, newLine
   INTEGER position
 
   STRING tool_class[MAX_TEXT_LENGTH]
 
   SWITCH( tool_class_in )
      CASE( RES_TOOL_FRINGE_ATTR_CLASS_Q, @
            RES_TOOL_DEFORM_ATTR_CLASS_Q, @
            RES_TOOL_2DCONTOUR_ATTR_CLASS_Q, @
            RES_TOOL_3DCONTOUR_ATTR_CLASS_Q, @
            RES_TOOL_VECTOR_ATTR_CLASS_Q, @
            RES_TOOL_TENSOR_ATTR_CLASS_Q, @
            RES_TOOL_CURSOR_ATTR_CLASS_Q, @
            RES_TOOL_CURSOR_ATTR_CLASS_Q )
         tool_class = tool_class_in
            
      DEFAULT
         tool_class = RES_TOOL_FRINGE_ATTR_CLASS_Q
   END SWITCH
      
 
   /* These are the most common. */
   
   show = TRUE
   showPrefix = FALSE
   showSuffix = TRUE
   suffix = ", "
   asIs = FALSE
   position = 0
   newLine = FALSE
 
   /* Set show. */
   
   SWITCH( var )
      CASE( RES_DISP_TITL_VAR_CODE_NAME,    @
            RES_DISP_TITL_VAR_CUR_GROUP,    @
            RES_DISP_TITL_VAR_DB_NAME,      @
            RES_DISP_TITL_VAR_DB_PATH,      @
            RES_DISP_TITL_VAR_DATE,         @
            RES_DISP_TITL_VAR_DATE2,        @
            RES_DISP_TITL_VAR_FRINGE_STYLE, @
            RES_DISP_TITL_VAR_GV,           @
            RES_DISP_TITL_VAR_JOB_NAME,     @
            RES_DISP_TITL_VAR_PRODUCT,      @
            RES_DISP_TITL_VAR_PROD,         @
            RES_DISP_TITL_VAR_DATA_TITLE,   @
            RES_DISP_TITL_VAR_SCALE_FACT,   @
            RES_DISP_TITL_VAR_TIME )
            
         show = FALSE
 
      CASE( RES_DISP_TITL_VAR_FILTER )
         IF( tool_class == RES_TOOL_DEFORM_ATTR_CLASS_Q ) THEN
            show = FALSE
         END IF
   END SWITCH
 
   /* Set showPrefix. */
   
   SWITCH( var )
      CASE( RES_DISP_TITL_VAR_AVG_DOM,      @
            RES_DISP_TITL_VAR_AVG_METH,     @
            RES_DISP_TITL_VAR_COORD_TRANS,  @
            RES_DISP_TITL_VAR_CUR_GROUP,    @
            RES_DISP_TITL_VAR_DATA_TYPE,    @
            RES_DISP_TITL_VAR_EXTRAP_METH,  @
            RES_DISP_TITL_VAR_FILTER,       @
            RES_DISP_TITL_VAR_FRINGE_STYLE, @
            RES_DISP_TITL_VAR_GV,           @
            RES_DISP_TITL_VAR_JOB_NAME,     @
            RES_DISP_TITL_VAR_LOCATION,     @
            RES_DISP_TITL_VAR_SCALE_FACT )
 
         showPrefix = TRUE
   END SWITCH
 
   /* Set asIs. */
 
   SWITCH( var )
      CASE( RES_DISP_TITL_VAR_AVG_DOM,      @
            RES_DISP_TITL_VAR_AVG_METH,     @
            RES_DISP_TITL_VAR_COORD_TRANS,  @
            RES_DISP_TITL_VAR_EXTRAP_METH,  @
            RES_DISP_TITL_VAR_FILTER )
            
         asIs = TRUE 
   END SWITCH
 
   /* Set position. */
 
   SWITCH( tool_class )
      CASE( RES_TOOL_DEFORM_ATTR_CLASS_Q )
         SWITCH( var )
            CASE( RES_DISP_TITL_VAR_PLOT_TYPE )
               position = 1
            CASE( RES_DISP_TITL_VAR_LC_NAME )
               position = 2
            CASE( RES_DISP_TITL_VAR_SC_NAME )
               position = 3
            CASE( RES_DISP_TITL_VAR_PRES_NAME )
               position = 4
            CASE( RES_DISP_TITL_VAR_SRES_NAME )
               position = 5
            CASE( RES_DISP_TITL_VAR_LYR_NAME )
               position = 6
            CASE( RES_DISP_TITL_VAR_LOCATION )
               position = 7
            CASE( RES_DISP_TITL_VAR_DATA_TYPE )
               position = 8
            CASE( RES_DISP_TITL_VAR_COORD_TRANS )
               position = 9
            CASE( RES_DISP_TITL_VAR_EXTRAP_METH )
               position = 10
            CASE( RES_DISP_TITL_VAR_AVG_DOM )
               position = 11
            CASE( RES_DISP_TITL_VAR_AVG_METH )
               position = 12
         END SWITCH
 
      DEFAULT
         SWITCH( var )
            CASE( RES_DISP_TITL_VAR_PLOT_TYPE )
               position = 1
            CASE( RES_DISP_TITL_VAR_LC_NAME )
               position = 2
            CASE( RES_DISP_TITL_VAR_SC_NAME )
               position = 3
            CASE( RES_DISP_TITL_VAR_PRES_NAME )
               position = 4
            CASE( RES_DISP_TITL_VAR_SRES_NAME )
               position = 5
            CASE( RES_DISP_TITL_VAR_DERIVATION_L )
               position = 6
            CASE( RES_DISP_TITL_VAR_LYR_NAME )
               position = 7
            CASE( RES_DISP_TITL_VAR_LOCATION )
               position = 8
            CASE( RES_DISP_TITL_VAR_DATA_TYPE )
               position = 9
            CASE( RES_DISP_TITL_VAR_COORD_TRANS )
               position = 10
            CASE( RES_DISP_TITL_VAR_EXTRAP_METH )
               position = 11
            CASE( RES_DISP_TITL_VAR_AVG_DOM )
               position = 12
            CASE( RES_DISP_TITL_VAR_AVG_METH )
               position = 13
            CASE( RES_DISP_TITL_VAR_FILTER )
               position = 14
         END SWITCH
   END SWITCH
 
   /* Set show suffix. */
 
   SWITCH( var )
      CASE( RES_DISP_TITL_VAR_LYR_NAME, @
            RES_DISP_TITL_VAR_FILTER )
         showSuffix = FALSE 
      CASE( RES_DISP_TITL_VAR_AVG_METH )
         IF( tool_class == RES_TOOL_DEFORM_ATTR_CLASS_Q ) THEN
            showSuffix = FALSE 
         END IF
   END SWITCH
 
   /* Set suffix. */
 
   SWITCH( var )
      CASE( RES_DISP_TITL_VAR_PLOT_TYPE )
         suffix = ": " 
      CASE( RES_DISP_TITL_VAR_GV )
         suffix = "Mode ," 
   END SWITCH
 
   /* Set newLine. */
 
   SWITCH( var )
      CASE( RES_DISP_TITL_VAR_LYR_NAME )
         newLine = TRUE 
   END SWITCH
 
END FUNCTION