Changeset 71


Ignore:
Timestamp:
Dec 4, 2009 4:59:55 PM (14 years ago)
Author:
toby
Message:

# on 1999/03/19 17:07:59, toby did:
bug fixes for reading new .EXP files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 1999/02/22 20:03:00 to 1999/03/19 17:07:59
    • Property rcs:lines changed from +17 -12 to +23 -19
    • Property rcs:rev changed from 1.11 to 1.12
    r63 r71  
    235235}
    236236
    237 proc CreateNewExp {} {
    238     global expgui
    239     set newexpfile [newexp]
    240     if {$newexpfile == ""} return
    241     # create an "empty" exp file
    242     createexp $newexpfile \
    243                 [getstring "title for experiment $newexpfile" 60 0]
    244     set expgui(expfile) $newexpfile
    245     catch {cd [string trim [file dirname $expgui(expfile)]]}
    246     loadexp $expgui(expfile)
    247 }
    248 
    249237proc SaveAsFile {} {
    250238    global expgui
    251239    set newexpfile [getExpFileName new]
    252240    if {$newexpfile == ""} return
     241    expwrite $newexpfile
    253242    set expgui(expfile) $newexpfile
    254243    catch {cd [string trim [file dirname $expgui(expfile)]]}
    255     expwrite $expgui(expfile)
    256244    set expgui(changed) 0
    257245    set expgui(expModifiedLast) [file mtime $expgui(expfile)]
     
    278266    set newexpfile [getExpFileName old]
    279267    if {$newexpfile == ""} return
     268
     269    if ![file exists $newexpfile] {
     270        # you've been warned this .EXP does not exist!
     271        # create an "empty" exp file
     272        createexp $newexpfile \
     273                [getstring "title for experiment $newexpfile" 60 0]
     274    }
    280275    set expgui(expfile) $newexpfile
    281276    catch {cd [string trim [file dirname $expgui(expfile)]]}
     
    285280    SelectOnePhase [lindex $expmap(phaselist) 0]
    286281    # select the first histogram in the list by default (if there are any)
    287     if {[llength $expmap(histlistboxcontents)] > 0} {set expgui(curhist) 0}
     282    if {[llength $expmap(histlistboxcontents)] > 0} {
     283        set expgui(curhist) 0
     284    } else {
     285        set expgui(curhist) {}
     286    }
    288287    if !$expgui(havetix) {
    289288        RaisePage lsFrame
     
    563562    set crsPhase $num
    564563    # no phase is selected
    565     if {$crsPhase == ""} {
     564    if {$crsPhase == "" || [llength $expmap(phaselist)] == 0} {
    566565        # disable traces on entryvar
    567566        set entrycmd(trace) 0
     
    572571            set entryvar($ent) ""
    573572        }
     573        set expgui(curPhase) {}
    574574        # enable traces on entryvar
    575575        set entrycmd(trace) 1
     
    12371237            grid [ entry $expgui(diffBox).eDCipola -width 2 \
    12381238                    -textvariable entryvar(ipola)] -column 6 -row 4
    1239                     -variable entryvar(zref) ] -column 2 -row 3
    12401239        } elseif {[string range $expmap(htype_$hist) 1 2] == "XE"} {
    12411240        #-------------
     
    15871586            set row 1
    15881587            set nterms [hapinfo $hist $i profterms]
    1589             set lbls $expgui(prof-$htype-$ptype)
     1588            set lbls {}
     1589            catch {set lbls $expgui(prof-$htype-$ptype)}
    15901590            # for type 4, add extra terms depending on the cell type
    15911591            if {$ptype == 4} {set lbls [type4lbls $lbls $nterms $i]}
     
    29992999SelectOnePhase [lindex $expmap(phaselist) 0]
    30003000# select the first histogram in the list by default (if there are any)
    3001 if {[llength $expmap(histlistboxcontents)] > 0} {set expgui(curhist) 0}
     3001if {[llength $expmap(histlistboxcontents)] > 0} {
     3002    set expgui(curhist) 0
     3003} else {
     3004    set expgui(curhist) {}
     3005}
    30023006
    30033007if !$expgui(havetix) {
Note: See TracChangeset for help on using the changeset viewer.