# Library functions for the scripting library (scrib)
#
# File: scrib/lib/hyperwidgets.tcl
#
# $Revision: 392323 $ on $Date: 2004-03-17 19:40:50 -0500 (Wed, 17 Mar 2004) $
# 
# Copyright (c) 1993-2003 ICEM CFD Engineering
#
#--------------------------------------------------------------------
#
# these are high level widgets for common frames
# they set specific lists of proc_scrib_data global hash slots!
#
#---------------------------------------------------

##

proc scrib_lib_hyperwidget_regression_notebook_page {} {

      scrib_app_data_notebook_page_begin "Regression settings"
      
	    scrib_app_data_entry -var testing_icem_acn -desc "Testing ICEM_ACN base:" \
                  -type dir -def "" -select 1 -allow_new 0
      
	    scrib_app_data_entry -var base_test_dir -desc "Base regression test models directory:" \
	          -type dir -def [pwd] -select 1 -allow_new 0
      
	    scrib_app_data_entry -var test_output_dir -desc "Regression output directory:" \
	          -type dir -def [file join [pwd] regression_out] -select 1 -allow_new 1
      
            scrib_app_data_choicelist -var test_site -def "berkeley" -desc "Testing site:" \
                        -choices {{"" "Guess"} {"pune" "Pune"} {"berkeley" "Berkeley"} \
				      {"livonia" "Livonia"}}

            scrib_app_data_choicelist -var test_bqs -def "icbqs" -desc "Batch-queueing system:" \
                        -choices {{"" "None"} {"icbqs" "IcBQS"} {"pbs" "PBS"} \
				      {"gridengine" "GridEngine"}}
            
            scrib_app_data_frame_begin "Platforms"
                  scrib_app_data_listbox -var plats_to_test -desc "" \
                        -choices_cmd "scrib_lib_regression_get_platforms" -multiple 1
            scrib_app_data_frame_end

            scrib_app_data_frame_begin "Options"
                  scrib_app_data_toggle -var report_to_maintainer -desc "Report problems to maintainer" -def 1
                  scrib_app_data_choicelist -var run_comparison -def "none" -desc "Perform comparisons" \
                        -choices {{"none" "None"} {"exact" "Exact"} {"fuzzy" "Fuzzy"} \
				      {"mapped" "Mapped"} {"quality" "Quality"} {"all" "All"}}
                  scrib_app_data_choicelist -var time_profiling -def "rel" -desc "Use time profiling" \
                        -choices {{"" "None"} {"rel" "Compare execution time"}}
	          #scrib_app_data_entry -var max_time -desc "Maximum time per model (seconds):" \
                  #      -type float -def "120000"
            scrib_app_data_frame_end
            
      scrib_app_data_notebook_page_end
}

## sets the following slots of proc_scrib_data global hash:
##       naspid_keystrings, naspid_nchar, naspid_offset

proc scrib_lib_hyperwidget_pidnaming_info {} {
    
    scrib_app_data_frame_begin "PID naming information"
    scrib_app_data_entry {
	naspid_keystrings
	"List of possible keystrings in CAD filename"
	string
	PART
    }
    scrib_app_data_entry {
	naspid_nchar
	"Length of PID string (number of characters)"
	int
	5
    }
    scrib_app_data_entry {
	naspid_offset
	"Offset of pid boundary from keystring boundary (+/- integer)"
	string
	+1
    }
    scrib_app_data_comment "Note: To get the PID of 99999 from the partfile named PART_09999900,\nthese values would be { PART , 5 , +3 } or { PART_ , 5 , +2 }.\nTo get the PID 999 from the partfile named 1234999_AB0000,\nthe values could be { {AA AB BB} , 3 , -2 }."
    
    scrib_app_data_frame_end
}

## sets the following slots of proc_scrib_data global hash:
##       mesh_size, ignore_tol, ignore_angle, num, size2

proc scrib_lib_hyperwidget_meshing_info {} {
    scrib_app_data_frame_begin "Meshing information"
    scrib_app_data_entry {
	mesh_size
	"Mesh size"
	float
	10
    }
    scrib_app_data_entry {
	ignore_tol
	"Ignore feature size"
	float
	5
    }
    scrib_app_data_entry {
	ignore_angle
	"Ignore feature angle"
	float
	30
    }
    scrib_app_data_entry {
	num
	"Remesh components with number of elements <"
	int
	100
    }
    scrib_app_data_entry {
	size2
	"Re-Mesh size"
	float
	5
    }
    
    scrib_app_data_frame_end
}

