Changeset 5315


Ignore:
Timestamp:
Apr 25, 2015 11:24:13 AM (9 years ago)
Author:
mmh
Message:

fix ScreenSize? bug and support multiple UQ runs with different UQ params

Location:
branches/uq
Files:
10 edited

Legend:

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

    r5182 r5315  
    399399itcl::body Rappture::Analyzer::simulate {args} {
    400400    puts "simulate args='$args'"
    401     if {$args == "-ifneeded"} {
     401
     402    set uq [$_tool get_uq -uq_type smolyak -uq_args 2]
     403
     404    # pop up UQ window
     405    if {[$uq num_runs] > 1} {
     406        set status [$uq run_dialog $itk_component(simulate)]
     407        if {$status == 0} {
     408            # cancelled
     409            return
     410        }
     411        lappend args -uq_type [$uq type]
     412        lappend args -uq_args [$uq args]
     413        # Need to put these UQ values into the driver file
     414        # so the call to resultset::contains will be correct.
     415        set _xml [$_tool xml object]
     416        $_xml put uq.type.current [$uq type]
     417        $_xml put uq.args.current [$uq args]
     418        $_xml put uq.args.about.label "level"
     419        $_xml put uq.args.about.description "Polynomial Degree of Smolyak GPC method."
     420    }
     421    puts "simulate args=$args"
     422
     423    if {[lindex $args 0] == "-ifneeded"} {
    402424        # check to see if simulation is really needed
    403425        $_tool sync
     
    408430            return
    409431        }
    410         set args ""
     432        set args [lreplace $args 0 0]
    411433    }
    412434    puts "simulation needed"
    413 
    414     set uq [$_tool get_uq -uq_type smolyak -uq_args 2]
    415     # pop up UQ window
    416     if {[$uq num_runs] > 1} {
    417         set status [$uq run_dialog $itk_component(simulate)]
    418         if {$status == 0} {
    419             # cancelled
    420             return
    421         }
    422         lappend args -uq_type [$uq type]
    423         lappend args -uq_args [$uq args]
    424     }
    425 
    426     puts "simulate args=$args"
    427435
    428436    # simulation is needed -- go to simulation page
     
    10561064        configure -simcontrolcolor $simcbg
    10571065
    1058         $itk_component(simulate) configure -state disabled
     1066        #$itk_component(simulate) configure -state disabled
    10591067        $itk_component(abort) configure -state normal
    10601068
  • branches/uq/gui/scripts/balloon.tcl

    r5245 r5315  
    142142    # set screenw [winfo screenwidth $p]
    143143    # set screenh [winfo screenheight $p]
    144     foreach {screenw screenh} [Rappture::ScreenSize [winfo screen $p]] break
     144    foreach {screenw screenh} [Rappture::ScreenSize] break
    145145
    146146    if {[winfo exists $where]} {
  • branches/uq/gui/scripts/dropdown.tcl

    r5222 r5315  
    8686    # set sw [winfo screenwidth $itk_component(hull)]
    8787    # set sh [winfo screenheight $itk_component(hull)]
    88     foreach {sw sh} [Rappture::ScreenSize [winfo screen $itk_component(hull)]] break
     88    foreach {sw sh} [Rappture::ScreenSize] break
    8989
    9090    if {[regexp {^@([0-9]+),([0-9]+)$} $where match x y]} {
  • branches/uq/gui/scripts/editor.tcl

    r5222 r5315  
    276276    set fnt [$e cget -font]
    277277
    278     foreach {screenw screenh} [Rappture::ScreenSize [winfo screen $e]] break
     278    foreach {screenw screenh} [Rappture::ScreenSize] break
    279279    set w [expr {[font measure $fnt $str]+20}]
    280280    set w [expr {($w < $_loc(w)) ? $_loc(w) : $w}]
  • branches/uq/gui/scripts/main.tcl

    r5222 r5315  
    356356
    357357    # set screenw [winfo screenwidth .]
    358     foreach {screenw screenh} [Rappture::ScreenSize [winfo screen .]] break
     358    foreach {screenw screenh} [Rappture::ScreenSize] break
    359359
    360360    update idletasks
  • branches/uq/gui/scripts/mainwin.tcl

    r5222 r5315  
    260260itcl::body Rappture::MainWin::draw {option args} {
    261261    set w $itk_component(hull)
    262     foreach {screenw screenh} [Rappture::ScreenSize [winfo screen $w]] break
     262    foreach {screenw screenh} [Rappture::ScreenSize] break
    263263    regsub -all {<w>} $args $screenw args
    264264    regsub -all {<h>} $args $screenh args
     
    365365            component hull configure -menu ""
    366366            pack forget $itk_component(app)
    367             foreach {wx wy} [Rappture::ScreenSize [winfo screen $itk_component(hull)]] break
     367            foreach {wx wy} [Rappture::ScreenSize] break
    368368            wm geometry $itk_component(hull) ${wx}x${wy}+0+0
    369369            _redraw
  • branches/uq/gui/scripts/pager.tcl

    r5222 r5315  
    412412# ----------------------------------------------------------------------
    413413itcl::body Rappture::Pager::_fixSize {} {
    414     foreach {screenw screenh} [Rappture::ScreenSize [winfo screen $itk_component(hull)]] break
     414    foreach {screenw screenh} [Rappture::ScreenSize] break
    415415    set sw [expr {$screenw-200}]
    416416    set sh [expr {$screenh-200}]
  • branches/uq/gui/scripts/tooltip.tcl

    r5222 r5315  
    160160    #
    161161    update idletasks
    162     foreach {screenw screenh} [Rappture::ScreenSize [winfo screen $hull]] break
     162    foreach {screenw screenh} [Rappture::ScreenSize] break
    163163    if {$signx == "+"} {
    164164        if {$xpos+[winfo reqwidth $hull] > $screenw} {
  • branches/uq/lang/tcl/scripts/library.tcl

    r5199 r5315  
    696696    set otherv [Rappture::entities $libobj input]
    697697
     698    # add UQ checking
     699    lappend thisv uq.type uq.args
     700    lappend otherv uq.type uq.args
     701
    698702    # scan through values for this object, and compare against other one
    699703    foreach path $thisv {
     
    717721        lappend rlist + $path "" $oraw
    718722    }
     723
    719724    return $rlist
    720725}
  • branches/uq/lang/tcl/src/RpScreenSize.c

    r5222 r5315  
    4545 *  RpScreenSizeCmd()
    4646 *
    47  *  Gets the screen width and height.
     47 *  Gets the screen width and height of the default DISPLAY
    4848 *
    4949 *  Returns TCL_OK on success, and TCL_ERROR (along with an error
     
    5959{
    6060    Tcl_Obj *resultPtr;
    61     char *display_name = "";
    6261    int w, h, screen;
    63 
    64     // parse through command line options
    65     if (argc != 2) {
    66         Tcl_AppendResult(interp,
    67                 "wrong # args: should be \"", argv[0],
    68                 " screen\"", (char*)NULL);
    69         return TCL_ERROR;
    70     }
    71 
    72     display_name = (char *)argv[1];
    7362
    7463    resultPtr = Tcl_GetObjResult(interp);
    7564
    76     Display *dpy = XOpenDisplay(display_name);
     65    Display *dpy = XOpenDisplay(NULL);
    7766    if (dpy == NULL) {
    7867        Tcl_AppendResult(interp,
    79                 "Could not find display for screen ",
    80                 display_name, (char*)NULL);
     68                "Could not open the display.", (char*)NULL);
    8169        return TCL_ERROR;
    8270    }
     
    8977    Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewIntObj(h));
    9078
     79    XCloseDisplay(dpy);
    9180    return TCL_OK;
    9281}
Note: See TracChangeset for help on using the changeset viewer.