Changeset 1186 for trunk/liveplot


Ignore:
Timestamp:
Jan 23, 2012 5:42:18 PM (9 years ago)
Author:
toby
Message:

liveplot: plottitle opts, bkgedit: match to liveplot, add update after adding points

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/liveplot

    r1181 r1186  
    6969set graph(yunits) 0
    7070set graph(autoraise) 1
     71set graph(setfiletitle) 0
    7172set graph(color_diff) blue
    7273set graph(color_chi2) magenta
     
    812813        return
    813814    }
    814     if {$::plot_title == "(None)"} {
     815    if {$::graph(setfiletitle) && $::topasfile != ""} {
     816        $box config -title "TOPAS import $::topasfile"
     817    } elseif {$::graph(setfiletitle)} {
     818        $box config -title "$expnam [histinfo $::hst file] cycle $cycle"
     819    } elseif {$::plot_title == "(None)"} {
    815820        $box config -title "$expnam cycle $cycle Hist $hst"
    816821    } else {
     
    12401245    }
    12411246    puts $fp "# LIVEPLOT saved options from [clock format [clock seconds]]"
    1242     foreach v {printout legend outname outcmd autoraise chi2 xunits yunits OmCoS} {
     1247    foreach v {
     1248        printout legend outname outcmd autoraise
     1249        chi2 xunits yunits OmCoS setfiletitle} {
    12431250        puts $fp "set graph($v) [list $graph($v)]"
    12441251    }
     
    14411448    close $fp
    14421449    .g element config 12 -data $l
     1450    # force a replot
     1451    .g elem show [.g elem show]
    14431452    if {[set l [llength $bkglist]] > 3} {
    14441453        .bkg.f.fit1 config -state normal
     
    23382347.a.file.menu add command -label "Set Plot Title" \
    23392348        -command SetTitle
     2349.a.file.menu add checkbutton -label "Set Plot Title to data file" \
     2350    -variable graph(setfiletitle) \
     2351    -command {set cycle [getcycle];readdata .g}
     2352
    23402353.a.file.menu add cascade -label "Export plot" -menu .a.file.menu.export
    23412354menu .a.file.menu.export
     
    23562369}
    23572370
    2358 .a.file.menu add command -label "Import from Topas" \
    2359     -command {get_topas_file}
    2360 
     2371if {$program == "liveplot"} {
     2372    .a.file.menu add command -label "Import from Topas" \
     2373        -command {get_topas_file}
     2374}
    23612375.a.file.menu add command -label Quit -command "destroy ."
    23622376.a.file.menu.export add command -label "as .csv file" \
     
    23812395.a.options.menu.tick add separator
    23822396.a.options.menu.tick add radiobutton -label "Label by phase number" \
    2383         -value 0 -variable expgui(phaselabel) -command plotdata
     2397    -value 0 -variable expgui(phaselabel) -command plotdata
    23842398.a.options.menu.tick add radiobutton -label "Label by phase name" \
    2385         -value 1 -variable expgui(phaselabel) -command plotdata
     2399    -value 1 -variable expgui(phaselabel) -command plotdata
    23862400.a.options.menu.tick add separator
    23872401
    2388 pack [menubutton .a.mag -text Magnification -underline 0 -menu .a.mag.menu] \
     2402if {$program == "liveplot"} {
     2403    pack [menubutton .a.mag -text Magnification -underline 0 -menu .a.mag.menu] \
    23892404        -side left
    2390 menu .a.mag.menu
     2405    menu .a.mag.menu
     2406}
    23912407set maglist {}
    23922408set mag0 1.0
Note: See TracChangeset for help on using the changeset viewer.