1
2# JStrack:  copyright 1997/2010 by Jim Graham, N5IAL, all rights reserved.
3#
4
5# The following aren't config variables, as such, but some are used here
6
7set noreconfig 0 ;# Not a config variable---used when handling resize
8                 ;# (which is currently disabled, since it doesn't work!)
9set altprint 0   ;# Not a config variable---set to 1 when using alt
10                 ;# colors (for printing)
11set mapwidth 1275 ;# Current width for all maps (used for setting c_w)
12set mapheight 728 ;# Current height for all maps (used for setting c_h)
13# More non-config variables
14set east_coast_image 0 ;# map loaded (standard colors)
15set gulf_coast_image 0 ;# map loaded (standard colors)
16set carib_image 0 ;# map loaded (standard colors)
17set full_map_image 0   ;# map loaded (standard colors)
18# Do NOT modify the next line!  Bad things will happen if you do....
19set info_text "JStrack, by Jim Graham,   http://www.purl.org/net/jstrack"
20
21
22proc defaultval {variable value} {
23   upvar #0 $variable lvar
24   global defaultvalue
25   set lvar $value
26   set defaultvalue($variable) $value
27}
28
29# PROGRAM DEFAULTS for config variables (DO NOT CHANGE VALUES HERE)
30
31defaultval defmap large_js
32defaultval units MPH
33defaultval auto_fc 1
34defaultval auto_radii 1
35defaultval auto_update 1
36defaultval auto_load_new 1
37
38if {[string compare $shell "Tcl/Tk"] == 0} {
39   defaultval maxx [lindex [wm maxsize .] 0]
40   defaultval maxy [lindex [wm maxsize .] 1]
41   defaultval c_w [min [expr {int($maxx * 0.95)}] $mapwidth]
42   defaultval c_h [min [expr {int($maxy * 0.75)}] $mapheight]
43   # defaultval c_w 640 ;# for testing....
44   # defaultval c_h 480 ;# for testing....
45} else {
46   defaultval c_w 0 ;# not used...but set just to be safe
47   defaultval c_h 0 ;# not used...but set just to be safe
48}
49
50defaultval text_font {Courier 15}
51defaultval show_ptrloc 1
52defaultval warn_at_nm 60
53defaultval update_prog ""
54defaultval pos_est_prog ""
55defaultval current_prog ""
56defaultval forecast_prog ""
57
58defaultval home_long 86.61
59defaultval home_latt 30.43
60
61
62#########################################################################
63# DEFINITION OF jstrackrc VARIABLE
64#########################################################################
65
66# NOTE:  jstrackrc should not need to be changed under UNIX.
67# Likewise, users on Windows NT/2k/XP (and possibly 95/98---I don't
68# have those to test) shouldn't need to change this, either.
69#
70# HOWEVER, anyone trying to run this under a Mac, etc., may want to
71# change this variable to a more suitable value.  This variable points
72# to individual users' config files.  It must be defined, but it does
73# not have to point to an existing file (i.e., if the file doesn't
74# exist, it just isn't opened).
75#
76# Oh, one more thing....  If this value points to a filename that can't
77# be opened (for append) on your system, the ``Save Config'' option will
78# not work.
79
80set sys_os $tcl_platform(platform)
81
82if {$sys_os == "unix" && [info exists env(HOME)]} {
83   defaultval jstrackrc $env(HOME)/.jstrackrc
84} elseif {$sys_os == "windows" && [info exists env(USERPROFILE)]} {
85   defaultval d "$env(USERPROFILE)/Application Data/JStrack"
86   if {[file exists $d ] && ![file isdirectory $d]} {
87      catch { file delete $d }
88   }
89   if {![file exists $d]} { file mkdir $d }
90   defaultval jstrackrc $d/jstrackrc
91} else {
92   defaultval jstrackrc jstrackrc
93}
94
95
96
97