Changeset 477


Ignore:
Timestamp:
Dec 4, 2009 5:06:49 PM (13 years ago)
Author:
toby
Message:

# on 2001/10/31 20:04:21, toby did:
add next histogram feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/liveplot

    • Property rcs:date changed from 2001/10/31 20:02:37 to 2001/10/31 20:04:21
    • Property rcs:lines changed from +59 -2 to +54 -34
    • Property rcs:rev changed from 1.21 to 1.22
    r476 r477  
    17211721
    17221722# fill the histogram menu
    1723 if {[llength $expmap(powderlist)] > 1} {
     1723if {[llength $expmap(powderlist)] > 15} {
     1724    set expgui(plotlist) {}
    17241725    .a.file.menu entryconfigure Histogram -state normal
    17251726    menu .a.file.menu.hist
    1726     if {[llength $expmap(powderlist)] > 15} {
    1727         set i 0
    1728         foreach num [lsort -integer $expmap(powderlist)] {
    1729             incr i
    1730             # for now include, but disable histograms
    1731             set state disabled
    1732             if {[string range $expmap(htype_$num) 3 3] != "*"} {
    1733                 set state normal
    1734             }
    1735             if {$i == 1} {
    1736                 set num1 $num
    1737                 menu .a.file.menu.hist.$num1
    1738             }
    1739             .a.file.menu.hist.$num1 add radiobutton -label $num -value $num \
    1740                     -variable hst -state $state \
    1741                     -command {set cycle [getcycle];readdata .g}
    1742             if {$i >= 10} {
    1743                 set i 0
    1744                 .a.file.menu.hist add cascade -label "$num1-$num" \
    1745                         -menu .a.file.menu.hist.$num1
    1746             }
    1747         }
    1748         if {$i != 0} {
     1727    set i 0
     1728    foreach num [lsort -integer $expmap(powderlist)] {
     1729        incr i
     1730        # for now include, but disable histograms
     1731        set state disabled
     1732        if {[string range $expmap(htype_$num) 3 3] != "*"} {
     1733            set state normal
     1734            lappend expgui(plotlist) $num
     1735        }
     1736        if {$i == 1} {
     1737            set num1 $num
     1738            menu .a.file.menu.hist.$num1
     1739        }
     1740        .a.file.menu.hist.$num1 add radiobutton -label $num -value $num \
     1741                -variable hst -state $state \
     1742                -command {set cycle [getcycle];readdata .g}
     1743        if {$i >= 10} {
     1744            set i 0
    17491745            .a.file.menu.hist add cascade -label "$num1-$num" \
    17501746                    -menu .a.file.menu.hist.$num1
    17511747        }
    1752     } else {
    1753         foreach num [lsort -integer $expmap(powderlist)] {
    1754             # for now include, but disable unprocessed histograms
    1755             set state disabled
    1756             if {[string range $expmap(htype_$num) 3 3] != "*"} {
    1757                 set state normal
    1758             }
    1759             .a.file.menu.hist add radiobutton -label $num -value $num \
    1760                     -variable hst -state $state \
    1761                     -command {set cycle [getcycle];readdata .g}
    1762         }
    1763     }
    1764 }
    1765 
     1748    }
     1749    if {$i != 0} {
     1750        .a.file.menu.hist add cascade -label "$num1-$num" \
     1751                -menu .a.file.menu.hist.$num1
     1752    }
     1753} elseif {[llength $expmap(powderlist)] > 1} {
     1754    set expgui(plotlist) {}
     1755    .a.file.menu entryconfigure Histogram -state normal
     1756    menu .a.file.menu.hist
     1757    foreach num [lsort -integer $expmap(powderlist)] {
     1758        # for now include, but disable unprocessed histograms
     1759        set state disabled
     1760        if {[string range $expmap(htype_$num) 3 3] != "*"} {
     1761            set state normal
     1762            lappend expgui(plotlist) $num
     1763        }
     1764        .a.file.menu.hist add radiobutton -label $num -value $num \
     1765                -variable hst -state $state \
     1766                -command {set cycle [getcycle];readdata .g}
     1767    }
     1768} else {
     1769    set expgui(plotlist) [lindex $expmap(powderlist) 0]
     1770}
     1771# N = load next histogram
     1772bind . <Key-n> {
     1773    set i [lsearch $expgui(plotlist) $hst]
     1774    incr i
     1775    if {$i >= [llength $expgui(plotlist)]} {set i 0}
     1776    set hst [lindex $expgui(plotlist) $i]
     1777    set cycle [getcycle];readdata .g
     1778}
     1779bind . <Key-N> {
     1780    set i [lsearch $expgui(plotlist) $hst]
     1781    incr i
     1782    if {$i >= [llength $expgui(plotlist)]} {set i 0}
     1783    set hst [lindex $expgui(plotlist) $i]
     1784    set cycle [getcycle];readdata .g
     1785}
    17661786updateifnew
    17671787donewaitmsg
Note: See TracChangeset for help on using the changeset viewer.