Ignore:
Timestamp:
Oct 18, 2012, 9:03:17 PM (12 years ago)
Author:
mmc
Message:

Added the Rappture::Logger facility and updated many (not all)
of the input/output controls to use it. This logs user activity
so you can see how they are interacting with the widgets during
the course of a session. If the RAPPTURE_LOG variable is set to
a directory (like /tmp), then Rappture creates a unique log file
in this directory for each tool session and writes logging info
into that file. The middleware ensures that the file is write-only
so that private activity information doesn't get out to people who
try to snoop around.

File:
1 edited

Legend:

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

    r3177 r3186  
    4343    public method download {option args}
    4444
    45     public method play {}
    46     public method pause {}
     45    public method play {{why -program}}
     46    public method pause {{why -program}}
    4747    public method goto {{newval ""}}
    4848
     
    8787        button $itk_component(player).play \
    8888            -bitmap [Rappture::icon play] \
    89             -command [itcl::code $this play]
     89            -command [itcl::code $this play -user]
    9090    }
    9191    grid $itk_component(play) -row 0 -rowspan 2 -column 0 \
     
    103103    grid $itk_component(dial) -row 1 -column 1 -sticky ew
    104104    bind $itk_component(dial) <<Value>> [itcl::code $this _fixValue]
     105
     106    # use this command for logging "goto" interactions
     107    $itk_component(dial) configure -interactcommand \
     108        [format {Rappture::Logger::log sequence goto [%s get -format label current]} $itk_component(dial)]
    105109
    106110    itk_component add info {
     
    338342
    339343# ----------------------------------------------------------------------
    340 # USAGE: play
     344# USAGE: play ?-user|-program?
    341345#
    342346# Invoked when the user hits the "play" button to play the current
    343347# sequence of frames as a movie.
    344348# ----------------------------------------------------------------------
    345 itcl::body Rappture::SequenceResult::play {} {
     349itcl::body Rappture::SequenceResult::play {{why -program}} {
    346350    if { [llength $_indices] == 0 } {
    347351        return;                         # No frames (i.e. no data).
    348352    }
     353
     354    if {$why eq "-user"} {
     355        Rappture::Logger::log sequence play -loop $_play(loop) -speed $_play(speed)
     356    }
     357
    349358    # Stop any existing animation.
    350359    pause
     
    358367    $itk_component(play) configure \
    359368        -bitmap [Rappture::icon pause] \
    360         -command [itcl::code $this pause]
     369        -command [itcl::code $this pause -user]
    361370
    362371    global readyForNextFrame
     
    368377
    369378# ----------------------------------------------------------------------
    370 # USAGE: pause
     379# USAGE: pause ?-user|-program?
    371380#
    372381# Invoked when the user hits the "pause" button to stop playing the
    373382# current sequence of frames as a movie.
    374383# ----------------------------------------------------------------------
    375 itcl::body Rappture::SequenceResult::pause {} {
     384itcl::body Rappture::SequenceResult::pause {{why -program}} {
     385    if {$why eq "-user"} {
     386        Rappture::Logger::log sequence pause
     387    }
     388
    376389    if {"" != $_afterId} {
    377390        catch {after cancel $_afterId}
     
    387400        $itk_component(play) configure \
    388401            -bitmap [Rappture::icon play] \
    389             -command [itcl::code $this play]
     402            -command [itcl::code $this play -user]
    390403    }
    391404}
Note: See TracChangeset for help on using the changeset viewer.