source: trunk/dumpprof.tcl @ 697

Last change on this file since 697 was 697, checked in by toby, 11 years ago

# on 2003/05/22 21:41:18, toby did:
initial tweaking

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