Ignore:
Timestamp:
Apr 6, 2014, 5:59:32 PM (11 years ago)
Author:
ldelgass
Message:

Renamed 'dataset coords' response to 'map coords', handle invalid coords,
response with/without screen/mouse coords

File:
1 edited

Legend:

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

    r4318 r4321  
    8383    protected method Pan {option x y}
    8484    protected method Rebuild {}
    85     protected method ReceiveDataset { args }
     85    protected method ReceiveMapInfo { args }
    8686    protected method ReceiveImage { args }
    8787    protected method Rotate {option x y}
     
    134134    private variable _motion
    135135    private variable _sendEarthFile 0
    136     private variable _useServerManip 1
     136    private variable _useServerManip 0
    137137}
    138138
     
    170170    #
    171171    $_parser alias image    [itcl::code $this ReceiveImage]
    172     $_parser alias dataset  [itcl::code $this ReceiveDataset]
     172    $_parser alias map      [itcl::code $this ReceiveMapInfo]
    173173    $_parser alias camera   [itcl::code $this camera]
    174174
     
    846846
    847847#
    848 # ReceiveDataset --
    849 #
    850 itcl::body Rappture::MapViewer::ReceiveDataset { args } {
     848# ReceiveMapInfo --
     849#
     850itcl::body Rappture::MapViewer::ReceiveMapInfo { args } {
    851851    if { ![isconnected] } {
    852852        return
     
    855855    switch -- $option {
    856856        "coords" {
    857             foreach { x y z } [lrange $args 1 end] break
    858             puts stderr "Coords: $x $y $z"
     857            set len [llength $args]
     858            if {$len < 4} {
     859                puts stderr "Coords out of range"
     860            } elseif {$len < 6} {
     861                foreach { x y z } [lrange $args 1 end] break
     862                puts stderr "Coords: $x $y $z"
     863            } else {
     864                foreach { x y z pxX pxY } [lrange $args 1 end] break
     865                puts stderr "Coords($pxX,$pxY): $x $y $z"
     866            }
    859867        }
    860868        "names" {
    861869            foreach { name } [lindex $args 1] {
    862                 #puts stderr "layer: $name"
     870                puts stderr "layer: $name"
    863871            }
    864872        }
    865873        default {
    866             error "unknown dataset option \"$option\" from server"
     874            error "unknown map option \"$option\" from server"
    867875        }
    868876    }
Note: See TracChangeset for help on using the changeset viewer.