Changeset 467 for trunk/liveplot
- Timestamp:
- Dec 4, 2009 5:06:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/liveplot
- Property rcs:date changed from 2001/09/25 23:34:32 to 2001/10/18 23:23:58
- Property rcs:lines changed from +48 -18 to +47 -18
- Property rcs:rev changed from 1.19 to 1.20
r451 r467 401 401 global blt_version expgui tcl_platform tcl_version 402 402 global refhkllist refphaselist peakinfo refpos 403 # look for peaks within pixelregion pixels 404 set xmin [$plot xaxis invtransform [expr $x - $expgui(pixelregion)]] 405 set xmax [$plot xaxis invtransform [expr $x + $expgui(pixelregion)]] 403 # look for peaks within pixelregion pixels or the entire plot range 404 if {$x == "all"} { 405 foreach {xmin xmax} [$plot xaxis limits] {} 406 } else { 407 set xmin [$plot xaxis invtransform [expr $x - $expgui(pixelregion)]] 408 set xmax [$plot xaxis invtransform [expr $x + $expgui(pixelregion)]] 409 } 406 410 set peaknums [refposvec search $xmin $xmax] 407 411 set peaklist {} 408 set xcen 0 409 # select by displayed phases 410 set lbls 0 412 # create a box, if needed 411 413 if {$expgui(hklbox)} { 412 414 catch { … … 424 426 } 425 427 } 428 set xcen 0 429 set lbls 0 426 430 foreach peak $peaknums { 431 # put all hkls, all phases in the box 427 432 if {$expgui(hklbox)} { 428 433 catch { … … 433 438 } 434 439 } 440 # label phases with tick marks 435 441 if [set peakinfo(flag[lindex $refphaselist $peak])] { 436 set xcen [expr $xcen + [refposvec range $peak $peak]] 437 lappend peaklist [lindex $refhkllist $peak] 438 incr lbls 439 } 440 } 442 set pos [refposvec range $peak $peak] 443 if {$lbls <= 0} { 444 set xcen $pos 445 set peaklist [lindex $refhkllist $peak] 446 set lbls 1 447 } elseif {abs($xcen/$lbls-$pos) <= $expgui(pixelregion)} { 448 set xcen [expr $xcen + $pos] 449 lappend peaklist [lindex $refhkllist $peak] 450 incr lbls 451 } else { 452 puthkllbl $plot $peaklist $xcen $lbls 453 set xcen $pos 454 set peaklist [lindex $refhkllist $peak] 455 set lbls 1 456 } 457 } 458 } 459 puthkllbl $plot $peaklist $xcen $lbls 460 } 461 462 proc puthkllbl {plot peaklist xcen lbls} { 463 global blt_version tcl_platform tcl_version expgui 441 464 if {$peaklist == ""} return 442 465 set xcen [expr $xcen / $lbls] … … 447 470 set ycen Inf 448 471 } 449 if {$tcl_platform(platform) == "windows"} { 450 # at least right now, text can't be rotated in windows 472 # older BLT versions can't rotate text in windows 473 if {$tcl_platform(platform) == "windows" && \ 474 ($blt_version <= 2.3 || $blt_version == 8.0)} { 451 475 regsub -all { } $peaklist "\n" peaklist 452 476 set mark [$plot marker create text -coords "$xcen $ycen" \ 453 -text $peaklist -anchor n -bg "" -name hkl$xcen]477 -text $peaklist -anchor n -bg "" -name hkl$xcen] 454 478 } else { 455 479 set mark [$plot marker create text -coords "$xcen $ycen" \ 456 -rotate 90 -text $peaklist -anchor n -bg "" -name hkl$xcen]480 -rotate 90 -text $peaklist -anchor n -bg "" -name hkl$xcen] 457 481 } 458 482 if {$tcl_version >= 8.0} { … … 462 486 catch { 463 487 after [expr $expgui(fadetime) * 1000 ] \ 464 "catch \{ $plot marker delete $mark \}"488 "catch \{ $plot marker delete $mark \}" 465 489 } 466 490 } … … 673 697 toplevel $box 674 698 focus $box 699 wm title $box "Set PS options" 675 700 pack [frame $box.4] -side top -anchor w -fill x 676 701 pack [checkbutton $box.4.a -text "Write PostScript files" \ … … 701 726 toplevel $box 702 727 focus $box 728 wm title $box "Set hkl options" 703 729 pack [frame $box.c] -side top -anchor w 704 730 pack [label $box.c.l -text "HKL label\nerase time:"] -side left … … 1445 1471 bind . <Key-h> "lblhkl $box %x" 1446 1472 bind . <Key-H> "lblhkl $box %x" 1447 # bind $box <Shift-Double-Button-1> "lblallhkl %W" 1473 bind . <Key-a> "lblhkl $box all" 1474 bind . <Key-A> "lblhkl $box all" 1475 bind . <Key-d> "delallhkllbl $box" 1476 bind . <Key-D> "delallhkllbl $box" 1448 1477 if {[bind bltZoomGraph] != ""} { 1449 1478 bind bltZoomGraph <Shift-Button-1> "lblhkl $box %x"
Note: See TracChangeset
for help on using the changeset viewer.