chiark / gitweb /
where-vessels: show vessel names 6.3.1
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 13 Dec 2009 14:02:22 +0000 (14:02 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 13 Dec 2009 14:02:22 +0000 (14:02 +0000)
yarrg/where-vessels

index 81341a0f43002e5b3190be8e27704cb1f03834df..6f4433fa9e7efc7521820ad94f64d5507756c270 100755 (executable)
@@ -282,13 +282,9 @@ proc code2abbrev {code} {
     return $abbrev
 }
 
     return $abbrev
 }
 
-proc show-report {islandname code} {
+proc show-report-decode {code} {
     global vc_code2full
 
     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
     
     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 _]"
     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 {} {
     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 {}
     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 {} {
 }
 
 proc draw {} {
-    global chart count isleloc canvas
+    global chart found isleloc canvas
     
     $canvas delete all
 
     
     $canvas delete all
 
@@ -506,8 +501,8 @@ proc draw {} {
     }
 
     set lastislandname {}
     }
 
     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
 
 #      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 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"]
 proc zoom {extail} {
     global scale canvas
     set nscale [expr "\$scale $extail"]