Tutorial Four - Net In, Net Out, Histogram and Line

First off lets set up our first measure and meter for NetIn.

[Rainmeter]
BackgroundMode=2

SolidColor="0, 255, 255, 255"

Author=Amfest

Update=1000

;--------------------------------------

[MeasureNetIn]
Measure=NetIn

;--------------------------------------

[MeterDownTxt]
Meter=STRING
X=0
Y=0
Text="Download "
AutoScale=1

[MeterDown]
Meter=STRING
MeasureName=MeasureNetIn
X=0
Y=15r
Text="%1B "
AutoScale=1


Measure creation is the same as usual. Nothing new. Just input the measure for NetIn. For this tutorial I decided to put the actual measurements under text so I made a seperate string meter with the text for Download. Under that is the NetIn measure. If you notice there is something different this time around. You'll notice that on the measure there is a Text="%1B ". It's written in the manual as;


Use %1 in the string to display the measured value. If this is bound to several measures just use %2, %3, etc. for different values.

It's so it shows the measurement and adds a B to the end of it so that kB shows up instead of just k by itself. so if you wanted to you could put Text="Your download is %1B fast" if you wanted and your speed would be inputed in the sentence. Now lets do the same and add in upload. The measure name for upload is Measure=NetOut. Just switch the download meters to be upload meters and link to the NetOut measure. Shouldn't be too hard now. After you have this setup you should have your download and upload speeds displayed. Now we can move on to Histogram. Input this:

[MeterHistogram]
Meter=HISTOGRAM
MeasureName=MeasureNetIn
X=0
Y=15r
W=70
H=35
PrimaryColor=0,255,0,255
AutoScale=1


Okay this will form a Histogram. A solid color graph of your constant changing measure. So naturally the Meter type is HISTOGRAM . . and the measurename we linked to MeasureNetIn. X and Y positions. then we specify how wide and high the graph is. Then we add in what PrimaryColor the graph will be. As usual it's RGB colors with Alpha. And as usual keep AutoScale set to 1. We can also add in another measure to the same graph.

[MeterHistogram]
Meter=HISTOGRAM
MeasureName=MeasureNetIn
SecondaryMeasureName=MeasureNetOut
X=0
Y=15r
W=70
H=35
PrimaryColor=0,255,0,255
SecondaryColor=250,0,250,255
AutoScale=1


In this example I've added in SecondaryMeasureName and linked in the MeasureNetOut. Then we had to specifiy a color for SecondaryColor. If you like you can also create a BothColor= color.

BothColor
Color that is used when the primary and secondary histograms are on top of eachother.

Also there is a PrimaryImage= SecondaryImage= and BothImage= where you can indicate an image to use as the graph but if you use the Image route you can't use color at all. And keep in mind that you will have to set a seoncary image and both image if you have a secondary measure. Last Item is you can also add a flip=1 if you want to flip the histogram upside down.

Lastly Lets do a line meter.I'm going to go ahead and post the full piece and then explain it after.

[MeterNetLines]
Meter=LINE
LineCount=2
MeasureName=MeasureNetIn
MeasureName2=MeasureNetOut
LineColor=150,150,255,255
LineColor2=255,255,255,255
X=0
Y=50r
W=70
H=35
HorizontalLines=1
HorizontalLineColor=0,0,0,255
LineWidth=1
AntiAlias=1
AutoScale=1


Of course the Meter type is LINE. Next is LineCount. This is an optional piece as you can have multiple lines. You just specify how many lines you want to be measured in one grouping. Useful if you have Multiple CPUs and you want to merge your up and down speed and memory usage all in one graph. After that we specify what measure is linked. If you have more than 1 then write in measurename again with the number after it. You don't have to put a number on the first measurename. Next we can specify the line color. Again if you have more than one measure linked in you'll have to make a linecolor for each. Just add the number after it. Positions, Width and Height setting adds. Next is another optional input. If you want lines to appear behind the line then just add HorizontalLines=1 and if you want them dont' forget to add a line color for the Horizontal lines. Next we can specify how fat we want the lines on the graph. Default is 1. AntiAlias is just there to make the lines less jaggy looking. And last but not least don't forget AutoScale=1.

And this is the basic makeup of Net measures, Histogram and Lines. Don't forget that you can link Histograms and lines to other things besides NetIn and NetOut. As long as you have a measurement that changes constnat you can use one nicely.

( categories: )