Changeset 1930
- Timestamp:
- Oct 25, 2010 8:50:55 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/resultviewer.tcl
r1587 r1930 209 209 itcl::body Rappture::ResultViewer::_plotAdd {dataobj {settings ""}} { 210 210 switch -- [$dataobj info class] { 211 ::Rappture::DataTable { 212 set mode "datatable" 213 if {![info exists _mode2widget($mode)]} { 214 set w $itk_interior.datatable 215 Rappture::DataTableResult $w 216 set _mode2widget($mode) $w 217 } 218 } 219 ::Rappture::Drawing3d { 220 set mode "vtkviewer" 221 if {![info exists _mode2widget($mode)]} { 222 set w $itk_interior.xy 223 Rappture::VtkViewer $w 224 set _mode2widget($mode) $w 225 } 226 } 211 227 ::Rappture::Histogram { 212 228 set mode "histogram" … … 436 452 return [Rappture::Curve ::#auto $xmlobj $path] 437 453 } 454 datatable { 455 return [Rappture::DataTable ::#auto $xmlobj $path] 456 } 438 457 histogram { 439 458 return [Rappture::Histogram ::#auto $xmlobj $path] … … 462 481 number - integer - boolean - choice { 463 482 return [$xmlobj element -as object $path] 483 } 484 drawing3d { 485 return [Rappture::Drawing3d ::#auto $xmlobj $path] 464 486 } 465 487 time - status { -
trunk/gui/scripts/sequence.tcl
r1929 r1930 72 72 curve { 73 73 set obj [Rappture::Curve ::#auto $xmlobj $path.$name.$cname] 74 } 75 datatable { 76 set obj [Rappture::DataTable ::#auto $xmlobj $path.$name.$cname] 74 77 } 75 78 histogram { -
trunk/gui/scripts/sequenceresult.tcl
r1929 r1930 436 436 ::Rappture::Curve { 437 437 Rappture::XyResult $viewer 438 pack $viewer -expand yes -fill both 439 } 440 ::Rappture::DataTable { 441 Rappture::DataTable $viewer 438 442 pack $viewer -expand yes -fill both 439 443 } -
trunk/gui/scripts/textresult.tcl
r1929 r1930 25 25 inherit itk::Widget 26 26 27 constructor {args} { # defined below } 28 27 constructor {args} { 28 # defined below 29 } 29 30 public method add {dataobj {settings ""}} 30 31 public method get {} 31 32 public method delete {args} 32 33 public method scale {args} 33 public method parameters {title args} { # do nothing } 34 public method parameters {title args} { 35 # do nothing 36 } 34 37 public method download {option args} 35 38 36 39 public method select {option args} 37 40 public method find {option} 41 public method popup {option args} 38 42 39 43 private variable _dataobj "" ;# data object currently being displayed … … 134 138 135 139 $itk_component(text) tag configure ERROR -foreground red 140 141 itk_component add emenu { 142 menu $itk_component(text).menu -tearoff 0 143 } { 144 ignore -tearoff 145 } 146 $itk_component(emenu) add command \ 147 -label "Select All" -accelerator "Ctrl+A" \ 148 -command [itcl::code $this select all] 149 $itk_component(emenu) add command \ 150 -label "Select None" -accelerator "Esc" \ 151 -command [itcl::code $this select none] 152 bind $itk_component(text) <<PopupMenu>> \ 153 [itcl::code $this popup menu emenu %X %Y] 154 $itk_component(emenu) add command \ 155 -label "Copy" -accelerator "Ctrl+C" \ 156 -command [list event generate $itk_component(text) <<Copy>>] 157 158 bind $itk_component(text) <Control-KeyPress-a> \ 159 [list $itk_component(emenu) invoke "Select All"] 160 bind $itk_component(text) <Control-KeyPress-c> \ 161 [list $itk_component(emenu) invoke "Copy"] 162 bind $itk_component(text) <Escape> \ 163 [list $itk_component(emenu) invoke "Select None" ] 164 bind $itk_component(text) <Enter> [list ::focus $itk_component(text)] 136 165 137 166 eval itk_initialize $args … … 333 362 $itk_component(text) tag add sel 1.0 end 334 363 } 364 none { 365 if { [$itk_component(text) tag ranges "sel"] != "" } { 366 selection clear 367 } 368 } 335 369 default { 336 error "bad option \"$option\": should be all "370 error "bad option \"$option\": should be all or none" 337 371 } 338 372 } … … 406 440 $itk_component(findstatus) configure -text $status 407 441 } 442 443 # ---------------------------------------------------------------------- 444 # USAGE: _popup menu <which> <X> <Y> 445 # 446 # Used internally to manage edit operations. 447 # ---------------------------------------------------------------------- 448 itcl::body Rappture::TextResult::popup {option args} { 449 switch -- $option { 450 menu { 451 if {[llength $args] != 3} { 452 error "wrong # args: should be \"_popup $option which x y\"" 453 } 454 set mname [lindex $args 0] 455 set x [lindex $args 1] 456 set y [lindex $args 2] 457 tk_popup $itk_component($mname) $x $y 458 } 459 default { 460 error "bad option \"$option\": should be menu" 461 } 462 } 463 } -
trunk/gui/scripts/xyprint.tcl
r1929 r1930 316 316 # Element component 317 317 foreach elem [$orig element names] { 318 $_clone element create $elem 319 CopyOptions [list element configure $elem] $orig $_clone -data 320 if { [$_clone element cget $elem -hide] } { 321 $_clone element configure $elem -label "" 318 set oper [$orig element type $elem] 319 $_clone $oper create $elem 320 CopyOptions [list $oper configure $elem] $orig $_clone -data 321 if { [$_clone $oper cget $elem -hide] } { 322 $_clone $oper configure $elem -label "" 323 puts stderr [$_clone $oper configure] 322 324 } 323 325 } … … 354 356 -plotborderwidth 1 -plotrelief solid \ 355 357 -plotbackground white -plotpadx 0 -plotpady 0 356 # 358 357 359 set _settings($this-layout-width) [Pixels2Inches [$_clone cget -width]] 358 360 set _settings($this-layout-height) [Pixels2Inches [$_clone cget -height]] 359 360 361 set _fonts(legend) [font create legend \ 361 362 -family helvetica -size 10 -weight normal] … … 385 386 } 386 387 foreach elem [$_clone element names] { 388 if { [$_clone element type $elem] == "bar" } { 389 continue 390 } 387 391 if { [$_clone element cget $elem -linewidth] > 1 } { 388 392 $_clone element configure $elem -linewidth 1 -pixels 3 … … 517 521 set index [$itk_component(element_slider) get] 518 522 set elem $_settings($this-element-$index) 519 set _settings($this-element- symbol) [$_clone element cget $elem -symbol]523 set _settings($this-element-label) [$_clone element cget $elem -label] 520 524 set _settings($this-element-color) [$_clone element cget $elem -color] 521 set _settings($this-element-dashes) [$_clone element cget $elem -dashes] 522 set _settings($this-element-label) [$_clone element cget $elem -label] 525 if { [$_clone element type $elem] != "bar" } { 526 set _settings($this-element-symbol) [$_clone element cget $elem -symbol] 527 set _settings($this-element-dashes) [$_clone element cget $elem -dashes] 528 } 523 529 set page $itk_component(legend_page) 524 530 set color [$page.color label $_settings($this-element-color)] … … 530 536 $page.color value [$page.color label $_settings($this-element-color)] 531 537 } 532 $page.symbol value [$page.symbol label $_settings($this-element-symbol)] 533 $page.dashes value [$page.dashes label $_settings($this-element-dashes)] 538 if { [$_clone element type $elem] != "bar" } { 539 $page.symbol value [$page.symbol label $_settings($this-element-symbol)] 540 $page.dashes value [$page.dashes label $_settings($this-element-dashes)] 541 } 534 542 #FixElement 535 543 } … … 665 673 itcl::body Rappture::XyPrint::ApplyLegendSettings {} { 666 674 set page $itk_component(legend_page) 667 set _settings($this-legend-position) [$page.position current]668 675 set _settings($this-legend-anchor) [$page.anchor current] 669 foreach option { -hide -position -anchor -borderwidth } { 670 SetComponentOption legend $option 671 } 672 $_clone legend configure -font legend 676 if { $_clone != "" } { 677 font configure $_fonts(legend) \ 678 -family $_settings($this-legend-font-family) \ 679 -size $_settings($this-legend-font-size) \ 680 -weight $_settings($this-legend-font-weight) \ 681 -slant $_settings($this-legend-font-slant) 682 foreach option { -hide -position -anchor -borderwidth } { 683 SetComponentOption legend $option 684 } 685 $_clone legend configure -font fixed -font $_fonts(legend) 686 } 673 687 ApplyElementSettings 674 688 } … … 1124 1138 itcl::body Rappture::XyPrint::ApplyElementSettings {} { 1125 1139 set index [$itk_component(element_slider) get] 1126 set elem $_settings($this-element-$index)1127 1140 set page $itk_component(legend_page) 1128 1141 set _settings($this-element-color) [$page.color current] 1129 set _settings($this-element-symbol) [$page.symbol current] 1130 set _settings($this-element-dashes) [$page.dashes current] 1131 foreach option { -symbol -color -dashes -label } { 1132 SetNamedComponentOption element $elem $option 1133 } 1134 RegeneratePreview 1142 if { $_clone != "" } { 1143 set elem $_settings($this-element-$index) 1144 if { [$_clone element type $elem] != "bar" } { 1145 set _settings($this-element-symbol) [$page.symbol current] 1146 set _settings($this-element-dashes) [$page.dashes current] 1147 foreach option { -symbol -dashes } { 1148 SetNamedComponentOption element $elem $option 1149 } 1150 } 1151 foreach option { -color -label } { 1152 SetNamedComponentOption element $elem $option 1153 } 1154 RegeneratePreview 1155 } 1135 1156 } 1136 1157 … … 1165 1186 set _settings($this-general-remember) 0 1166 1187 set page $itk_component(graph_page) 1167 $page.format value [$page.format label $_settings($this-general-format)]1168 $page.style value [$page.style label $_settings($this-general-style)]1169 1188 1170 1189 # Layout settings … … 1355 1374 append out " if \{ \[preview element exists \"$label\"\] \} \{\n" 1356 1375 append out " preview element configure \"$label\"" 1357 foreach opt { -symbol -color -dashes -label } { 1376 if { [$_clone element type $elem] != "bar" } { 1377 set options { -symbol -color -dashes -label } 1378 } else { 1379 set options { -color -label } 1380 } 1381 foreach opt $options { 1358 1382 set value [list [$_clone element cget $elem $opt]] 1359 1383 append out " $opt $value" -
trunk/gui/scripts/xyresult.tcl
r1839 r1930 4 4 # This widget is an X/Y plot, meant to view line graphs produced 5 5 # as output from the run of a Rappture tool. Use the "add" and 6 # "delete" methods to control the curves showing on the plot.6 # "delete" methods to control the dataobjs showing on the plot. 7 7 # ====================================================================== 8 8 # AUTHOR: Michael McLennan, Purdue University … … 25 25 26 26 set autocolors { 27 #0000ff #ff0000 #00cc00 28 #cc00cc #ff9900 #cccc00 29 #000080 #800000 #006600 30 #660066 #996600 #666600 31 } 32 set autocolors { 33 #0000cd 34 #cd0000 35 #00cd00 36 #3a5fcd 37 #cdcd00 38 #cd1076 39 #009acd 40 #00c5cd 41 #a2b5cd 42 #7ac5cd 43 #66cdaa 44 #a2cd5a 45 #cd9b9b 46 #cdba96 47 #cd3333 48 #cd6600 49 #cd8c95 50 #cd00cd 51 #9a32cd 52 #6ca6cd 53 #9ac0cd 54 #9bcd9b 55 #00cd66 56 #cdc673 57 #cdad00 58 #cd5555 59 #cd853f 60 #cd7054 61 #cd5b45 62 #cd6889 63 #cd69c9 64 #551a8b 27 #0000cd 28 #cd0000 29 #00cd00 30 #3a5fcd 31 #cdcd00 32 #cd1076 33 #009acd 34 #00c5cd 35 #a2b5cd 36 #7ac5cd 37 #66cdaa 38 #a2cd5a 39 #cd9b9b 40 #cdba96 41 #cd3333 42 #cd6600 43 #cd8c95 44 #cd00cd 45 #9a32cd 46 #6ca6cd 47 #9ac0cd 48 #9bcd9b 49 #00cd66 50 #cdc673 51 #cdad00 52 #cd5555 53 #cd853f 54 #cd7054 55 #cd5b45 56 #cd6889 57 #cd69c9 58 #551a8b 65 59 } 66 60 … … 76 70 itk_option define -autocolors autoColors AutoColors "" 77 71 78 constructor {args} { # defined below } 79 destructor { # defined below } 80 81 public method add {curve {settings ""}} 72 constructor {args} { 73 # defined below 74 } 75 destructor { 76 # defined below 77 } 78 public method add {dataobj {settings ""}} 82 79 public method get {} 83 80 public method delete {args} 84 81 public method scale {args} 85 public method parameters {title args} { # do nothing } 82 public method parameters {title args} { 83 # do nothing 84 } 86 85 public method download {option args} 87 86 … … 91 90 protected method _hilite {state x y} 92 91 protected method _axis {option args} 93 protected method _getAxes { curve}92 protected method _getAxes {dataobj} 94 93 protected method _getLineMarkerOptions { style } 95 94 protected method _getTextMarkerOptions { style } … … 98 97 99 98 private variable _dispatcher "" ;# dispatcher for !events 100 private variable _ clist "" ;# list of curveobjects101 private variable _ curve2color ;# maps curve=> plotting color102 private variable _ curve2width ;# maps curve=> line width103 private variable _ curve2dashes ;# maps curve=> BLT -dashes list104 private variable _ curve2raise ;# maps curve=> raise flag 0/1105 private variable _ curve2desc ;# maps curve=> description of data106 private variable _elem2 curve ;# maps graph element => curve99 private variable _dlist "" ;# list of dataobj objects 100 private variable _dataobj2color ;# maps dataobj => plotting color 101 private variable _dataobj2width ;# maps dataobj => line width 102 private variable _dataobj2dashes ;# maps dataobj => BLT -dashes list 103 private variable _dataobj2raise ;# maps dataobj => raise flag 0/1 104 private variable _dataobj2desc ;# maps dataobj => description of data 105 private variable _elem2dataobj ;# maps graph element => dataobj 107 106 private variable _label2axis ;# maps axis label => axis ID 108 107 private variable _limits ;# axis limits: x-min, x-max, etc. … … 174 173 -outline black -fill red -color black 175 174 176 #177 175 # Add bindings so you can mouse over points to see values: 178 #179 176 bind $itk_component(plot) <Motion> \ 180 177 [itcl::code $this _hilite at %x %y] … … 182 179 [itcl::code $this _hilite off %x %y] 183 180 184 #185 181 # Add support for editing axes: 186 #187 182 Rappture::Balloon $itk_component(hull).axes -title "Axis Options" 188 183 set inner [$itk_component(hull).axes component inner] … … 206 201 Rappture::Combobox $inner.format -width 15 -editable no 207 202 $inner.format choices insert end \ 208 "%. 3g" "Auto" \203 "%.6g" "Auto" \ 209 204 "%.0f" "X" \ 210 205 "%.1f" "X.X" \ … … 231 226 232 227 foreach axis {x y} { 233 set _axisPopup(format-$axis) "%. 3g"228 set _axisPopup(format-$axis) "%.6g" 234 229 } 235 230 _axis scale x linear … … 250 245 } 251 246 pack $itk_component(legend) -expand yes -fill both 252 253 247 after idle [subst { 254 248 update idletasks … … 270 264 271 265 # ---------------------------------------------------------------------- 272 # USAGE: add < curve> ?<settings>?273 # 274 # Clients use this to add a curveto the plot. The optional <settings>266 # USAGE: add <dataobj> ?<settings>? 267 # 268 # Clients use this to add a dataobj to the plot. The optional <settings> 275 269 # are used to configure the plot. Allowed settings are -color, 276 270 # -brightness, -width, -linestyle and -raise. 277 271 # ---------------------------------------------------------------------- 278 itcl::body Rappture::XyResult::add { curve{settings ""}} {272 itcl::body Rappture::XyResult::add {dataobj {settings ""}} { 279 273 array set params { 280 274 -color auto … … 337 331 } 338 332 339 set pos [lsearch -exact $ curve $_clist]333 set pos [lsearch -exact $dataobj $_dlist] 340 334 if {$pos < 0} { 341 lappend _ clist $curve342 set _ curve2color($curve) $params(-color)343 set _ curve2width($curve) $params(-width)344 set _ curve2dashes($curve) $params(-linestyle)345 set _ curve2raise($curve) $params(-raise)346 set _ curve2desc($curve) $params(-description)335 lappend _dlist $dataobj 336 set _dataobj2color($dataobj) $params(-color) 337 set _dataobj2width($dataobj) $params(-width) 338 set _dataobj2dashes($dataobj) $params(-linestyle) 339 set _dataobj2raise($dataobj) $params(-raise) 340 set _dataobj2desc($dataobj) $params(-description) 347 341 348 342 $_dispatcher event -idle !rebuild … … 358 352 itcl::body Rappture::XyResult::get {} { 359 353 # put the dataobj list in order according to -raise options 360 set clist $_ clist354 set clist $_dlist 361 355 foreach obj $clist { 362 if {[info exists _ curve2raise($obj)] && $_curve2raise($obj)} {356 if {[info exists _dataobj2raise($obj)] && $_dataobj2raise($obj)} { 363 357 set i [lsearch -exact $clist $obj] 364 358 if {$i >= 0} { … … 372 366 373 367 # ---------------------------------------------------------------------- 374 # USAGE: delete ?< curve1> <curve2> ...?375 # 376 # Clients use this to delete a curve from the plot. If no curves377 # are specified, then all curves are deleted.368 # USAGE: delete ?<dataobj1> <dataobj2> ...? 369 # 370 # Clients use this to delete a dataobj from the plot. If no dataobjs 371 # are specified, then all dataobjs are deleted. 378 372 # ---------------------------------------------------------------------- 379 373 itcl::body Rappture::XyResult::delete {args} { 380 374 if {[llength $args] == 0} { 381 set args $_ clist382 } 383 384 # delete all specified curves375 set args $_dlist 376 } 377 378 # delete all specified dataobjs 385 379 set changed 0 386 foreach curve$args {387 set pos [lsearch -exact $_ clist $curve]380 foreach dataobj $args { 381 set pos [lsearch -exact $_dlist $dataobj] 388 382 if {$pos >= 0} { 389 set _ clist [lreplace $_clist $pos $pos]390 catch {unset _ curve2color($curve)}391 catch {unset _ curve2width($curve)}392 catch {unset _ curve2dashes($curve)}393 catch {unset _ curve2raise($curve)}394 foreach elem [array names _elem2 curve] {395 if {$_elem2 curve($elem) == $curve} {396 unset _elem2 curve($elem)383 set _dlist [lreplace $_dlist $pos $pos] 384 catch {unset _dataobj2color($dataobj)} 385 catch {unset _dataobj2width($dataobj)} 386 catch {unset _dataobj2dashes($dataobj)} 387 catch {unset _dataobj2raise($dataobj)} 388 foreach elem [array names _elem2dataobj] { 389 if {$_elem2dataobj($elem) == $dataobj} { 390 unset _elem2dataobj($elem) 397 391 } 398 392 } … … 407 401 408 402 # Nothing left? then start over with auto colors 409 if {[llength $_ clist] == 0} {403 if {[llength $_dlist] == 0} { 410 404 set _autoColorI 0 411 405 } … … 413 407 414 408 # ---------------------------------------------------------------------- 415 # USAGE: scale ?< curve1> <curve2> ...?409 # USAGE: scale ?<dataobj1> <dataobj2> ...? 416 410 # 417 411 # Sets the default limits for the overall plot according to the 418 # limits of the data for all of the given < curve> objects. This419 # accounts for all curves--even those not showing on the screen.420 # Because of this, the limits are appropriate for all curves as412 # limits of the data for all of the given <dataobj> objects. This 413 # accounts for all dataobjs--even those not showing on the screen. 414 # Because of this, the limits are appropriate for all dataobjs as 421 415 # the user scans through data in the ResultSet viewer. 422 416 # ---------------------------------------------------------------------- … … 435 429 436 430 catch {unset _limits} 437 foreach curve$args {438 # find the axes for this curve(e.g., {x y2})439 foreach {map(x) map(y)} [_getAxes $ curve] break431 foreach dataobj $args { 432 # find the axes for this dataobj (e.g., {x y2}) 433 foreach {map(x) map(y)} [_getAxes $dataobj] break 440 434 441 435 foreach axis {x y} { … … 444 438 # store results -- ex: _limits(x2log-min) 445 439 set id $map($axis)$type 446 foreach {min max} [$ curvelimits $axis$type] break440 foreach {min max} [$dataobj limits $axis$type] break 447 441 if {"" != $min && "" != $max} { 448 442 if {![info exists _limits($id-min)]} { … … 460 454 } 461 455 462 if {[$ curvehints ${axis}scale] == "log"} {456 if {[$dataobj hints ${axis}scale] == "log"} { 463 457 _axis scale $map($axis) log 464 458 } … … 530 524 append csvdata "[string repeat - 60]\n" 531 525 append csvdata " [$dataobj hints label]\n" 532 if {[info exists _ curve2desc($dataobj)]533 && [llength [split $_ curve2desc($dataobj) \n]] > 1} {526 if {[info exists _dataobj2desc($dataobj)] 527 && [llength [split $_dataobj2desc($dataobj) \n]] > 1} { 534 528 set indent "for:" 535 foreach line [split $_ curve2desc($dataobj) \n] {529 foreach line [split $_dataobj2desc($dataobj) \n] { 536 530 append csvdata " $indent $line\n" 537 531 set indent " " … … 599 593 set g $itk_component(plot) 600 594 601 # first clear out the widget595 # First clear out the widget 602 596 eval $g element delete [$g element names] 603 597 eval $g marker delete [$g marker names] … … 608 602 $g xaxis configure -hide no 609 603 $g yaxis configure -hide no 610 catch {unset _label2axis}604 array unset _label2axis 611 605 612 606 # … … 618 612 set anum(x) 0 619 613 set anum(y) 0 620 foreach curve[get] {614 foreach dataobj [get] { 621 615 foreach ax {x y} { 622 set label [$ curvehints ${ax}label]616 set label [$dataobj hints ${ax}label] 623 617 if {"" != $label} { 624 618 if {![info exists _label2axis($ax-$label)]} { … … 636 630 637 631 # if this axis has a description, add it as a tooltip 638 set desc [string trim [$ curvehints ${ax}desc]]632 set desc [string trim [$dataobj hints ${ax}desc]] 639 633 Rappture::Tooltip::text $g-$axis $desc 640 634 } … … 663 657 664 658 foreach axis $all { 665 set _axisPopup(format-$axis) "%. 3g"659 set _axisPopup(format-$axis) "%.6g" 666 660 667 661 $g axis bind $axis <Enter> \ … … 669 663 $g axis bind $axis <Leave> \ 670 664 [itcl::code $this _axis hilite $axis off] 671 $g axis bind $axis <ButtonPress > \665 $g axis bind $axis <ButtonPress-1> \ 672 666 [itcl::code $this _axis click $axis %x %y] 673 667 $g axis bind $axis <B1-Motion> \ 674 668 [itcl::code $this _axis drag $axis %x %y] 675 $g axis bind $axis <ButtonRelease > \669 $g axis bind $axis <ButtonRelease-1> \ 676 670 [itcl::code $this _axis release $axis %x %y] 677 671 $g axis bind $axis <KeyPress> \ … … 680 674 681 675 # 682 # Plot all of the curves.676 # Plot all of the dataobjs. 683 677 # 684 678 set count 0 685 foreach curve $_clist {686 set label [$ curvehints label]687 foreach {mapx mapy} [_getAxes $ curve] break688 689 foreach comp [$ curvecomponents] {690 set xv [$ curvemesh $comp]691 set yv [$ curvevalues $comp]692 693 if {[info exists _ curve2color($curve)]} {694 set color $_ curve2color($curve)679 foreach dataobj $_dlist { 680 set label [$dataobj hints label] 681 foreach {mapx mapy} [_getAxes $dataobj] break 682 683 foreach comp [$dataobj components] { 684 set xv [$dataobj mesh $comp] 685 set yv [$dataobj values $comp] 686 687 if {[info exists _dataobj2color($dataobj)]} { 688 set color $_dataobj2color($dataobj) 695 689 } else { 696 set color [$ curvehints color]690 set color [$dataobj hints color] 697 691 if {"" == $color} { 698 692 set color black … … 700 694 } 701 695 702 if {[info exists _ curve2width($curve)]} {703 set lwidth $_ curve2width($curve)696 if {[info exists _dataobj2width($dataobj)]} { 697 set lwidth $_dataobj2width($dataobj) 704 698 } else { 705 699 set lwidth 2 706 700 } 707 701 708 if {[info exists _ curve2dashes($curve)]} {709 set dashes $_ curve2dashes($curve)702 if {[info exists _dataobj2dashes($dataobj)]} { 703 set dashes $_dataobj2dashes($dataobj) 710 704 } else { 711 705 set dashes "" … … 721 715 722 716 set elem "elem[incr count]" 723 set _elem2 curve($elem) $curve717 set _elem2dataobj($elem) $dataobj 724 718 lappend label2elem($label) $elem 725 719 $g element create $elem -x $xv -y $yv \ … … 737 731 } 738 732 foreach elem $label2elem($label) { 739 set curve $_elem2curve($elem)740 scan [$ curvehints xmlobj] "::libraryObj%d" suffix733 set dataobj $_elem2dataobj($elem) 734 scan [$dataobj hints xmlobj] "::libraryObj%d" suffix 741 735 incr suffix 742 736 set elabel [format "%s \#%d" $label $suffix] … … 745 739 } 746 740 747 foreach curve $_clist {741 foreach dataobj $_dlist { 748 742 set xmin -Inf 749 743 set ymin -Inf … … 753 747 # Create text/line markers for each *axis.marker specified. 754 748 # 755 foreach m [$ curvexmarkers] {749 foreach m [$dataobj xmarkers] { 756 750 foreach {at label style} $m break 757 751 set id [$g marker create line -coords [list $at $ymin $at $ymax]] … … 773 767 } 774 768 } 775 foreach m [$ curveymarkers] {769 foreach m [$dataobj ymarkers] { 776 770 foreach {at label style} $m break 777 771 set id [$g marker create line -coords [list $xmin $at $xmax $at]] … … 914 908 915 909 # Some elements are generated dynamically and therefore will 916 # not have a curveobject associated with them.910 # not have a dataobj object associated with them. 917 911 set mapx [$g element cget $elem -mapx] 918 912 set mapy [$g element cget $elem -mapy] 919 if {[info exists _elem2 curve($elem)]} {920 foreach {mapx mapy} [_getAxes $_elem2 curve($elem)] break913 if {[info exists _elem2dataobj($elem)]} { 914 foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break 921 915 } 922 916 … … 930 924 set y [$g axis transform $mapy $info(y)] 931 925 932 if {[info exists _elem2 curve($elem)]} {933 set curve $_elem2curve($elem)934 set yunits [$ curvehints yunits]935 set xunits [$ curvehints xunits]926 if {[info exists _elem2dataobj($elem)]} { 927 set dataobj $_elem2dataobj($elem) 928 set yunits [$dataobj hints yunits] 929 set xunits [$dataobj hints xunits] 936 930 } else { 937 931 set xunits "" … … 951 945 952 946 # Some elements are generated dynamically and therefore will 953 # not have a curveobject associated with them.947 # not have a dataobj object associated with them. 954 948 set mapx [$g element cget $elem -mapx] 955 949 set mapy [$g element cget $elem -mapy] 956 if {[info exists _elem2 curve($elem)]} {957 foreach {mapx mapy} [_getAxes $_elem2 curve($elem)] break950 if {[info exists _elem2dataobj($elem)]} { 951 foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break 958 952 } 959 953 … … 962 956 set y [$g axis transform $mapy $info(y)] 963 957 964 if {[info exists _elem2 curve($elem)]} {965 set curve $_elem2curve($elem)966 set yunits [$ curvehints yunits]967 set xunits [$ curvehints xunits]958 if {[info exists _elem2dataobj($elem)]} { 959 set dataobj $_elem2dataobj($elem) 960 set yunits [$dataobj hints yunits] 961 set xunits [$dataobj hints xunits] 968 962 } else { 969 963 set xunits "" … … 999 993 set mapx [$g element cget $elem -mapx] 1000 994 set mapy [$g element cget $elem -mapy] 1001 if {[info exists _elem2 curve($elem)]} {1002 foreach {mapx mapy} [_getAxes $_elem2 curve($elem)] break995 if {[info exists _elem2dataobj($elem)]} { 996 foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break 1003 997 } 1004 998 set allx [$g x2axis use] … … 1120 1114 itcl::body Rappture::XyResult::_axis {option args} { 1121 1115 set inner [$itk_component(hull).axes component inner] 1122 1123 1116 switch -- $option { 1124 1117 hilite { … … 1439 1432 1440 1433 if {[$itk_component(plot) axis cget $axis -logscale]} { 1441 set fmt "%. 3g"1434 set fmt "%.6g" 1442 1435 } else { 1443 1436 set fmt $_axisPopup(format-$axis) … … 1520 1513 1521 1514 # ---------------------------------------------------------------------- 1522 # USAGE: _getAxes < curveObj>1515 # USAGE: _getAxes <dataobj> 1523 1516 # 1524 1517 # Used internally to figure out the axes used to plot the given 1525 # < curveObj>. Returns a list of the form {x y}, where x is the1518 # <dataobj>. Returns a list of the form {x y}, where x is the 1526 1519 # x-axis name (x, x2, x3, etc.), and y is the y-axis name. 1527 1520 # ---------------------------------------------------------------------- 1528 itcl::body Rappture::XyResult::_getAxes { curve} {1521 itcl::body Rappture::XyResult::_getAxes {dataobj} { 1529 1522 # rebuild if needed, so we know about the axes 1530 1523 if {[$_dispatcher ispending !rebuild]} { … … 1534 1527 1535 1528 # what is the x axis? x? x2? x3? ... 1536 set xlabel [$ curvehints xlabel]1529 set xlabel [$dataobj hints xlabel] 1537 1530 if {[info exists _label2axis(x-$xlabel)]} { 1538 1531 set mapx $_label2axis(x-$xlabel) … … 1542 1535 1543 1536 # what is the y axis? y? y2? y3? ... 1544 set ylabel [$ curvehints ylabel]1537 set ylabel [$dataobj hints ylabel] 1545 1538 if {[info exists _label2axis(y-$ylabel)]} { 1546 1539 set mapy $_label2axis(y-$ylabel) -
trunk/lang/tcl/src/Makefile.in
r1916 r1930 71 71 FFMPEG = @HAVE_FFMPEG_LIBS@ 72 72 ifeq ($(FFMPEG),yes) 73 # OBJS += RpMediaPlayerTclInterface.o74 73 OBJS += RpVideoTclInterface.o 75 74 LIBS += -L../../../src/objects -lRpObjects -
trunk/lang/tcl/src/Rappture_Init.c
r1916 r1930 38 38 39 39 #ifdef BUILD_with_ffmpeg 40 // extern Tcl_AppInitProc RpMediaPlayer_Init;41 40 extern Tcl_AppInitProc RpVideo_Init; 42 41 #endif … … 72 71 } 73 72 #ifdef BUILD_with_ffmpeg 74 // if (RpMediaPlayer_Init(interp) != TCL_OK) {75 // return TCL_ERROR;76 // }77 73 if (RpVideo_Init(interp) != TCL_OK) { 78 74 return TCL_ERROR;
Note: See TracChangeset
for help on using the changeset viewer.