The following is an example of a menu file (utilities.mnu), which comes from the CGNS utility programs package.
File:separator # File->Import menu File:Import:PLOT3D import plot3d_to_cgns plot3d_import plot3d.tcl File:Import:Tecplot import tecplot_to_cgns tecplot_import tecplot.tcl File:Import:Patran import patran_to_cgns patran_import patran.tcl File:Import:User import # File->Export menu File:Export:PLOT3D export cgns_to_plot3d plot3d_export plot3d.tcl File:Export:Tecplot export cgns_to_tecplot tecplot_export tecplot.tcl File:Export:User export # Utilities "Utilities:Solution Location" convert convert_location \ convert_location convert.tcl "Utilities:Solution Variables" convert convert_variables \ convert_variables convert.tcl Utilities:Dimensionalization convert convert_dataclass \ convert_dimensional convert.tcl Utilities:separator "Utilities:Extract Subset" convert extract_subset extract_subset util.tcl Utilities:Interpolation convert interpolate_cgns interpolate_cgns util.tclThis adds two cascade menus to the File menu (Import and Export), and creates a new toplevel menu item, Utilities, as shown below.
menu type command TCLscript TCLfilewhere menu is required and the others are optional. The values are white-space separated, so an input that contains spaces must be enclosed in double-quotes ("). Blank lines and comments in the file are ignored and an input line may be continued to the next line with the back-slash character (\) at the end of the line. Comments are indicated with the # character, which causes everything to the end of the line to be ignored.
Import routines read a non-CGNS file, and convert it to a CGNS file. An example of this is the plot3d_to_cgns program, which reads a PLOT3D file and writes out a CGNS file. This menu item will always be enabled in the CGNSview GUI. The following shows the default panel for import menu items.
The specification in the menu file in this case was
"Test:My Import" import "import_my_file option1 option2"When the Accept button is selected, the import command will be executed asimport_my_file option1 option2 InputFile CGNSoutputIf the command is successfull, then the CGNSview will read and display the CGNS file.
Export routines read a CGNS file, and convert it to a non-CGNS format. An example of this is the cgns_to_plot3d program, which reads a CGNS file and writes a PLOT3D file. This menu item will only be enabled after a CGNS file has been read into CGNSview. The following shows the default panel for export menu items.
The specification in the menu file in this case was
"Test:My Export" export export_cgnsWhen the Accept button is selected, the export command will be executed asexport_cgns CGNSinput OutputFileIf any options are specified, they will appear after the executable name and before the CGNS input file name.
This class of routines read a CGNS file, operate on it in some way, and then write a new CGNS file. An example is the convert_location utility program which converts between cell-center and vertex based solutions. This menu item will only be enabled after a CGNS file has been read into CGNSview. The following shows the default panel for convert menu items.
The specification in the menu file in this case was
"Test:My Conversion" convert convert_cgnsWhen the Accept button is selected, the convert command will be executed asconvert_cgns CGNSinput CGNSoutputIf any options are specified, they will appear after the executable name and before the CGNS input file name.
A utility processes a CGNS file, such as the cgnscheck program which reads a CGNS file and checks for SIDS compliance. This menu item will only be enabled after a CGNS file has been read into CGNSview. The following shows the default panel for utility menu items.
The specification in the menu file in this case was
"Test:My Utility" utility print_cgnsWhen the Accept button is selected, the utility command will be executed asprint_cgns CGNSinputIf any options are specified, they will appear after the executable name and before the CGNS input file name. If Run Command in Background is selected, then CGNSview will execute the command, but not wait for the command to finish.
This is the default behavior for a menu item if the type is not one of import, export, convert or utility. A command is simply executed by CGNSview and the menu item is always enabled. The following shows the default panel for command menu items.[previous] [index] [next]
The specification in the menu file in this case was
"Test:My Command" command "run_command options"When the Accept button is selected, the command will be executed asrun_command optionsIf Run Command in Background is selected, then CGNSview will execute the command, but not wait for the command to finish.