#!/icem4.0/bin/bltwish

# This code is shared by all the ICEM CFD GUI's.
#
# Copyright (c) 1996 Pacific Marketing and Consulting, Inc,
#       and ICEM Systems, GmbH.  All rights reserved.
# Author:  Wayne A. Christopher, wayne@icemcfd.com
#
# Usage: famboco_edit.tcl [ bocos | mparams | sparams ] file solver

set argv {sparams family_boco Attila}

set is_win 0
set has_blt 0

if {$tcl_version >= 8.3} {
    lappend auto_path $env(ICEM_ACN)/lib/bwidget
    package require BWidget
} else {
    lappend auto_path $env(ICEM_ACN)/lib/BWidget-1.2.1
    package require BWidget
}

if [info exists env(GUIBASE_DIR)] {
    set guibase_dir $env(GUIBASE_DIR)
} else {
    set guibase_dir $env(ICEM_ACN)/lib/med/guibase
}

foreach f {
    family_boco
    mesh_params
    forms
    formutil
    misc
    settings
    sizes
    choose_one
    toplevel
    help
    bubble
    questionbox
    cursors
    fileselect
    exec_cmds
} {
    source $guibase_dir/$f.tcl
}

proc mess {line args} { puts -nonewline $line }
proc busy args {}
if $is_win {
    set botform_geo -0-25
} else {
    set botform_geo -0-0
}

set what [lindex $argv 0]
set file [lindex $argv 1]
set solver [lindex $argv 2]

wm withdraw .
compute_sizes
#famboco_load $file
famboco_set_solver "" $solver
source attila.tcl

set sname attila
set project_dir attila_test
switch $what {
    bocos {
	set ok [famboco_edit $solver]
    }
    sparams {
	set ok [famboco_edit_params $sname]
    }
    mparams {
	set ok [meshparam_edit]
    }
}
if $ok {
    famboco_save $file
}

exit 0
