Ignore:
Timestamp:
Mar 14, 2015, 1:50:46 AM (10 years ago)
Author:
ldelgass
Message:

Use SendData? method to send binary data in viewers, make _outbuf private in
superclass.

File:
1 edited

Legend:

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

    r5100 r5134  
    9191    private method EventuallyGoto { nSteps }
    9292    private method EventuallyResizeLegend { }
    93     private method FlowCmd { dataobj comp nbytes extents }
    9493    private method GetDatasetsWithComponent { cname }
    9594    private method GetFlowInfo { widget }
     
    112111    private method ResizeLegend {}
    113112    private method Rotate {option x y}
     113    private method SendFlowCmd { dataobj comp nbytes extents }
    114114    private method SendTransferFuncs {}
    115115    private method SetOrientation { side }
     
    11741174                SendCmd "volume data follows $nbytes $tag"
    11751175            } else {
    1176                 set cmd [FlowCmd $dataobj $comp $nbytes $extents]
    1177                 if { $cmd == "" } {
    1178                     puts stderr "no command"
    1179                     continue
     1176                if {[SendFlowCmd $dataobj $comp $nbytes $extents] < 0} {
     1177                     continue
    11801178                }
    1181                 append _outbuf $cmd
    1182             }
    1183             append _outbuf $data
     1179            }
     1180            SendData $data
    11841181            NameTransferFunc $dataobj $comp
    11851182            set _recvObjs($tag) 1
     
    26142611}
    26152612
    2616 itcl::body Rappture::FlowvisViewer::FlowCmd { dataobj comp nbytes extents } {
     2613itcl::body Rappture::FlowvisViewer::SendFlowCmd { dataobj comp nbytes extents } {
    26172614    set tag "$dataobj-$comp"
    26182615    if { ![info exists _obj2flow($tag)] } {
    2619         append cmd "flow add $tag\n"
    2620         append cmd "$tag data follows $nbytes $extents\n"
    2621         return $cmd
     2616        SendCmd "flow add $tag"
     2617        SendCmd "$tag data follows $nbytes $extents"
     2618        return 0
    26222619    }
    26232620    set flowobj $_obj2flow($tag)
    26242621    if { $flowobj == "" } {
    26252622        puts stderr "no flowobj"
    2626         return ""
    2627     }
    2628     set cmd {}
    2629     append cmd "if {\[flow exists $tag\]} {flow delete $tag}\n"
     2623        return -1
     2624    }
     2625    SendCmd "if {\[flow exists $tag\]} {flow delete $tag}"
    26302626    array set info  [$flowobj hints]
    26312627    set _settings($this-volume) $info(volume)
     
    26342630    set _settings($this-duration) $info(duration)
    26352631    $itk_component(speed) value $info(speed)
     2632    set cmd {}
    26362633    append cmd "flow add $tag"
    26372634    append cmd " -position $info(position)"
     
    26402637    append cmd " -outline $info(outline)"
    26412638    append cmd " -slice $info(streams)"
    2642     append cmd " -arrows $info(arrows)\n"
     2639    append cmd " -arrows $info(arrows)"
     2640    SendCmd $cmd
    26432641    foreach part [$flowobj particles] {
     2642        set cmd {}
    26442643        array unset info
    26452644        array set info $part
     
    26502649        append cmd " -axis $info(axis)"
    26512650        append cmd " -color {$color}"
    2652         append cmd " -size $info(size)\n"
     2651        append cmd " -size $info(size)"
     2652        SendCmd $cmd
    26532653    }
    26542654    foreach box [$flowobj boxes] {
     2655        set cmd {}
    26552656        array unset info
    26562657        set info(corner1) ""
     
    26662667        append cmd " -linewidth $info(linewidth) "
    26672668        append cmd " -corner1 {$info(corner1)} "
    2668         append cmd " -corner2 {$info(corner2)}\n"
    2669     }
    2670     append cmd "$tag data follows $nbytes $extents\n"
    2671     return $cmd
     2669        append cmd " -corner2 {$info(corner2)}"
     2670        SendCmd $cmd
     2671    }
     2672    SendCmd "$tag data follows $nbytes $extents"
     2673    return 0
    26722674}
    26732675
Note: See TracChangeset for help on using the changeset viewer.