It is currently April 19th, 2024, 3:04 pm

Simplifying Netmeter Code

Get help with creating, editing & fixing problems with skins
†Blade†
Posts: 24
Joined: May 11th, 2010, 7:43 am
Location: Wellington, OH

Simplifying Netmeter Code

Post by †Blade† »

You guys have really been a good help to me when I have ran into some issues.
This time I do not have an issue, I was just looking for any "suggestions" on how this code might(if possible) get simplified.
I know there has been new measures and meters added since I last made this skin, so I am going to post the code up here to see if anyone can find a way that I could make this a little more organized. I know the saying goes, if it's not broke don't fix it, but I feel as if I should be able to cut this down a bit. Just let me know what you guys think and be welcomed to express any code backing up your thoughts.

Additional information:
My internet speed is 3355 Kbits/sec by 843 Kbits/sec
I would like it not to autoscale but be set at a fixed height
Would also like to be able to change the update willingly without it effecting the formulas(cause right now it does for some reason)

Here is what it looks like:
Image
Red up to the top is my max download speed, all the way to no red which is no download being used at all

--------------------------------------------------
;Rainmeter Settings
--------------------------------------------------
[Rainmeter]
Author=†Blade†(XxSpawn@gmail.com)
Update=1000

--------------------------------------------------
;Variables
--------------------------------------------------
[Variables]
DownloadColor=200,0,0,255
UploadColor=0,150,0,255
OverlapColor=255,255,50,255
FontFace=Drifter
FontSize=4
FontColor=255,255,255,255

--------------------------------------------------
;Measures
--------------------------------------------------
[MeasureDownload]
Measure=NetIn
NetInSpeed=3072000
Interface=0

[CalcNetIn]
Measure=Calc
Formula=(MeasureDownload/1024)

[MeasureUpload]
Measure=NetOut
NetOutSpeed=3072000
Interface=0

[CalcNetOut]
Measure=Calc
Formula=(MeasureUpload/1024)

--------------------------------------------------
;Meters
--------------------------------------------------
[DownloadMeter]
Meter=HISTOGRAM
Measurename=MeasureDownload
SecondaryMeasureName=MeasureUpload
X=2
Y=4
W=196
H=55
PrimaryColor=#DOWNLOADCOLOR#
SecondaryColor=#UPLOADCOLOR#
BothColor=#OVERLAPCOLOR#
BarOrientation=HORIZONTAL
AntiAlias=0
Autoscale=0

[DownloadText]
Meter=String
MeasureName=CalcNetIn
X=37
Y=64
AntiAlias=0
FontFace=#FONTFACE#
FontSize=#FONTSIZE#
FontColor=#FONTCOLOR#
Text="%1 KB/s"
NumOfDecimals=0

[Upload Text]
Meter=String
MeasureName=CalcNetOut
X=137
Y=64
AntiAlias=0
FontFace=#FONTFACE#
FontSize=#FONTSIZE#
FontColor=#FONTCOLOR#
Text="%1 KB/s"
NumOfDecimals=0
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Simplifying Netmeter Code

Post by poiru »

That's a real simple skin, and can't really go any simpler than that code-wise. Only suggestion I have is to add a semi-colon infront of the dashes ;)
†Blade†
Posts: 24
Joined: May 11th, 2010, 7:43 am
Location: Wellington, OH

Re: Simplifying Netmeter Code

Post by †Blade† »

Okay, fair enough, I was just making sure as I seen that there was a new multithread CPU measures added so I was just making sure that the same thing didn't happen with one of these as well.