Changeset 5005 for trunk


Ignore:
Timestamp:
Feb 11, 2015, 2:51:13 PM (10 years ago)
Author:
ldelgass
Message:

whitespace

File:
1 edited

Legend:

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

    r4692 r5005  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22
    33# ----------------------------------------------------------------------
    4 #  VisViewer - 
    5 #
    6 #  This class is the base class for the various visualization viewers 
     4#  VisViewer -
     5#
     6#  This class is the base class for the various visualization viewers
    77#  that use the nanoserver render farm.
    88#
     
    3232    private common _done            ;   # Used to indicate status of send.
    3333    private variable _buffer        ;   # buffer for incoming/outgoing commands
    34     private variable _initialized 
     34    private variable _initialized
    3535    private variable _isOpen 0
    3636    private variable _afterId -1
     
    7474    private method SendHelper {}
    7575    private method SendHelper.old {}
    76     private method WaitDialog { state } 
    77 
    78     protected method ToggleConsole {} 
    79     private method DebugConsole {} 
    80     private method BuildConsole {} 
    81     private method HideConsole {} 
    82     private method TraceComm { channel {data {}} } 
    83     private method SendDebugCommand {} 
     76    private method WaitDialog { state }
     77
     78    protected method ToggleConsole {}
     79    private method DebugConsole {}
     80    private method BuildConsole {}
     81    private method HideConsole {}
     82    private method TraceComm { channel {data {}} }
     83    private method SendDebugCommand {}
    8484
    8585    protected method CheckConnection {}
     
    8888    protected method Connect { servers }
    8989    protected method Disconnect {}
    90     protected method EnableWaitDialog { timeout } 
     90    protected method EnableWaitDialog { timeout }
    9191    protected method Euler2XYZ { theta phi psi }
    9292    protected method Flush {}
     
    102102    protected method SendEcho { channel {data ""} }
    103103    protected method StartBufferingCommands {}
    104     protected method StartWaiting {} 
     104    protected method StartWaiting {}
    105105    protected method StopBufferingCommands {}
    106     protected method StopWaiting {} 
    107 
    108     private method Waiting { option widget } 
     106    protected method StopWaiting {}
     107
     108    private method Waiting { option widget }
    109109
    110110    private proc CheckNameList { namelist }  {
     
    200200    global env
    201201    if { [info exists env(VISRECORDER)] } {
    202         set _logging 1
    203         if { [file exists /tmp/recording.log] } {
    204             file delete /tmp/recording.log
    205         }
     202        set _logging 1
     203        if { [file exists /tmp/recording.log] } {
     204            file delete /tmp/recording.log
     205        }
    206206    }
    207207    eval itk_initialize $args
     
    259259#    Connect to the visualization server (e.g. nanovis, pymolproxy).
    260260#    Creates an event callback that is triggered when we are idle
    261 #    (no I/O with the server) for some specified time. 
     261#    (no I/O with the server) for some specified time.
    262262#
    263263itcl::body Rappture::VisViewer::Connect { servers } {
     
    282282        set _hostname $server
    283283        fconfigure $_sid -translation binary -encoding binary
    284        
     284
    285285        # Read back the server identification string.
    286286        if { [gets $_sid data] <= 0 } {
     
    318318    after cancel $_afterId
    319319    $_dispatcher cancel !timeout
    320     catch {close $_sid} 
     320    catch {close $_sid}
    321321    set _sid ""
    322322    set _buffer(in) ""
     
    344344# CheckConection --
    345345#
    346 #   This routine is called whenever we're about to send/receive data on 
    347 #   the socket connection to the visualization server.  If we're connected, 
    348 #   then reset the timeout event.  Otherwise try to reconnect to the 
     346#   This routine is called whenever we're about to send/receive data on
     347#   the socket connection to the visualization server.  If we're connected,
     348#   then reset the timeout event.  Otherwise try to reconnect to the
    349349#   visualization server.
    350350#
     
    402402    }
    403403    puts -nonewline $_sid $_buffer(out)
    404     flush $_sid 
     404    flush $_sid
    405405    set _buffer(out) ""
    406406    set _done($this) 1;                 # Success
     
    467467        SendHelper
    468468    } else {
    469         # This can cause us to re-enter SendBytes during the tkwait, which 
     469        # This can cause us to re-enter SendBytes during the tkwait, which
    470470        # is not safe because the _buffer will be clobbered
    471471        blt::busy hold $itk_component(main)
     
    487487# StartWaiting --
    488488#
    489 #    Read some number of bytes from the visualization server. 
     489#    Read some number of bytes from the visualization server.
    490490#
    491491
    492492itcl::body Rappture::VisViewer::StartWaiting {} {
    493493    if { $_waitTimeout > 0 } {
    494         after cancel $_afterId 
     494        after cancel $_afterId
    495495        set _afterId [after $_waitTimeout [itcl::code $this WaitDialog on]]
    496496    }
    497497}
    498498
    499 itcl::body Rappture::VisViewer::StopWaiting {} { 
     499itcl::body Rappture::VisViewer::StopWaiting {} {
    500500    if { $_waitTimeout > 0 } {
    501501        WaitDialog off
     
    503503}
    504504
    505 itcl::body Rappture::VisViewer::EnableWaitDialog { value } { 
     505itcl::body Rappture::VisViewer::EnableWaitDialog { value } {
    506506    set _waitTimeout $value
    507507}
     
    510510# ReceiveBytes --
    511511#
    512 #    Read some number of bytes from the visualization server. 
     512#    Read some number of bytes from the visualization server.
    513513#
    514514itcl::body Rappture::VisViewer::ReceiveBytes { size } {
     
    631631}
    632632
    633 # 
     633#
    634634# ReceiveEcho --
    635635#
     
    654654        }
    655655        set inner [frame $itk_component(plotarea).view.splash]
    656         $inner configure -relief raised -bd 2 
     656        $inner configure -relief raised -bd 2
    657657        label $inner.text1 -text "Working...\nPlease wait." \
    658             -font "Arial 10" 
    659         label $inner.icon 
     658            -font "Arial 10"
     659        label $inner.icon
    660660        pack $inner -expand yes -anchor c
    661661        blt::table $inner \
    662662            0,0 $inner.text1 -anchor w \
    663             0,1 $inner.icon 
     663            0,1 $inner.icon
    664664        Waiting start $inner.icon
    665665    } else {
     
    721721    pack $f.send.l -side left
    722722    itk_component add command {
    723         entry $f.send.e -background white
     723        entry $f.send.e -background white
    724724    } {
    725         ignore -background
     725        ignore -background
    726726    }
    727727    pack $f.send.e -side left -expand yes -fill x
     
    731731    pack $f.sb -side right -fill y
    732732    itk_component add trace {
    733         text $f.comm -wrap char -yscrollcommand "$f.sb set" -background white
     733        text $f.comm -wrap char -yscrollcommand "$f.sb set" -background white
    734734    } {
    735         ignore -background
     735        ignore -background
    736736    }
    737737    pack $f.comm -expand yes -fill both
     
    741741
    742742    $itk_component(trace) tag configure error -foreground red \
    743         -font -*-courier-medium-o-normal-*-*-120-*
     743        -font -*-courier-medium-o-normal-*-*-120-*
    744744    $itk_component(trace) tag configure incoming -foreground blue
    745745}
     
    753753itcl::body Rappture::VisViewer::ToggleConsole {} {
    754754    if { $_debugConsole } {
    755         set _debugConsole 0
     755        set _debugConsole 0
    756756    } else {
    757         set _debugConsole 1
     757        set _debugConsole 1
    758758    }
    759759    DebugConsole
     
    763763# DebugConsole --
    764764#
    765 #    Based on the value of the variable _debugConsole, turns on/off 
    766 #    debugging. This is done by setting/unsetting a procedure that 
    767 #    is called whenever new characters are received or sent on the 
     765#    Based on the value of the variable _debugConsole, turns on/off
     766#    debugging. This is done by setting/unsetting a procedure that
     767#    is called whenever new characters are received or sent on the
    768768#    socket to the render server.  Additionally, the debug console
    769769#    is created if necessary and hidden/shown.
     
    771771itcl::body Rappture::VisViewer::DebugConsole {} {
    772772    if { ![winfo exists .renderconsole] } {
    773         BuildConsole
     773        BuildConsole
    774774    }
    775775    if { $_debugConsole } {
    776         $this configure -sendcommand [itcl::code $this TraceComm]
    777         $this configure -receivecommand [itcl::code $this TraceComm]
    778         wm deiconify .renderconsole
     776        $this configure -sendcommand [itcl::code $this TraceComm]
     777        $this configure -receivecommand [itcl::code $this TraceComm]
     778        wm deiconify .renderconsole
    779779    } else {
    780         $this configure -sendcommand ""
    781         $this configure -receivecommand ""
    782         wm withdraw .renderconsole
     780        $this configure -sendcommand ""
     781        $this configure -receivecommand ""
     782        wm withdraw .renderconsole
    783783    }
    784784}
     
    866866                -title "Render Server Error"
    867867            set inner [$popup component inner]
    868             label $inner.summary -text "" -anchor w 
     868            label $inner.summary -text "" -anchor w
    869869
    870870            Rappture::Scroller $inner.scrl \
    871                 -xscrollmode auto -yscrollmode auto 
     871                -xscrollmode auto -yscrollmode auto
    872872            text $inner.scrl.text \
    873873                -font "Arial 9 " -background white -relief sunken -bd 1 \
     
    878878            blt::table $inner \
    879879                0,0 $inner.scrl -fill both \
    880                 1,0 $inner.ok 
    881             $inner.scrl.text tag configure normal -font "Arial 9" 
    882             $inner.scrl.text tag configure italic -font "Arial 9 italic" 
     880                1,0 $inner.ok
     881            $inner.scrl.text tag configure normal -font "Arial 9"
     882            $inner.scrl.text tag configure italic -font "Arial 9 italic"
    883883            $inner.scrl.text tag configure bold -font "Arial 10 bold"
    884884            $inner.scrl.text tag configure code -font "Courier 10 bold"
     
    889889        set inner [$popup component inner]
    890890        $inner.scrl.text delete 0.0 end
    891        
     891
    892892        $inner.scrl.text configure -state normal
    893893        $inner.scrl.text insert end "The following error was reported by the render server:\n\n" bold
     
    959959        "blue-to-grey" {
    960960            return {
    961                 0.0                     0.000 0.600 0.800 
    962                 0.14285714285714285     0.400 0.900 1.000 
    963                 0.2857142857142857      0.600 1.000 1.000 
    964                 0.42857142857142855     0.800 1.000 1.000 
    965                 0.5714285714285714      0.900 0.900 0.900 
    966                 0.7142857142857143      0.600 0.600 0.600 
    967                 0.8571428571428571      0.400 0.400 0.400 
     961                0.0                     0.000 0.600 0.800
     962                0.14285714285714285     0.400 0.900 1.000
     963                0.2857142857142857      0.600 1.000 1.000
     964                0.42857142857142855     0.800 1.000 1.000
     965                0.5714285714285714      0.900 0.900 0.900
     966                0.7142857142857143      0.600 0.600 0.600
     967                0.8571428571428571      0.400 0.400 0.400
    968968                1.0                     0.200 0.200 0.200
    969969            }
    970970        }
    971971        "white-to-blue" {
    972             return { 
    973                 0.0                     0.900 1.000 1.000 
    974                 0.1111111111111111      0.800 0.983 1.000 
    975                 0.2222222222222222      0.700 0.950 1.000 
    976                 0.3333333333333333      0.600 0.900 1.000 
    977                 0.4444444444444444      0.500 0.833 1.000 
    978                 0.5555555555555556      0.400 0.750 1.000 
    979                 0.6666666666666666      0.300 0.650 1.000 
    980                 0.7777777777777778      0.200 0.533 1.000 
    981                 0.8888888888888888      0.100 0.400 1.000 
     972            return {
     973                0.0                     0.900 1.000 1.000
     974                0.1111111111111111      0.800 0.983 1.000
     975                0.2222222222222222      0.700 0.950 1.000
     976                0.3333333333333333      0.600 0.900 1.000
     977                0.4444444444444444      0.500 0.833 1.000
     978                0.5555555555555556      0.400 0.750 1.000
     979                0.6666666666666666      0.300 0.650 1.000
     980                0.7777777777777778      0.200 0.533 1.000
     981                0.8888888888888888      0.100 0.400 1.000
    982982                1.0                     0.000 0.250 1.000
    983983            }
     
    985985        "brown-to-blue" {
    986986            return {
    987                 0.0                             0.200   0.100   0.000 
    988                 0.09090909090909091             0.400   0.187   0.000 
    989                 0.18181818181818182             0.600   0.379   0.210 
    990                 0.2727272727272727              0.800   0.608   0.480 
    991                 0.36363636363636365             0.850   0.688   0.595 
    992                 0.45454545454545453             0.950   0.855   0.808 
    993                 0.5454545454545454              0.800   0.993   1.000 
    994                 0.6363636363636364              0.600   0.973   1.000 
    995                 0.7272727272727273              0.400   0.940   1.000 
    996                 0.8181818181818182              0.200   0.893   1.000 
    997                 0.9090909090909091              0.000   0.667   0.800 
    998                 1.0                             0.000   0.480   0.600 
     987                0.0                             0.200   0.100   0.000
     988                0.09090909090909091             0.400   0.187   0.000
     989                0.18181818181818182             0.600   0.379   0.210
     990                0.2727272727272727              0.800   0.608   0.480
     991                0.36363636363636365             0.850   0.688   0.595
     992                0.45454545454545453             0.950   0.855   0.808
     993                0.5454545454545454              0.800   0.993   1.000
     994                0.6363636363636364              0.600   0.973   1.000
     995                0.7272727272727273              0.400   0.940   1.000
     996                0.8181818181818182              0.200   0.893   1.000
     997                0.9090909090909091              0.000   0.667   0.800
     998                1.0                             0.000   0.480   0.600
    999999            }
    10001000        }
    10011001        "blue-to-brown" {
    10021002            return {
    1003                 0.0                             0.000   0.480   0.600 
    1004                 0.09090909090909091             0.000   0.667   0.800 
    1005                 0.18181818181818182             0.200   0.893   1.000 
    1006                 0.2727272727272727              0.400   0.940   1.000 
    1007                 0.36363636363636365             0.600   0.973   1.000 
    1008                 0.45454545454545453             0.800   0.993   1.000 
    1009                 0.5454545454545454              0.950   0.855   0.808 
    1010                 0.6363636363636364              0.850   0.688   0.595 
    1011                 0.7272727272727273              0.800   0.608   0.480 
    1012                 0.8181818181818182              0.600   0.379   0.210 
    1013                 0.9090909090909091              0.400   0.187   0.000 
    1014                 1.0                             0.200   0.100   0.000 
     1003                0.0                             0.000   0.480   0.600
     1004                0.09090909090909091             0.000   0.667   0.800
     1005                0.18181818181818182             0.200   0.893   1.000
     1006                0.2727272727272727              0.400   0.940   1.000
     1007                0.36363636363636365             0.600   0.973   1.000
     1008                0.45454545454545453             0.800   0.993   1.000
     1009                0.5454545454545454              0.950   0.855   0.808
     1010                0.6363636363636364              0.850   0.688   0.595
     1011                0.7272727272727273              0.800   0.608   0.480
     1012                0.8181818181818182              0.600   0.379   0.210
     1013                0.9090909090909091              0.400   0.187   0.000
     1014                1.0                             0.200   0.100   0.000
    10151015            }
    10161016        }
     
    10501050            set clist {
    10511051                "#EE82EE"
    1052                 "#4B0082" 
    1053                 "blue" 
    1054                 "#008000" 
    1055                 "yellow" 
    1056                 "#FFA500" 
    1057                 "red" 
     1052                "#4B0082"
     1053                "blue"
     1054                "#008000"
     1055                "yellow"
     1056                "#FFA500"
     1057                "red"
    10581058            }
    10591059        }
    10601060        "BGYOR" {
    10611061            set clist {
    1062                 "blue" 
    1063                 "#008000" 
    1064                 "yellow" 
    1065                 "#FFA500" 
    1066                 "red" 
     1062                "blue"
     1063                "#008000"
     1064                "yellow"
     1065                "#FFA500"
     1066                "red"
    10671067            }
    10681068        }
    10691069        "ROYGB" {
    10701070            set clist {
    1071                 "red" 
    1072                 "#FFA500" 
    1073                 "yellow" 
    1074                 "#008000" 
    1075                 "blue" 
     1071                "red"
     1072                "#FFA500"
     1073                "yellow"
     1074                "#008000"
     1075                "blue"
    10761076            }
    10771077        }
    10781078        "RYGCB" {
    10791079            set clist {
    1080                 "red" 
    1081                 "yellow" 
     1080                "red"
     1081                "yellow"
    10821082                "green"
    10831083                "cyan"
     
    10871087        "BCGYR" {
    10881088            set clist {
    1089                 "blue" 
     1089                "blue"
    10901090                "cyan"
    10911091                "green"
    1092                 "yellow" 
    1093                 "red" 
     1092                "yellow"
     1093                "red"
    10941094            }
    10951095        }
    10961096        "spectral" {
    10971097            return {
    1098                 0.0 0.150 0.300 1.000 
    1099                 0.1 0.250 0.630 1.000 
    1100                 0.2 0.450 0.850 1.000 
    1101                 0.3 0.670 0.970 1.000 
    1102                 0.4 0.880 1.000 1.000 
    1103                 0.5 1.000 1.000 0.750 
    1104                 0.6 1.000 0.880 0.600 
    1105                 0.7 1.000 0.680 0.450 
    1106                 0.8 0.970 0.430 0.370 
    1107                 0.9 0.850 0.150 0.196 
     1098                0.0 0.150 0.300 1.000
     1099                0.1 0.250 0.630 1.000
     1100                0.2 0.450 0.850 1.000
     1101                0.3 0.670 0.970 1.000
     1102                0.4 0.880 1.000 1.000
     1103                0.5 1.000 1.000 0.750
     1104                0.6 1.000 0.880 0.600
     1105                0.7 1.000 0.680 0.450
     1106                0.8 0.970 0.430 0.370
     1107                0.9 0.850 0.150 0.196
    11081108                1.0 0.650 0.000 0.130
    11091109            }
     
    11111111        "green-to-magenta" {
    11121112            return {
    1113                 0.0 0.000 0.316 0.000 
    1114                 0.06666666666666667 0.000 0.526 0.000 
    1115                 0.13333333333333333 0.000 0.737 0.000 
    1116                 0.2 0.000 0.947 0.000 
    1117                 0.26666666666666666 0.316 1.000 0.316 
    1118                 0.3333333333333333 0.526 1.000 0.526 
    1119                 0.4 0.737 1.000 0.737 
    1120                 0.4666666666666667 1.000 1.000 1.000 
    1121                 0.5333333333333333 1.000 0.947 1.000 
    1122                 0.6 1.000 0.737 1.000 
    1123                 0.6666666666666666 1.000 0.526 1.000 
    1124                 0.7333333333333333 1.000 0.316 1.000 
    1125                 0.8 0.947 0.000 0.947 
    1126                 0.8666666666666667 0.737 0.000 0.737 
    1127                 0.9333333333333333 0.526 0.000 0.526 
     1113                0.0 0.000 0.316 0.000
     1114                0.06666666666666667 0.000 0.526 0.000
     1115                0.13333333333333333 0.000 0.737 0.000
     1116                0.2 0.000 0.947 0.000
     1117                0.26666666666666666 0.316 1.000 0.316
     1118                0.3333333333333333 0.526 1.000 0.526
     1119                0.4 0.737 1.000 0.737
     1120                0.4666666666666667 1.000 1.000 1.000
     1121                0.5333333333333333 1.000 0.947 1.000
     1122                0.6 1.000 0.737 1.000
     1123                0.6666666666666666 1.000 0.526 1.000
     1124                0.7333333333333333 1.000 0.316 1.000
     1125                0.8 0.947 0.000 0.947
     1126                0.8666666666666667 0.737 0.000 0.737
     1127                0.9333333333333333 0.526 0.000 0.526
    11281128                1.0 0.316 0.000 0.316
    11291129            }
    11301130        }
    11311131        "greyscale" {
    1132             return { 
     1132            return {
    11331133                0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0
    11341134            }
     
    11611161#
    11621162itcl::body Rappture::VisViewer::StartBufferingCommands { } {
    1163     incr _buffering 
     1163    incr _buffering
    11641164    if { $_buffering == 1 } {
    11651165        set _outbuf ""
     
    11871187#
    11881188#       Send commands off to the rendering server.  If we're currently
    1189 #       sending data objects to the server, buffer the commands to be 
     1189#       sending data objects to the server, buffer the commands to be
    11901190#       sent later.
    11911191#
     
    12061206#
    12071207#       Send commands off to the rendering server.  If we're currently
    1208 #       sending data objects to the server, buffer the commands to be 
     1208#       sending data objects to the server, buffer the commands to be
    12091209#       sent later.
    12101210#
Note: See TracChangeset for help on using the changeset viewer.