source: trunk/dumpprof.tcl @ 926

Last change on this file since 926 was 875, checked in by toby, 16 years ago

# on 2006/03/29 03:50:00, toby did:
return diffractometer constants
support starkit

  • Property rcs:author set to toby
  • Property rcs:date set to 2006/03/29 03:50:00
  • Property rcs:lines set to +7 -1
  • Property rcs:rev set to 1.3
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 2.7 KB
Line 
1if {[llength $argv] != 1} {
2    wm withdraw .
3    tk_dialog .err {Wrong Args} \
4            "$argv0: argument should be a .EXP file name" \
5            error 0 Continue
6    exit
7}
8
9package require Tk
10
11set filename [lindex $argv 0]
12
13set expgui(font) 14
14set expgui(debug) 0
15
16pack [label .l -text "Reading $filename\nPlease wait"]
17update
18wm protocol . WM_DELETE_WINDOW {puts ""; exit}
19#=============================================================================
20#----------------------------------------------------------------
21# where are we?
22set expgui(script) [info script]
23# translate links -- go six levels deep
24foreach i {1 2 3 4 5 6} {
25    if {[file type $expgui(script)] == "link"} {
26        set link [file readlink $expgui(script)]
27        if { [file  pathtype  $link] == "absolute" } {
28            set expgui(script) $link
29        } {
30            set expgui(script) [file dirname $expgui(script)]/$link
31        }
32    } else {
33        break
34    }
35}
36# fixup relative paths
37if {[file pathtype $expgui(script)] == "relative"} {
38    set expgui(script) [file join [pwd] $expgui(script)]
39}
40set expgui(scriptdir) [file dirname $expgui(script) ]
41#----------------------------------------------------------------
42source [file join $expgui(scriptdir) opts.tcl]
43# fetch EXP file processing routines
44source [file join $expgui(scriptdir) readexp.tcl]
45# commands for running GSAS programs
46#source [file join $expgui(scriptdir) gsascmds.tcl]
47# override options with locally defined values
48set filelist [file join $expgui(scriptdir) localconfig]
49if {$tcl_platform(platform) == "windows"} {
50    lappend filelist "c:/gsas.config"
51} else {
52    lappend filelist [file join ~ .gsas_config]
53}
54catch {
55    foreach file $filelist {
56        if [file exists $file] {source $file}
57    }
58}
59SetTkDefaultOptions $expgui(font)
60
61if {![file exists $filename]} {
62    # read error
63    wm withdraw .
64    tk_dialog .err {Bad file} \
65            "$argv0: error\nfile $filename not found" \
66            error 0 Continue
67    exit
68}
69set fmt [expload $filename]
70if {$fmt < 0} {
71    # read error
72    wm withdraw .
73    tk_dialog .err {Bad file} \
74            "$argv0: error reading $filename\nThis is not a valid GSAS .EXP file" \
75            error 0 Continue
76    exit
77}
78mapexp
79set list1 {}
80foreach hist $expmap(powderlist) {
81    set list2 $hist
82    set instcons {}
83    foreach item {difc difa zero ipola pola} {
84        lappend instcons [histinfo $hist $item] 
85    }
86    lappend list2 "$expmap(htype_$hist) [list $instcons]"
87    foreach i $expmap(phaselist_$hist) {
88        set list $i
89        lappend list [string trim [hapinfo $hist $i proftype]]
90        lappend list [hapinfo $hist $i pcut]
91        set nterms [hapinfo $hist $i profterms]
92        for { set num 1 } { $num <= $nterms } { incr num } {
93            lappend list [hapinfo $hist $i pterm$num]
94        }
95        lappend list2 $list
96    }
97    lappend list1 $list2
98}
99puts $list1
100exit
Note: See TracBrowser for help on using the repository browser.