Changeset 470 for trunk/gsascmds.tcl
- Timestamp:
- Dec 4, 2009 5:06:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsascmds.tcl
- Property rcs:date changed from 2001/09/25 23:31:59 to 2001/10/18 23:30:15
- Property rcs:lines changed from +180 -10 to +62 -9
- Property rcs:rev changed from 1.38 to 1.39
r450 r470 881 881 882 882 # Substitute the HTML filename into the command for %1 883 regsub %1 $appCmd $url appCmd 883 # or stick it on the end 884 if {[string first %1 $appCmd] != -1} { 885 regsub %1 $appCmd $url appCmd 886 } else { 887 append appCmd " " $url 888 } 884 889 885 890 # Double up the backslashes for eval (below) … … 1323 1328 } 1324 1329 1330 proc archiveexp {} { 1331 global expgui tcl_platform 1332 # is there a file to archive? 1333 if {![file exists $expgui(expfile)]} return 1334 set expnam [file rootname $expgui(expfile)] 1335 # get the last archived version 1336 set lastf [lindex [lsort [glob $expnam.{O\[0-9A-F\]\[0-9A-F\]}]] end] 1337 if {$lastf == ""} { 1338 set num 01 1339 } else { 1340 regexp {.*\.O([0-9A-F][0-9A-F])$} $lastf a num 1341 scan $num %x num 1342 if {$num >= 255} { 1343 set num FF 1344 } else { 1345 set num [string toupper [format %.2x [incr num]]] 1346 } 1347 } 1348 catch { 1349 set file $expnam.O$num 1350 file rename -force $expgui(expfile) $file 1351 exec echo "\n----------------------------------------------" >> $expnam.LST 1352 exec echo " Archiving [file tail $expnam.EXP] as [file tail $file]" >> $expnam.LST 1353 exec echo "----------------------------------------------\n" >> $expnam.LST 1354 } errmsg 1355 if {$errmsg != ""} { 1356 tk_dialog .warn Confirm "Error archiving the current .EXP file: $errmsg" warning 0 OK 1357 } 1358 } 1359 1360 # save and optionally archive the expfile 1361 proc savearchiveexp {} { 1362 global expgui expmap 1363 if {$expgui(expfile) == ""} { 1364 SaveAsFile 1365 return 1366 } 1367 if !$expgui(changed) return 1368 if {$expgui(archive)} archiveexp 1369 # add a history record 1370 exphistory add " EXPGUI [lindex $expgui(Revision) 1] [lindex $expmap(Revision) 1] ($expgui(changed) changes) -- [clock format [clock seconds]]" 1371 # now save the file 1372 expwrite $expgui(expfile) 1373 set expgui(changed) 0 1374 set expgui(expModifiedLast) [file mtime $expgui(expfile)] 1375 set expgui(last_History) [string range [string trim [lindex [exphistory last] 1]] 0 50 ] 1376 wm title . $expgui(expfile) 1377 set expgui(titleunchanged) 1 1378 # set convergence criterion 1379 InitLSvars 1380 } 1381 1325 1382 #------------------------------------------------------------------------------ 1326 1383 # GSAS interface routines … … 1358 1415 set expnam [file root [file tail $expgui(expfile)]] 1359 1416 foreach prog $proglist { 1360 if {$prog == "expedt" && $expgui(archive)} archiveexp1361 1417 if {$tcl_platform(platform) == "windows"} { 1362 1418 append cmd " \"$expgui(gsasexe)/${prog}.exe $expnam \" " … … 1778 1834 1779 1835 set expgui(includearchived) 0 1780 if {$ tcl_platform(platform) == "unix" && $mode == "old"} {1836 if {$mode == "old"} { 1781 1837 pack [checkbutton $frmC.ar -text "Include Archived Files" \ 1782 1838 -variable expgui(includearchived) \ … … 1840 1896 } 1841 1897 # check for archive files 1842 if {([string match {*.EXP.[0-9][0-9][0-9].gz} $expgui(FileMenuEXPNAM)] || \ 1843 [string match {*.EXP.[0-9][0-9][0-9]} $expgui(FileMenuEXPNAM)]) && \ 1844 $tcl_platform(platform) == "unix" && \ 1898 if {[string match {*.O[0-9A-F][0-9A-F]} $expgui(FileMenuEXPNAM)] && \ 1845 1899 $mode == "old" && [file exists $expgui(FileMenuEXPNAM)]} { 1846 1900 destroy .file … … 2186 2240 lappend pairlist [list $file $modified] 2187 2241 } elseif {![file isdirectory $file] && $expgui(includearchived) && \ 2188 ([string match {*.EXP.[0-9][0-9][0-9].gz} $file] ||\ 2189 [string match {*.EXP.[0-9][0-9][0-9]} $file])} { 2242 [string match {*.O[0-9A-F][0-9A-F]} $file]} { 2190 2243 set modified [file mtime $file] 2191 2244 lappend pairlist [list $file $modified]
Note: See TracChangeset
for help on using the changeset viewer.