Ignore:
Timestamp:
Sep 21, 2012 5:56:33 PM (11 years ago)
Author:
toby
Message:

more Fourier work; remove warning on R *3* H sg in CIF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/export_drawxtl.tcl

    r1220 r1221  
    162162              -command "$bx.f.canvas yview"] -sticky ns -row 3 -column 2
    163163    grid [button $bx.f.1.1 -text "Setup\nFourier" \
    164               -command EditFourier] -column 0 -row 0
     164              -command {EditFourier $::expgui(export_phase); SetupFourierButtons} \
     165             ] -column 0 -row 0
    165166    grid [button [set ::DXTL(FourCompute) $bx.f.1.2] -text "Compute\nFourier" \
    166167              -command {DXTLwritegrd $expgui(export_phase)}] -column 1 -row 0
     
    186187    trace variable ::expgui(export_phase) w OnNewFourierPhase
    187188    OnNewFourierPhase
    188 #SetupFourierButtons
    189 #return
    190189    # this appears to be needed by OSX
    191190    ResizeWin .export
     
    584583# and the files that are present
    585584proc SetupFourierButtons {} {
    586     set phase $::expgui(export_phase)
    587     $::DXTL(FourCompute) config -state disabled
    588     $::DXTL(AddContour) config -state disabled
    589     $::DXTL(fmenu) delete 0 end
     585    if {[catch {
     586        set phase $::expgui(export_phase)
     587        $::DXTL(FourCompute) config -state disabled
     588        $::DXTL(AddContour) config -state disabled
     589        $::DXTL(fmenu) delete 0 end
     590    }]} return
    590591    set ::DXTL(mtype) ""
    591592    set ::DXTL(mfil) ""
     
    619620        incr i
    620621    }
    621 }
    622 
    623 proc EditFourier {} {
    624     set phase $::expgui(export_phase)
    625     # check that all Fourier records are set to the current phase
    626     foreach i [listFourier] {
    627         set ph [Fourierinfo $i phase]
    628         if {$ph != $phase} {Fourierinfo $i phase set $phase}
    629     }
    630     # for now we will not offer access to section, (dmin, dmax not supported)
    631     set typelist {}
    632     foreach i [listFourier] {
    633         lappend typelist [Fourierinfo $i type]
    634     }
    635     set histlist [FourierHists $phase]
    636     set limits  [getFourierLimits $phase]
    637     set box .export.fourier
    638     catch {destroy $box}
    639     toplevel $box
    640     grid [frame $box.1] -row 1 -column 1 -rowspan 10
    641     grid [frame $box.2] -row 1 -column 2 -rowspan 10
    642     grid [frame $box.b] -sticky news -row 11 -column 1 -columnspan 2
    643     grid columnconfigure $box.b 0 -weight 1
    644     grid columnconfigure $box.b 3 -weight 1
    645     grid [button $box.b.1 -text Continue \
    646               -command "set ::DXTL(quit) 0; destroy $box" \
    647              ] -row 1 -column 1
    648     grid [button $box.b.2 -text Quit \
    649               -command "set ::DXTL(quit) 1; destroy $box" \
    650              ] -row 1 -column 2
    651    
    652     # map type selection
    653     set row 0
    654     grid [label $box.1.$row -text "Select map type(s)"] -column 1 -row $row
    655     foreach typ {DELF FCLC FOBS 2FDF 3FDF 4FDF PTSN DPTS} lbl {
    656         "Difference Fourier" "Fcalc Fourier" "Fobs Fourier"
    657         "2*Fo-Fc Fourier" "3*Fo-2*Fc Fourier" "4*Fo-3*Fc Fourier" "Patterson map" "Delta-F Patterson"\
    658         } {
    659             incr row
    660             grid [ \
    661                        checkbutton $box.1.$row -variable ::DXTL($typ) \
    662                        -text "$lbl ($typ)" \
    663                       ] -column 1 -row $row -sticky w
    664             if {[lsearch $typelist $typ] == -1} {
    665                 set ::DXTL($typ) 0
    666             } else {
    667                 set ::DXTL($typ) 1
    668             }
    669         }
    670     grid [label $box.2.a1 -text "Histogram(s) to be used\n(last superceeds)"] -column 1 -row 1
    671     grid [entry $box.2.a2 -textvariable ::DXTL(histlist) -width 20] -column 2 -row 1 -columnspan 3
    672     set ::DXTL(histlist) $histlist
    673     grid [label $box.2.m1 -text min] -column 2 -row 2
    674     grid [label $box.2.m2 -text max] -column 3 -row 2
    675     grid [label $box.2.m3 -text "map step\n(A)"] -column 4 -row 2
    676     set row 3
    677     foreach axis {X Y Z} lim [lrange $limits 1 end] step [lindex $limits 0] {
    678         incr row
    679         grid [label $box.2.0$axis -text "$axis limits"] -column 1 -row $row -sticky e
    680         grid [entry $box.2.min$axis -width 10 -textvariable ::DXTL(min$axis)] -column 2 -row $row
    681         grid [entry $box.2.max$axis -width 10 -textvariable ::DXTL(max$axis)] -column 3 -row $row
    682         grid [entry $box.2.step$axis -width 10 -textvariable ::DXTL(step$axis)] -column 4 -row $row
    683         set ::DXTL(min$axis) [lindex $lim 0]
    684         set ::DXTL(max$axis) [lindex $lim 1]
    685         set ::DXTL(step$axis) [format "%.4f" [expr {$step + 0.0001}]]
    686     }
    687     putontop $box
    688     tkwait window $box
    689     afterputontop
    690     if $::DXTL(quit) return
    691     delFourier
    692     foreach typ {DELF FCLC FOBS 2FDF 3FDF 4FDF PTSN DPTS} {
    693         if {$::DXTL($typ)} {
    694             addFourier $phase $typ
    695         }
    696     }
    697     FourierHists $phase set $::DXTL(histlist)
    698     setFourierLimits $phase \
    699         [list $::DXTL(stepX) $::DXTL(stepY) $::DXTL(stepZ)] \
    700         [list $::DXTL(minX) $::DXTL(maxX)] \
    701         [list $::DXTL(minY) $::DXTL(maxY)] \
    702         [list $::DXTL(minZ) $::DXTL(maxZ)]
    703     SetupFourierButtons
    704     incr ::expgui(changed)
    705622}
    706623
Note: See TracChangeset for help on using the changeset viewer.