Changeset 1025 for trunk/expgui


Ignore:
Timestamp:
Oct 13, 2010 2:27:15 PM (10 years ago)
Author:
toby
Message:

see https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/News20101013

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/expgui

    r997 r1025  
    155155# setting data range/excluded regions
    156156source [file join $expgui(scriptdir) exclinit.tcl]
     157# setup DISAGL viewer & editor
     158source [file join $expgui(scriptdir) disagledit.tcl]
     159source [file join $expgui(scriptdir) geo_viewer.tcl]
    157160#---------------------------------------------------------------------------
    158161# override options with locally defined values
     
    546549    set newexpfile [getExpFileName new]
    547550    if {$newexpfile == ""} return
    548     SetEXPfile $newexpfile
     551    SetEXPfile $newexpfile 1
    549552    if {$expgui(expfile) == ""} {
    550553        set expgui(expfile) $prevexp
     
    16991702        }
    17001703    }
    1701     # disable the unallowed pages in all mode
    1702     if {$expgui(globalmode) == 6} {
    1703         foreach pair $expgui(GlobalModeAllDisable) {
    1704             if {$expgui(pagenow) == [lindex $pair 0]} {
    1705                 RaisePage lsFrame
    1706             }
    1707             eval [lindex $pair 1] -state disabled
    1708         }
    1709     } else {
    1710         foreach pair $expgui(GlobalModeAllDisable) {
    1711             eval [lindex $pair 1] -state normal
    1712         }
    1713     }
     1704    StageTabUse
     1705    # # disable the unallowed pages in all mode
     1706    # if {$expgui(globalmode) == 6} {
     1707    #   foreach pair $expgui(GlobalModeAllDisable) {
     1708    #       if {$expgui(pagenow) == [lindex $pair 0]} {
     1709    #           RaisePage lsFrame
     1710    #       }
     1711    #       eval [lindex $pair 1] -state disabled
     1712    #   }
     1713    # } else {
     1714    #   foreach pair $expgui(GlobalModeAllDisable) {
     1715    #       eval [lindex $pair 1] -state normal
     1716    #   }
     1717    # }
    17141718    set histlist {}
    17151719    if  {$expgui(hsorttype) == "type"} {
     
    33483352            DisplayProfile \
    33493353            1  expgui5.html ""}
    3350     {consFrame    Constraints \
     3354    {consFrame    "Re/Constraints" \
    33513355            "source [file join $expgui(scriptdir) atomcons.tcl]; MakeConstraintsPane" \
    33523356            DisplayConstraintsPane \
     
    33833387    }
    33843388}
     3389# procedure to disable tabs when phases or histograms are not defined
     3390proc StageTabUse {args} {
     3391    global expgui
     3392    # reset everything
     3393    foreach item [lrange $::expgui(notebookpagelist) 0 end] {
     3394        set frm [lindex $item 0]
     3395        .n itemconfigure $frm -state normal
     3396    }
     3397    # disable the unallowed pages in all mode
     3398    if {$expgui(globalmode) == 6} {
     3399        foreach pair $expgui(GlobalModeAllDisable) {
     3400            if {$expgui(pagenow) == [lindex $pair 0]} {
     3401                RaisePage lsFrame
     3402            }
     3403            eval [lindex $pair 1] -state disabled
     3404        }
     3405    } else {
     3406        foreach pair $expgui(GlobalModeAllDisable) {
     3407            eval [lindex $pair 1] -state normal
     3408        }
     3409    }
     3410    # no phases are present, one must add a phase 1st
     3411    if {[llength $::expmap(phaselist)] == 0} {
     3412        foreach item [lrange $::expgui(notebookpagelist) 2 end] {
     3413            set frm [lindex $item 0]
     3414            .n itemconfigure $frm -state disabled
     3415        }
     3416        return
     3417    }
     3418    # do any of the phases have atoms?
     3419    set flag 1
     3420    foreach phase $::expmap(phaselist) {
     3421        if {[array names ::expmap atomlist_$phase] != ""} {
     3422            if {[llength $::expmap(atomlist_$phase)] > 0} {
     3423                set flag 0
     3424                break
     3425            }
     3426        }
     3427    }
     3428    # no atoms are present, one must add at least one before continuing
     3429    if $flag {
     3430        foreach item [lrange $::expgui(notebookpagelist) 2 end] {
     3431            set frm [lindex $item 0]
     3432            .n itemconfigure $frm -state disabled
     3433        }
     3434        return
     3435    }
     3436
     3437    # no data is present, one must add a histogram next
     3438    if {[llength $::expmap(nhst)] == 0} {
     3439        foreach item [lrange $::expgui(notebookpagelist) 4 end] {
     3440            set frm [lindex $item 0]
     3441            .n itemconfigure $frm -state disabled
     3442        }
     3443        return
     3444    }
     3445}
     3446# expgui(mapstat) is set by mapexp when it is called
     3447# mapexp will be called when the .EXP file is changed (addition of phases, atoms or histograms)
     3448trace variable expgui(mapstat) w StageTabUse
    33853449
    33863450# this is used to bring up the selected frame
     
    42044268        -command {set expgui(debug) 1}
    42054269}
    4206 # add update commands to buffer
    4207 if [CheckUpdateImplemented $expgui(gsasdir)] {
     4270# add update commands to menu
     4271if {[file exists [file join  $expgui(gsasdir) .svn]]} {
    42084272    $expgui(fm).file.menu add command -command CheckAndDoUpdate -label "Update GSAS/EXPGUI"
    4209 #    $expgui(fm).file.menu add cascade -menu $expgui(fm).file.menu.track \
    4210 #       -label "Select EXPGUI version"
    4211 #    menu $expgui(fm).file.menu.track
    4212 #    $expgui(fm).file.menu.track add radiobutton -command {SetSVNbranch trunk} -label Development -value trunk \
    4213 #       -variable expgui(SVNversion)
    4214 #    $expgui(fm).file.menu.track add radiobutton -command {SetSVNbranch stable} -label Standard -value stable \
    4215 #       -variable expgui(SVNversion)
    4216     # get info about the current version on the server. Someday we might want to compare this
    4217     # say every month and notify when there is a new version to update
    4218     set repos [GetSVNrepository [file normalize $expgui(gsasdir)]]
    4219     # send a "p" to accept the server fingerprint in case needed on 1st access
    4220     set svninp [file normalize "~/svntmp.txt"]
    4221     set fp [open $svninp "w"]
    4222     puts $fp "p"
    4223     close $fp
    4224     if [catch {set out [exec svn info $repos < $svninp]} err] {
    4225         puts "svn info error = $err"
    4226     }
    4227     catch {file delete $svninp}
    4228     set expgui(SVNversion) [lindex [split $repos '/'] end]
    4229     # cleanup batch file from a previous update
    4230     if {$::tcl_platform(platform) == "windows" && $::tcl_platform(os) != "Windows 95"} {
    4231         catch {
    4232             file delete [file normalize ~/expgui_update.bat]
    4233         }
    4234     }
    42354273} else {
    4236     $expgui(fm).file.menu add command -label "Show update problem" -command {
    4237         if {! [file exists [file join $expgui(gsasdir) .svn]]} {
    4238             MyMessageBox -parent . -title "No .svn" \
    4239                 -message "Unable to update because the gsas/.svn directory is not present." \
    4240                 -icon warning
    4241         } else {
    4242             MyMessageBox -parent . -title "No .svn" \
    4243                 -message "Unable to update because the subversion (svn) program is not in the path." \
    4244                 -icon warning
    4245         }
    4246     }
     4274    $expgui(fm).file.menu add command  -state disabled -label "Self-updating not installed"
    42474275}
    42484276foreach c {h H} {bind . <Alt-$c> [list showhelp]}
Note: See TracChangeset for help on using the changeset viewer.