Changeset 770
- Timestamp:
- Dec 4, 2009 5:11:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fillcif.tcl
- Property rcs:date changed from 2003/08/11 19:23:12 to 2004/01/30 00:41:11
- Property rcs:lines changed from +6 -6 to +36 -47
- Property rcs:rev changed from 1.5 to 1.6
r727 r770 19 19 # this file (Included with EXPGUI) 20 20 # 21 # 3) file CIF_index must be in the same directory as this file 22 # (Included with EXPGUI) 23 # This file is an index to the CIF dictionaries in use and is generated 24 # using routines in indexCIFdict.tcl 25 # note that variable CIF(cif_path) dictates where these dictionary 26 # files will be found and the GSAS data directory (../data/) included. 27 # 28 # 4) The CIF core & powder dictionaries are included in the GSAS data 21 # 3) The CIF core & powder dictionaries are included in the GSAS data 29 22 # directory (../data/), files cif_core_2.2.dic and cif_pd.dic 30 23 # (Included with GSAS/EXPGUI distribution) 31 24 # 32 # 5) The GSAS2CIF template files (template_instrument.cif,25 # 4) The GSAS2CIF template files (template_instrument.cif, 33 26 # template_phase.cif and template_publ.cif) are included in the GSAS data 34 27 # directory (../data/). 35 28 # (Included with GSAS/EXPGUI distribution) 36 29 37 if {$tcl_version < 8.2} {38 tk_dialog .error {Old Tcl/Tk} \39 "Sorry, the CIF Browser requires version 8.2 or later of the Tcl/Tk package. This is $tcl_version" \40 warning 0 Sorry41 exit42 }43 44 if {[llength $argv] != 1} {45 set file [tk_getOpenFile -title "Select GSAS Experiment" -parent . \46 -defaultextension EXP -filetypes {{"GSAS experiment" .EXP}}]47 if {$file == ""} {exit}48 set prefix [file root $file]49 } else {50 set prefix $argv51 }52 53 if {[set dir [file dirname $prefix]] != ""} {54 cd $dir55 set prefix [file tail $prefix]56 }57 30 # where is this file running from? 58 31 set script [info script] … … 75 48 } 76 49 set scriptdir [file dirname $script ] 50 51 if {$tcl_version < 8.2} { 52 tk_dialog .error {Old Tcl/Tk} \ 53 "Sorry, the CIF Browser requires version 8.2 or later of the Tcl/Tk package. This is $tcl_version" \ 54 warning 0 Sorry 55 exit 56 } 57 58 if {[llength $argv] != 1} { 59 set file [tk_getOpenFile -title "Select GSAS Experiment" -parent . \ 60 -defaultextension EXP -filetypes {{"GSAS experiment" .EXP}}] 61 if {$file == ""} {exit} 62 set prefix [file root $file] 63 } else { 64 set prefix $argv 65 } 66 67 if {[set dir [file dirname $prefix]] != ""} { 68 cd $dir 69 set prefix [file tail $prefix] 70 } 77 71 # used by some gsascmds routines 78 72 set expgui(scriptdir) $scriptdir … … 404 398 wm title $defw "CIF definitions" 405 399 set CIF(defBox) $defw.t 406 grid [text $CIF(defBox) -width 65-xscrollcommand "$defw.x set" \407 -yscrollcommand "$defw.y set" ] -column 0 -row 0 -sticky news400 grid [text $CIF(defBox) -width 45 -height 18 -xscrollcommand "$defw.x set" \ 401 -yscrollcommand "$defw.y set" -wrap word] -column 0 -row 0 -sticky news 408 402 grid [scrollbar $defw.y -command "$CIF(defBox) yview"] -column 1 -row 0 -sticky ns 409 403 grid [scrollbar $defw.x -command "$CIF(defBox) xview" \ … … 414 408 wm withdraw $defw 415 409 416 if {![file exists [file join $scriptdir CIF_index]]} { 417 MyMessageBox -parent . -title "No CIF index" \ 418 -message "File CIF_index was not found in directory $scriptdir. Without this file, CIF definitions can not be read and editing is not recommended. See routine indexCIFdict.tcl for info on creating CIF_index" \ 419 -icon error -type {"Oh darn"} -default "oh darn" 420 } elseif [catch { 421 source [file join $scriptdir CIF_index] 422 } errmsg] { 423 MyMessageBox -parent . -title "CIF index error" \ 424 -message "An error occured reading file CIF_index (directory $scriptdir). Without this file, CIF definitions can not be read and editing is not recommended. See routine indexCIFdict.tcl for info on creating CIF_index. Error: $errmsg" \ 425 -icon error -type {"Oh darn"} -default "oh darn" 426 } 427 428 429 # add location of these files & the typical GSAS data directory 430 # to the dictionary search path 431 lappend CIF(cif_path) $scriptdir [file join [file dirname $scriptdir] data] 410 # is there a defined list of dictionary files? 411 if {[catch {set ::CIF(dictfilelist)}]} { 412 set dictfilelist [glob -nocomplain \ 413 [file join $::expgui(gsasdir) data *.dic]] 414 foreach f $dictfilelist { 415 lappend ::CIF(dictfilelist) $f 416 set ::CIF(dict_$f) 1 417 } 418 } 419 # load the initial CIF dictionaries 420 LoadDictIndices 432 421 433 422 # make frame for the CIF browser
Note: See TracChangeset
for help on using the changeset viewer.