
# This code creates the ICEM CFD Manager.
#
# Copyright (c) 1993 - 1996 Pacific Marketing and Consulting, Inc,
#       and ICEM Systems, GmbH.  All rights reserved.
# Author:  Wayne A. Christopher, wayne@icemcfd.com

# This file contains the menu configuration for the manager.  Most of the
# routines listed here are defined in routines.tcl

proc add_menu_buttons {} {
    global icem_fluent gui_name
    
    make_menu file "    File    "
    make_menu util "    Utility    "
    make_menu app "    Applications    "
    
    # make_menu tnh "T & H"
    # make_menu tag "Tagging"
    
    make_menu trans "    Translation    "
    
    if $icem_fluent {
	make_menu output "    Transfer    "
    } else {
	make_menu output "    Output    "
    }
    make_menu help "    Help    "
}

proc add_menu_items {} {
    global icem_fluent icem_powermesh cfdcae icem_input_for_fluent icem_stamp
    global gui_name env icem_starcd is_win
    
    make_entry file "Open $gui_name(Conf)" o {} {config_open 0}
    
    make_entry file "New $gui_name(Conf)" {} {} {config_open 1}
    
    make_entry file "Copy $gui_name(Conf)" {} {} {config_copy}
    
    make_entry file "Rename $gui_name(Conf)" {} {} {config_rename}
    
    make_entry file "Delete $gui_name(Conf)" {} {} {config_delete}
    
    make_line file
    
    make_entry file "Open $gui_name(Geo)" {} {} {geom_open} high
    
    make_entry file "Copy $gui_name(Geo)" {} {} {geom_copy} high
    
    make_entry file "Rename $gui_name(Geo)" {} {} {geom_rename} high
    
    make_entry file "Delete $gui_name(Geo)" {} {} {geom_delete} high
    
    make_line file
    
    make_entry file "Copy Object Geometry" {} {} {config_objgeo} high
    
    # currently ignored for Fluent Option - GWH - 28.2.94
    
    make_entry file "Archive $gui_name(Conf)" {} {} {config_archive} high
    
    make_entry file "Un-archive $gui_name(Conf)" {} {} {config_unarchive} high
    
    make_entry file "Change Directory" {} {} {config_chdir}
    
    make_entry file "Copy Directory" {} {} {config_cpdir}
    
    make_entry file "Quit" q {} {config_quit}
    
    # -----------------------------------------------------------
    
    make_entry util "$cfdcae Modals" {} {} {util_edit_vars}
    
    make_entry util "Change Program Pathnames" {} {} {util_edit_paths} nfluent
    
    make_entry util "Change ICEM_ACN" {} {} {util_change_icem_acn} high
    
    make_line util
    
    make_entry util "UNIX Shell" {} {} {util_shell {}}
    
    make_entry util "Transfer Shell" {} {} {util_shell transfer}
    
    make_entry util "Mesh Dir Shell" {} {} {util_shell mesh}
    
    make_entry util "Delete Domains" {} {} util_delete_domains
    
    make_entry util "Mulcad -> Hexa" {} {} util_mulcad_convert
    
    make_entry util "Cleanup Padamm Scratch Files" {} {} {util_cleanup} high
    
    make_entry util "Stamping Shell" {} {} {util_shell stamping} stamp
    
    make_entry util "Text Editor" {} {} {util_editor}
    
    make_entry util "Gplot PostScript Output" {} {} {util_gplot}
    
    make_line util
    
    #make_entry util "Rebuild Linked Applications" {} {} {make_linked_apps}
    
    make_entry util "Execute Tcl Command" {} {} {util_tcl}
    
    make_entry util "Check License File" {} {} {util_check_lic}
    
    make_entry util "Check System Info" {} {} {check_sysinfo}
    
    make_entry util "Start License Server" {} {} {verify_license_daemon}
    
    make_entry util "Clear File Locking" {} {} {util_clear_lock}
    
    make_entry util "Play Game" {} {} {game} nfluent
    
    make_entry util "Delete P-Cube Undo Files" {} {} delete_undos nfluent
    
    make_entry util "Set P-Cube Tolerance" {} {} {set_pcube_user_tol} nfluent
    
    # -----------------------------------------------------------
    
    make_entry app "ICEM CFD 4.0 GUI" {} {} {app_med}
    
    make_line app
    if !$is_win {
        make_entry app "Unput" {} {} {app_unput} {HEXA TETRA GLOBAL UNPUT}
    }
    if {!$icem_fluent || $icem_input_for_fluent} {
	make_entry app "ICEM Input" I {} {app_input}
    }
    
    make_entry app "DDN" D {} {app_ddn}
    
    make_entry app "COMAK" {} {} {app_comak} COMAK
    
    make_entry app "AutoHex" "" "" app_autohex AUTOMDL
    
    make_line app
    
    make_entry app "P-Cube" P {} {app_blockmod} P-CUBE
    
    make_entry app "MULCAD" M {} {app_mulcad} MULCAD
    
    #make_entry app "Auto-comak" "" {} {app_auto_comak}
    
    make_line app
    
    make_entry app "DDN Mesher Interface" {} {} {app_ddn_tetra} \
	{HEXA TETRA GLOBAL CADMSIF}
    
    make_entry app "Hex Mesher" {} {} {app_hex} HEXA
    
    if $is_win {
	make_entry app "Tetra Mesher" {} {} {app_tetra_gui} TETRA
	make_entry app "Tetra Editor" {} {} {app_tetra_editor} TETRA
    } else {
	make_entry app "Tetra Mesher" {} {} {app_tetra_gui} TETRA
    }
    
    make_entry app "Global Mesher" {} {} {app_global_gui} GLOBAL
    
    # make_entry app "Triangle to Quad Mesher" {} {} {app_thex} HEXA
    
    make_entry app "Prism Mesher" {} {} {app_prism} PRISM
    
    make_entry app "PADAMM" {} {} {app_padamm} PADAMM
    
    make_entry app "Quad Mesher" {} {} {app_quad} QUAD
    
    make_line app
    if !$is_win {
        make_entry app "Leo" L {} {view_leo} LEO
    }    
    make_entry app "ICEM Visual3" {} {} {app_visual3} VISUAL3
    
    make_entry app "ICEM MOM3D" {} {} {app_mom3d} MOM3D
    
    make_entry app "ICEM Frontal" F {} {app_frontal} high
        
    if $icem_stamp { make_line app }
    
    make_entry app "DDN Stamping Interface" {} {} {app_stamp ddn} stamp
    
    make_entry app "Stamping Analysis" {} {} {app_stamp sta} stamp
    
    make_entry app "Stamping Results" {} {} {app_stamp leo} stamp
    
    make_entry app "Stamping Fld" {} {} {app_stamp fld} stamp
    
    
    # -----------------------------------------------------------
    
    make_entry trans "DDN -> IGES" {} {} {trans_ddn_iges} IGE
    
    make_entry trans "IGES -> DDN" {} {} {trans_iges_ddn} IGE
    
    if { !$icem_powermesh } { make_line trans }
    
    make_entry trans "DDN -> TVDA" {} {} {trans_ddn_tvda} TVD
    
    make_entry trans "TVDA -> DDN" {} {} {trans_tvda_ddn} TVD
    
    make_line trans
    
    make_entry trans "DDN -> SET" {} {} {trans_ddn_set} SET
    
    make_entry trans "SET -> DDN" {} {} {trans_set_ddn} SET
    
    make_line trans
    
    make_entry trans "DDN -> DXF" {} {} {trans_ddn_dxf} DXF
    
    make_entry trans "DXF -> DDN" {} {} {trans_dxf_ddn} DXF
    
    make_line trans
    
    make_entry trans "Plot3d -> Domain" {} {} {trans_plot3d_domain} high
    
    make_entry trans "Patran -> Domain" {} {} {trans_patran_domain} high
    
    make_entry trans "STL -> Domain" {} {} {trans_stl_domain} high
    
    make_entry trans "Nastran -> Domain" {} {} {trans_nastran_domain} high
    
    make_entry trans "Rampant -> Domain" {} {} {trans_rampant_domain} high
    
    make_entry trans "PreBFC -> DDN" {} {} {trans_prebfc_ddn} high
    
    # -----------------------------------------------------------
    
    if {!$icem_fluent && !$icem_powermesh} {
	make_entry output "Select Translator" {} {} {output_select_solver}
	make_entry output "Write Input" S {} {output_write}
	make_line output
	make_entry output "Run Smoother" {} {} {app_tetra_smoother}
	make_line output
	make_entry output "Global -> Unstructured" {} {} {output_g2u}
	
    } elseif $icem_fluent {
	make_entry output "Fluent/V4 Input" {} {} {output_write Fluent}
	make_entry output "Fluent/UNS Input" {} {} {output_write Fluent/UNS}
	make_entry output "Rampant Input" {} {} {output_write Rampant}
	make_entry output "TGrid Input" {} {} {output_write TGrid}
	make_entry output "Nekton Input" {} {} {output_write Nekton}
	make_entry output "Fluent/UNS_V2 Input" {} {} {output_write Fluent/UNS-V2}
    } elseif $icem_starcd {
	make_entry output "StarCD Input" {} {} {output_write STAR-CD}
	
    } else {
	make_entry output "Select Solver" {} {} {output_select_solver}
	make_entry output "Write Input" S {} {output_write} 
    }
    
    make_entry output "Structured -> Unstructured" {} {} {output_s2u}
    
    make_entry output "Structured -> Super" {} {} {output_super 0}
    
    make_entry output "Merge Unstruct Domains" {} {} {output_merge}
    
    make_entry output "Linear -> Quadratic" {} {} {output_qtet} high
    
    make_entry output "Uncouple refinement" {} {} {output_uncouple} high
    
    make_entry output "Reduce bandwidth" {} {} {output_bandwidth} high
    
    # -----------------------------------------------------------
    
    make_entry help "Help Browser" {} {} {help_topic base}
    
    #make_entry help "Dynatext Help" {} {} {help_show_manual Dynatext}
}
