Changeset 738


Ignore:
Timestamp:
May 16, 2007 7:37:45 PM (17 years ago)
Author:
mmc
Message:

Fixed a problem recently introduced with device structures on the
input side. app-rtd was having trouble changing the structure when
you changed devices via the loader.

Fix for support ticket #1631 'can't read "_axis(click-x)": no such
variable'. Added some code to guard against the case when release
gets called somehow before click.

Fix for support ticket #1688 'can't use empty string as operand of "-"'
Fix for support ticket #1689 'divide by zero'
Fix for support ticket #1707 'can't read "_dobj2cols(-energy)":
no such element in array'
All of these fixes had to do with the energy viewer, particularly
in the case where there was only 1 energy level, so the homo/lumo
levels could not be displayed.

Fix for support ticket #1704 'impossible limits (min 1.58489 >=
max 6.30957e-05)'
Added some code to guard against setting limits where min >= max.

Location:
trunk/gui/scripts
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/deviceViewer1D.tcl

    r729 r738  
    868868        add $itk_option(-device)
    869869    }
    870     after cancel [list catch [itcl::code $this _loadDevice]]
    871     after idle [list catch [itcl::code $this _loadDevice]]
    872 }
     870    _loadDevice
     871}
  • trunk/gui/scripts/energyLevels.tcl

    r676 r738  
    362362        }
    363363    }
     364
     365    if {"" != $_emin && $_emin == $_emax} {
     366        set _emin [expr {$_emin-0.1}]
     367        set _emax [expr {$_emax+0.1}]
     368    }
     369
    364370    set _eviewmin ""  ;# reset zoom view
    365371    set _eviewmax ""
     
    471477                set _ehomo [lindex $elist $nhomo]
    472478                set _elumo [lindex $elist $nlumo]
    473                 set gap [expr {$_elumo - $_ehomo}]
    474                 set _edefmin [expr {$_ehomo - 0.3*$gap}]
    475                 set _edefmax [expr {$_elumo + 0.3*$gap}]
    476 
    477                 set y [expr {($_ehomo-$_emin)*$e2y + $yzoom0}]
    478                 set id [$c create rectangle $xx0 $y $xx1 $y0 \
    479                     -stipple [Rappture::icon rdiag] \
    480                     -outline "" -fill $itk_option(-shadecolor)]
    481                 $c lower $id
     479                if {"" != $_elumo && "" != $_ehomo} {
     480                    set gap [expr {$_elumo - $_ehomo}]
     481                    set _edefmin [expr {$_ehomo - 0.3*$gap}]
     482                    set _edefmax [expr {$_elumo + 0.3*$gap}]
     483
     484                    set y [expr {($_ehomo-$_emin)*$e2y + $yzoom0}]
     485                    set id [$c create rectangle $xx0 $y $xx1 $y0 \
     486                        -stipple [Rappture::icon rdiag] \
     487                        -outline "" -fill $itk_option(-shadecolor)]
     488                    $c lower $id
     489                }
    482490            }
    483491        }
     
    543551        }
    544552
    545         if {"" != $_ehomo && "" != $_elumo} {
     553        if {"" != $topdobj && "" != $_ehomo && "" != $_elumo} {
    546554            set ecol $_dobj2cols($topdobj-energy)
    547555            set units [$topdobj columns -units $ecol]
  • trunk/gui/scripts/field.tcl

    r732 r738  
    349349                set nv $value
    350350            }
    351             if {![string is double -strict $nv]
     351            if {![string is double $nv]
    352352                  || [regexp -nocase {^(inf|nan)$} $nv]} {
    353353                error "Value out of range"
  • trunk/gui/scripts/gauge.tcl

    r730 r738  
    234234        switch -- $itk_option(-type) {
    235235            integer {
    236                 if {![string is integer -strict $nv]} {
     236                if {![string is integer $nv]} {
    237237                    error "Should be an integer value"
    238238                }
    239239            }
    240240            real {
    241                 if {![string is double -strict $nv]
     241                if {![string is double $nv]
    242242                      || [regexp -nocase {^(inf|nan)$} $nv]} {
    243243                    error "Should be a real number"
  • trunk/gui/scripts/xyresult.tcl

    r736 r738  
    721721                }
    722722            }
    723             if {$min != $max} {
     723            if {$min < $max} {
    724724                $g axis configure $axis -min $min -max $max
    725725            } else {
     
    10101010            if {[llength $args] != 3} {
    10111011                error "wrong # args: should be \"_axis drag axis x y\""
     1012            }
     1013            if {![info exists _axis(moved)]} {
     1014                return  ;# must have skipped click event -- ignore
    10121015            }
    10131016            set axis [lindex $args 0]
     
    10661069                error "wrong # args: should be \"_axis release axis x y\""
    10671070            }
     1071            if {![info exists _axis(moved)]} {
     1072                return  ;# must have skipped click event -- ignore
     1073            }
    10681074            set axis [lindex $args 0]
    10691075            set x [lindex $args 1]
    10701076            set y [lindex $args 2]
    10711077
    1072             if {![info exists _axis(moved)] || !$_axis(moved)} {
     1078            if {!$_axis(moved)} {
    10731079                # small movement? then treat as click -- pop up axis editor
    10741080                set dx [expr {abs($x-$_axis(click-x))}]
Note: See TracChangeset for help on using the changeset viewer.