## sets the following slots of proc_scrib_data global hash:
##       welding_mode ("", vif, biwasm),
##       welding_file

proc scrib_lib_hyperwidget_welding_info {} {
    
    scrib_app_data_frame_begin "Weld information"
    
    scrib_app_data_choicelist {
	welding_mode
	"Type of WELD file"
	{{"" "None"} {vif "X Y Z PID1 PID2 PID3"} {biwasm "BIWASM"} }
	vif
    }
    scrib_app_data_entry_t -var welding_file -desc "Weld file" \
	    -type file -def "" -allow_new 0 -select 1 \
	    -active {{welding_mode vif} {welding_mode biwasm}}	
    
    scrib_app_data_frame_end
}

## sets the following slots of proc_scrib_data global hash:
##       offset, offset_file, offset_layers

proc scrib_lib_hyperwidget_offset_info {} {
    
    scrib_app_data_frame_begin "Offset information"
    
    scrib_app_data_choicelist {
	offset
	"Type of offset"
	{{0 "No offset"} {1 "Offset from file"} {2 "Offset from layers"}}
	0	
    }
    
    scrib_app_data_entry_t  \
	    -var offset_file \
	    -desc "Offset file" \
	    -type file \
	    -def "" \
	    -allow_new 1 \
	    -select 1 \
	    -active {{offset 1}}
    
    scrib_app_data_entry_t  \
	    -var offset_layers \
	    -desc "Layers of offset curves" \
	    -type string \
	    -def "" \
	    -active {{offset 2}}
    
    scrib_app_data_frame_end
}

## sets the following slots of proc_scrib_data global hash:
##       build_topo_tol, min_hole, med_hole, max_hole

proc scrib_lib_hyperwidget_feature_info {} {
    
    scrib_app_data_frame_begin "Feature information"
    
    scrib_app_data_entry {
	build_topo_tol
	"Gap tolerance"
	float
	0.2
    }
    scrib_app_data_entry {
	min_hole
	"Remove holes w/Diameter <"
	float
	5
    }
    scrib_app_data_entry {
	med_hole
	"4+ noded bolt hole (diameter upper limit <)"
	float
	15
    }
    scrib_app_data_entry {
	max_hole
	"6+ noded bolt hole (diameter upper limit <)"
	float
	30
    }
    
    scrib_app_data_frame_end
}

## sets the following slots of proc_scrib_data global hash:
##       wdir, record

proc scrib_lib_hyperwidget_runtimefile_info {} {
    scrib_app_data_frame_begin "Runtime file information"
    scrib_app_data_entry {
	wdir
	"Working directory"
	dir
	./wdir
	1
	1
    }
    scrib_app_data_entry {
	record
	"Record file"
	file
	app_bsm.log
	1
	1
    }
    scrib_app_data_frame_end
}

## sets the following slots of proc_scrib_data global hash :
##       cadsys, layers, cad_dir

proc scrib_lib_hyperwidget_import_info {} {
    
    scrib_app_data_frame_begin "Import information"
    
    scrib_app_data_choicelist {
	cadsys
	"Type of CAD file(s)"
	{{tetin "ICEM CFD tetin file"} {catia "CATIA"} {iges "IGES"} }
	tetin
    }
    scrib_app_data_entry_t  \
	    -var layers \
	    -desc "Layers of meshable surfaces" \
	    -type string \
	    -def "" \
	    -active {{cadsys catia}}
    
    scrib_app_data_entry {
	cad_dir
	"Directory of CAD file(s)"
	dir
	.
	1
	0
    }
    scrib_app_data_frame_end
}

## sets the following slots of proc_scrib_data global hash :
##     export_dir, export_file

proc scrib_lib_hyperwidget_nastranexport_info {} {
    
    scrib_app_data_frame_begin "Export information"
    scrib_app_data_entry {
	export_dir
	"Directory for Nastran files"
	dir
	.
	1
	1
    }
    scrib_app_data_entry {
	export_file
	"Name of assembled file"
	file
	assembly.nas
	1
	1
    }
    scrib_app_data_frame_end
}

#   sets the following slots of proc_scrib_data global hash :
#      
#proc scrib_lib_hyperwidget_ _info {} {}
