It is currently May 7th, 2024, 7:31 pm

Help creating new type of Meter

Get help with creating, editing & fixing problems with skins
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Re: Help creating new type of Meter

Post by VasTex »

All of your questions are fairly simply and I'll do my best to answer them all, however, iNjUST may be able to answer his reasons behind dividing by 100 better than I can.

I didn't actually 'whip' the rotation angle or Roundline meter into anything it couldn't already do. I promise it wasn't magic. What the Roundline meter does is that it basically displays varying sizes of a pie chart. The larger the measure or value it's being given, the more complete that slice of 'pie' is. However, when it's not given a value it basically just defaults to 1 meaning that only a sliver of the whole 'pie' is visible. When that sliver is as small as it is it just appears to be a line when in fact it's still more or less a 'slice of pie'. I didn't do anything special with it. I just didn't give it a value to work with and so it defaulted to the smallest visible value thus making a slice that is, for all intents and purposes, a straight line.

As for iNjUST's usage of the #CurrentSection# variable that is actually a very handy variable. The value of #CurrentSection# is equal to the name of the meter or measure that the variable is in at that time.

For example, in the following meter the value of #CurrentSection# is equal to MeterDisplayDot:

[MeterDisplayDot]
Meter=String
Text="#CurrentSection#"


In this example the value of #CurrentSection# is equal to MeasureGetLength:

[MeasureGetLength]
Measure=Calc
Formula=(#CurrentSection# / 100)


There is no 'one' value to #CurrentSection#. It's essentially just a reference variable equal to the name of the meter or measure that it's being used in. You can have as many meters and as many measures as you want, all using the #CurrentSection# variable, and they will each have independent values of #CurrentSection#. Just think of #CurrentSection# as a dynamic way of referencing the meter or measure name using the variable at that time. This allows you to change the name of the meter or measure without needing to change the equations or formulas referencing that name as they will always have the most current name of that meter or measure which is #CurrentSection#.

As for him dividing his random numbers by 100 and your CPU measure going 'off screen' that is probably to keep his values in a different range. I assume the maximum value of his dots is probably much lower than 100 or even 50 meaning that a CPU measure of that value or higher would basically appear 'off screen'. He may want to jump in here and explain his reasoning, but I think that's about the gist of it.
Last edited by VasTex on July 1st, 2014, 7:39 pm, edited 2 times in total.
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
User avatar
TweaknFreak
Posts: 217
Joined: July 14th, 2012, 7:26 am

Re: Help creating new type of Meter

Post by TweaknFreak »

VasTex wrote:All of your questions are fairly simply and I'll do my best to answer them all, however, iNjUST may be able to answer his reasons behind dividing by 100 better than I can.

I didn't actually 'whip' the rotation angle or Roundline meter into anything it couldn't already do. I promise it wasn't magic. What the Roundline meter does is that it basically displays varying sizes of a pie chart. The larger the measure or value it's being given, the more complete that slice of 'pie' is. However, when it's not given a value it basically just defaults to 1 meaning that only a sliver of the whole 'pie' is visible. When that sliver is as small as it is it basically just appears to be a line when in fact it's still more or less a 'slice of pie'. I didn't do anything special with it. I just didn't give it a value to work with and so it default to the smallest visible value thus making a slice that is, for all intents and purposes, a straight line.

As for iNjUST's usage of the #CurrentSection# variable that is actually a very handy variable. The value of #CurrentSection# is equal to the name of the meter that the variable is in at that time.

For example, in the following meter the value of #CurrentSection# is equal to MeterDisplayDot:

[MeterDisplayDot]
Meter=String
Text="#CurrentSection#"

In this example the value of #CurrentSection# is equal to MeasureGetLength

[MeasureGetLength]
Measure=Calc
Formula=(#CurrentSection# / 100)

There is no 'one' value to #CurrentSection#. It's essentially just a reference variable equal to the name of the meter or measure that it's being used in. You can have as many meters and as many measures as you want, all using the #CurrentSection# variable, and they will each have independent values of #CurrentSection#. Just think of #CurrentSection# as a dynamic way of referencing the meter or measure name using the variable at that time.

As for him dividing his random numbers by 100 and your CPU measure going 'off screen' is probably to keep his in a different range. I assume the maximum value of his dots is probably much lower than 100 or even 50 meaning that a CPU measure of that value or higher would basically appear 'off screen'. he may want to jump in here and explain his reasoning, but I think that's about the gist of it.
Thanks, I get it all now.
Be one of the iNEViTABLES - Storm, Earthquake, Lightning, Flood - and the world will bow down to you.

My current desktop
[hsimg]http://i1313.photobucket.com/albums/t559/TweaknFreak/6-22-20149-46-40PM_zps7bcbc1f6.png[/hsimg]
User avatar
iNjUST
Posts: 117
Joined: June 20th, 2012, 12:44 am

Re: Help creating new type of Meter

Post by iNjUST »

TweaknFreak wrote:@iNjUST - You code was the same thing but in a more small package. Except for these, I could understand it all-
1. The use of CURRENTSECTION in context to this measure. Now I have never used that variable but after going though the docs its purpose is still blurry:

Code: Select all

[sLine]
MeasureName=cAngle#CURRENTSECTION#
X=(#CURRENTSECTION#*#graph.width#+#pad.X#)
Y=(#graph.height#*(1-[mRandom#CURRENTSECTION#])+#pad.Y#)
LineWidth=#line.size#
LineColor=#line.color#
StartAngle=(PI/2)
RotationAngle=(-PI)
LineLength=[#CURRENTSECTION#.0]
DynamicVariables=1
AntiAlias=1
2. Why did you divide it by 100.

1. I use the CurrentSection variable to make coding more compact. Rather than manually write MeasureName=cAngle1 for one meter, and then have to type again MeasureName=cAngle2 for the next one, I just name the meter's by number, and then I can use that name in the MeterStyles and parameters. For the meter named [1], cAngle#CURRENTSECTION# becomes cAngle1. It's X position, too, can be set based on this number. If it's the nth meter, I can position it n times the spacing/width over. It's an advanced technique that I don't have the time to explain in more detail right now, but I can fill in more information a little later.

2. I divide by 100 simply because the default high-low bounds for RANDOM are 1-100. Thus I get a value that is always between 0 and 1, which is the "normal" bounds for most measures in Rainmeter. Measuring CPU gives a value between 0 and 100, so you need to modify all of the cAngle calculations to be divided by 100 within the ATAN() function.

Example:

Code: Select all

Formula=ATAN((mCPU1-mCPU0)/100*#graph.height#/#graph.width#)
I've got to head out, but I can try to answer in more details or any new questions a bit later.