Changeset 673 for trunk


Ignore:
Timestamp:
Dec 4, 2009 5:10:06 PM (14 years ago)
Author:
toby
Message:

# on 2003/04/10 22:13:02, toby did:
implement GRWND startup (Win-9x)
warn on names with spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsascmds.tcl

    • Property rcs:date changed from 2002/12/30 17:14:03 to 2003/04/10 22:13:02
    • Property rcs:lines changed from +21 -9 to +62 -1
    • Property rcs:rev changed from 1.48 to 1.49
    r665 r673  
    12631263    set cmd {}
    12641264    foreach prog $proglist {
     1265        StartGRWND $prog
    12651266        if {$tcl_platform(platform) == "windows"} {
    12661267            append cmd " \"$expgui(gsasexe)/${prog}.exe \" "
     
    12711272    }
    12721273    forknewterm $prog $cmd [expr !$concurrent] 1
     1274}
     1275
     1276# dummy routine, overridden if needed
     1277proc StartGRWND {prog} {
    12731278}
    12741279
     
    12881293    set expnam [file root [file tail $expgui(expfile)]]
    12891294    foreach prog $proglist {
     1295        if {$prog == "powpref"} {
     1296            set expgui(needpowpref) 0
     1297            set expgui(needpowpref_why) ""
     1298        } elseif {$prog == "genles" && $expgui(needpowpref) != 0} {
     1299            set msg "You are attempting to run GENLES, after making changes that require POWPREF:\n\n$expgui(needpowpref_why) \nRun POWPREF first?"
     1300            set ans [MyMessageBox -parent . -title "Run POWPREF" \
     1301                    -message $msg -icon warning -type "Yes No" -default yes \
     1302                    -helplink "expguierr.html RunPowpref"]
     1303            if {$ans == "yes"} {
     1304                set expgui(needpowpref) 0
     1305                set expgui(needpowpref_why) ""
     1306                if {$tcl_platform(platform) == "windows"} {
     1307                    append cmd " \"$expgui(gsasexe)/powpref.exe $expnam \" "
     1308                } else {
     1309                    if {$cmd != ""} {append cmd "\;"}
     1310                    append cmd "[file join $expgui(gsasexe) powpref] $expnam"
     1311                }
     1312            }
     1313        }
     1314        StartGRWND $prog
    12901315        if {$tcl_platform(platform) == "windows"} {
    12911316            append cmd " \"$expgui(gsasexe)/${prog}.exe $expnam \" "
     
    17521777    afterputontop
    17531778    if {$expgui(FileMenuEXPNAM) == ""} return
     1779    # is there a space in the EXP name?
     1780    if {[string first " " [file tail $expgui(FileMenuEXPNAM)]] != -1} {
     1781        update
     1782        MyMessageBox -parent . -title "File Name Error" \
     1783            -message "File name \"$expgui(FileMenuEXPNAM)\" is invalid -- EXPGUI cannot process experiment files with spaces in the name" \
     1784            -icon warning -type Continue -default continue
     1785#               -helplink "expguierr.html OpenErr"
     1786        return
     1787    }
     1788    if {[string first " " $expgui(FileMenuDir)] != -1} {
     1789        update
     1790        MyMessageBox -parent . -title "Good luck..." \
     1791            -message "You are using a directory with a space in the name ([file dirname $expgui(FileMenuDir)]) -- You may encounter bugs in EXPGUI. Please e-mail them to Brian.Toby@NIST.gov so they can be fixed." \
     1792            -icon warning -type Continue -default continue
     1793#               -helplink "expguierr.html OpenErr"
     1794    }
    17541795    return [file join $expgui(FileMenuDir) $expgui(FileMenuEXPNAM)]
    17551796}
     
    22782319        }
    22792320    }
     2321    # this procedure starts the GRWND program, if needed for program $prog
     2322    proc StartGRWND {prog} {
     2323        global expgui
     2324        if {!$expgui(autoGRWND)} return
     2325        # at some point we might want to have a real list
     2326        if {$prog != "genles" && $prog != "powpref"} {
     2327            # get a list of running jobs
     2328            exec [file join $expgui(scriptdir) win9xbin tlist.exe] > tlist.tlist
     2329            set fp [open tlist.tlist r]
     2330            set text [read $fp]
     2331            close $fp
     2332            file delete -force tlist.tlist
     2333            # if GRWND.EXE is not currently running, start it
     2334            if {[lsearch [string toupper $text] GRWND.EXE] == -1} {
     2335                exec [file join $expgui(gsasexe) grwnd.exe] &
     2336                # give grwnd a 1 second head start
     2337                after 1000
     2338            }
     2339        }
     2340    }
    22802341    # this creates a DOS box to run a program in
    22812342    proc forknewterm {title command "wait 1" "scrollbar 1"} {
Note: See TracChangeset for help on using the changeset viewer.