It is currently May 2nd, 2024, 6:57 am

Calc Meter

Get help with creating, editing & fixing problems with skins
CarlPalmer
Posts: 13
Joined: December 22nd, 2012, 6:00 pm

Calc Meter

Post by CarlPalmer »

I have a calc meter measure doing some math to calculate a value.

[Soft1X]
Measure=Calc
Formula=(#MyRadius#) + ((#MyRadius#) * cos(Radians * 1))

Now I want to use this as the x position value on another meter, but I can not seem to get it to work.

I tried referencing it as Soft1X and I tried referencing it as #Soft1X#. No luck

I have tried not creating a variable but using the following:
!SetVariable Soft01XC Soft1X
the variable never got created.

I tried to dim the variable, but the !SetVariable Soft01XC Soft1X command did not put anything into it. so it remained 0.

I tried:
!set option Img_Soft1 x Soft1X

That didn't work.

How do I reference the contents of the meter measure to use as a x coordinate in another a meter?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Calc Meter

Post by jsmorley »

Code: Select all

[Soft1X]
Measure=Calc
Formula=(#MyRadius#) + ((#MyRadius#) * cos(Radians * 1))
Well, I don't know where you are defining the variable #MyRadius#, but assuming you are doing it in [Variables] then that part should be ok. The element "Radians" near the end of the formula I don't understand. That is not a variable, is it the name of some other measure that is defining or returning a number?

In any case, assuming that the formula in the MEASURE [Soft1X] is correct, you can use it in a meter to define X with a section variable:

[MeterSample]
Meter=String
X=[Soft1X]
DynamicVariables=1

Side note: It is important to understand the high-level idea of how bangs work. (those are the commands that start with "!" in the manual) They are "actions", and are only executed when "triggered" by some action statement. Examples of that are mouse actions, (LeftMouseUpAction=!SomeBangs) IF actions (IfEqualAction=!SomeBangs) and a few others like OnRefreshAction and FinishAction (you can search the manual for any of these).

I just didn't want you to be confused and think you can just say
!SetVariable SomeVar "SomeValue"
on a line by itself and expect it to do anything. It won't.
CarlPalmer
Posts: 13
Joined: December 22nd, 2012, 6:00 pm

Re: Calc Meter

Post by CarlPalmer »

Yes, #MyRadius# is up in variables, and Radians is the name of another (calc) measure. It appears that the calculations for each x and y are working exactly correctly. !! Finally !!

Ah Ha! That is the ticket, worked a charm!

>Side note: It is important to understand the high-level idea of how "bangs" work.
After digging in the other forum posts for some time, I came to that conclusion. Thank you for confirming it.

I really do appreciate your help.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Calc Meter

Post by jsmorley »

Glad to help. I sense that you have some experience with programming, which believe it or not can be a bit of a disadvantage when starting out with Rainmeter... You have to be careful not to make too many assumptions based on other languages. Rainmeter is just about exactly not like any of them....

;-)
CarlPalmer
Posts: 13
Joined: December 22nd, 2012, 6:00 pm

Re: Calc Meter

Post by CarlPalmer »

OMG, tell me about it. I am trying to force myself to not think like I have trained myself to.

I also notice that it doesn't process the page from top to bottom.

I LOVE Rainmeter, and I decided to build what I couldn't find out there, and the stumbling blocks are the simple things.