Changeset 392


Ignore:
Timestamp:
Dec 4, 2009 5:05:24 PM (11 years ago)
Author:
toby
Message:

# on 2001/05/11 18:35:14, toby did:
test histograms before sending them to liveplot -- avoid errors on read

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsascmds.tcl

    • Property rcs:date changed from 2001/05/11 16:10:22 to 2001/05/11 18:35:14
    • Property rcs:lines changed from +27 -7 to +23 -4
    • Property rcs:rev changed from 1.32 to 1.33
    r388 r392  
    992992# run liveplot
    993993proc liveplot {} {
    994     global expgui liveplot wishshell
     994    global expgui liveplot wishshell expmap
    995995    set expnam [file root [file tail $expgui(expfile)]]
    996     exec $wishshell [file join $expgui(scriptdir) liveplot] \
    997             $expnam $liveplot(hst) $liveplot(legend) &
     996    # which histograms are ready for use?
     997    set validlist {}
     998    foreach ihist $expmap(powderlist) {
     999        if {[string range $expmap(htype_$ihist) 3 3] == ""} {
     1000            lappend validlist $ihist
     1001        }
     1002    }
     1003    if {[llength $validlist] == 0} {
     1004        MyMessageBox -parent . -title "No Valid Histograms" \
     1005                -message "No histograms are ready to plot. Run GENLES and try again" \
     1006                -icon warning -helplink "expguierr.html NoValidHist"
     1007        return
     1008    }
     1009    # use $liveplot(hst) if valid, the 1st entry otherwise
     1010    if {[lsearch $validlist $liveplot(hst)] != -1} {
     1011        exec $wishshell [file join $expgui(scriptdir) liveplot] \
     1012                $expnam $liveplot(hst) $liveplot(legend) &
     1013    } else {
     1014        exec $wishshell [file join $expgui(scriptdir) liveplot] \
     1015                $expnam [lindex $validlist 0] $liveplot(legend) &
     1016    }
    9981017}
    9991018
Note: See TracChangeset for help on using the changeset viewer.