I am venturing into new territory and want to use RBC. One thing that
strikes me immediately is the handling of the time resp. x axis: All
examples I saw so far label it with the number of samples.
This strikes me as very odd. I am used to seeing scales like some
seconds or some hundreds of milli seconds - but with several thousand
data points.
Surely I am missing something here.
Any link to an example or other form of clarification will be greatly
Some fragments from an old trending program using rbc::graph imported into the ::t2k:: namespace.
A lot of the program is accessing data from a custom networked trend database (t2k is Trend2000)
that is no longer used anywhere that I know of. However it does show how times can be formatted for display on the x axis of an rbc/blt graph.
proc trend {win} {
global t2k
set g $win.g
destroy $g
::t2k::graph $g -background darkSlateGray -foreground lightgray \
-plotbackground black -plotrelief sunken
$g axis configure x -command {formatTimeTick} -color lightgray
$g legend configure -hide yes
$g pen configure activeLine -symbol "" -linewidth 3
$g grid on
pack $g -side left -expand yes -fill both
set t2k(win) $win
set t2k(graph) $g
set t2k(day,first) [date2Day [today]]
set t2k(day,last) $t2k(day,first)
t2k_ZoomStackTime $g
t2k_Crosshairs $g
}
# format time ticks as time and date
proc formatTimeTick {graph sec} {
if {[expr {$sec < 100000}]} {
return [format {%11.8g} $sec]
}
set ss [expr int($sec)]
set sf [expr {int(1000*($sec - $ss) + 0.5)}]
if {0 == $sf} { set sf ""} {set sf .[format %03d $sf]}
return "[clock format $ss -format {%T}]$sf\n[clock format $ss -format {%x}]"
}
t2k_ZoomStackTime and t2k_Crosshairs are from a modified library/graph.tcl from the rbc source.
and are not needed for a basic trend graph.
formatTimeTick displays date and time for large times, and fractions of seconds for short times.
Dave B
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)