Product Overview » Documentation, How to create your own cFos(Speed) skin, page 4

The history method

rx_bar.tga For displaying incoming connection speed ( rx_speed ) as a bar graph, we'll need another animation. Since it contains a 26-frame animation, the rx_bar.tga image from the cFosSpeed "Liquid Crystal" skin lends itself particularly well to this.
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 skin definition reference for a more detailed description), but it can also be used to calculate and display the arithmetic mean of the values a parameter assumes over any given time period.

        [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
      
The min and max values define the range of the rx_speed parameter, which is best thought of as the percentage of available bandwidth.


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: Adding text sections

Powered by cFos Personal Net Web Server
Practice random kindness and senseless acts of beauty