Changeset 5189


Ignore:
Timestamp:
Apr 2, 2015 11:41:28 AM (9 years ago)
Author:
mmh
Message:

make sure computed uniform does not exceed min or max

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/uq/gui/scripts/probdisteditor.tcl

    r5182 r5189  
    200200# ----------------------------------------------------------------------
    201201itcl::body Rappture::ProbDistEditor::value {{newval ""}} {
    202     #puts "PDE::value $newval"
     202    puts "PDE::value $newval"
    203203
    204204    #FIXME: _value has numerical values _uvalue has value with units
     
    286286# ----------------------------------------------------------------------
    287287itcl::body Rappture::ProbDistEditor::mode {{newval ""}} {
    288     #puts "PDE::mode mode=$newval min=$_umin max=$_umax units=$_units"
     288    puts "PDE::mode mode=$newval min=$_umin max=$_umax units=$_units"
    289289
    290290    set modes {exact uniform gaussian custom}
     
    311311            set min ""
    312312        } else {
    313             set min [Rappture::Units::convert $_umin -units off]
     313            set min [Rappture::Units::convert $_umin -context $_units -units off]
    314314        }
    315315        if {$_umax == ""} {
    316316            set max ""
    317317        } else {
    318             set max [Rappture::Units::convert $_umax -units off]
     318            set max [Rappture::Units::convert $_umax -context $_units -units off]
    319319        }
    320320    }
     
    338338                if {$_value(central) == 0.0} {
    339339                    set _value(max) 1.0
     340                }
     341                if {$min != ""} {
     342                    if {$_value(min) < $min} {
     343                        set $_value(min) $min
     344                    }
     345                }
     346                if {$max != ""} {
     347                    if {$_value(max) > $max} {
     348                        set $_value(max) $max
     349                    }
    340350                }
    341351                set _uvalue(min) $_value(min)$_units
     
    596606# ----------------------------------------------------------------------
    597607itcl::body Rappture::ProbDistEditor::_apply {op {widget ""}} {
    598     #puts "PDE::_apply $op $widget"
     608    puts "PDE::_apply $op $widget"
    599609    if {$op != "bindings"} {
    600610        # need this for value/finalize
Note: See TracChangeset for help on using the changeset viewer.