The history method
For displaying incoming connection speed (
rx_speed
) as a bar graph, we'll need another animation. Since it contains a 26-frame animation, the
Keep in mind though that the parameter here may change very rapidly, which could cause the animation to behave slightly erratically. So, we'll have to smooth things out a bit. This can be accomplished with the history method. Not only does it offer a number of ways for displaying the progression of a value (consult our
[disp3]
value=rx_speed
method=history
updatetime=240
historysize=1
hdisp1=rx_speed_disp
You may have noticed there is no
bitmap
but a
hdisp1
entry instead. This is because the
history
method can handle multiple display sections for rendering
value
progression. These are defined as
hdisp1,...,hdispN
and can be used to create effects like the scrolling bar graphs of the
cFos
"Modern" skin or the moving fish-shaped packets of the
cFosSpeed
"Default" skin. For this bar graph, however, only one such section is needed. It should be given its own name though (to
distinguish it from regular
disp
sections). Note that there is no need to enter a
value
here, because the value in the
history
section will be used for this section as well.
[rx_speed_disp]
method=animation
rect=54,41,108,59
bitmap=rx_bar.tga
min=0
max=100
frames=26
Again, adding a similar display for the speed ( tx_speed ) of outgoing connections can be done simply by copying the previous sections, changing disp name, value and rect entries, and applying the same color transformation as for the tx_packet .
[disp4]
value=tx_speed
method=history
updatetime=240
historysize=1
hdisp1=tx_speed_disp
[tx_speed_disp]
method=animation
rect=54,58,108,76
bitmap=rx_bar.tga
min=0
max=100
frames=26
transform1=15,0,0,40,255,255,100,0,0,120,230,210
Next step: