Changeset 56


Ignore:
Timestamp:
Sep 11, 2005 10:49:16 PM (16 years ago)
Author:
mmc
Message:
  • Changed the driver to recognize a new FULLSCREEN environment variable. When this is set, the driver goes into "web" mode, taking over the full screen of the desktop, as we normally do when running within the nanoHUB. This avoids the problem of having to edit the desktop/web setting in the driver file by hand during nanoHUB installations.
  • Fixed min/max scales for curves to work better.
  • Added seconds as recognized units.
Location:
trunk/gui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/driver

    r52 r56  
    9696wm withdraw .main
    9797
     98# if the FULLSCREEN variable is set, then nanoHUB wants us to go full screen
     99if {[info exists env(FULLSCREEN)]} {
     100    .main configure -mode web
     101}
     102
    98103#
    99104# The main window has a pager that acts as a notebook for the
  • trunk/gui/scripts/booleanentry.tcl

    r22 r56  
    135135itcl::body Rappture::BooleanEntry::tooltip {} {
    136136    set str [$_owner xml get $_path.about.description]
    137 
    138     set units [$_owner xml get $_path.units]
    139     set min [$_owner xml get $_path.min]
    140     set max [$_owner xml get $_path.max]
    141 
    142     if {$units != "" || $min != "" || $max != ""} {
    143         append str "\n\nEnter a number"
    144 
    145         if {$min != "" && $max != ""} {
    146             append str " between $min and $max"
    147         } elseif {$min != ""} {
    148             append str " greater than $min"
    149         } elseif {$max != ""} {
    150             append str " less than $max"
    151         }
    152 
    153         if {$units != ""} {
    154             set desc [Rappture::Units::description $units]
    155             append str " with units of $desc"
    156         }
    157     }
     137    append str "\n\nEnter a boolean value (1/0, on/off, yes/no, true/false)"
    158138    return [string trim $str]
    159139}
  • trunk/gui/scripts/curve.tcl

    r54 r56  
    116116    set max ""
    117117    switch -- $which {
    118         x { set pos 0; set log 0 }
    119         xlog { set pos 0; set log 1 }
    120         y - v { set pos 1; set log 0 }
    121         ylog - vlog { set pos 1; set log 1 }
     118        x { set pos 0; set log 0; set axis xaxis }
     119        xlog { set pos 0; set log 1; set axis xaxis }
     120        y - v { set pos 1; set log 0; set axis yaxis }
     121        ylog - vlog { set pos 1; set log 1; set axis yaxis }
    122122        default {
    123123            error "bad option \"$which\": should be x, xlog, y, ylog, v, vlog"
     
    156156    }
    157157    blt::vector destroy tmp zero
     158
     159    set val [$_curve get $axis.min]
     160    if {"" != $val && "" != $min} {
     161        if {$val > $min} {
     162            # tool specified this min -- don't go any lower
     163            set min $val
     164        }
     165    }
     166
     167    set val [$_curve get $axis.max]
     168    if {"" != $val && "" != $max} {
     169        if {$val < $max} {
     170            # tool specified this max -- don't go any higher
     171            set max $val
     172        }
     173    }
    158174
    159175    return [list $min $max]
  • trunk/gui/scripts/units.tcl

    r11 r56  
    478478
    479479Rappture::Units::define V -type voltage -metric yes
     480
     481Rappture::Units::define s -type seconds -metric yes
  • trunk/gui/scripts/xyresult.tcl

    r54 r56  
    553553            set min $_xmin
    554554            set max $_xmax
    555             if {$min > 0} {
    556                 set min [expr {0.95*$min}]
    557             } else {
    558                 set min [expr {1.05*$min}]
    559             }
    560             if {$max > 0} {
    561                 set max [expr {1.05*$max}]
    562             } else {
    563                 set max [expr {0.95*$max}]
    564             }
    565555        }
    566556        if {$min != $max} {
     
    579569            set max $_vlogmax
    580570            if {$min == $max} {
    581                 set min [expr {0.9*$min}]
    582                 set max [expr {1.1*$max}]
    583             }
    584             set v [expr {floor(log10($min))}]
    585             if {$v > 0} {
    586                 set min [expr {pow(10.0,$v)}]
    587             }
    588             set v [expr {floor(log10($max))}]
    589             if {$v > 0} {
    590                 set max [expr {pow(10.0,$v)}]
     571                set logmin [expr {floor(log10(abs(0.9*$min)))}]
     572                set logmax [expr {ceil(log10(abs(1.1*$max)))}]
     573            } else {
     574                # add a little padding
     575                set logmin [expr {floor(log10(abs($min)))}]
     576                set logmax [expr {ceil(log10(abs($max)))}]
     577                set delta [expr {$logmax-$logmin}]
     578                set logmin [expr {$logmin-0.05*$delta}]
     579                set logmax [expr {$logmax+0.05*$delta}]
     580            }
     581            if {$logmin < -300} {
     582                set min 1e-300
     583            } elseif {$logmin > 300} {
     584                set min 1e+300
     585            } else {
     586                set min [expr {pow(10.0,$logmin)}]
     587            }
     588
     589            if {$logmax < -300} {
     590                set max 1e-300
     591            } elseif {$logmax > 300} {
     592                set max 1e+300
     593            } else {
     594                set max [expr {pow(10.0,$logmax)}]
    591595            }
    592596        } else {
    593597            set min $_vmin
    594598            set max $_vmax
    595             if {$min > 0} {
    596                 set min [expr {0.95*$min}]
    597             } else {
    598                 set min [expr {1.05*$min}]
    599             }
    600             if {$max > 0} {
    601                 set max [expr {1.05*$max}]
    602             } else {
    603                 set max [expr {0.95*$max}]
    604             }
     599            set delta [expr {$max-$min}]
     600            set min [expr {$min-0.05*$delta}]
     601            set max [expr {$max+0.05*$delta}]
    605602        }
    606603        if {$min != $max} {
Note: See TracChangeset for help on using the changeset viewer.