Changeset 234 for trunk/expgui
- Timestamp:
- Dec 4, 2009 5:02:38 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2000/06/09 03:45:28 to 2000/07/06 22:43:40
- Property rcs:lines changed from +51 -19 to +118 -158
- Property rcs:rev changed from 1.27 to 1.28
r199 r234 67 67 # use a separate window for DISAGL (default) 68 68 set expgui(disaglSeparateBox) 1 69 set expgui(DefaultPeakType) 0 69 70 #============================================================================= 70 # Store names of profile terms.71 array set expgui {72 prof-T-1 {TOF-type1 alp-0 bet-0 sig-0 alp-1 bet-1 sig-1 rstr rsta \73 sig-2 rsca s1ec s2ec }74 prof-T-2 {TOF-type2 alp-0 sig-0 gam-0 alp-1 sig-1 gam-1 beta sig-2 \75 gam-2 switch ptec stec difc difa zero }76 prof-T-3 {TOF-type3 alp bet-0 bet-1 sig-0 sig-1 sig-2 gam-0 gam-1 \77 gam-2 gsf g1ec g2ec rstr rsta rsca L11 L22 L33 L12 L13 L23 }78 prof-T-4 {TOF-type4 alp bet-0 bet-1 sig-1 sig-2 gam-2 g2ec gsf \79 rstr rsta rsca eta}80 prof-C-1 {CW-type U V W asym F1 F2 }81 prof-C-2 {CW-type2 GU GV GW LX LY trns asym shft GP stec ptec sfec \82 L11 L22 L33 L12 L13 L23 }83 prof-C-3 {CW-type3 GU GV GW GP LX LY S/L H/L trns shft stec ptec sfec \84 L11 L22 L33 L12 L13 L23 }85 prof-C-4 {CW-type4 GU GV GW GP LX ptec trns shft sfec S/L H/L eta}86 }87 # >>>>>>>>>>>>>>>> End of Profile Terms >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>88 71 #---------------------------------------------------------------- 89 72 # where are we? … … 230 213 setphases 231 214 232 # disable the "global options" that don't make sense based 233 # on thehistograms present215 # disable the "global options" that don't make sense based on 216 # which histograms present 234 217 foreach num {1 2 3 4 5} { 235 218 set flag($num) 0 236 219 } 220 # save a list of the allowed modes, too 221 set expgui(AllowedHistSelectModes) {0 6} 237 222 foreach h $expmap(powderlist) { 238 223 if {[string range $expmap(htype_$h) 2 2] == "T"} {set flag(1) 1} … … 249 234 if $flag($num) { 250 235 $expgui(fm).option.menu.editmode entryconfigure $lbl -state normal 236 lappend expgui(AllowedHistSelectModes) $num 251 237 } else { 252 238 $expgui(fm).option.menu.editmode entryconfigure $lbl -state disabled … … 649 635 set file $expnam.EXP.[format "%3.3d" $number] 650 636 } 651 exec cp$expgui(expfile) $file637 file copy $expgui(expfile) $file 652 638 if [catch {exec gzip $file}] { 653 639 exec echo "\n----------------------------------------------" >> $expnam.LST … … 792 778 set phase $expgui(curPhase) 793 779 set atomlist {} 780 set typehead "type " 781 set namehead " name " 782 set multhead "Mult" 783 set coordhead " " 794 784 if {$expgui(asorttype) == "type"} { 795 785 # sort on atom type 786 set typehead "type* " 796 787 foreach atom $expmap(atomlist_$phase) { 797 788 lappend atomlist "$atom [atominfo $phase $atom type] $phase" … … 800 791 } elseif {$expgui(asorttype) == "number"} { 801 792 # sort on atom number 793 set namehead "* name " 802 794 foreach atom $expmap(atomlist_$phase) { 803 795 lappend atomlist "$atom $atom $phase" 804 796 } 805 797 set expmap(atomlistboxcontents) [lsort -integer -index 1 $atomlist] 798 } elseif {$expgui(asorttype) == "mult"} { 799 # sort on atom number 800 set multhead "Mlt*" 801 foreach atom $expmap(atomlist_$phase) { 802 lappend atomlist "$atom [atominfo $phase $atom mult] $phase" 803 } 804 set expmap(atomlistboxcontents) [lsort -integer -decreasing -index 1 $atomlist] 806 805 } elseif {$expgui(asorttype) == "x"} { 807 806 # sort on x 807 set coordhead "(x*)" 808 808 foreach atom $expmap(atomlist_$phase) { 809 809 lappend atomlist "$atom [atominfo $phase $atom x] $phase" … … 812 812 } elseif {$expgui(asorttype) == "y"} { 813 813 # sort on y 814 set coordhead "(y*)" 814 815 foreach atom $expmap(atomlist_$phase) { 815 816 lappend atomlist "$atom [atominfo $phase $atom y] $phase" … … 818 819 } elseif {$expgui(asorttype) == "z"} { 819 820 # sort on z 821 set coordhead "(z*)" 820 822 foreach atom $expmap(atomlist_$phase) { 821 823 lappend atomlist "$atom [atominfo $phase $atom z] $phase" … … 823 825 set expmap(atomlistboxcontents) [lsort -real -index 1 $atomlist] 824 826 } else { 825 error "Bad expgui(asorttype = $expgui(asorttype)"827 error "Bad expgui(asorttype) = $expgui(asorttype)" 826 828 } 827 829 … … 837 839 } 838 840 } 839 set line [format "%3d %-6s %-6s %8s %10.6f%10.6f%10.6f% 9.4f" \841 set line [format "%3d %-6s %-6s %8s %10.6f%10.6f%10.6f%4d%9.4f" \ 840 842 $atom \ 841 843 [atominfo $phase $atom label] \ … … 845 847 [atominfo $phase $atom y] \ 846 848 [atominfo $phase $atom z] \ 849 [atominfo $phase $atom mult] \ 847 850 [atominfo $phase $atom frac] 848 851 ] 852 849 853 # add temperature factors (iso/anoiso) 850 854 if {[atominfo $phase $atom temptype] == "A"} { … … 867 871 $expgui(atomtitle) delete 0 end 868 872 if {$maxline == "A"} { 869 $expgui(atomtitle) insert end [format "%10s %6s %8s %30s%9s %s" \ 870 " name " "type " "ref/damp " "fractional coordinates " \ 871 " Occupancy" \ 873 $expgui(atomtitle) insert end [format "%10s %6s %8s%29s %9s %s" \ 874 $namehead $typehead "ref/damp " \ 875 "fractional coordinates$coordhead" \ 876 "$multhead Occupancy" \ 872 877 "Uiso/Uij "] 873 878 } else { 874 $expgui(atomtitle) insert end [format "%10s %6s %8s %30s%9s %s" \ 875 " name " "type " "ref/damp " "fractional coordinates " \ 876 " Occupancy" \ 879 $expgui(atomtitle) insert end [format "%10s %6s %8s%29s %9s %s" \ 880 $namehead $typehead "ref/damp " \ 881 "fractional coordinates$coordhead" \ 882 "$multhead Occupancy" \ 877 883 "Uiso"] 878 884 } … … 1082 1088 } 1083 1089 1090 # make a histogram box; used in MakeHistPane, 1091 proc MakeHistBox {frm} { 1092 global expgui 1093 grid [label $frm.mode -text "Select a Histogram" \ 1094 -bg beige -anchor center] \ 1095 -row 0 -column 0 -columnspan 2 -sticky ew 1096 bind $frm.mode <Button-1> { 1097 set i [lsearch $expgui(AllowedHistSelectModes) $expgui(globalmode)] 1098 set expgui(globalmode) [lindex \ 1099 "$expgui(AllowedHistSelectModes) \ 1100 $expgui(AllowedHistSelectModes)" [incr i]] 1101 sethistlist 1102 } 1103 bind $frm.mode <Button-3> {set expgui(globalmode) 0; sethistlist} 1104 grid [listbox $frm.title -height 1 -relief flat \ 1105 -exportselection 0 \ 1106 -font $expgui(histfont) ] -row 1 -column 0 -sticky ew 1107 grid [listbox $frm.lbox -height 10 -width 25 \ 1108 -exportselection 0 \ 1109 -font $expgui(histfont) \ 1110 -xscrollcommand "$frm.x set" \ 1111 -yscrollcommand "$frm.y set" \ 1112 ] -row 2 -column 0 -sticky news 1113 lappend expgui(HistSelectList) $frm 1114 grid [scrollbar $frm.x -orient horizontal \ 1115 -command "move2boxes \" $frm.title $frm.lbox \" " 1116 ] -row 3 -column 0 -sticky ew 1117 grid [scrollbar $frm.y \ 1118 -command "$frm.lbox yview"] \ 1119 -row 2 -column 1 -sticky ns 1120 grid columnconfigure $frm 0 -weight 1 1121 grid rowconfigure $frm 2 -weight 1 1122 } 1123 1084 1124 # update the histogram list 1085 1125 # to do: show histogram ref flags? 1086 1126 proc sethistlist {} { 1087 1127 global expgui expmap 1128 array set lbl { 1129 1 "Select 1 or more\nTOF Histograms" 1130 2 "Select 1 or more\nCW Neutron Histograms" 1131 3 "Select 1 or more\nAlpha 1,2 X-ray Histograms" 1132 4 "Select 1 or more\nmonochromatic X-ray Histograms" 1133 5 "Select 1 or more Energy\nDisperive X-ray Histograms" 1134 6 "Select 1 or more of\n any type Histograms" 1135 } 1088 1136 foreach lbox $expgui(HistSelectList) { 1089 1137 $lbox.title delete 0 end … … 1091 1139 if {$expgui(globalmode) != 0} { 1092 1140 $lbox.lbox config -selectmode extended 1141 $lbox.mode config -text $lbl($expgui(globalmode)) -bg yellow 1093 1142 } else { 1094 1143 $lbox.lbox config -selectmode browse 1144 $lbox.mode config -text "Select a histogram" -bg beige 1095 1145 } 1096 1146 } … … 1775 1825 set entrycmd(pcut_$i) "hapinfo $hist $i pcut" 1776 1826 set entryvar(pcut_$i) [hapinfo $hist $i pcut] 1827 1828 pack [button $ProfileFrame.1.b1 \ 1829 -text "Change Type" \ 1830 -command "ChangeProfileType $hist $i"]\ 1831 -side left 1777 1832 1778 1833 set col -1 1779 1834 set row 1 1780 1835 set nterms [hapinfo $hist $i profterms] 1781 set lbls {} 1782 catch {set lbls $expgui(prof-$htype-$ptype)} 1783 # for type 4, add extra terms depending on the cell type 1784 if {$ptype == 4} {set lbls [type4lbls $lbls $nterms $i]} 1836 set lbls "dummy [GetProfileTerms $i $hist $ptype]" 1785 1837 for { set num 1 } { $num <= $nterms } { incr num } { 1786 1838 set term {} … … 1843 1895 set nterms [hapinfo $hist1 $phase1 profterms] 1844 1896 set htype [string range $expmap(htype_$hist1) 2 2] 1845 set lbls $expgui(prof-$htype-$ptype) 1846 # for type 4, add extra terms depending on the cell type 1847 if {$ptype == 4} {set lbls [type4lbls $lbls $nterms $phase1]} 1897 set lbls "dummy [GetProfileTerms $phase1 $hist1 $ptype]" 1848 1898 # Create a frame for this type 1849 1899 incr i … … 1851 1901 if {$expgui(haveBW)} { 1852 1902 grid [TitleFrame $expgui(ProfileBox).f.$i \ 1853 -text " Histogram [CompressList $histarray($key)](type $ptype)" \1903 -text "(type $ptype)" \ 1854 1904 -relief groove -bd 2] \ 1855 1905 -column 0 -row $i -sticky ew … … 1879 1929 -text "Global Edit"] -row 0 -column 4 -sticky w 1880 1930 set entryvar(pdamp_$i) [hapinfo $hist $phase pdamp] 1931 grid [button $ProfileFrame.1.b1 -text "Change Type"] \ 1932 -row 0 -column 5 -sticky w 1881 1933 set col -1 1882 1934 set row 2 … … 1907 1959 [list $curhistlist] \ 1908 1960 [list $curphaslist]" 1961 $ProfileFrame.1.b1 config -command "ChangeProfileType \ 1962 [list $curhistlist] [list $curphaslist]" 1909 1963 set entrycmd(pdamp_$i) "hapinfo \ 1910 1964 [list $curhistlist] \ … … 1926 1980 # enable traces on entryvar now 1927 1981 set entrycmd(trace) 1 1928 }1929 1930 # profile labels for type 4 profile1931 proc type4lbls {lbls nterms phase} {1932 if {$nterms == 14} {1933 # cubic1934 lappend lbls S400 S2201935 } elseif {$nterms == 15} {1936 # hexagonal1937 lappend lbls S400 S004 S2021938 } elseif {$nterms == 16} {1939 # tetragonal or rhombohedral1940 if {[phaseinfo $phase a] == [phaseinfo $phase c]} {1941 # rhombohedral1942 lappend lbls S400 S220 S310 S2111943 } else {1944 lappend lbls S400 S004 S220 S2021945 }1946 } elseif {$nterms == 18} {1947 # orthorhombic1948 lappend lbls S400 S040 S004 S220 S202 S0221949 } elseif {$nterms == 21} {1950 # monoclinic1951 lappend lbls S400 S040 S004 S220 S202 S022 S301 S103 S1211952 } elseif {$nterms == 25} {1953 # triclinic1954 lappend lbls S400 S040 S004 S220 S202 S022 S310 S103 S031 \1955 S130 S301 S013 S211 S121 S1121956 }1957 return $lbls1958 1982 } 1959 1983 … … 2335 2359 set col -1 2336 2360 set row 1 2337 set lbls $expgui(prof-$htype-$ptype) 2338 # for type 4, add extra terms depending on the cell type 2339 if {$ptype == 4} {set lbls [type4lbls $lbls $nterms $i]} 2361 set lbls "dummy [GetProfileTerms $phase $hist $ptype]" 2340 2362 pack [frame $w.1 -bd 6 -relief groove -bg beige \ 2341 2363 ] -side top -expand yes -fill both … … 2579 2601 #-------------- Begin Atom Coordinates Box ------------------------------ 2580 2602 grid [listbox $fbig.title -height 1 -relief flat \ 2581 -exportselection 0] \ 2603 -exportselection 0 -bg lightgrey -fg black \ 2604 -selectforeground black -selectbackground lightgrey] \ 2582 2605 -row 0 -column 0 -sticky ew 2583 2606 set expgui(atomtitle) $fbig.title 2607 bind $expgui(atomtitle) <Button-1> { 2608 set i [lsearch {number type mult x y z} $expgui(asorttype)] 2609 incr i 2610 set expgui(asorttype) [lindex {number type mult x y z number} $i] 2611 DisplayAllAtoms 2612 } 2613 bind $expgui(atomtitle) <Button-3> {set expgui(asorttype) number; DisplayAllAtoms} 2614 2584 2615 $expgui(atomtitle) configure -font $expgui(coordfont) -selectmode extended 2585 2616 grid [listbox $fbig.lbox -height 10 \ … … 2704 2735 #v v v v v v v v v v BEGINNING OF HISTOGRAM PANE CODE v v v v v v v v v v 2705 2736 global expgui 2706 grid [frame $expgui(histFrame).hs] \ 2707 -column 0 -row 0 -rowspan 10 -sticky nsew 2737 2708 2738 grid columnconfigure $expgui(histFrame) 0 -weight 1 2709 2739 grid rowconfigure $expgui(histFrame) 1 -weight 1 2710 2740 grid rowconfigure $expgui(histFrame) 2 -weight 1 2711 2741 grid rowconfigure $expgui(histFrame) 3 -weight 1 2712 grid [listbox $expgui(histFrame).hs.title -height 1 -relief flat \ 2713 -exportselection 0 \ 2714 -font $expgui(histfont) ] -row 0 -column 0 -sticky ew 2715 grid [listbox $expgui(histFrame).hs.lbox -height 10 -width 25 \ 2716 -exportselection 0 \ 2717 -font $expgui(histfont) \ 2718 -xscrollcommand "$expgui(histFrame).hs.x set" \ 2719 -yscrollcommand "$expgui(histFrame).hs.y set" \ 2720 ] -row 1 -column 0 -sticky news 2721 lappend expgui(HistSelectList) $expgui(histFrame).hs 2722 grid [scrollbar $expgui(histFrame).hs.x -orient horizontal \ 2723 -command "move2boxes \" $expgui(histFrame).hs.title $expgui(histFrame).hs.lbox \" " 2724 ] -row 2 -column 0 -sticky ew 2725 grid [scrollbar $expgui(histFrame).hs.y \ 2726 -command "$expgui(histFrame).hs.lbox yview"] \ 2727 -row 1 -column 1 -sticky ns 2728 grid columnconfigure $expgui(histFrame).hs 0 -weight 1 2729 grid rowconfigure $expgui(histFrame).hs 1 -weight 1 2742 2743 grid [frame $expgui(histFrame).hs] \ 2744 -column 0 -row 0 -rowspan 10 -sticky nsew 2745 MakeHistBox $expgui(histFrame).hs 2730 2746 bind $expgui(histFrame).hs.lbox <ButtonRelease-1> { 2731 2747 set expgui(curhist) [$expgui(histFrame).hs.lbox curselection] … … 2799 2815 #v v v v v v v v v v BEGINNING OF SCALING PANE CODE v v v v v v v v v v 2800 2816 global expgui 2817 2801 2818 pack [frame $expgui(fracFrame).hs] -side left -expand y -fill both 2802 grid [listbox $expgui(fracFrame).hs.title -height 1 -relief flat \ 2803 -exportselection 0 \ 2804 -font $expgui(histfont) ] -row 0 -column 0 -sticky ew 2805 grid [listbox $expgui(fracFrame).hs.lbox -height 10 -width 25 \ 2806 -exportselection 0 \ 2807 -font $expgui(histfont) \ 2808 -xscrollcommand "$expgui(fracFrame).hs.x set" \ 2809 -yscrollcommand "$expgui(fracFrame).hs.y set" \ 2810 ] -row 1 -column 0 -sticky news 2811 lappend expgui(HistSelectList) $expgui(fracFrame).hs 2812 grid [scrollbar $expgui(fracFrame).hs.x -orient horizontal \ 2813 -command "move2boxes \" $expgui(fracFrame).hs.title $expgui(fracFrame).hs.lbox \" " 2814 ] -row 2 -column 0 -sticky ew 2815 grid [scrollbar $expgui(fracFrame).hs.y \ 2816 -command "$expgui(fracFrame).hs.lbox yview"] \ 2817 -row 1 -column 1 -sticky ns 2818 grid columnconfigure $expgui(fracFrame).hs 0 -weight 1 2819 grid rowconfigure $expgui(fracFrame).hs 1 -weight 1 2819 MakeHistBox $expgui(fracFrame).hs 2820 2820 bind $expgui(fracFrame).hs.lbox <ButtonRelease-1> { 2821 2821 set expgui(curhist) [$expgui(fracFrame).hs.lbox curselection] … … 2829 2829 } 2830 2830 } 2831 2831 2832 pack [frame $expgui(fracFrame).f1] -fill both -expand true 2832 2833 # Create a large canvas area containing a frame for each phase in the data set. … … 2898 2899 # v v v v v v v v v v BEGINNING OF PROFILE PANE CODE v v v v v v v v v v v 2899 2900 pack [frame $expgui(profFrame).hs] -side left -expand y -fill both 2900 grid [listbox $expgui(profFrame).hs.title -height 1 -relief flat \ 2901 -exportselection 0 \ 2902 -font $expgui(histfont) ] -row 0 -column 0 -sticky ew 2903 grid [listbox $expgui(profFrame).hs.lbox -height 10 -width 25 \ 2904 -exportselection 0 \ 2905 -font $expgui(histfont) \ 2906 -xscrollcommand "$expgui(profFrame).hs.x set" \ 2907 -yscrollcommand "$expgui(profFrame).hs.y set" \ 2908 ] -row 1 -column 0 -sticky news 2909 lappend expgui(HistSelectList) $expgui(profFrame).hs 2910 grid [scrollbar $expgui(profFrame).hs.x -orient horizontal \ 2911 -command "move2boxes \" $expgui(profFrame).hs.title $expgui(profFrame).hs.lbox \" " 2912 ] -row 2 -column 0 -sticky ew 2913 grid [scrollbar $expgui(profFrame).hs.y \ 2914 -command "$expgui(profFrame).hs.lbox yview"] \ 2915 -row 1 -column 1 -sticky ns 2916 grid columnconfigure $expgui(profFrame).hs 0 -weight 1 2917 grid rowconfigure $expgui(profFrame).hs 1 -weight 1 2901 MakeHistBox $expgui(profFrame).hs 2918 2902 bind $expgui(profFrame).hs.lbox <ButtonRelease-1> { 2919 2903 set expgui(curhist) [$expgui(profFrame).hs.lbox curselection] … … 2965 2949 } 2966 2950 pack [frame $expgui(lsFrame).hs] -side left -expand y -fill both 2967 grid [listbox $expgui(lsFrame).hs.title -height 1 -relief flat \ 2968 -exportselection 0 \ 2969 -font $expgui(histfont) ] -row 0 -column 0 -sticky ew 2970 grid [listbox $expgui(lsFrame).hs.lbox -height 10 -width 25 \ 2971 -exportselection 0 \ 2972 -font $expgui(histfont) \ 2973 -xscrollcommand "$expgui(lsFrame).hs.x set" \ 2974 -yscrollcommand "$expgui(lsFrame).hs.y set" \ 2975 ] -row 1 -column 0 -sticky news 2976 lappend expgui(HistSelectList) $expgui(lsFrame).hs 2977 grid [scrollbar $expgui(lsFrame).hs.x -orient horizontal \ 2978 -command "move2boxes \" $expgui(lsFrame).hs.title $expgui(lsFrame).hs.lbox \" " 2979 ] -row 2 -column 0 -sticky ew 2980 grid [scrollbar $expgui(lsFrame).hs.y \ 2981 -command "$expgui(lsFrame).hs.lbox yview"] \ 2982 -row 1 -column 1 -sticky ns 2983 grid columnconfigure $expgui(lsFrame).hs 0 -weight 1 2984 grid rowconfigure $expgui(lsFrame).hs 1 -weight 1 2951 MakeHistBox $expgui(lsFrame).hs 2985 2952 bind $expgui(lsFrame).hs.lbox <ButtonRelease-1> { 2986 2953 set expgui(curhist) [$expgui(lsFrame).hs.lbox curselection] … … 3117 3084 set expgui(asorttype) number 3118 3085 menu $expgui(fm).option.menu.asort 3119 $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms \ 3120 -label number -value number -variable expgui(asorttype) 3121 $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms \ 3122 -label type -value type -variable expgui(asorttype) 3123 $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms \ 3124 -label x -value x -variable expgui(asorttype) 3125 $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms \ 3126 -label y -value y -variable expgui(asorttype) 3127 $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms \ 3128 -label z -value z -variable expgui(asorttype) 3129 3086 foreach opt {number type mult x y z} { 3087 $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms \ 3088 -label $opt -value $opt -variable expgui(asorttype) 3089 } 3130 3090 3131 3091 $expgui(fm).option.menu add cascade -menu $expgui(fm).option.menu.hsort \
Note: See TracChangeset
for help on using the changeset viewer.