Changeset 2943 for trunk/gui/scripts/analyzer.tcl
- Timestamp:
- Apr 5, 2012, 1:37:35 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/analyzer.tcl
r2783 r2943 55 55 public method reset {{when -eventually}} 56 56 public method load {xmlobj} 57 public method clear { }57 public method clear {{xmlobj ""}} 58 58 public method download {option args} 59 59 … … 641 641 642 642 # ---------------------------------------------------------------------- 643 # USAGE: clear 644 # 645 # Discards all results previously loaded into the analyzer. 646 # ---------------------------------------------------------------------- 647 itcl::body Rappture::Analyzer::clear {} { 648 foreach obj $_runs { 649 itcl::delete object $obj 650 } 651 set _runs "" 652 653 $itk_component(resultset) clear 654 655 # reset the size of the controls area 656 set ht [winfo height $itk_component(results)] 657 set cntlht [$itk_component(resultset) size -controlarea] 658 set frac [expr {double($cntlht)/$ht}] 659 $itk_component(results) fraction end $frac 660 661 foreach label [array names _label2page] { 662 set page $_label2page($label) 663 destroy $page.rviewer 664 #$page.rviewer clear 665 } 666 $itk_component(resultselector) value "" 667 $itk_component(resultselector) choices delete 0 end 668 catch {unset _label2page} 669 catch {unset _label2desc} 670 set _plotlist "" 671 672 $itk_component(resultselector) choices insert end --- "---" 673 $itk_component(resultselector) choices insert end \ 674 @download [Rappture::filexfer::label download] 675 set _lastlabel "" 643 # USAGE: clear ?<xmlobj>? 644 # 645 # Discards one or more results previously loaded into the analyzer. 646 # If an <xmlobj> is specified, then that one result is cleared. 647 # Otherwise, all results are cleared. 648 # ---------------------------------------------------------------------- 649 itcl::body Rappture::Analyzer::clear {{xmlobj ""}} { 650 if {$xmlobj ne ""} { 651 set i [lsearch -exact $_runs $xmlobj] 652 if {$i >= 0} { 653 itcl::delete object $xmlobj 654 set _runs [lreplace $_runs $i $i] 655 656 # delete this result from all viewers 657 foreach label [array names _label2page] { 658 set page $_label2page($label) 659 $page.rviewer clear $xmlobj 660 } 661 } 662 } else { 663 # clear everything 664 foreach obj $_runs { 665 itcl::delete object $obj 666 } 667 set _runs "" 668 } 669 670 if {[llength $_runs] == 0} { 671 # reset the size of the controls area 672 set ht [winfo height $itk_component(results)] 673 set cntlht [$itk_component(resultset) size -controlarea] 674 set frac [expr {double($cntlht)/$ht}] 675 $itk_component(results) fraction end $frac 676 677 foreach label [array names _label2page] { 678 set page $_label2page($label) 679 destroy $page.rviewer 680 } 681 $itk_component(resultselector) value "" 682 $itk_component(resultselector) choices delete 0 end 683 catch {unset _label2page} 684 catch {unset _label2desc} 685 set _plotlist "" 686 687 $itk_component(resultselector) choices insert end --- "---" 688 $itk_component(resultselector) choices insert end \ 689 @download [Rappture::filexfer::label download] 690 set _lastlabel "" 691 } 676 692 677 693 #
Note: See TracChangeset
for help on using the changeset viewer.