- Timestamp:
- Dec 7, 2006, 3:46:45 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/gauge.tcl
r442 r550 213 213 # the value is bound by any min/max value constraints. 214 214 # 215 # Keep track of the inputted units so we can give a 216 # response about min and max values in familiar units. 217 # 215 218 set newval [set nv [lindex $args 0]] 216 219 set units $itk_option(-units) 217 220 if {$units != ""} { 221 set nvUnits [Rappture::Units::Search::for $nv] 218 222 set newval [Rappture::Units::convert $newval \ 219 223 -context $units] … … 223 227 224 228 if {"" != $itk_option(-minvalue)} { 225 set minv $itk_option(-minvalue)229 set convMinVal [set minv $itk_option(-minvalue)] 226 230 if {$units != ""} { 227 231 set minv [Rappture::Units::convert $minv \ 228 232 -context $units -to $units -units off] 233 set convMinVal [Rappture::Units::convert \ 234 $itk_option(-minvalue) -to $nvUnits] 229 235 } 230 236 if {$nv < $minv} { 231 error "minimum value allowed here is $ itk_option(-minvalue)"237 error "minimum value allowed here is $convMinVal" 232 238 } 233 239 } 234 240 235 241 if {"" != $itk_option(-maxvalue)} { 236 set maxv $itk_option(-maxvalue)242 set convMaxVal [set maxv $itk_option(-maxvalue)] 237 243 if {$units != ""} { 238 244 set maxv [Rappture::Units::convert $maxv \ 239 245 -context $units -to $units -units off] 246 set convMaxVal [Rappture::Units::convert \ 247 $itk_option(-maxvalue) -to $nvUnits] 240 248 } 241 249 if {$nv > $maxv} { 242 error "maximum value allowed here is $ itk_option(-maxvalue)"250 error "maximum value allowed here is $convMaxVal" 243 251 } 244 252 }
Note: See TracChangeset
for help on using the changeset viewer.