Changeset 4637


Ignore:
Timestamp:
Sep 19, 2014 12:05:14 PM (9 years ago)
Author:
ldelgass
Message:

Update map client for 0.6.0 protocol

File:
1 edited

Legend:

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

    r4633 r4637  
    894894        "coords" {
    895895            set len [llength $args]
    896             if {$len < 5} {
     896            if {$len < 3} {
    897897                error "Bad map coords response"
    898898            } else {
    899899                set token [lindex $args 1]
    900900            }
    901             if {$len == 5} {
    902                 puts stderr "\[$token - $elapsed\] Map coords out of range"
    903             } elseif {$len < 7} {
    904                 foreach { x y z } [lrange $args 2 end] break
    905                 puts stderr "\[$token - $elapsed\] Map coords: $x $y $z"
    906             } elseif {$len < 8} {
    907                 foreach { x y z screenX screenY } [lrange $args 2 end] break
    908                 puts stderr "\[$token - $elapsed\] Map coords($screenX,$screenY): $x $y $z"
    909             } else {
    910                 foreach { x y z screenX screenY srs vert } [lrange $args 2 end] break
    911                 puts stderr "\[$token - $elapsed\] Map coords($screenX,$screenY): $x $y $z {$srs} {$vert}"
     901            foreach { x y z } [lindex $args 2] {
     902                puts stderr "\[$token\] Map coords: $x $y $z"
     903            }
     904            if {$len > 3} {
     905                set srs [lindex $args 3]
     906                set vert [lindex $args 4]
     907                puts stderr "\[$token\] {$srs} {$vert}"
    912908            }
    913909        }
     
    934930        "coords" {
    935931            set len [llength $args]
    936             if {$len < 6} {
     932            if {$len < 3} {
    937933                error "Bad screen coords response"
    938934            } else {
    939935                set token [lindex $args 1]
    940936            }
    941             if {$len == 6} {
    942                 puts stderr "\[$token\] Screen coords out of range"
    943             } else {
    944                 foreach { x y z worldX worldY worldZ } [lrange $args 2 end] break
    945                 puts stderr "\[$token\] Screen coords($worldX,$worldY,$worldZ): $x $y $z"
     937            foreach { x y z } [lindex $args 2] {
     938                puts stderr "\[$token\] Screen coords: $x $y $z"
    946939            }
    947940        }
Note: See TracChangeset for help on using the changeset viewer.