Changeset 6316 for trunk/gui/scripts/visviewer.tcl
- Timestamp:
- May 4, 2016, 12:51:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/visviewer.tcl
r6301 r6316 20 20 itk_option define -receivecommand receiveCommand ReceiveCommand "" 21 21 22 private common _servers; # array of visualization server lists23 set _servers(geovis) "localhost:2015"24 set _servers(nanovis) "localhost:2000"25 set _servers(pymol) "localhost:2020"26 set _servers(vmdmds) "localhost:2018"27 set _servers(vtkvis) "localhost:2010"28 29 private common _done; # Used to indicate status of send.30 private variable _buffer; # buffer for incoming/outgoing commands31 private variable _outbuf; # buffer for outgoing commands32 private variable _blockOnWrite 0; # Should writes to socket block?33 private variable _initialized34 private variable _isOpen 035 private variable _afterId -136 private variable _icon 037 private variable _trace 0; # Protocol tracing for console38 private variable _logging 0; # Command logging to file39 # Number of milliseconds to wait before idle timeout. If greater than 0,40 # automatically disconnect from the visualization server when idle timeout41 # is reached.42 private variable _idleTimeout 43200000; # 12 hours43 #private variable _idleTimeout 5000;# 5 seconds44 #private variable _idleTimeout 0; # No timeout45 46 protected variable _debug 047 protected variable _serverType "???";# Type of server.48 protected variable _sid ""; # socket connection to server49 protected variable _maxConnects 10050 protected variable _buffering 051 protected variable _cmdSeq 0; # Command sequence number52 protected variable _dispatcher ""; # dispatcher for !events53 protected variable _hosts ""; # list of hosts for server54 protected variable _parser ""; # interpreter for incoming commands55 protected variable _image56 protected variable _hostname57 protected variable _numConnectTries 058 protected variable _debugConsole 059 protected variable _reportClientInfo 160 # Number of milliscends to wait for server reply before displaying wait61 # dialog. If set to 0, dialog is never displayed.62 protected variable _waitTimeout 063 64 22 constructor { args } { 65 23 # defined below … … 68 26 # defined below 69 27 } 70 # Used internally only. 71 private method BuildConsole {} 72 private method DebugConsole {} 73 private method HideConsole {} 74 private method ReceiveHelper {} 75 private method SendDebugCommand {} 76 private method SendHelper {} 77 private method ServerDown {} 78 private method Shuffle { servers } 79 private method TraceComm { channel {data {}} } 80 private method WaitDialog { state } 81 private method Waiting { option widget } 28 public proc GetServerList { type } { 29 return $_servers($type) 30 } 31 public proc SetServerList { type namelist } { 32 # Convert the comma separated list into a Tcl list. OGRE also adds 33 # a trailing comma that we want to ignore. 34 regsub -all "," $namelist " " namelist 35 CheckNameList $namelist 36 set _servers($type) $namelist 37 } 38 public proc RemoveServerFromList { type server } { 39 if { ![info exists _servers($type)] } { 40 error "unknown server type \"$type\"" 41 } 42 set i [lsearch $_servers($type) $server] 43 if { $i < 0 } { 44 return 45 } 46 set _servers($type) [lreplace $_servers($type) $i $i] 47 } 48 public proc SetPymolServerList { namelist } { 49 SetServerList "pymol" $namelist 50 } 51 public proc SetNanovisServerList { namelist } { 52 SetServerList "nanovis" $namelist 53 } 54 public proc SetVtkServerList { namelist } { 55 SetServerList "vtk" $namelist 56 } 82 57 83 58 protected method CheckConnection {} … … 117 92 protected method ToggleConsole {} 118 93 94 protected variable _debug 0 95 protected variable _serverType "???";# Type of server. 96 protected variable _sid ""; # socket connection to server 97 protected variable _maxConnects 100 98 protected variable _buffering 0 99 protected variable _cmdSeq 0; # Command sequence number 100 protected variable _dispatcher ""; # dispatcher for !events 101 protected variable _hosts ""; # list of hosts for server 102 protected variable _parser ""; # interpreter for incoming commands 103 protected variable _image 104 protected variable _hostname 105 protected variable _numConnectTries 0 106 protected variable _debugConsole 0 107 protected variable _reportClientInfo 1 108 # Number of milliscends to wait for server reply before displaying wait 109 # dialog. If set to 0, dialog is never displayed. 110 protected variable _waitTimeout 0 111 112 private method BuildConsole {} 113 private method DebugConsole {} 114 private method HideConsole {} 115 private method ReceiveHelper {} 116 private method SendDebugCommand {} 117 private method SendHelper {} 118 private method ServerDown {} 119 private method Shuffle { servers } 120 private method TraceComm { channel {data {}} } 121 private method WaitDialog { state } 122 private method Waiting { option widget } 123 119 124 private proc CheckNameList { namelist } { 120 125 foreach host $namelist { … … 125 130 } 126 131 } 127 public proc GetServerList { type } { 128 return $_servers($type) 129 } 130 public proc SetServerList { type namelist } { 131 # Convert the comma separated list into a Tcl list. OGRE also adds 132 # a trailing comma that we want to ignore. 133 regsub -all "," $namelist " " namelist 134 CheckNameList $namelist 135 set _servers($type) $namelist 136 } 137 public proc RemoveServerFromList { type server } { 138 if { ![info exists _servers($type)] } { 139 error "unknown server type \"$type\"" 140 } 141 set i [lsearch $_servers($type) $server] 142 if { $i < 0 } { 143 return 144 } 145 set _servers($type) [lreplace $_servers($type) $i $i] 146 } 147 public proc SetPymolServerList { namelist } { 148 SetServerList "pymol" $namelist 149 } 150 public proc SetNanovisServerList { namelist } { 151 SetServerList "nanovis" $namelist 152 } 153 public proc SetVtkServerList { namelist } { 154 SetServerList "vtk" $namelist 155 } 132 133 private variable _buffer; # buffer for incoming/outgoing commands 134 private variable _outbuf; # buffer for outgoing commands 135 private variable _blockOnWrite 0; # Should writes to socket block? 136 private variable _initialized 137 private variable _isOpen 0 138 private variable _afterId -1 139 private variable _icon 0 140 private variable _trace 0; # Protocol tracing for console 141 private variable _logging 0; # Command logging to file 142 # Number of milliseconds to wait before idle timeout. If greater than 0, 143 # automatically disconnect from the visualization server when idle timeout 144 # is reached. 145 private variable _idleTimeout 43200000; # 12 hours 146 #private variable _idleTimeout 5000;# 5 seconds 147 #private variable _idleTimeout 0; # No timeout 148 149 private common _servers; # array of visualization server lists 150 set _servers(geovis) "localhost:2015" 151 set _servers(nanovis) "localhost:2000" 152 set _servers(pymol) "localhost:2020" 153 set _servers(vmdmds) "localhost:2018" 154 set _servers(vtkvis) "localhost:2010" 155 private common _done; # Used to indicate status of send. 156 156 } 157 157
Note: See TracChangeset
for help on using the changeset viewer.