| 1 |
greg |
2.1 |
# SCCSid "$SunId$ LBL"
|
| 2 |
|
|
#
|
| 3 |
|
|
# Results screen for trad
|
| 4 |
|
|
#
|
| 5 |
|
|
|
| 6 |
|
|
set conv(TIFF-bw,nam) "TIFF B&W"
|
| 7 |
|
|
set conv(TIFF-bw,com) "ra_tiff -b %s %s"
|
| 8 |
|
|
set conv(TIFF-bw,suf) .tif
|
| 9 |
|
|
set conv(TIFF-24,nam) "TIFF 24-bit"
|
| 10 |
|
|
set conv(TIFF-24,com) "ra_tiff %s %s"
|
| 11 |
|
|
set conv(TIFF-24,suf) .tif
|
| 12 |
|
|
set conv(GIF-bw,nam) "GIF B&W"
|
| 13 |
|
|
set conv(GIF-bw,com) "ra_gif -b %s %s"
|
| 14 |
|
|
set conv(GIF-bw,suf) .gif
|
| 15 |
|
|
set conv(GIF-8,nam) "GIF"
|
| 16 |
|
|
set conv(GIF-8,com) "ra_gif -n 10 -d %s %s"
|
| 17 |
|
|
set conv(GIF-8,suf) .gif
|
| 18 |
|
|
set conv(PPM-bin,nam) "PPM (binary)"
|
| 19 |
|
|
set conv(PPM-bin,com) "ra_ppm %s %s"
|
| 20 |
|
|
set conv(PPM-bin,suf) .ppm
|
| 21 |
|
|
set conv(PPM-asc,nam) "PPM (ASCII)"
|
| 22 |
|
|
set conv(PPM-asc,com) "ra_ppm -a %s %s"
|
| 23 |
|
|
set conv(PPM-asc,suf) .ppm
|
| 24 |
|
|
set conv(PICT,nam) "PICT 32-bit"
|
| 25 |
|
|
set conv(PICT,com) "ra_pict -g 1.8 %s %s"
|
| 26 |
|
|
set conv(PICT,suf) .pict
|
| 27 |
|
|
set conv(ras-bw,nam) "Sun B&W"
|
| 28 |
|
|
set conv(ras-bw,com) "ra_pr -b %s %s"
|
| 29 |
|
|
set conv(ras-bw,suf) .ras
|
| 30 |
|
|
set conv(ras-8,nam) "Sun 8-bit"
|
| 31 |
|
|
set conv(ras-8,com) "ra_pr %s %s"
|
| 32 |
|
|
set conv(ras-8,suf) .ras
|
| 33 |
|
|
set conv(ras-24,nam) "Sun 24-bit"
|
| 34 |
|
|
set conv(ras-24,com) "ra_pr24 %s %s"
|
| 35 |
|
|
set conv(ras-24,suf) .ras
|
| 36 |
|
|
set conv(PS,nam) "PostScript B&W"
|
| 37 |
|
|
set conv(PS,com) "ra_ps %s %s"
|
| 38 |
|
|
set conv(PS,suf) .ps
|
| 39 |
|
|
set conv(tga-bw,nam) "Targa B&W"
|
| 40 |
|
|
set conv(tga-bw,com) "ra_t8 -b %s %s"
|
| 41 |
|
|
set conv(tga-bw,suf) .tga
|
| 42 |
|
|
set conv(tga-8,nam) "Targa 8-bit"
|
| 43 |
|
|
set conv(tga-8,com) "ra_t8 -n 10 -d %s %s"
|
| 44 |
|
|
set conv(tga-8,suf) .tga
|
| 45 |
|
|
set conv(tga-16,nam) "Targa 16-bit"
|
| 46 |
|
|
set conv(tga-16,com) "ra_t16 -2 %s %s"
|
| 47 |
|
|
set conv(tga-16,suf) .tga
|
| 48 |
|
|
set conv(tga-24,nam) "Targa 24-bit"
|
| 49 |
|
|
set conv(tga-24,com) "ra_t16 -3 %s %s"
|
| 50 |
|
|
set conv(tga-24,suf) .tga
|
| 51 |
|
|
set conv(types) {GIF-bw GIF-8 PICT PS PPM-asc PPM-bin ras-bw ras-8 ras-24\
|
| 52 |
|
|
tga-bw tga-8 tga-16 tga-24 TIFF-bw TIFF-24}
|
| 53 |
|
|
set conv(typ) tga-24
|
| 54 |
|
|
|
| 55 |
greg |
2.5 |
proc testappend {flst tf} { # test if tf exists and append to flst if so
|
| 56 |
|
|
upvar $flst mylist
|
| 57 |
|
|
if [file exists $tf] {
|
| 58 |
|
|
lappend mylist $tf
|
| 59 |
|
|
}
|
| 60 |
|
|
}
|
| 61 |
|
|
|
| 62 |
greg |
2.1 |
proc list_views {} { # List finished and unfinished pictures
|
| 63 |
greg |
2.5 |
global radvar fvwbox ufvwbox alldone rawfroot
|
| 64 |
greg |
2.1 |
set fpics {}
|
| 65 |
|
|
set ufpics {}
|
| 66 |
|
|
foreach vw $radvar(view) {
|
| 67 |
greg |
2.5 |
if [file exists ${rawfroot}_[lindex $vw 0].unf] {
|
| 68 |
greg |
2.1 |
lappend ufpics [lindex $vw 0]
|
| 69 |
greg |
2.5 |
} elseif {[file exists $radvar(PICTURE)_[lindex $vw 0].pic]} {
|
| 70 |
greg |
2.1 |
lappend fpics [lindex $vw 0]
|
| 71 |
|
|
}
|
| 72 |
|
|
}
|
| 73 |
|
|
$fvwbox delete 0 end
|
| 74 |
|
|
eval $fvwbox insert end $fpics
|
| 75 |
|
|
$ufvwbox delete 0 end
|
| 76 |
|
|
eval $ufvwbox insert end $ufpics
|
| 77 |
greg |
2.4 |
set alldone [expr [llength $fpics] == [llength $radvar(view)]]
|
| 78 |
greg |
2.1 |
}
|
| 79 |
|
|
|
| 80 |
|
|
proc delpic {} { # Delete selected pictures
|
| 81 |
greg |
2.4 |
global curmess
|
| 82 |
greg |
2.6 |
set selected_pics [get_selpics 1]
|
| 83 |
greg |
2.7 |
if {$selected_pics == {}} {
|
| 84 |
greg |
2.1 |
set curmess "No pictures selected."
|
| 85 |
|
|
return
|
| 86 |
|
|
}
|
| 87 |
|
|
if [tk_dialog .dlg {Verification} \
|
| 88 |
greg |
2.5 |
"Really delete file(s) $selected_pics?" \
|
| 89 |
greg |
2.3 |
questhead 0 {Delete} {Cancel}] {
|
| 90 |
greg |
2.1 |
return
|
| 91 |
|
|
}
|
| 92 |
|
|
if {! [catch {eval exec rm $selected_pics < /dev/null} curmess]} {
|
| 93 |
|
|
set curmess "Deleted [llength $selected_pics] file(s)."
|
| 94 |
|
|
}
|
| 95 |
|
|
list_views
|
| 96 |
|
|
}
|
| 97 |
|
|
|
| 98 |
greg |
2.6 |
proc get_selpics {{getall 0}} { # return selected pictures
|
| 99 |
greg |
2.5 |
global fvwbox ufvwbox radvar rawfroot
|
| 100 |
greg |
2.1 |
set sl {}
|
| 101 |
|
|
foreach i [$fvwbox curselection] {
|
| 102 |
greg |
2.5 |
testappend sl $radvar(PICTURE)_[$fvwbox get $i].pic
|
| 103 |
greg |
2.6 |
if {$getall && $rawfroot != $radvar(PICTURE)} {
|
| 104 |
greg |
2.5 |
testappend sl ${rawfroot}_[$fvwbox get $i].pic
|
| 105 |
|
|
}
|
| 106 |
greg |
2.6 |
if {$getall && $radvar(ZFILE) != {}} {
|
| 107 |
greg |
2.5 |
testappend sl $radvar(ZFILE)_[$fvwbox get $i].zbf
|
| 108 |
|
|
}
|
| 109 |
greg |
2.1 |
}
|
| 110 |
|
|
foreach i [$ufvwbox curselection] {
|
| 111 |
greg |
2.5 |
testappend sl ${rawfroot}_[$ufvwbox get $i].unf
|
| 112 |
greg |
2.6 |
if {$getall && $radvar(ZFILE) != {}} {
|
| 113 |
greg |
2.5 |
testappend sl $radvar(ZFILE)_[$ufvwbox get $i].zbf
|
| 114 |
|
|
}
|
| 115 |
greg |
2.1 |
}
|
| 116 |
|
|
return $sl
|
| 117 |
|
|
}
|
| 118 |
|
|
|
| 119 |
|
|
proc dsppic {} { # Display selected pictures
|
| 120 |
|
|
global curmess dispcom radvar
|
| 121 |
|
|
set selected_pics [get_selpics]
|
| 122 |
greg |
2.7 |
if {$selected_pics == {}} {
|
| 123 |
greg |
2.1 |
set curmess "No pictures selected."
|
| 124 |
|
|
return
|
| 125 |
|
|
}
|
| 126 |
greg |
2.7 |
if {$radvar(EXPOSURE) == {}} {
|
| 127 |
greg |
2.1 |
set ev 0
|
| 128 |
|
|
} else {
|
| 129 |
|
|
if [regexp {^[+-]} $radvar(EXPOSURE)] {
|
| 130 |
greg |
2.8 |
set ev [expr {round($radvar(EXPOSURE))}]
|
| 131 |
greg |
2.1 |
} else {
|
| 132 |
greg |
2.8 |
set ev [expr {round(log($radvar(EXPOSURE))/log(2))}]
|
| 133 |
greg |
2.1 |
}
|
| 134 |
|
|
}
|
| 135 |
|
|
foreach p $selected_pics {
|
| 136 |
greg |
2.7 |
if {[string match *.unf $p] ||
|
| 137 |
greg |
2.8 |
$radvar(PICTURE) == $radvar(RAWFILE)} {
|
| 138 |
greg |
2.1 |
set dc [format $dispcom $ev $p]
|
| 139 |
|
|
} else {
|
| 140 |
|
|
set dc [format $dispcom 0 $p]
|
| 141 |
|
|
}
|
| 142 |
|
|
catch {eval exec $dc} curmess
|
| 143 |
|
|
}
|
| 144 |
|
|
}
|
| 145 |
|
|
|
| 146 |
|
|
proc cnvpic {} { # Convert selected pictures
|
| 147 |
|
|
global curmess radvar conv convdest fvwbox
|
| 148 |
|
|
set curmess "No finished pictures selected."
|
| 149 |
|
|
foreach i [$fvwbox curselection] {
|
| 150 |
|
|
set vw [$fvwbox get $i]
|
| 151 |
|
|
set p $radvar(PICTURE)_$vw.pic
|
| 152 |
|
|
set df [format $convdest $vw]
|
| 153 |
|
|
set curmess "Converting $p to $df..."
|
| 154 |
greg |
2.2 |
update
|
| 155 |
greg |
2.1 |
set cc [format $conv($conv(typ),com) $p $df]
|
| 156 |
|
|
if {! [catch {eval exec $cc} curmess]} {
|
| 157 |
|
|
set curmess "Done."
|
| 158 |
|
|
}
|
| 159 |
|
|
}
|
| 160 |
|
|
}
|
| 161 |
|
|
|
| 162 |
|
|
proc prtpic {} { # Print selected pictures
|
| 163 |
|
|
global curmess prntcom radvar fvwbox
|
| 164 |
|
|
set curmess "No finished pictures selected."
|
| 165 |
|
|
foreach i [$fvwbox curselection] {
|
| 166 |
|
|
set p $radvar(PICTURE)_[$fvwbox get $i].pic
|
| 167 |
|
|
set curmess "Printing $p..."
|
| 168 |
greg |
2.2 |
update
|
| 169 |
greg |
2.1 |
set pc [format $prntcom $p]
|
| 170 |
|
|
if {! [catch {eval exec $pc} curmess]} {
|
| 171 |
|
|
set curmess "Done."
|
| 172 |
|
|
}
|
| 173 |
|
|
}
|
| 174 |
|
|
}
|
| 175 |
|
|
|
| 176 |
|
|
proc do_results w { # Results screen
|
| 177 |
greg |
2.5 |
global radvar curmess fvwbox ufvwbox dispcom prntcom conv \
|
| 178 |
|
|
rawfroot convdest
|
| 179 |
greg |
2.1 |
if {"$w" == "done"} {
|
| 180 |
greg |
2.5 |
unset fvwbox ufvwbox convdest rawfroot
|
| 181 |
greg |
2.1 |
return
|
| 182 |
|
|
}
|
| 183 |
|
|
frame $w
|
| 184 |
|
|
# Finished view box
|
| 185 |
|
|
label $w.vvl -text "Finished views"
|
| 186 |
|
|
place $w.vvl -relx .0714 -rely .0610
|
| 187 |
|
|
frame $w.vnl
|
| 188 |
|
|
scrollbar $w.vnl.sb -relief sunken -command "$w.vnl.lb yview"
|
| 189 |
|
|
listbox $w.vnl.lb -relief sunken -yscroll "$w.vnl.sb set"
|
| 190 |
|
|
pack $w.vnl.sb -side right -fill y
|
| 191 |
|
|
pack $w.vnl.lb -side left -expand yes -fill both
|
| 192 |
|
|
place $w.vnl -relwidth .2143 -relheight .4268 -relx .0714 -rely .1220
|
| 193 |
|
|
set fvwbox $w.vnl.lb
|
| 194 |
|
|
helplink $w.vnl.lb trad results finished
|
| 195 |
|
|
# Unfinished view box
|
| 196 |
|
|
label $w.uvvl -text "Unfinished views"
|
| 197 |
|
|
place $w.uvvl -relx .7143 -rely .0610
|
| 198 |
|
|
frame $w.uvnl
|
| 199 |
|
|
scrollbar $w.uvnl.sb -relief sunken -command "$w.uvnl.lb yview"
|
| 200 |
|
|
listbox $w.uvnl.lb -relief sunken -yscroll "$w.uvnl.sb set"
|
| 201 |
|
|
pack $w.uvnl.sb -side right -fill y
|
| 202 |
|
|
pack $w.uvnl.lb -side left -expand yes -fill both
|
| 203 |
|
|
place $w.uvnl -relwidth .2143 -relheight .4268 -relx .7143 -rely .1220
|
| 204 |
|
|
set ufvwbox $w.uvnl.lb
|
| 205 |
|
|
helplink $w.uvnl.lb trad results unfinished
|
| 206 |
|
|
# Rescan button
|
| 207 |
|
|
button $w.rsb -text Rescan -relief raised -command list_views
|
| 208 |
|
|
place $w.rsb -relwidth .1071 -relheight .0610 -relx .4464 -rely .2439
|
| 209 |
|
|
helplink $w.rsb trad results rescan
|
| 210 |
|
|
# Delete button
|
| 211 |
|
|
button $w.del -text Delete -relief raised -command delpic
|
| 212 |
|
|
place $w.del -relwidth .1071 -relheight .0610 -relx .4464 -rely .3659
|
| 213 |
|
|
helplink $w.del trad results delete
|
| 214 |
|
|
# Display picture(s)
|
| 215 |
|
|
if {! [info exists dispcom]} {
|
| 216 |
|
|
set dispcom "ximage -e %+d %s >& /dev/null &"
|
| 217 |
|
|
}
|
| 218 |
|
|
button $w.dpyb -text Display -relief raised -command dsppic
|
| 219 |
|
|
place $w.dpyb -relwidth .1071 -relheight .0610 -relx .0714 -rely .6098
|
| 220 |
|
|
helplink $w.dpyb trad results display
|
| 221 |
|
|
label $w.dpycl -text Command:
|
| 222 |
|
|
place $w.dpycl -relx .2143 -rely .6098
|
| 223 |
|
|
entry $w.dpyce -textvariable dispcom -relief sunken
|
| 224 |
|
|
place $w.dpyce -relwidth .5714 -relheight .0610 -relx .3571 -rely .6098
|
| 225 |
|
|
helplink $w.dpyce trad results dispcommand
|
| 226 |
|
|
# Convert picture(s)
|
| 227 |
|
|
button $w.cnvb -text Convert -relief raised -command cnvpic
|
| 228 |
|
|
place $w.cnvb -relwidth .1071 -relheight .0610 -relx .0714 -rely .7317
|
| 229 |
|
|
helplink $w.cnvb trad results convert
|
| 230 |
|
|
menubutton $w.typb -text $conv($conv(typ),nam) -relief raised \
|
| 231 |
|
|
-menu $w.typb.m
|
| 232 |
|
|
place $w.typb -relwidth .1786 -relheight .0610 -relx .2143 -rely .7317
|
| 233 |
|
|
helplink $w.typb trad results convtype
|
| 234 |
|
|
menu $w.typb.m
|
| 235 |
|
|
foreach t $conv(types) {
|
| 236 |
|
|
$w.typb.m add radiobutton -variable conv(typ) -value $t \
|
| 237 |
|
|
-label $conv($t,nam) \
|
| 238 |
|
|
-command "$w.typb configure -text \"$conv($t,nam)\"
|
| 239 |
|
|
set convdest $radvar(PICTURE)_%s$conv($t,suf)"
|
| 240 |
|
|
}
|
| 241 |
|
|
label $w.fil -text File:
|
| 242 |
|
|
place $w.fil -relx .4286 -rely .7317
|
| 243 |
|
|
set convdest $radvar(PICTURE)_%s$conv($conv(typ),suf)
|
| 244 |
|
|
entry $w.file -textvariable convdest -relief sunken
|
| 245 |
|
|
place $w.file -relwidth .4286 -relheight .0610 -relx .5000 -rely .7317
|
| 246 |
|
|
helplink $w.file trad results convfile
|
| 247 |
|
|
# Print picture(s)
|
| 248 |
|
|
button $w.prtb -text Print -relief raised -command prtpic
|
| 249 |
|
|
place $w.prtb -relwidth .1071 -relheight .0610 -relx .0714 -rely .8537
|
| 250 |
|
|
helplink $w.prtb trad results print
|
| 251 |
|
|
label $w.prtl -text Command:
|
| 252 |
|
|
place $w.prtl -relx .2143 -rely .8537
|
| 253 |
|
|
if {! [info exists prntcom]} {
|
| 254 |
|
|
set prntcom "ra_ps %s | lpr"
|
| 255 |
|
|
}
|
| 256 |
|
|
entry $w.prte -textvariable prntcom -relief sunken
|
| 257 |
|
|
place $w.prte -relwidth .5714 -relheight .0610 -relx .3571 -rely .8537
|
| 258 |
|
|
helplink $w.prte trad results printcommand
|
| 259 |
|
|
# Fill in views
|
| 260 |
greg |
2.7 |
if {$radvar(RAWFILE) != {}} {
|
| 261 |
greg |
2.5 |
set rawfroot $radvar(RAWFILE)
|
| 262 |
greg |
2.8 |
if {$radvar(RAWFILE) == $radvar(PICTURE)} {
|
| 263 |
|
|
set curmess "Warning: finished views are unfiltered"
|
| 264 |
|
|
}
|
| 265 |
greg |
2.5 |
} else {
|
| 266 |
|
|
set rawfroot $radvar(PICTURE)
|
| 267 |
|
|
}
|
| 268 |
greg |
2.1 |
list_views
|
| 269 |
|
|
}
|