- Timestamp:
- Nov 10, 2014, 10:44:18 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/visviewer.tcl
r4492 r4692 47 47 protected variable _outbuf ; # buffer for outgoing commands 48 48 protected variable _buffering 0 49 50 private variable _logging 0 49 protected variable _cmdSeq 0 ; # Command sequence number 50 51 private variable _trace 0 ; # Protocol tracing for console 52 private variable _logging 0 ; # Command logging to file 51 53 52 54 protected variable _dispatcher ""; # dispatcher for !events … … 320 322 set _buffer(in) "" 321 323 set _outbuf "" 324 set _cmdSeq 0 322 325 } 323 326 … … 400 403 puts -nonewline $_sid $_buffer(out) 401 404 flush $_sid 405 set _buffer(out) "" 402 406 set _done($this) 1; # Success 403 407 } … … 453 457 # before sending anything. 454 458 set _done($this) 1 459 if {$_buffer(out) != ""} { 460 puts stderr "ERROR: re-entered SendBytes: buffer=([string range $_buffer(out) 0 70]...)" 461 puts stderr "New cmd $_cmdSeq: [string range $bytes 0 70]..." 462 } 455 463 set _buffer(out) $bytes 456 if { 1} {464 if {0} { 457 465 # Let's try this approach: allow a write to block so we don't 458 466 # re-enter SendBytes … … 461 469 # This can cause us to re-enter SendBytes during the tkwait, which 462 470 # is not safe because the _buffer will be clobbered 471 blt::busy hold $itk_component(main) 463 472 fileevent $_sid writable [itcl::code $this SendHelper] 464 473 tkwait variable ::Rappture::VisViewer::_done($this) 474 blt::busy release $itk_component(main) 465 475 } 466 476 set _buffer(out) "" … … 547 557 if { [string compare -length 3 $line "nv>"] == 0 } { 548 558 ReceiveEcho <<line $line 559 if ($_trace) { 560 puts stderr "<<[string range $line 0 70]" 561 } 549 562 append _buffer(in) [string range $line 3 end] 550 563 append _buffer(in) "\n" … … 809 822 # ---------------------------------------------------------------------- 810 823 itcl::body Rappture::VisViewer::SendDebugCommand {} { 824 incr _cmdSeq 811 825 set cmd [$itk_component(command) get] 812 826 append cmd "\n" 827 if {$_trace} { 828 puts stderr "$_cmdSeq>>[string range $cmd 0 70]" 829 } 813 830 SendBytes $cmd 814 831 $itk_component(command) delete 0 end … … 1174 1191 # 1175 1192 itcl::body Rappture::VisViewer::SendCmd {string} { 1193 incr _cmdSeq 1194 if {$_trace} { 1195 puts stderr "$_cmdSeq>>[string range $string 0 70]" 1196 } 1176 1197 if { $_buffering } { 1177 1198 append _outbuf $string "\n" … … 1189 1210 # 1190 1211 itcl::body Rappture::VisViewer::SendCmdNoWait {string} { 1212 incr _cmdSeq 1213 if {$_trace} { 1214 puts stderr "$_cmdSeq>>[string range $string 0 70]" 1215 } 1191 1216 if { $_buffering } { 1192 1217 append _outbuf $string "\n"
Note: See TracChangeset
for help on using the changeset viewer.