source: trunk/addcmds.tcl @ 113

Last change on this file since 113 was 113, checked in by toby, 14 years ago

# on 1999/10/11 19:49:28, toby did:
* empty log message *

  • Property rcs:author set to toby
  • Property rcs:date set to 1999/10/11 19:49:28
  • Property rcs:lines set to +24 -8
  • Property rcs:rev set to 1.3
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 19.8 KB
Line 
1# $Id: addcmds.tcl 113 2009-12-04 23:00:37Z toby $
2
3proc MakeAddPhaseBox {} {
4    global expmap
5
6    set nextphase ""
7    foreach p {1 2 3 4 5 6 7 8 9} {
8        if {[lsearch $expmap(phaselist) $p] == -1} {
9            set nextphase $p
10            break
11        }
12    }
13
14    # no more room
15    if {$nextphase == ""} {
16        tk_dialog .phaseerr "Add Phase Error" \
17                "There are already 9 phases. You cannot add more." \
18                error 0 "OK" 
19        return
20    }
21
22    set np .newphase
23    catch {destroy $np}
24    toplevel $np
25
26    grid [label $np.l1 -text "Adding phase #$nextphase"] \
27            -column 0 -row 0 -sticky w
28    grid [label $np.l2 -text "Phase title:"] -column 0 -row 1 
29    grid [entry $np.t1 -width 68] -column 1 -row 1 -columnspan 8
30    grid [label $np.l3 -text "Space Group:"] -column 0 -row 2 
31    grid [entry $np.t2 -width 12] -column 1 -row 2 
32    grid [frame $np.f -bd 4 -relief groove] -column 3 -row 2 -columnspan 8
33    set col -1
34    foreach i {a b c} {
35        grid [label $np.f.l1$i -text $i] -column [incr col] -row 1
36        grid [entry $np.f.e1$i -width 12] -column [incr col]  -row 1
37    }
38    set col -1
39    foreach i {a b g} {
40        grid [label $np.f.l2$i -text $i -font symbol] -column [incr col] -row 2
41        grid [entry $np.f.e2$i -width 12] -column [incr col]  -row 2
42        $np.f.e2$i insert 0 90.
43    }   
44   
45    grid [button $np.b1 -text Add \
46            -command "addphase $np"] -column 2 -row 3
47    bind $np <Return> "addphase $np"
48    grid [button $np.b2 -text Cancel \
49            -command "destroy $np"] -column 3 -row 3
50   
51    wm title $np "add new phase"
52
53    # grab focus, etc.
54    putontop $np
55
56    tkwait window $np
57
58    # fix focus...
59    afterputontop
60}
61
62proc addphase {np} {
63    global expgui
64    # validate the input
65    set err {}
66    set title [$np.t1 get]
67    if {[string trim $title] == ""} {
68        append err "  Title cannot be blank\n"
69    }
70    set spg [$np.t2 get]
71    if {[string trim $spg] == ""} {
72        append err "  Space group cannot be blank\n"
73    }
74    foreach i {a b c} {
75        set cell($i) [$np.f.e1$i get]
76        if {[string trim $cell($i)] == ""} {
77            append err "  $i cannot be blank\n"
78        } elseif {[catch {expr $cell($i)}]} {
79            append err "  $i is not valid\n"
80        }
81    }
82
83    foreach i {a b g} lbl {alpha beta gamma} {
84        set cell($lbl) [$np.f.e2$i get]
85        if {[string trim $cell($lbl)] == ""} {
86            append err "  $lbl cannot be blank\n"
87        } elseif {[catch {expr $cell($lbl)}]} {
88            append err "  $lbl is not valid\n"
89        }
90    }
91
92    if {$err != ""} {
93        tk_dialog .phaseerr "Add Phase Error" \
94                "The following error(s) were found in your input:\n$err" \
95                error 0 "OK" 
96        return
97    }
98
99    # check the space group
100    set fp [open spg.in w]
101    puts $fp "N"
102    puts $fp "N"
103    puts $fp $spg
104    puts $fp "Q"
105    close $fp
106    global tcl_platform
107    catch {
108        if {$tcl_platform(platform) == "windows"} {
109            exec [file join $expgui(gsasexe) spcgroup.exe] < spg.in >& spg.out
110        } else {
111            exec [file join $expgui(gsasexe) spcgroup] < spg.in >& spg.out
112        }
113    }
114    set fp [open spg.out r]
115    set out [read $fp]
116    close $fp
117    # attempt to parse out the output (fix up if parse did not work)
118    if {[regexp "space group symbol.*>(.*)Enter a new space group symbol" \
119            $out a b ] != 1} {set b $out}
120    if {[string first Error $b] != -1} {
121        # got an error, show it
122        ShowBigMessage \
123                 $np.error \
124                 "Error processing space group\nReview error message below" \
125                 $b
126        return
127    } else {
128        # show the result and confirm
129        set opt [ShowBigMessage \
130                $np.check \
131                "Check the symmetry operators in the output below" \
132                $b \
133                {Continue Redo} ]
134        if {$opt > 1} return
135    }
136    file delete spg.in spg.out
137   
138    # ok do it!
139    set fp [open exptool.in w]
140    puts $fp "P"
141    puts $fp $title
142    puts $fp $spg
143    puts $fp "$cell(a) $cell(b) $cell(c) $cell(alpha) $cell(beta) $cell(gamma)"
144    puts $fp "/"
145    close $fp
146    global tcl_platform
147    # Save the current exp file
148    savearchiveexp
149    # disable the file changed monitor
150    set expgui(expModifiedLast) 0
151    set expnam [file root [file tail $expgui(expfile)]]
152    catch {
153        if {$tcl_platform(platform) == "windows"} {
154            exec [file join $expgui(gsasexe) exptool.exe] $expnam \
155                    < exptool.in >& exptool.out
156        } else {
157            exec [file join $expgui(gsasexe) exptool] $expnam \
158                    < exptool.in >& exptool.out
159        }
160    } errmsg
161    # load the revised exp file
162    loadexp $expgui(expfile)
163    set fp [open exptool.out r]
164    set out [read $fp]
165    close $fp
166    destroy $np
167    if {$errmsg != ""} {
168        append errmsg "\n" $out
169    } else {
170        set errmsg $out
171    }
172    ShowBigMessage \
173                 $np \
174                 "Please review the result from adding the phase" \
175                 $errmsg
176    file delete exptool.in exptool.out
177}
178
179proc MakeAddHistBox {} {
180    global expmap newhist
181
182    # --> should check here if room for another histogram, but only texture
183    # folks will ever need that
184
185    set np .newhist
186    catch {destroy $np}
187    toplevel $np
188
189    grid [label $np.l0 -text "Adding new histogram"] \
190            -column 0 -row 0 -sticky ew -columnspan 7
191    grid [label $np.l1 -text "Data file:"] -column 0 -row 1 
192    grid [label $np.t1 -textvariable newhist(rawfile)] \
193            -column 1 -row 1 -columnspan 3
194    grid [button $np.b1 -text "Select File" \
195            -command "getrawfile $np" \
196            ] -column 4 -row 1
197
198    grid [label $np.lbank -text "Select bank" -anchor w] -column 1 -row 2 -sticky w
199    grid [frame $np.bank]  -column 2 -row 2 -columnspan 7 -sticky ew
200
201    grid [label $np.l2 -text "Instrument\nParameter file:"] -column 0 -row 3
202    grid [label $np.t2 -textvariable newhist(instfile)] \
203            -column 1 -row 3 -columnspan 3
204    grid [button $np.b2 -text "Select File" \
205            -command "getinstfile $np" \
206            ] -column 4 -row 3
207
208    grid [label $np.lset -text "Select set" -anchor w] -column 1 -row 4 -sticky w
209    grid [frame $np.set]  -column 2 -row 4 -columnspan 7 -sticky ew
210
211    grid [label $np.l3 -text "Usable data limit:"] -column 0 -row 5 -rowspan 2 
212    grid [entry $np.e3 -width 12 -textvariable newhist(2tLimit) \
213            ] -column 1 -row 5 -rowspan 2 
214    grid [radiobutton $np.cb3 -text "D-min" -variable newhist(LimitMode) \
215            -value 0] -column 2 -row 5 -sticky w
216    grid [radiobutton $np.cb4 -text "2-Theta Max" -variable newhist(LimitMode)\
217            -value 1] -column 2 -row 6 -sticky w
218   
219    grid [frame $np.f6] -column 1 -row 7 -columnspan 3
220    grid [button $np.f6.b6a -text Add \
221            -command "addhist $np"] -column 0 -row 0
222    bind $np <Return> "addhist $np"
223    grid [button $np.f6.b6b -text Cancel \
224            -command "destroy $np"] -column 1 -row 0
225   
226    grid columnconfigure $np 3 -weight 1
227
228    wm title $np "add new histogram"
229
230    if {[string trim $newhist(rawfile)] != {}} {
231        validaterawfile $np $newhist(rawfile)
232    }
233    if {[string trim $newhist(instfile)] != {}} {
234        validateinstfile $np $newhist(instfile)
235    }
236    set newhist(banknum) {}
237    set newhist(setnum) {}
238    #    for {set i 0} {$i<100} {incr i} {set newhist(bank$i) 0}
239    #    for {set i 0} {$i<100} {incr i} {set newhist(set$i) 0}
240
241    # grab focus, etc.
242    putontop $np
243
244    tkwait window $np
245
246    # fix focus...
247    afterputontop
248}
249
250# convert a file to Win-95 direct access
251proc WinCvt {file} {
252    global expgui
253    if ![file exists $file] {
254        tk_dialog .warn "Convert Error" \
255                "File $file does not exist" question 0 "OK"
256        return
257    }
258
259    set tmpname "[file join [file dirname $file] tempfile.xxx]"
260    set oldname "[file rootname $file].org"
261    if [file exists $oldname] {
262        set ans [tk_dialog .warn "OK to overwrite?" \
263                "File [file tail $oldname] exists in [file dirname $oldname]. OK to overwrite?" question 0 \
264                "Yes" "No"]
265        if $ans return
266        catch {file delete $oldname}
267    }
268
269    if [catch {
270        set in [open $file r]
271        # needed to test under UNIX
272        set out [open $tmpname w]
273        fconfigure $out -translation crlf
274        set len [gets $in line]
275        if {$len > 160} {
276            # this is a UNIX file. Hope there are no control characters
277            set i 0
278            set j 79
279            while {$j < $len} {
280                puts $out [string range $line $i $j]
281                incr i 80
282                incr j 80
283            }
284        } else {
285            while {$len >= 0} {
286                append line "                                        "
287                append line "                                        "
288                set line [string range $line 0 79]
289                puts $out $line
290                set len [gets $in line]
291            }
292        }
293        close $in
294        close $out
295        file rename $file $oldname
296        file rename $tmpname $file
297    } errmsg] {
298        tk_dialog .warn Notify "Error in conversion:\n$errmsg" warning 0 OK
299    }
300    return $file
301}
302
303proc getrawfile {np} {
304    global newhist tcl_platform
305    if {$tcl_platform(platform) == "windows"} {
306        set inp [
307        tk_getOpenFile -parent $np -initialfile $newhist(rawfile) -filetypes {
308            {"Data files" .GSAS} {"Data files" .GSA} 
309            {"Data files" .RAW}  {"All files" *}
310        }
311        ]
312    } else {
313        set inp [
314        tk_getOpenFile -parent $np -initialfile $newhist(rawfile) -filetypes {
315            {"Data files" .GSA*} {"Data files" .RAW} 
316            {"Data files" .gsa*} {"Data files" .raw} 
317            {"All files" *}
318        } 
319        ]
320    }
321    validaterawfile $np $inp
322}
323
324proc validaterawfile {np inp} {
325    global tcl_platform expgui newhist
326    if {$inp == ""} return
327    if [catch {set in [open $inp r]}] {
328        tk_dialog .err "Open error" "Unable to open file $inp" \
329                error 0 OK
330        return 
331    }
332    set newhist(banklist) {}
333    foreach child [pack slaves $np.bank] {destroy $child}
334    # is this a properly formatted file?
335    if {$tcl_platform(platform) == "windows"} {
336        # are lines the correct length?
337
338        #--> can we check that lines are terminated CR-LF?
339
340        set i 0
341        while {[set len [gets $in line]] > 0} {
342            incr i
343            if {$len != 80} {
344                set ans [tk_dialog .err "Read error" \
345                        "File $inp is not direct access. OK to convert?" \
346                        error 0 OK QUIT]
347                if {$ans == 0} {
348                    close $in
349                    WinCvt $inp
350                    set i 0
351                    set in [open $inp r]
352                    set line {}
353                } else {
354                    return
355                }
356            }
357            # scan for BANK lines
358            if {[string first BANK $line] == 0} {
359                scan $line "BANK%d" num
360                lappend newhist(banklist) $num
361            }
362            # check for "Instrument parameter file" line
363            if {$i == 2 && [string first "Instrument parameter" $line] == 0} {
364                validateinstfile $np \
365                        [file join [file dirname $inp] \
366                        [string trim [string range $line 26 end]]]
367            }
368        }
369    } else {
370        # is the file one big record?
371        set len [gets $in line]
372        # a instrument parameter file should be more than 4 lines
373        if {$len <= 4*80} {
374            set ans [tk_dialog .err "Read error" \
375                    "File $inp is not direct access. OK to convert?" \
376                    error 0 OK QUIT]
377            if {$ans == 0} {
378                close $in
379                set oldname ${inp}.original
380                file rename $inp $oldname
381                if [catch {
382                    exec [file join $expgui(gsasexe) convstod] < \
383                            $oldname > $inp
384                } errmsg] {
385                    tk_dialog .warn Notify \
386                            "Error in conversion:\n$errmsg" warning 0 OK
387                }
388                set in [open $inp r]
389                set line {}
390            } else {
391                return
392            }
393        }
394        seek $in 0
395        set i 0
396        while {[string length [set line [read $in 80]]] == 80} {
397            incr i
398            # scan for BANK lines
399            if {[string first BANK $line] == 0} {
400                scan $line "BANK%d" num
401                lappend newhist(banklist) $num
402            }
403            # check for "Instrument parameter file" line
404            if {$i == 2 && [string first "Instrument parameter" $line] == 0} {
405                validateinstfile $np \
406                        [file join [file dirname $inp] \
407                        [string trim [string range $line 26 end]]]
408            }
409        }
410    }
411    # were banks found?
412    if {$newhist(banklist) == ""} {
413        tk_dialog .err "Read error" \
414                "File $inp has no BANK lines. This is not a valid GSAS data file." \
415                error 0 OK
416        return
417    }
418    set newhist(rawfile) $inp
419    foreach i $newhist(banklist) {
420#       pack [checkbutton $np.bank.$i -text $i \
421#               -variable newhist(bank$i)] -side left
422        pack [radiobutton $np.bank.$i -text $i \
423                -variable newhist(banknum) -value $i] -side left
424    }
425}
426
427proc getinstfile {np} {
428    global newhist tcl_platform
429    if {$tcl_platform(platform) == "windows"} {
430        set inp [
431        tk_getOpenFile -parent $np -initialfile $newhist(instfile) -filetypes {
432            {"Inst files" .INST} {"Inst files" .INS} 
433            {"Inst files" .PRM} {"All files" *}
434        }
435        ]
436    } else {
437        set inp [
438        tk_getOpenFile -parent $np -initialfile $newhist(instfile) -filetypes {
439            {"Inst files" .INS*} {"Inst files" .ins*} 
440            {"Inst files" .PRM}  {"Inst files" .prm} 
441            {"All files" *}
442        }
443        ]
444    }
445    validateinstfile $np $inp
446}
447
448proc validateinstfile {np inp} {
449    global tcl_platform expgui newhist
450    if {$inp == ""} return
451    if [catch {set in [open $inp r]}] {
452        tk_dialog .err "Open error" "Unable to open file $inp" \
453                error 0 OK
454        return 
455    }
456    set newhist(instbanks) {}
457    foreach child [pack slaves $np.set] {destroy $child}
458    # is this a properly formatted file?
459    if {$tcl_platform(platform) == "windows"} {
460        # are lines the correct length?
461
462        #--> can we check that lines are terminated CR-LF?
463
464        while {[set len [gets $in line]] > 0} {
465            if {$len != 80} {
466                set ans [tk_dialog .err "Read error" \
467                        "File $inp is not direct access. OK to convert?" \
468                        error 0 OK QUIT]
469                if {$ans == 0} {
470                    close $in
471                    WinCvt $inp
472                    set in [open $inp r]
473                    set line {}
474                } else {
475                    return
476                }
477            }
478            # scan for the INS   BANK line
479            if {[string first "INS   BANK" $line] == 0} {
480                set newhist(instbanks) \
481                        [string trim [string range $line 12 end]]
482            }
483        }
484    } else {
485        # is the file one big record?
486        set len [gets $in line]
487        if {$len <= 80} {
488            set ans [tk_dialog .err "Read error" \
489                    "File $inp is not direct access. OK to convert?" \
490                    error 0 OK QUIT]
491            if {$ans == 0} {
492                close $in
493                set oldname ${inp}.original
494                file rename $inp $oldname
495                if [catch {
496                    exec [file join $expgui(gsasexe) convstod] < \
497                            $oldname > $inp
498                } errmsg] {
499                    tk_dialog .warn Notify \
500                            "Error in conversion:\n$errmsg" warning 0 OK
501                }
502                set in [open $inp r]
503                set line {}
504            } else {
505                return
506            }
507        }
508        seek $in 0
509        while {[string length [set line [read $in 80]]] == 80} {
510            # scan for the INS   BANK line
511            if {[string first "INS   BANK" $line] == 0} {
512                set newhist(instbanks) \
513                        [string trim [string range $line 12 end]]
514            }
515        }
516    }
517    # were banks found?
518    if {$newhist(instbanks) == ""} {
519        tk_dialog .err "Read error" \
520                "File $inp has no INS   BANK line. This is not a valid GSAS Instrument Parameter file." \
521                error 0 OK
522        return
523    }
524    set newhist(instfile) $inp
525    for {set i 1} {$i <= $newhist(instbanks)} {incr i} {
526#       pack [checkbutton $np.set.$i -text $i \
527#               -variable newhist(set$i)] -side left
528        pack [radiobutton $np.set.$i -text $i \
529                -variable newhist(setnum) -value $i] -side left
530    }
531}
532
533proc addhist {np} {
534    global expgui newhist
535    # validate the input
536    set err {}
537    if {[string trim $newhist(rawfile)] == ""} {
538        append err "  No data file specified\n"
539    }
540    if {[string trim $newhist(instfile)] == ""} {
541        append err "  No instrument parameter file specified\n"
542    }
543    if {[string trim $newhist(banknum)] == ""} {
544            append err "  Bank number must be specified\n"
545    } elseif {[catch {expr $newhist(banknum)}]} {
546            append err "  Bank number is not valid\n"
547    }
548    if {[string trim $newhist(setnum)] == ""} {
549        append err "  Parameter set number must be specified\n"
550    } elseif {[catch {expr $newhist(setnum)}]} {
551        append err "  Parameter set number is not valid\n"
552    }
553    if {[string trim $newhist(2tLimit)] == ""} {
554        append err "  2Theta/d-space limit must be specified\n"
555    } elseif {[catch {expr $newhist(2tLimit)}]} {
556        append err "  The 2Theta/d-space limit is not valid\n"
557    }
558    if {[string trim $newhist(LimitMode)] == ""} {
559        append err "  Please choose between either a 2Theta or d-space limit\n"
560    }
561
562    if {$err != ""} {
563        tk_dialog .phaseerr "Add Histogram Error" \
564                "The following error(s) were found in your input:\n$err" \
565                error 0 "OK" 
566        return
567    }
568
569    # ok do it!
570    set fp [open exptool.in w]
571    puts $fp "H"
572    puts $fp $newhist(rawfile)
573    puts $fp $newhist(instfile)
574    puts $fp $newhist(banknum)
575    puts $fp $newhist(setnum)
576    if {$newhist(LimitMode)} {
577        puts $fp "T"
578    } else {
579        puts $fp "D"
580    }
581    puts $fp "$newhist(2tLimit)"
582    puts $fp "/"
583    puts $fp "X"
584    puts $fp "X"
585    close $fp
586    global tcl_platform
587    # Save the current exp file
588    savearchiveexp
589    # disable the file changed monitor
590    set expgui(expModifiedLast) 0
591    set expnam [file root [file tail $expgui(expfile)]]
592    catch {
593        if {$tcl_platform(platform) == "windows"} {
594            exec [file join $expgui(gsasexe) exptool.exe] $expnam \
595                    < exptool.in >& exptool.out
596        } else {
597            exec [file join $expgui(gsasexe) exptool] $expnam \
598                    < exptool.in >& exptool.out
599        }
600    } errmsg
601    # load the revised exp file
602    loadexp $expgui(expfile)
603    set fp [open exptool.out r]
604    set out [read $fp]
605    close $fp
606    destroy $np
607    if {$errmsg != ""} {
608        append errmsg "\n" $out
609    } else {
610        set errmsg $out
611    }
612    ShowBigMessage \
613                 $np \
614                 "Please review the result from adding the phase" \
615                 $errmsg
616    file delete exptool.in exptool.out
617}
618
619proc MakeAddAtomsBox {phase} {
620    global expmap
621
622    # is there room for more atoms? Well, we will check this later
623    if {$phase == ""} return
624    if {[llength $phase] != 1} return
625
626    set np .newatoms
627    catch {destroy $np}
628    toplevel $np
629
630    grid [label $np.l1 -text "Adding atoms to phase #$phase"] \
631            -column 0 -row 0 -sticky w -columnspan 10
632#    grid [label $np.l2 -text "Phase title:"] -column 0 -row 1
633    set row 1
634    set col -1
635    foreach i {Atom\ntype Name x y z Occ Uiso} {
636        grid [label $np.l_${row}$i -text $i] -column [incr col] -row $row
637    }
638
639    set row 2
640    set col -1
641    grid [entry $np.e${row}t -width 5] -column [incr col]  -row $row
642    grid [entry $np.e${row}n -width 8] -column [incr col]  -row $row
643    foreach i {x y z o u} {
644        grid [entry $np.e${row}$i -width 12] -column [incr col] -row $row
645    }
646    # default occupancy
647    $np.e${row}o delete 0 end
648    $np.e${row}o insert end 1.0
649    # default Uiso
650    $np.e${row}u delete 0 end
651    $np.e${row}u insert end 0.025
652    # default occupancy
653    $np.e${row}n delete 0 end
654    $np.e${row}n insert end (default)
655
656    grid [button $np.b1 -text Add \
657            -command "addatom $phase $np"] -column 2 -row 3
658    bind $np <Return> "addatom $phase $np"
659    grid [button $np.b2 -text Cancel \
660            -command "destroy $np"] -column 3 -row 3
661   
662    wm title $np "add new atom"
663
664    # grab focus, etc.
665    putontop $np
666
667    tkwait window $np
668
669    # fix focus...
670    afterputontop
671}
672
673proc addatom {phase np} {
674    global expgui env
675    # validate the input
676    set err {}
677    set row 2
678    if {[set type [string trim [$np.e${row}t get]]] == ""} {
679        append err "  No atom type specified\n"
680    }
681
682    set name [string trim [$np.e${row}n get]]
683    if {$name == "(default)"} {set name "/"}
684    if {$name == ""} {set name "/"}
685
686    foreach i {x y z o u} n {x y z Occ Uiso} {
687        if {[set $i [string trim [$np.e${row}$i get]]] == ""} {
688            append err "  No value specified for $n\n"
689        } elseif {[catch {expr [set $i]}]} {
690            append err "  The value for $n is invalid\n"
691        }
692    }
693
694    if {$err != ""} {
695        tk_dialog .phaseerr "Add Atom Error" \
696                "The following error(s) were found in your input:\n$err" \
697                error 0 "OK" 
698        return
699    }
700
701    # ok do it!
702    set fp [open exptool.in w]
703    puts $fp "A"
704    puts $fp $phase
705    # for now, only one atom at a time
706    puts $fp 1
707    puts $fp "$type $x $y $z $o $name I $u"
708    close $fp
709    # needed in UNIX
710    set env(ATOMDATA) [file join $expgui(gsasdir) data atmdata.dat]
711    # needed in Windows
712    set env(GSAS) [file nativename $expgui(gsasdir)]
713    global tcl_platform
714    # Save the current exp file
715    savearchiveexp
716    # disable the file changed monitor
717    set expgui(expModifiedLast) 0
718    set expnam [file root [file tail $expgui(expfile)]]
719    catch {
720        if {$tcl_platform(platform) == "windows"} {
721            exec [file join $expgui(gsasexe) exptool.exe] $expnam \
722                    < exptool.in >& exptool.out
723        } else {
724            exec [file join $expgui(gsasexe) exptool] $expnam \
725                    < exptool.in >& exptool.out
726        }
727    } errmsg
728    # load the revised exp file
729    loadexp $expgui(expfile)
730    set fp [open exptool.out r]
731    set out [read $fp]
732    close $fp
733    destroy $np
734    if {$errmsg != ""} {
735        append errmsg "\n" $out
736    } else {
737        set errmsg $out
738    }
739    ShowBigMessage \
740                 $np \
741                 "Please review the result from adding the atom" \
742                 $errmsg
743    file delete exptool.in exptool.out
744}
Note: See TracBrowser for help on using the repository browser.