Changeset 6021 for trunk/gui/scripts/analyzer.tcl
- Timestamp:
- Feb 18, 2016, 4:13:14 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
-
trunk/gui/scripts/analyzer.tcl
r5880 r6021 79 79 protected method _lammpsToSequence {xmlobj path id child data} 80 80 protected method _trajToSequence {xmlobj {path ""}} 81 protected method _pop_uq_dialog {win} 82 protected method _setWaitVariable {state} 83 protected method _adjust_level {win} 81 84 82 85 private variable _tool "" ;# belongs to this tool … … 92 95 private variable _lastPlot 93 96 private common job ;# array var used for blt::bgexec jobs 97 private variable _uq_active 0 ;# a UQ variables has been used 98 private variable _wait_uq 0 94 99 } 95 100 … … 328 333 } 329 334 pack $itk_component(resultpages) -expand yes -fill both 330 331 set f [$itk_component(results) insert end -fraction 0.1] 335 set f [$itk_component(results) insert end -fraction 0.1] 332 336 itk_component add resultselector { 333 337 Rappture::ResultSelector $f.rsel -resultset $_resultset \ … … 395 399 # ---------------------------------------------------------------------- 396 400 itcl::body Rappture::Analyzer::simulate {args} { 397 if {$args == "-ifneeded"} { 401 #puts "simulate args='$args'" 402 403 set uq [$_tool get_uq -uq_type smolyak -uq_args 2] 404 405 # pop up UQ window 406 if {[$uq num_runs] > 1} { 407 set _uq_active 1 408 set status [$uq run_dialog $itk_component(simulate)] 409 if {$status == 0} { 410 # cancelled 411 return 412 } 413 lappend args -uq_type [$uq type] 414 lappend args -uq_args [$uq args] 415 # Need to put these UQ values into the driver file 416 # so the call to resultset::contains will be correct. 417 set _xml [$_tool xml object] 418 $_xml put uq.type.current [$uq type] 419 $_xml put uq.args.current [$uq args] 420 $_xml put uq.args.about.label "level" 421 $_xml put uq.args.about.description "Polynomial Degree of Smolyak GPC method." 422 } 423 #puts "simulate args=$args" 424 425 if {[lindex $args 0] == "-ifneeded"} { 398 426 # check to see if simulation is really needed 399 427 $_tool sync … … 404 432 return 405 433 } 406 set args ""434 set args [lreplace $args 0 0] 407 435 } 408 436 … … 427 455 428 456 # execute the job 457 #puts "$_tool run $args" 458 429 459 foreach {status result} [eval $_tool run $args] break 430 460 … … 470 500 } 471 501 502 472 503 # ---------------------------------------------------------------------- 473 504 # USAGE: reset ?-eventually|-now? … … 515 546 clear 516 547 } 548 #puts "Analyzer::load" 517 549 $_resultset add $xmlobj 518 550 … … 652 684 # ---------------------------------------------------------------------- 653 685 itcl::body Rappture::Analyzer::_plot {args} { 686 #puts "analyzer::_plot" 654 687 set _plotlist $args 655 688 … … 755 788 } elseif {$page != ""} { 756 789 set _lastlabel $name 757 set win [winfo toplevel $itk_component(hull)]758 790 $itk_component(resultpages) current $page 759 791 set f [$itk_component(resultpages) page $page] 760 761 792 # We don't want to replot if we're using an existing viewer with the 762 793 # the same list of objects to plot. So track the viewer and the list. 763 794 if { ![info exists _lastPlot($f)] || $_plotlist != $_lastPlot($f) } { 764 795 set _lastPlot($f) $_plotlist 796 set win [winfo toplevel $itk_component(hull)] 765 797 blt::busy hold $win 798 #puts "rviewer = $f.rviewer" 799 #puts "_plotlist = $_plotlist" 766 800 $f.rviewer plot clear 767 801 eval $f.rviewer plot add $_plotlist 768 blt::busy release [winfo toplevel $itk_component(hull)]802 blt::busy release $win 769 803 } 770 804 Rappture::Logger::log output $_label2item($name) … … 782 816 # ---------------------------------------------------------------------- 783 817 itcl::body Rappture::Analyzer::_fixResultSet {args} { 818 #puts "Analyzer::_fixResultSet $args" 784 819 array set eventData $args 785 820 switch -- $eventData(op) { … … 794 829 set haveresults 0 795 830 foreach item [_reorder [$xmlobj children output]] { 796 switch -glob -- $item { 797 log* { 798 _autoLabel $xmlobj output.$item "Output Log" counters 799 } 800 number* { 801 _autoLabel $xmlobj output.$item "Number" counters 802 } 803 integer* { 804 _autoLabel $xmlobj output.$item "Integer" counters 805 } 806 mesh* { 807 _autoLabel $xmlobj output.$item "Mesh" counters 808 } 809 string* { 810 _autoLabel $xmlobj output.$item "String" counters 811 } 812 histogram* - curve* - field* { 813 _autoLabel $xmlobj output.$item "Plot" counters 814 } 815 map* { 816 _autoLabel $xmlobj output.$item "Map" counters 817 } 818 drawing* { 819 _autoLabel $xmlobj output.$item "Drawing" counters 820 } 821 structure* { 822 _autoLabel $xmlobj output.$item "Structure" counters 823 } 824 table* { 825 _autoLabel $xmlobj output.$item "Energy Levels" counters 826 } 827 sequence* { 828 _autoLabel $xmlobj output.$item "Sequence" counters 831 if {[$xmlobj get output.$item.about.uqtype] == ""} { 832 switch -glob -- $item { 833 log* { 834 _autoLabel $xmlobj output.$item "Output Log" counters 835 } 836 number* { 837 _autoLabel $xmlobj output.$item "Number" counters 838 } 839 integer* { 840 _autoLabel $xmlobj output.$item "Integer" counters 841 } 842 mesh* { 843 _autoLabel $xmlobj output.$item "Mesh" counters 844 } 845 string* { 846 _autoLabel $xmlobj output.$item "String" counters 847 } 848 histogram* - curve* - field* { 849 _autoLabel $xmlobj output.$item "Plot" counters 850 } 851 drawing* { 852 _autoLabel $xmlobj output.$item "Drawing" counters 853 } 854 structure* { 855 _autoLabel $xmlobj output.$item "Structure" counters 856 } 857 table* { 858 _autoLabel $xmlobj output.$item "Energy Levels" counters 859 } 860 sequence* { 861 _autoLabel $xmlobj output.$item "Sequence" counters 862 } 829 863 } 830 864 } … … 853 887 } 854 888 set hidden [$xmlobj get output.$item.hide] 855 if { $hidden == ""} {889 if {$hidden == ""} { 856 890 set hidden 0 857 891 } 858 892 if {"" != $label && !$hidden} { 893 set uq_part [$xmlobj get output.$item.about.uqtype] 894 895 #puts "label=$label uq_part=$uq_part" 896 859 897 if {![info exists _label2page($label)]} { 898 #puts "Adding label: '$label'" 860 899 set name "page[incr _pages]" 900 #puts "Inserting $name into resultpages" 861 901 set page [$itk_component(resultpages) \ 862 902 insert end $name] … … 884 924 set reset($page) 1 885 925 } 886 $page.rviewer add $index $xmlobj output.$item 926 $page.rviewer add $index $xmlobj output.$item $label $uq_part 887 927 } 888 928 } … … 1037 1077 configure -simcontrolcolor $simcbg 1038 1078 1039 $itk_component(simulate) configure -state disabled 1079 if {$_uq_active == 0} { 1080 $itk_component(simulate) configure -state disabled 1081 } 1040 1082 $itk_component(abort) configure -state normal 1041 1083 … … 1065 1107 # Scan through and pick out any =RAPPTURE-PROGRESS=> messages first. 1066 1108 # 1109 1067 1110 while {[regexp -indices \ 1068 1111 {=RAPPTURE-PROGRESS=> *([-+]?[0-9]+) +([^\n]*)(\n|$)} $message \ … … 1080 1123 foreach {i0 i1} $match break 1081 1124 set message [string replace $message $i0 $i1] 1125 } 1126 1127 # 1128 # Now handle SUBMIT-PROGRESS 1129 # 1130 while {[regexp -indices {=SUBMIT-PROGRESS=> aborted=([0-9]+) finished=([0-9]+) failed=([0-9]+) executing=([0-9]+)\ 1131 waiting=([0-9]+) setting_up=([0-9]+) setup=([0-9]+) %done=([0-9.]+) timestamp=([0-9.]+)(\n|$)} $message \ 1132 match aborted finished failed executing waiting setting_up setup percent ts mesg]} { 1133 1134 set mesg "" 1135 foreach {i0 i1} $percent break 1136 set percent [string range $message $i0 $i1] 1137 foreach {i0 i1} $failed break 1138 set failed [string range $message $i0 $i1] 1139 foreach {i0 i1} $match break 1140 set message [string replace $message $i0 $i1] 1141 1142 if {$failed != 0} {set mesg "$failed jobs failed!"} 1143 if {$percent >= 100} { set mesg "Jobs finished. Analyzing results..."} 1144 1145 pack $itk_component(progress) -fill x -padx 10 -pady 10 1146 $itk_component(progress) settings -percent $percent -message $mesg 1082 1147 } 1083 1148
Note: See TracChangeset
for help on using the changeset viewer.