
# JStrack:  copyright 1997/2010 by Jim Graham, N5IAL, all rights reserved.
#

# The following aren't config variables, as such, but some are used here

set noreconfig 0 ;# Not a config variable---used when handling resize
                 ;# (which is currently disabled, since it doesn't work!)
set altprint 0   ;# Not a config variable---set to 1 when using alt
                 ;# colors (for printing)
set mapwidth 1275 ;# Current width for all maps (used for setting c_w)
set mapheight 728 ;# Current height for all maps (used for setting c_h)
# More non-config variables
set east_coast_image 0 ;# map loaded (standard colors)
set gulf_coast_image 0 ;# map loaded (standard colors)
set carib_image 0 ;# map loaded (standard colors)
set full_map_image 0   ;# map loaded (standard colors)
# Do NOT modify the next line!  Bad things will happen if you do....
set info_text "JStrack, by Jim Graham,   http://www.purl.org/net/jstrack"


proc defaultval {variable value} {
   upvar #0 $variable lvar
   global defaultvalue
   set lvar $value
   set defaultvalue($variable) $value
}

# PROGRAM DEFAULTS for config variables (DO NOT CHANGE VALUES HERE)

defaultval defmap large_js
defaultval units MPH
defaultval auto_fc 1
defaultval auto_radii 1
defaultval auto_update 1
defaultval auto_load_new 1

if {[string compare $shell "Tcl/Tk"] == 0} {
   defaultval maxx [lindex [wm maxsize .] 0]
   defaultval maxy [lindex [wm maxsize .] 1]
   defaultval c_w [min [expr {int($maxx * 0.95)}] $mapwidth]
   defaultval c_h [min [expr {int($maxy * 0.75)}] $mapheight]
   # defaultval c_w 640 ;# for testing....
   # defaultval c_h 480 ;# for testing....
} else {
   defaultval c_w 0 ;# not used...but set just to be safe
   defaultval c_h 0 ;# not used...but set just to be safe
}

defaultval text_font {Courier 15}
defaultval show_ptrloc 1
defaultval warn_at_nm 60
defaultval update_prog ""
defaultval pos_est_prog ""
defaultval current_prog ""
defaultval forecast_prog ""

defaultval home_long 86.61
defaultval home_latt 30.43


#########################################################################
# DEFINITION OF jstrackrc VARIABLE
#########################################################################

# NOTE:  jstrackrc should not need to be changed under UNIX.
# Likewise, users on Windows NT/2k/XP (and possibly 95/98---I don't
# have those to test) shouldn't need to change this, either.
#
# HOWEVER, anyone trying to run this under a Mac, etc., may want to
# change this variable to a more suitable value.  This variable points
# to individual users' config files.  It must be defined, but it does
# not have to point to an existing file (i.e., if the file doesn't
# exist, it just isn't opened).
#
# Oh, one more thing....  If this value points to a filename that can't
# be opened (for append) on your system, the ``Save Config'' option will
# not work.

set sys_os $tcl_platform(platform)

if {$sys_os == "unix" && [info exists env(HOME)]} {
   defaultval jstrackrc $env(HOME)/.jstrackrc
} elseif {$sys_os == "windows" && [info exists env(USERPROFILE)]} {
   defaultval d "$env(USERPROFILE)/Application Data/JStrack"
   if {[file exists $d ] && ![file isdirectory $d]} {
      catch { file delete $d }
   }
   if {![file exists $d]} { file mkdir $d }
   defaultval jstrackrc $d/jstrackrc
} else {
   defaultval jstrackrc jstrackrc
}



