1 2# JStrack: copyright 1997/2010 by Jim Graham, N5IAL, all rights reserved. 3# 4 5proc get_st_type {name timestamp} { return [get_st_root $name $timestamp 0] } 6proc get_st_name {name timestamp} { return [get_st_root $name $timestamp 1] } 7proc get_st_ts {name timestamp} { return [get_st_root $name $timestamp 2] } 8proc get_st_latt {name timestamp} { return [get_st_root $name $timestamp 3] } 9proc get_st_long {name timestamp} { return [get_st_root $name $timestamp 4] } 10proc get_st_course {name timestamp} { return [get_st_root $name $timestamp 5] } 11proc get_st_speed {name timestamp} { return [get_st_root $name $timestamp 6] } 12proc get_st_press {name timestamp} { return [get_st_root $name $timestamp 7] } 13proc get_st_winds {name timestamp} { return [get_st_root $name $timestamp 8] } 14proc get_st_cat {nm ts} { 15 if {[string compare [get_st_type $nm $ts] "HR"] == 0} { 16 return "CAT [st_cat [get_st_winds $nm $ts]]" 17 } else { 18 return "" 19 } 20} 21proc get_st_gusts {name timestamp} { return [get_st_root $name $timestamp 9] } 22proc get_st_eye {name timestamp} { return [get_st_root $name $timestamp 10] } 23 24proc get_st_root {name timestamp lidx} { 25 global stinfo 26 set idx "$name$timestamp" 27 if {[array get stinfo $idx] == ""} { return -1 } 28 set retval [lindex $stinfo($idx) $lidx] 29} 30 31 32proc get_st_radii {name timestamp winds} { 33 global stradii 34 set idx $name$timestamp$winds 35 if {[array get stradii $idx] == ""} { return [list] } 36 set retval [split $stradii($idx)] 37} 38 39 40proc get_fc_latt {nm ts fcts} { return [get_fc_root $nm $ts $fcts 0] } 41proc get_fc_long {nm ts fcts} { return [get_fc_root $nm $ts $fcts 1] } 42proc get_fc_winds {nm ts fcts} { return [get_fc_root $nm $ts $fcts 2] } 43proc get_fc_gusts {nm ts fcts} { return [get_fc_root $nm $ts $fcts 3] } 44 45proc get_fc_root {name timestamp fcts lidx} { 46 global forecasts 47 set idx "$name $timestamp $fcts" 48 if {[array get forecasts $idx] == ""} { return -1 } 49 set retval [lindex $forecasts($idx) $lidx] 50} 51 52 53proc get_fc_radii {name timestamp fcts winds} { 54 global fc_stradii 55 set idx $name$timestamp$fcts$winds 56 if {[array get fc_stradii $idx] == ""} { return [list] } 57 set retval [split $fc_stradii($idx)] 58} 59 60 61 62