--- ray/src/util/do_results3.6.tcl 1995/09/13 14:24:16 2.6 +++ ray/src/util/do_results3.6.tcl 2003/02/22 02:07:30 2.12 @@ -1,4 +1,4 @@ -# SCCSid "$SunId$ LBL" +# RCSid: $Id: do_results3.6.tcl,v 2.12 2003/02/22 02:07:30 greg Exp $ # # Results screen for trad # @@ -33,9 +33,12 @@ set conv(ras-8,suf) .ras set conv(ras-24,nam) "Sun 24-bit" set conv(ras-24,com) "ra_pr24 %s %s" set conv(ras-24,suf) .ras -set conv(PS,nam) "PostScript B&W" -set conv(PS,com) "ra_ps %s %s" -set conv(PS,suf) .ps +set conv(PS-bw,nam) "PostScript B&W" +set conv(PS-bw,com) "ra_ps -b -C %s %s" +set conv(PS-bw,suf) .ps +set conv(PS-clr,nam) "PostScript Color" +set conv(PS-clr,com) "ra_ps -c -C %s %s" +set conv(PS-clr,suf) .ps set conv(tga-bw,nam) "Targa B&W" set conv(tga-bw,com) "ra_t8 -b %s %s" set conv(tga-bw,suf) .tga @@ -48,13 +51,13 @@ set conv(tga-16,suf) .tga set conv(tga-24,nam) "Targa 24-bit" set conv(tga-24,com) "ra_t16 -3 %s %s" set conv(tga-24,suf) .tga -set conv(types) {GIF-bw GIF-8 PICT PS PPM-asc PPM-bin ras-bw ras-8 ras-24\ - tga-bw tga-8 tga-16 tga-24 TIFF-bw TIFF-24} +set conv(types) {GIF-bw GIF-8 PICT PS-bw PS-clr PPM-asc PPM-bin ras-bw ras-8\ + ras-24 tga-bw tga-8 tga-16 tga-24 TIFF-bw TIFF-24} set conv(typ) tga-24 proc testappend {flst tf} { # test if tf exists and append to flst if so upvar $flst mylist - if [file exists $tf] { + if [file isfile $tf] { lappend mylist $tf } } @@ -64,9 +67,9 @@ proc list_views {} { # List finished and unfinished p set fpics {} set ufpics {} foreach vw $radvar(view) { - if [file exists ${rawfroot}_[lindex $vw 0].unf] { + if [file isfile ${rawfroot}_[lindex $vw 0].unf] { lappend ufpics [lindex $vw 0] - } elseif {[file exists $radvar(PICTURE)_[lindex $vw 0].pic]} { + } elseif {[file isfile $radvar(PICTURE)_[lindex $vw 0].pic]} { lappend fpics [lindex $vw 0] } } @@ -80,7 +83,7 @@ proc list_views {} { # List finished and unfinished p proc delpic {} { # Delete selected pictures global curmess set selected_pics [get_selpics 1] - if {"$selected_pics" == {}} { + if {$selected_pics == {}} { set curmess "No pictures selected." return } @@ -119,26 +122,22 @@ proc get_selpics {{getall 0}} { # return selected pic proc dsppic {} { # Display selected pictures global curmess dispcom radvar set selected_pics [get_selpics] - if {"$selected_pics" == {}} { + if {$selected_pics == {}} { set curmess "No pictures selected." return } - if {"$radvar(EXPOSURE)" == {}} { + if {$radvar(EXPOSURE) == {}} { set ev 0 } else { if [regexp {^[+-]} $radvar(EXPOSURE)] { - set ev $radvar(EXPOSURE) + set ev [expr {round($radvar(EXPOSURE))}] } else { - set ev [expr {log($radvar(EXPOSURE))/log(2)}] + set ev [expr {round(log($radvar(EXPOSURE))/log(2))}] } - if {$ev < 0} { - set ev [expr {int($ev - .5)}] - } else { - set ev [expr {int($ev + .5)}] - } } foreach p $selected_pics { - if [string match *.unf $p] { + if {[string match *.unf $p] || + $radvar(PICTURE) == $radvar(RAWFILE)} { set dc [format $dispcom $ev $p] } else { set dc [format $dispcom 0 $p] @@ -233,7 +232,7 @@ proc do_results w { # Results screen helplink $w.cnvb trad results convert menubutton $w.typb -text $conv($conv(typ),nam) -relief raised \ -menu $w.typb.m - place $w.typb -relwidth .1786 -relheight .0610 -relx .2143 -rely .7317 + place $w.typb -relwidth .1986 -relheight .0610 -relx .2143 -rely .7317 helplink $w.typb trad results convtype menu $w.typb.m foreach t $conv(types) { @@ -243,10 +242,10 @@ proc do_results w { # Results screen set convdest $radvar(PICTURE)_%s$conv($t,suf)" } label $w.fil -text File: - place $w.fil -relx .4286 -rely .7317 + place $w.fil -relx .4486 -rely .7317 set convdest $radvar(PICTURE)_%s$conv($conv(typ),suf) entry $w.file -textvariable convdest -relief sunken - place $w.file -relwidth .4286 -relheight .0610 -relx .5000 -rely .7317 + place $w.file -relwidth .4086 -relheight .0610 -relx .5200 -rely .7317 helplink $w.file trad results convfile # Print picture(s) button $w.prtb -text Print -relief raised -command prtpic @@ -261,13 +260,13 @@ proc do_results w { # Results screen place $w.prte -relwidth .5714 -relheight .0610 -relx .3571 -rely .8537 helplink $w.prte trad results printcommand # Fill in views - if {[info exists radvar(RAWFILE)] && $radvar(RAWFILE) != {}} { + if {$radvar(RAWFILE) != {}} { set rawfroot $radvar(RAWFILE) + if {$radvar(RAWFILE) == $radvar(PICTURE)} { + set curmess "Warning: finished views are unfiltered" + } } else { set rawfroot $radvar(PICTURE) - } - if {! [info exists radvar(ZFILE)]} { - set radvar(ZFILE) {} } list_views }