From 363f7060f6fd6ffceca3611b7283c695cc2731df Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 13 Dec 2009 14:02:22 +0000 Subject: [PATCH] where-vessels: show vessel names --- yarrg/where-vessels | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/yarrg/where-vessels b/yarrg/where-vessels index 81341a0..6f4433f 100755 --- a/yarrg/where-vessels +++ b/yarrg/where-vessels @@ -282,13 +282,9 @@ proc code2abbrev {code} { return $abbrev } -proc show-report {islandname code} { +proc show-report-decode {code} { global vc_code2full - .report.island configure -text $islandname - glset report_code $code - glset report_abbrev [code2abbrev $code] - manyset [split $code _] inport classcode subclass lockown xabbrev manyset [split $lockown ""] lock notown @@ -382,18 +378,17 @@ proc vessel {vin} { lappend codel "$lock$notown" $xabbrev lappend newnotes [list $vid $realname $owner $xabbrev] set kk "$island [join $codel _]" - upvar #0 count($kk) k - if {![info exists k]} { set k 0 } - incr k - + upvar #0 found($kk) k + lappend k [list $vid $realname] + debug "CODED $kk $vid $realname" } set clipboard {} proc parse-clipboard {} { - global clipboard count notes notes_used newnotes + global clipboard found notes notes_used newnotes - catch { unset count } + catch { unset found } catch { unset notes_used } glset note_infos {} glset note_missings {} @@ -495,7 +490,7 @@ proc chart-got/league {x1 y1 x2 y2 kind} { } proc draw {} { - global chart count isleloc canvas + global chart found isleloc canvas $canvas delete all @@ -506,8 +501,8 @@ proc draw {} { } set lastislandname {} - foreach key [lsort [array names count]] { - set c $count($key) + foreach key [lsort [array names found]] { + set c [llength $found($key)] # debug "SHOWING $key $c" regexp {^(.*) (\S+)$} $key dummy islandname code @@ -765,6 +760,24 @@ proc widgets-setup {} { proc report-set {sw val} { .report.details.$sw configure -text $val } +proc show-report {islandname code} { + .report.island configure -text $islandname + glset report_code $code + glset report_abbrev [code2abbrev $code] + + show-report-decode $code + + set kk "$islandname $code" + upvar #0 found($kk) k + + .report.list delete 0 end + + foreach entry $k { + manyset $entry vid name + .report.list insert end $name + } +} + proc zoom {extail} { global scale canvas set nscale [expr "\$scale $extail"] -- 2.30.2