#!/usr/local/bin/wish -f # Copyright(c) 1998, Space Science and Engineering Center, UW-Madison # Refer to "McIDAS Software Acquisition and Distribution Policies" # in the file mcidas/data/license.txt # $Id: rt_raobdisp.gui,v 1.25 1998/10/13 20:26:48 dglo Exp $ # igtv.gui # # set guipath $env(GUIDIR) set auto_path "$guipath $auto_path" setoptions set level 1 # # Before we get the GUI built - set up all of the lists which will # be used to make the selections. # wm title . "McIDAS: PTDISP" wm iconname . "Display Upper Air Data" placegui . frame .frame -borderwidth 10 # Create buttons which line up at the top and will pack and # unpack frames depending upon the users level of expertise. # These will not be needed for all commands , as some are # too easy for progressive disclosure. # frame .top button .top.low -text "Less" -command {set level 1; pack unpack .frame.hi pack forget .top.low pack .top.hi -side left -expand yes pack .frame.low -side top -fill x -expand yes } button .top.hi -text "More" -command {set level 3; pack forget .top.hi pack .top.low -side left -expand yes pack .frame.low -side top -fill x pack .frame.hi -side top -fill x } button .top.help -text "Help" -command "mkHelp" pack .top.help -side right -expand yes pack .top.hi -side left -expand yes message .msg -width 400 -font $messfont -borderwidth 1 -text "Display Real-Time Upper Air Data" frame .frame.low # # parameters # frame .frame.low.parm menubutton .frame.low.parm.menu -relief raised\ -menu .frame.low.parm.menu.options\ -text "Parameter" -width 20 entry .frame.low.parm.entry -textvariable parm \ -relief groove -width 7 -state disabled menu .frame.low.parm.menu.options -tearoff 0 .frame.low.parm.menu.options add radio -label Dewpoint \ -variable parm -value TD -command {set fmt "I6" set unit ""} .frame.low.parm.menu.options add radio -label "Height" \ -variable parm -value Z -command {set fmt "I8" set unit ""} .frame.low.parm.menu.options add radio -label "Pressure" \ -variable parm -value P -command {set fmt "F7.2" set unit ""} .frame.low.parm.menu.options add radio -label Temperature \ -variable parm -value T -command {set fmt "I6" set unit ""} .frame.low.parm.menu.options add radio -label "Wind Direction" \ -variable parm -value DIR -command {set fmt "I3" set unit ""} .frame.low.parm.menu.options add radio -label "Wind Flag" \ -variable parm -value WIND -command {set fmt "FLAG" set unit ""} .frame.low.parm.menu.options add radio -label "Wind Speed" \ -variable parm -value SPD -command {set fmt "I5" set unit ""} pack .frame.low.parm.menu -side left -padx 10 pack .frame.low.parm.entry -side right -padx 10 pack .frame.low.parm -side top -pady 2 -fill both # # Contour Units # set unit "" frame .frame.low.unit menubutton .frame.low.unit.menu -text "Units" -relief raised \ -menu .frame.low.unit.menu.choices -width 20 # # Unit type menu. # menu .frame.low.unit.menu.choices -tearoff 0 .frame.low.unit.menu.choices add cascade -label "Linear Measure" \ -menu .frame.low.unit.menu.choices.lin .frame.low.unit.menu.choices add cascade -label "Pressure" \ -menu .frame.low.unit.menu.choices.pres .frame.low.unit.menu.choices add cascade -label "Temperature" \ -menu .frame.low.unit.menu.choices.temp .frame.low.unit.menu.choices add cascade -label "Wind" \ -menu .frame.low.unit.menu.choices.wind # # Linear measure units. # menu .frame.low.unit.menu.choices.lin -tearoff 0 .frame.low.unit.menu.choices.lin add radio -label "Centimeters (CM)" \ -value CM -variable unit .frame.low.unit.menu.choices.lin add radio -label "Decameters (DM)" \ -value DM -variable unit .frame.low.unit.menu.choices.lin add radio -label "Feet (FT)" \ -value FT -variable unit .frame.low.unit.menu.choices.lin add radio -label "Geopotential meters(GPM)" \ -value GPM -variable unit .frame.low.unit.menu.choices.lin add radio -label "Inches (IN)" \ -value IN -variable unit .frame.low.unit.menu.choices.lin add radio -label "Kilometers (KM)" \ -value KM -variable unit .frame.low.unit.menu.choices.lin add radio -label "Meters (M)" \ -value M -variable unit .frame.low.unit.menu.choices.lin add radio -label "Miles (MI)" \ -value MI -variable unit .frame.low.unit.menu.choices.lin add radio -label "Millimeters (MM)" \ -value MM -variable unit .frame.low.unit.menu.choices.lin add radio -label "Nautical Miles (MI)" \ -value NMI -variable unit .frame.low.unit.menu.choices.lin add radio -label "Yards (YD)" \ -value YD -variable unit # # Pressure units. # menu .frame.low.unit.menu.choices.pres -tearoff 0 .frame.low.unit.menu.choices.pres add radio -label "Hectopacals (HPA)" \ -value HPA -variable unit .frame.low.unit.menu.choices.pres add radio -label "Inches of Mercury (INHG)" \ -value INHG -variable unit .frame.low.unit.menu.choices.pres add radio -label "Millibars (MB)" \ -value MB -variable unit # # Temperature units. # menu .frame.low.unit.menu.choices.temp -tearoff 0 .frame.low.unit.menu.choices.temp add radio -label "Celsius (C)" \ -value C -variable unit .frame.low.unit.menu.choices.temp add radio -label "Fahrenheit (F)" \ -value F -variable unit .frame.low.unit.menu.choices.temp add radio -label "Kelvin (K)" \ -value K -variable unit # # Wind units. # menu .frame.low.unit.menu.choices.wind -tearoff 0 .frame.low.unit.menu.choices.wind add radio -label "Knots (KTS)" \ -value KTS -variable unit .frame.low.unit.menu.choices.wind add radio -label "Meters Per Second (MPS)" \ -value MPS -variable unit .frame.low.unit.menu.choices.wind add radio -label "Miles Per Hour (MPH)" \ -value MPH -variable unit entry .frame.low.unit.entry -textvariable unit -width 7 -relief groove \ -state disabled pack .frame.low.unit.menu -side left -padx 10 pack .frame.low.unit.entry -side right -padx 10 pack .frame.low.unit -side top -pady 2 -fill both frame .frame.low.levels menubutton .frame.low.levels.menu -relief raised -text "Level"\ -menu .frame.low.levels.menu.options -width 20 entry .frame.low.levels.entry -relief groove -width 7 \ -textvariable levels menu .frame.low.levels.menu.options -tearoff 0 .frame.low.levels.menu.options add radio -label 1000\ -variable levels -value 1000 .frame.low.levels.menu.options add radio -label 925\ -variable levels -value 925 .frame.low.levels.menu.options add radio -label 850\ -variable levels -value 850 .frame.low.levels.menu.options add radio -label 700\ -variable levels -value 700 .frame.low.levels.menu.options add radio -label 500\ -variable levels -value 500 .frame.low.levels.menu.options add radio -label 400\ -variable levels -value 400 .frame.low.levels.menu.options add radio -label 300\ -variable levels -value 300 .frame.low.levels.menu.options add radio -label 250\ -variable levels -value 250 .frame.low.levels.menu.options add radio -label 200\ -variable levels -value 200 .frame.low.levels.menu.options add radio -label 150\ -variable levels -value 150 .frame.low.levels.menu.options add radio -label 100\ -variable levels -value 100 .frame.low.levels.menu.options add radio -label TRO1\ -variable levels -value TRO1 .frame.low.levels.menu.options add radio -label SFC\ -variable levels -value SFC .frame.low.levels.menu.options add radio -label MAXW\ -variable levels -value MAXW pack .frame.low.levels.menu -side left -padx 10 pack .frame.low.levels.entry -side right -padx 10 pack .frame.low.levels -side top -fill both -pady 2 frame .frame.low.time menubutton .frame.low.time.menu -relief raised -text "Time" \ -menu .frame.low.time.menu.options -width 20 entry .frame.low.time.entry -textvariable time -relief groove\ -width 7 -state disabled menu .frame.low.time.menu.options -tearoff 0 .frame.low.time.menu.options add radio -label 0 -variable time\ -value 0 .frame.low.time.menu.options add radio -label 12 -variable time\ -value 12 set time [Now] if {$time > 0 && $time < 12 } { set time 0 } else { set time 12 } pack .frame.low.time.menu -side left -padx 10 pack .frame.low.time.entry -side right -padx 10 pack .frame.low.time -side top -pady 2 -fill both frame .frame.low.date -relief sunken -borderwidth 2 set today [Today] set pday $today set date [getnicedate $today 0 ] set jdate [getjdate $today 0] set offset 0 set pdate $date scale .frame.low.date.scale -orient horizontal\ -from -9 -to 0 -length 200 -showvalue YES\ -variable offset\ -command {set pdate "[getnicedate $today $offset] " set jdate "[getjdate $today $offset]" set junk } frame .frame.low.date.offday label .frame.low.date.offday.label -text "Date to plot : " entry .frame.low.date.offday.entry -textvariable pdate -state disabled \ -relief flat pack .frame.low.date.offday.label -side left pack .frame.low.date.offday.entry -side right pack .frame.low.date.offday -side top pack .frame.low.date.scale -side top pack .frame.low.date -side top -padx 2 -pady 2 # # Menu for map options # set map USA frame .frame.low.map entry .frame.low.map.entry -textvariable map -width 7 -relief groove \ -state disabled menubutton .frame.low.map.menu -text "Map" -relief raised \ -menu .frame.low.map.menu.choices -width 20 menu .frame.low.map.menu.choices -tearoff 0 .frame.low.map.menu.choices add radio -label "Define Lat/Lon (DEFINE)" \ -variable map -value DEFINE \ -command {enableLatLon .frame.low.lat .frame.low.lon} .frame.low.map.menu.choices add radio -label "Midwest USA (MID)" \ -variable map -value MID \ -command {disableLatLon .frame.low.lat .frame.low.lon set lat "" set lon ""} .frame.low.map.menu.choices add radio -label "North America (NA)" \ -variable map -value NA \ -command {disableLatLon .frame.low.lat .frame.low.lon set lat "" set lon ""} .frame.low.map.menu.choices add radio -label "Satellite (SAT)" \ -variable map -value SAT \ -command {disableLatLon .frame.low.lat .frame.low.lon set lat "" set lon ""} .frame.low.map.menu.choices add radio -label "USA (USA)" \ -variable map -value USA \ -command {disableLatLon .frame.low.lat .frame.low.lon set lat "" set lon ""} .frame.low.map.menu.choices add command -label "States" \ -command {set stype "map"; getstate disableLatLon .frame.low.lat .frame.low.lon set lat "" set lon ""} pack .frame.low.map.menu -side left -padx 10 pack .frame.low.map.entry -side right -padx 10 pack .frame.low.map -side top -pady 2 -fill both # # Latitude Bounds # set lat " " frame .frame.low.lat label .frame.low.lat.label -text "Latitude Min Max" -width 20 entry .frame.low.lat.entry -textvariable lat -width 7 -relief sunken \ -state disabled pack .frame.low.lat.label -side left -padx 10 pack .frame.low.lat.entry -side right -padx 10 pack .frame.low.lat -side top -pady 2 -fill both # # Longitude Bounds # set lon " " frame .frame.low.lon label .frame.low.lon.label -text "Longitude Min Max" -width 20 entry .frame.low.lon.entry -textvariable lon -width 7 -relief sunken \ -state disabled pack .frame.low.lon.label -side left -padx 10 pack .frame.low.lon.entry -side right -padx 10 pack .frame.low.lon -side top -pady 2 -fill both # # Lat/Lon Bounds start out disabled. # .frame.low.lat.label configure -foreground gray80 .frame.low.lon.label configure -foreground gray80 ptmore; # # Pack all the command widgets into the command frame # bindit $level if {$level == "1"} { pack append .frame \ .frame.low {top fill} } if {$level == 3} { pack append .frame \ .frame.low {top fill} \ } # # Make an OK button which will execute command and destroy widget # frame .bottom -relief raised button .bottom.ok -text OK -width 10 \ -command { if {$clev == "" || $clev == " "} {set colkey " " } else {set colkey [format "COLOR=%s" $clev]} if {$lat == "" || $lat == " "} {set latkey " " } else {set latkey [format "LAT=%s" $lat]} if {$lon == "" || $lon == " "} {set lonkey " " } else {set lonkey [format "LON=%s" $lon]} if {$lsize == "" || $lsize == " "} {set lsizekey " " } else {set lsizekey [format "LSIZE=%s" $lsize]} set pankey [format "PAN=%s" $panel] if {$mlev == "" || $mlev == " "} {set cmapkey " " } else {set cmapkey [format "MCOLOR=%s" $mlev]} if {$project == "" || $project == " "} {set prokey " " } else {set prokey [format "PRO=%s" $project]} if {$slat == "" || $slat == " "} {set slatkey " " } else {set slatkey [format "SLAT=%s" $slat]} if {$slon == "" || $slon == " "} {set slonkey " " } else {set slonkey [format "SLON=%s" $slon]} set fmtkey [format "FORMAT=%s" $fmt] # # Test for special map entries. # set mmap $map set mapkey [format "MAP=%s" $map] if {$map == "DEFINE"} { set mapkey " " } else { if {$map == "DEFAULT"} { set mapkey " " } else { if {$map == "SAT"} { set mapkey "NAV=C" } } } #------- # check mandatory fields are filled #------- set rcode 0 set rcode [expr $rcode + [checkmandfield $parm \ "Parameter"]] set rcode [expr $rcode + [checkmandfield $time \ "Time"]] set rcode [expr $rcode + [checkmandfield $levels \ "Level"]] if {$rcode == 0} { set select [format "SELECT='TIME $time ;DAY $jdate ;LEV $levels' "] set paramkey [format "PARAM=$parm\[$unit\]"] set dsname RTPTSRC/UPPERMAND set labkey "TDAY=CAL" RunCommand "PTDISP $dsname $paramkey $select $mapkey \ $colkey $latkey $lonkey $lsizekey \ $pankey $cmapkey $prokey $slatkey \ $slonkey $fmtkey $labkey" } } button .bottom.cancel -text Dismiss -command {destroy .} -width 10 pack .bottom.ok -side left -expand true -padx 20 pack .bottom.cancel -side right -expand true -padx 20 initStatus .bottom.status if [winfo exists .bottom.status] { pack .bottom.status -side left -expand true -padx 20 } # # Pack the message, the command and the OK buttons into the base widget # pack append . \ .top {top fill} \ .msg {top fill} \ .frame {top fill} \ .bottom {bottom fill} wm minsize . 10 10 proc mkHelp {} { global level messfont catch {destroy .help} toplevel .help wm title .help "Help - Display Upper Air" wm minsize .help 10 10 placehelp .help message .help.title -width 500 -font $messfont -text\ "Display Real-Time Upper Air Data" frame .help.frame -relief groove -borderwidth 2 scrollbar .help.frame.scroll -relief sunken \ -command ".help.frame.low yview" text .help.frame.low -relief flat -height 40 -width 60\ -yscroll ".help.frame.scroll set" .help.frame.low insert 0.0 { Parameter type of upper air point source data to display; the McIDAS-XCD server specified in the ADDE Client Routing Table must contain the group RTPTSRC; select ADDE from the File menu then click Edit Client Routing Table; see the Edit Client Routing Table help for more information Level data levels to plot Time time of upper air point source data Date to plot date of upper air point source data; the default is the current date; move the slider to specify upper air point source data from the past nine days Map geographical boundaries to plot Latitude Min Max minimum and maximum latitudes boundaries; active when Map Boundaries is set to DEFINE Longitude Min Max minimum and maximum longitude boundaries; active when Map Boundaries is set to DEFINE } if {$level == "3"} { .help.frame.low configure -height 40 -width 60 .help.frame.low insert end { Plot Color graphics color level for plot Label Height height of label in pixels Screen Panel graphics frame panel numbers for displaying the plot Units units for the plot; depends on the plotted parameters Map Color graphics color level for the map Projection projection for the plot Standard Latitude one value for polar stereographic projections; two values for Lambert conformal Standard Longitude normal longitude for polar stereographic and Lambert conformal projections Additional options are available using the PTDISP command from the McIDAS-X Text and Command Window. See the McIDAS-X User's Guide for more information. } } pack .help.frame.scroll -side right -fill both -expand yes pack .help.frame.low -side left -fill both button .help.ok -text " OK " -relief raise -borderwidth 2 \ -command {destroy .help} pack append .help \ .help.title {top} \ .help.ok {bottom }\ .help.frame {top} }