- Timestamp:
- Dec 4, 2009 5:05:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2001/04/17 22:51:20 to 2001/05/11 16:18:58
- Property rcs:lines changed from +5 -7 to +75 -28
- Property rcs:rev changed from 1.41 to 1.42
r385 r390 167 167 # 168 168 set expgui(exptool) [file join $expgui(gsasexe) exptool.exe] 169 if ![file exists [file join $expgui(gsasdir) fonts grfont.dat]] {170 MyMessageBox -parent . -title "PGPLOT Error" \171 -message "Warning -- Unable to find file GRFONT.DAT. GSAS graphics will not work. Is GSAS correctly installed?" \172 -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \173 -helplink "expguierr.html NoPGPLOT"174 }175 169 } else { 176 170 set expgui(exptool) [file join $expgui(gsasexe) exptool] 177 if ![file exists [file join $expgui(gsasdir) pgl grfont.dat]] {178 MyMessageBox -parent . -title "PGPLOT Error" \179 -message "Warning -- Unable to find file grfont.dat. GSAS graphics will not work. Is GSAS correctly installed?" \180 -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \181 -helplink "expguierr.html NoPGPLOT"182 }183 171 if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1} 172 } 173 # do we have a PGPLOT fonts file? 174 if ![file exists [file join $expgui(gsasdir) pgl grfont.dat]] { 175 MyMessageBox -parent . -title "PGPLOT Error" \ 176 -message "Warning -- Unable to find file GRFONT.DAT. GSAS graphics will not work. Is GSAS correctly installed?" \ 177 -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \ 178 -helplink "expguierr.html NoPGPLOT" 184 179 } 185 180 #--------------------------------------------------------------------------- … … 226 221 proc loadexp {expfile} { 227 222 global expgui expmap entryvar entrycmd tcl_platform 228 set exploadtime [time {set fmt [expload $expfile]}] 229 if $expgui(debug) {puts "expload $exploadtime"} 230 # if the file was not in the correct format, force a rewrite before use 231 if {$fmt < 0} { 232 # read error 233 return 234 } elseif {$fmt == 1} { 235 set expgui(changed) 0 223 # is this a compressed archive file? 224 if {[string match {*.EXP.[0-9][0-9][0-9].gz} $expfile] && \ 225 $tcl_platform(platform) == "unix"} { 226 regexp {.*.EXP} $expfile rootname 227 if {[auto_execok gunzip] == ""} { 228 # tno gunzip -- bail out 229 MyMessageBox -parent . -title "Cannot Load Archived File" \ 230 -message "Unable to find the gunzip program in your path. Loading this archived version of [file tail $rootname] requires the gzip program. Load gunzip or fix your path and then restart EXPGUI" \ 231 -icon error 232 return 233 } 234 set ans [MyMessageBox -parent . -title "Load Archived File" \ 235 -message "Loading archived version of [file tail $rootname]. Do you want to overwrite $rootname or save the archived version under a new name?" \ 236 -icon question -type "{Use New Name} Overwrite"\ 237 -default {Use New Name} \ 238 -helplink "expguierr.html LoadArchived" 239 ] 240 set fmt [expload $expfile] 241 if {$fmt < 0} { 242 # read error 243 return 244 } 245 set expgui(changed) 1 246 set expfile $rootname 247 if {$ans == "use new name"} { 248 SaveAsFile 249 set expfile $expgui(expfile) 250 } 251 # is this an uncompressed archive file? 252 } elseif {[string match {*.EXP.[0-9][0-9][0-9]} $expfile] && \ 253 $tcl_platform(platform) == "unix"} { 254 regexp {.*.EXP} $expfile rootname 255 set ans [MyMessageBox -parent . -title "Load Archived File" \ 256 -message "Loading archived version of [file tail $rootname]. Do you want to overwrite $rootname or save the archived version under a new name?" \ 257 -icon question -type "{Use New Name} Overwrite"\ 258 -default {Use New Name} \ 259 -helplink "expguierr.html LoadArchived" 260 ] 261 set fmt [expload $expfile] 262 if {$fmt < 0} { 263 # read error 264 return 265 } 266 set expgui(changed) 1 267 set expfile $rootname 268 if {$ans == "use new name"} { 269 SaveAsFile 270 set expfile $expgui(expfile) 271 } 236 272 } else { 237 set expgui(changed) 1 238 } 239 273 set exploadtime [time {set fmt [expload $expfile]}] 274 if $expgui(debug) {puts "expload $exploadtime"} 275 # if the file was not in the correct format, force a rewrite before use 276 if {$fmt < 0} { 277 # read error 278 return 279 } elseif {$fmt == 1} { 280 set expgui(changed) 0 281 } else { 282 set expgui(changed) 1 283 } 284 } 240 285 # force exp files to be upper case, force save if name changes 241 286 set filetail [file tail $expfile] … … 1328 1373 1329 1374 # disable the add histogram button if no phases are present 1330 if {[llength $expmap(phaselist)] == 0} { 1331 $expgui(histFrame).newh configure -state disabled 1332 } else { 1333 $expgui(histFrame).newh configure -state normal 1375 catch { 1376 if {[llength $expmap(phaselist)] == 0} { 1377 $expgui(histFrame).newh configure -state disabled 1378 } else { 1379 $expgui(histFrame).newh configure -state normal 1380 } 1334 1381 } 1335 1382
Note: See TracChangeset
for help on using the changeset viewer.