2 # show your vessels on a map
4 # This is part of ypp-sc-tools, a set of third-party tools for assisting
5 # players of Yohoho Puzzle Pirates.
7 # Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 # Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
23 # are used without permission. This program is not endorsed or
24 # sponsored by Three Rings.
32 #---------- general utilities ----------
37 if {$debug} { puts "DEBUG $m" }
41 puts stderr "where-vessels: bad usage: $m"
50 #---------- expecting certain errors ----------
52 proc errexpect-setline {lno line} {
53 glset errexpect_lno $lno
54 glset errexpect_line $line
57 proc errexpect-error {m} {
58 global errexpect_line errexpect_lno
59 error $m "$errexpect_line\n" [list YARRG-ERREXPECT $errexpect_lno]
62 proc errexpect-arrayget {arrayvar key} {
64 upvar 1 ${arrayvar}($key) v
65 if {[info exists v]} { return $v }
66 errexpect-error "undefined $key"
69 proc errexpect-arrayget-boolean {arrayvar key} {
70 switch -exact [uplevel 1 [list errexpect-arrayget $arrayvar $key]] {
73 default { errexpect-error "unexpected $key" }
77 proc errexpect-catch {code} {
78 global errorInfo errorCode
82 debug "ERREXPECT CATCH |$rc|$rv|$errorCode|$errorInfo|"
83 if {$rc==1 && ![string compare YARRG-ERREXPECT [lindex $errorCode 0]]} {
84 return [list 1 $rv [lindex $errorCode 1] $errorInfo]
88 return -code $rc -errorinfo $errorInfo -errorcode $errorCode $rv
92 #---------- argument parsing ----------
96 if {$ai >= [llength $argv]} {
97 badusage "option [lindex $argv [expr {$ai-1}]] needs a value"
99 set v [lindex $argv $ai]
104 set notes_loc vessel-notes
105 set scraper {./yppedia-ocean-scraper --chart}
112 while {[regexp {^\-} [set arg [lindex $argv $ai]]]} {
114 switch -exact -- $arg {
116 --pirate { glset pirate [string totitle [nextarg]] }
117 --ocean { glset ocean [string totitle [nextarg]] }
118 --clipboard-file { load-clipboard-file [nextarg] }
119 --local-html-dir { lappend scraper --local-html-dir=[nextarg] }
120 --notes { glset notes_loc [nextarg] }
121 --debug { incr debug }
122 default { badusage "unknown option $arg" }
125 set argv [lrange $argv $ai end]
126 if {[llength $argv]} { badusage "non-option args not allowed" }
129 proc argdefaults {} {
130 global ocean notes_loc pirate scraper
131 if {![info exists ocean] || ![info exists pirate]} {
132 set cmd {./yarrg --find-window-only --quiet}
133 if {[info exists ocean]} { lappend cmd --ocean $ocean }
134 if {[info exists pirate]} { lappend cmd --pirate $pirate }
135 manyset [split [eval exec $cmd] " "] ocean pirate
137 lappend scraper $ocean
141 #---------- loading and parsing the vessel notes ----------
144 global notes_loc notes_data
145 if {[regexp {^\w+\:} $notes_loc]} {
147 debug "FETCHING NOTES $notes_loc"
148 set req [::http::geturl $notes_loc]
149 switch -glob [::http::status $req].[::http::ncode $req] {
151 ok.* { error "retrieving vessel-notes: [::http::code $req]" }
152 * { error "Retrieving vessel-notes: [::http::error $req]" }
154 set newdata [::http::data $req]
157 debug "READING NOTES $notes_loc"
158 set vn [open $notes_loc]
159 set newdata [read $vn]
162 set notes_data $newdata
165 proc parse-notes {} {
166 global notes_data notes
167 catch { unset notes }
170 foreach l [split $notes_data "\n"] {
172 errexpect-setline $lno $l
173 set l [string trim $l]
174 if {![string length $l]} continue
175 if {[regexp {^\#} $l]} continue
176 if {![regexp -expanded \
177 {^ (\d+) (?: \s+([^=]*?) )? \s* =
179 (?: \s+ (\S+) )?)? $} \
180 $l dummy vid vname owner note]} {
181 errexpect-error "badly formatted"
183 set vname [string trim $vname]
184 if {[info exists notes($vid)]} {
185 errexpect-error "duplicate vesselid $vid"
187 set notes($vid) [list $lno $vname $owner $note]
191 proc note-info {lno vid name island description} {
193 lappend note_infos [list $lno $vid $name $island $description]
196 proc display-note-infos {} {
197 global note_infos note_missings notes
199 set nmissing [llength $note_missings]
200 debug "display-note-infos $nmissing [array size notes]"
202 if {[llength $note_infos]} {
203 set tiny "[llength $note_infos] warnings"
204 } elseif {$nmissing && [array size notes]} {
205 set tiny "$nmissing missing"
212 foreach info $note_infos {
213 manyset $info lno vid name island description
214 append infodata "vessel"
215 append infodata " $vid"
216 if {[string length $name]} { append infodata " $name" }
217 if {[string length $island]} { append infodata " ($island)" }
218 append infodata ": " $description "\n"
222 if {[string length $infodata]} { append infodata "\n" }
223 append infodata "$nmissing vessel(s) not mentioned in notes:\n"
225 foreach info [lsort $note_missings] {
226 manyset $info island name vid
227 if {[string compare $island $last_island]} {
228 append infodata "# $island:\n"
229 set last_island $island
231 append infodata [format "%-9d %-29s =\n" $vid $name]
235 parser-control-failed-core .ctrl.notes notes \
238 "[llength $note_infos] warning(s);\
239 $nmissing vessel(s) missing" \
240 "Full description of warnings and missing vessels:" \
244 #---------- vessel properties ----------
246 proc vesselclasses-init {} {
247 global vc_game2code vc_code2abbrev vc_code2full vc_codes
252 longship dm ls Longship
253 baghlah em bg Baghlah
254 merchbrig fm mb {Merchant Brig}
255 warbrig gm wb {War Brig}
257 warfrig im wf {War Frigate}
258 merchgal jm mg {Merchant Galleon}
259 grandfrig km gf {Grand Frigate}
262 foreach {game code abbrev full} $vcl {
263 lappend vc_codes $code
264 set vc_game2code($game) $code
265 set vc_code2abbrev($code) $abbrev
266 set vc_code2full($code) $full
270 proc code2abbrev-lock {lockown} {
271 manyset [split $lockown ""] lock notown
272 append abbrev [lindex {* + -} $lock]
273 append abbrev [lindex {= - ?} [regsub {\D} $notown 2]]
276 proc code2abbrev {code} {
277 global vc_code2abbrev
279 manyset [split $code _] inport class subclass lockown xabbrev
282 append abbrev [lindex {? {}} $inport]
283 append abbrev $vc_code2abbrev($class)
284 append abbrev $subclass
285 append abbrev [code2abbrev-lock $lockown]
286 append abbrev $xabbrev
288 debug "CODE2ABBREV $code $abbrev"
292 proc show-report-decode {code} {
295 manyset [split $code _] inport classcode subclass lockown xabbrev
296 manyset [split $lockown ""] lock notown
298 report-set inport [lindex {{At Sea} {In port}} $inport]
299 report-set class $vc_code2full($classcode)
301 switch -exact $subclass {
302 {} { report-set subclass {Ordinary} }
303 F { report-set subclass {"Frost class"} }
304 default { report-set subclass "Subclass \"$subclass\"" }
307 report-set lock [lindex {
308 {Battle ready} {Unlocked} {Locked}
311 switch -exact $notown {
312 0 { report-set own "Yours" }
313 1 { report-set own "Other pirate's" }
314 U { report-set own "Owner not known" }
315 M { report-set own "Missing from notes" }
316 default { report-set own "?? $notown" }
319 if {[string length $xabbrev]} {
320 report-set xabbrev "Notes flags: $xabbrev"
322 report-set xabbrev "No flags in notes"
326 #---------- filtering ----------
330 proc filter-values/size {} { global vc_codes; return $vc_codes }
331 proc filter-map/size {code} { upvar #0 vc_code2abbrev($code) abb; return $abb }
332 proc filter-default/size {code} { return 1 }
333 proc filter-says-yes/size {codel} {
334 set sizecode [lindex $codel 1]
335 upvar #0 filter_size($sizecode) yes
339 proc filter-values/lockown {} {
342 lappend vals "$lv$ov"
347 proc filter-map/lockown {lockown} { return [code2abbrev-lock $lockown] }
348 proc filter-default/lockown {lockown} {
349 return [regexp {^[01]|^2[^1]} $lockown]
351 proc filter-says-yes/lockown {codel} {
352 set lockown [lindex $codel 3]
353 regsub -all {\D} $lockown X lockown
354 upvar #0 filter_lockown($lockown) yes
358 proc filter-validate/xabbre {re} {
362 regsub {^.*:\s*} $emsg {} emsg
363 regsub {^.*(.{30})$} $emsg {\1} emsg
368 proc filter-says-yes/xabbre {codel} {
370 set xabbrev [lindex $codel 4]
371 return [regexp -- $filter_xabbre $xabbrev]
374 proc filter-tickbox-flip {fil} {
375 upvar #0 filter_$fil vars
376 set values [filter-values/$fil]
377 foreach val $values {
378 set vars($val) [expr {!$vars($val)}]
383 proc make-tickbox-filter {fil label rows inrow} {
384 upvar #0 filter_$fil vars
385 set fw [make-filter tickbox $fil $label frame]
386 set values [filter-values/$fil]
387 set nvalues [llength $values]
389 set inrow [expr {($nvalues + $rows) / $rows}]
392 for {set ix 0} {$ix < $nvalues} {incr ix} {
393 set val [lindex $values $ix]
394 set vars($val) [filter-default/$fil $val]
395 checkbutton $fw.$ix -variable filter_${fil}($val) \
396 -text [filter-map/$fil $val] -font fixed \
397 -command redraw-needed
398 grid configure $fw.$ix -sticky sw \
399 -row [expr {$ix / $inrow}] \
400 -column [expr {$ix % $inrow}]
402 button $fw.invert -text flip -command [list filter-tickbox-flip $fil] \
404 grid configure $fw.invert -sticky se \
405 -row [expr {$rows-1}] \
406 -column [expr {$inrow-1}]
409 proc entry-filter-changed {fw fil n1 n2 op} {
411 upvar #0 filter_$fil realvar
412 upvar #0 filterentered_$fil entryvar
413 global def_background
414 debug "entry-filter-changed $fw $fil $entryvar"
416 set error [filter-validate/$fil $entryvar]
417 if {[string length $error]} {
418 $fw.error configure -text $error -foreground white -background red
420 $fw.error configure -text { } -background $def_background
421 set realvar $entryvar
425 puts stderr "FILTER CHECK ERROR $emsg $errorInfo"
429 proc make-entry-filter {fil label def} {
430 global filterentered_$fil
431 upvar #0 filter_$fil realvar
433 set fw [make-filter entry $fil $label frame]
434 entry $fw.entry -textvariable filterentered_$fil
436 glset def_background [$fw.error cget -background]
437 trace add variable filterentered_$fil write \
438 [list entry-filter-changed $fw $fil]
439 pack $fw.entry $fw.error -side top -anchor w
442 proc make-filter {kind fil label ekind} {
444 label .filter.lab_$fil -text $label -justify left
447 set nfilters [llength $filters]
448 grid configure .filter.lab_$fil -row $nfilters -column 0 -sticky nw -pady 4
449 grid configure .filter.$fil -row $nfilters -column 1 -sticky w -pady 3
453 proc make-filters {} {
454 make-tickbox-filter size Size 2 0
455 make-tickbox-filter lockown "Lock/\nowner" 2 6
456 make-entry-filter xabbre "Flags\n regexp" {}
459 proc filters-say-yes {code} {
461 debug "filters-say-yes $code"
462 foreach fil $filters {
463 if {![filter-says-yes/$fil [split $code _]]} { return 0 }
468 #---------- loading and parsing the clipboard (vessel locations) ----------
471 global pirate notes_used note_missings newnotes
475 lappend codel [errexpect-arrayget-boolean vi inPort]
477 set gameclass [errexpect-arrayget vi vesselClass]
478 upvar #0 vc_game2code($gameclass) class
479 if {![info exists class]} { errexpect-error "unexpected vesselClass"}
482 set subclass [errexpect-arrayget vi vesselSubclass]
483 switch -exact $subclass {
484 null { lappend codel {} }
485 icy { lappend codel F }
486 default { lappend codel ($subclass) }
489 switch -exact [errexpect-arrayget vi isLocked]/[ \
490 errexpect-arrayget vi isBattleReady] {
491 true/false { set lock 2 }
492 false/false { set lock 1 }
493 false/true { set lock 0 }
494 default { errexpect-error "unexpected isLocked/isBattleReady" }
497 set vid [errexpect-arrayget vi vesselId]
498 upvar #0 notes($vid) note
499 set realname [errexpect-arrayget vi vesselName]
500 set island [errexpect-arrayget vi islandName]
504 if {[info exists note]} {
505 manyset $note lno notename owner xabbrev
506 if {[string compare -nocase $realname $notename]} {
507 note-info $lno $vid $realname $island \
508 "notes say name is $notename"
510 if {[string length $owner]} {
511 if {![string compare $owner $pirate]} {
519 append abbrev $xabbrev
520 set notes_used($vid) 1
524 lappend note_missings [list $island $realname $vid]
527 lappend codel "$lock$notown" $xabbrev
528 lappend newnotes [list $vid $realname $owner $xabbrev]
529 set kk "$island [join $codel _]"
530 upvar #0 found($kk) k
531 lappend k [list $vid $realname]
533 debug "CODED $kk $vid $realname"
537 proc parse-clipboard {} {
538 global clipboard found notes notes_used newnotes
540 catch { unset found }
541 catch { unset notes_used }
543 glset note_missings {}
547 set itemre { (\w+) = ([^=]*) }
548 set manyitemre "^\\\[ $itemre ( (?: ,\\ $itemre)* ) \\]\$"
552 foreach l [split $clipboard "\n"] {
554 errexpect-setline $lno $l
555 if {![string length $l]} continue
558 if {![regexp -expanded $manyitemre $l dummy \
559 thiskey thisval rhs]} {
560 errexpect-error "badly formatted"
562 set vi($thiskey) $thisval
563 if {![string length $rhs]} break
564 regsub {^, } $rhs {} rhs
570 if {[llength $newnotes]} {
571 foreach vid [lsort [array names notes]] {
572 if {![info exists notes_used($vid)]} {
573 manyset $notes($vid) lno notename
574 note-info $lno $vid $notename {} \
575 "vessel in notes no longer found"
581 proc load-clipboard-file {fn} {
583 glset clipboard [read $f]
588 #---------- loading and parsing the chart ----------
592 debug "FETCHING CHART"
593 set chart [eval exec $scraper [list | perl -we {
598 yppedia_chart_parse(\*STDIN, (new IO::File ">/dev/null"),
599 sub { sprintf "%d %d", @_; },
600 sub { printf "archlabel %d %d %s\n", @_; },
601 sub { printf "island %s %s\n", @_; },
602 sub { printf "league %s %s %s.\n", @_; },
603 sub { printf STDERR "warning: %s: incomprehensible: %s", @_; }
605 STDOUT->error and die $!;
614 return [expr {$c * $scale}]
617 proc chart-got/archlabel {args} { }
618 proc chart-got/island {x y args} {
619 # debug "ISLE $x $y $args"
620 global canvas isleloc
621 set isleloc($args) [list $x $y]
623 # $canvas create oval \
624 # [expr {[coord $x] - $sz}] [expr {[coord $y] - $sz}] \
625 # [expr {[coord $x] + $sz}] [expr {[coord $y] + $sz}] \
627 $canvas create text [coord $x] [coord $y] \
628 -text $args -anchor s
630 proc chart-got/league {x1 y1 x2 y2 kind} {
631 # debug "LEAGUE $x1 $y1 $x2 $y2 $kind"
633 set l [$canvas create line \
634 [coord $x1] [coord $y1] \
635 [coord $x2] [coord $y2]]
636 if {![string compare $kind .]} {
637 $canvas itemconfigure $l -dash .
641 proc redraw-needed {} {
643 debug "REDRAW NEEDED"
644 if {[info exists redraw_after]} return
645 set redraw_after [after 250 draw]
649 global chart found isleloc canvas redraw_after
651 catch { after cancel $redraw_after }
652 catch { unset redraw_after }
656 foreach l [split $chart "\n"] {
657 # debug "CHART-GOT $l"
658 set proc [lindex $l 0]
659 eval chart-got/$proc [lrange $l 1 end]
662 set lastislandname {}
663 foreach key [lsort [array names found]] {
664 set c [llength $found($key)]
665 # debug "SHOWING $key $c"
666 regexp {^(.*) (\S+)$} $key dummy islandname code
668 if {![filters-say-yes $code]} continue
670 set abbrev [code2abbrev $code]
672 if {[string compare $lastislandname $islandname]} {
673 manyset $isleloc($islandname) x y
676 set lastislandname $islandname
680 regsub -all {[0-9]} $text {} text
682 set text [format "%2d%s" $c $text]
684 set text [format " %s" $text]
686 set id [$canvas create text $x $y \
687 -anchor nw -font fixed \
689 set bbox [$canvas bbox $id]
690 set bid [eval $canvas create rectangle $bbox -fill white]
691 $canvas lower $bid $id
692 $canvas bind $id <ButtonPress> [list show-report $islandname $code]
693 $canvas bind $bid <ButtonPress> [list show-report $islandname $code]
694 manyset $bbox dummy dummy dummy y
698 panner::updatecanvas-bbox .ctrl.pan
702 #---------- parser error reporting ----------
704 proc parser-control-create {w base invokebuttontext etl_title} {
706 button $w.do -text $invokebuttontext -command invoke_$base
708 frame $w.resframe -width 120 -height 32
709 button $w.resframe.res -text {} -anchor nw \
710 -padx 1 -pady 1 -borderwidth 0 -justify left
711 glset deffont_$base [$w.resframe.res cget -font]
712 place $w.resframe.res -relx 0.5 -y 0 -anchor n
715 pack $w.resframe -side top -expand y -fill both
720 wm title $eb "where-vessels - $etl_title"
722 label $eb.title -text $etl_title
723 pack $eb.title -side top
725 button $eb.close -text Close -command [list wm withdraw $eb]
726 pack $eb.close -side bottom
728 frame $eb.emsg -bd 2 -relief groove
729 label $eb.emsg.lab -text "Error:"
730 text $eb.emsg.text -height 1
731 pack $eb.emsg.text -side bottom
732 pack $eb.emsg.lab -side left
734 pack $eb.emsg -side top -pady 2
736 frame $eb.text -bd 2 -relief groove
737 pack $eb.text -side bottom -pady 2
741 text $eb.text.text -width 85 \
742 -xscrollcommand [list $eb.text.xscroll set] \
743 -yscrollcommand [list $eb.text.yscroll set]
744 $eb.text.text tag configure error \
745 -background red -foreground white
747 scrollbar $eb.text.xscroll -orient horizontal \
748 -command [list $eb.text.text xview]
749 scrollbar $eb.text.yscroll -orient vertical \
750 -command [list $eb.text.text yview]
752 grid configure $eb.text.lab -row 0 -column 0 -sticky w
753 grid configure $eb.text.text -row 1 -column 0
754 grid configure $eb.text.yscroll -sticky ns -row 1 -column 1
755 grid configure $eb.text.xscroll -sticky ew -row 2 -column 0
758 proc parser-control-ok-core {w base background show} {
759 debug "parser-control-ok-core $w $base $background $show"
760 upvar #0 deffont_$base deffont
761 $w.resframe.res configure \
762 -background $background -disabledforeground black -font $deffont \
763 -state disabled -command {} \
766 proc parser-control-ok {w base show} {
767 parser-control-ok-core $w $base green $show
769 proc parser-control-none {w base show} {
770 parser-control-ok-core $w $base blue $show
772 proc parser-control-failed-core {w base foreground background smallfont
773 tiny summary fulldesc fulldata} {
774 debug "parser-control-failed-core $w $base $summary $fulldesc"
775 upvar #0 deffont_$base deffont
778 $eb.emsg.text delete 0.0 end
779 $eb.emsg.text insert end $summary
781 $eb.text.lab configure -text $fulldesc
782 $eb.text.text delete 0.0 end
783 $eb.text.text insert end $fulldata
785 regsub -all {.{18}} $tiny "&\n" ewrap
793 $w.resframe.res configure \
794 -background $background -foreground $foreground -font $font \
795 -state normal -command [list wm deiconify $eb] \
799 proc parser-control-failed-expected {w base emsg lno ei fulldesc newdata} {
802 set line [lindex [split $ei "\n"] 0]
803 debug "parser-control-failed-expected: $w $base: $lno: $emsg\n $line"
805 parser-control-failed-core $w $base \
807 "err: [string trim $emsg]: \"$line\"" \
808 "at line $lno: $emsg" \
811 $eb.text.text tag add error $lno.0 $lno.end
812 $eb.text.text see $lno.0
814 proc parser-control-failed-unexpected {w base emsg ei} {
816 parser-control-failed-core $w $base \
818 $emsg $emsg "Details and stack trace:" $ei
821 proc reparse {base varname old fulldesc okshow noneshow parse ok} {
822 upvar #0 $varname var
823 manyset [errexpect-catch {
825 if {[string length [string trim $var]]} {
826 parser-control-ok .ctrl.$base $base $okshow
828 parser-control-none .ctrl.$base $base $noneshow
830 }] failed emsg lno ei
832 parser-control-failed-expected .ctrl.$base $base \
833 $emsg $lno $ei $fulldesc $var
841 #---------- main user interface ----------
843 proc widgets-setup {} {
844 global canvas debug pirate ocean
846 wm geometry . 1024x480
847 wm title . "where-vessels - $pirate on the $ocean ocean"
851 frame .f -border 1 -relief groove
854 pack $canvas -expand 1 -fill both
855 pack .f -expand 1 -fill both -side left
859 frame .filter -relief groove -bd 2
860 pack .filter -side bottom
862 label .filter.title -text Filter
863 grid configure .filter.title -row 0 -column 0 -columnspan 2
865 #----- control panel -----
868 pack .ctrl -side left -anchor n
870 debug "BBOX [$canvas bbox all]"
872 panner::canvas-scroll-bbox .f.c
873 panner::create .ctrl.pan .f.c 120 120 $debug
875 pack .ctrl.pan -side top -pady 10 -padx 5
877 pack .ctrl.zoom -side top
879 button .ctrl.zoom.out -text - -font {Courier 16} -command {zoom /2}
880 button .ctrl.zoom.in -text + -font {Courier 16} -command {zoom *2}
881 pack .ctrl.zoom.out .ctrl.zoom.in -side left
883 parser-control-create .ctrl.acquire \
885 "Clipboard parsing error" \
887 pack .ctrl.acquire -side top -pady 2
889 parser-control-create .ctrl.notes \
890 notes "Reload notes" \
891 "Vessel notes loading report" \
893 pack .ctrl.notes -side top -pady 2
895 #----- decoding etc. report -----
898 pack .report -side left -anchor n
900 label .report.island -text { }
902 frame .report.abbrev -background black
903 glset report_abbrev { }
904 entry .report.abbrev.abbrev -state readonly \
905 -textvariable report_abbrev \
906 -borderwidth 0 -relief flat -width 0 \
907 -highlightbackground white \
908 -readonlybackground white -foreground black
909 pack .report.abbrev.abbrev -side left -padx 1 -pady 1
912 label .report.code.lab -text Code:
913 glset report_code { }
914 entry .report.code.code -state readonly -textvariable report_code -width 15
915 pack .report.code.lab .report.code.code -side left
916 frame .report.details -bd 2 -relief groove -padx 2 -pady 2
918 listbox .report.list -height 5
920 pack .report.island .report.abbrev .report.details \
921 .report.list .report.code -side top
922 pack configure .report.details -fill x
924 foreach sw {inport class subclass lock own xabbrev} {
925 label .report.details.$sw -text { }
926 pack .report.details.$sw -side top -anchor w
930 proc report-set {sw val} { .report.details.$sw configure -text $val }
932 proc show-report {islandname code} {
933 .report.island configure -text $islandname
934 glset report_code $code
935 glset report_abbrev [code2abbrev $code]
937 show-report-decode $code
939 set kk "$islandname $code"
940 upvar #0 found($kk) k
942 .report.list delete 0 end
945 manyset $entry vid name
946 .report.list insert end $name
952 set nscale [expr "\$scale $extail"]
953 debug "ZOOM $scale $nscale"
954 if {$nscale < 1 || $nscale > 200} return
959 proc invoke_acquire {} {
960 global clipboard errorInfo
964 set clipboard [clipboard get]
966 parser-control-failed-unexpected .ctrl.acquire acquire \
967 $emsg "fetching clipboard:\n\n$errorInfo"
972 clipboard $old "Clipboard contents:" { acquired ok } { no vessels } {
980 proc invoke_notes {} {
981 global notes_data errorInfo notes_loc
987 parser-control-failed-unexpected .ctrl.notes notes \
988 $emsg "loading $notes_loc:\n\n$errorInfo"
993 notes_data $old "Vessel notes:" "loaded ok" { no notes } {
1002 #---------- main program ----------
1008 httpclientsetup where-vessels
1014 if {[catch { parse-clipboard } emsg]} {
1015 puts stderr "$emsg\n$errorInfo"
1018 after idle invoke_notes