Hello,

i need a Expression to make a Indicator for the Heartrate.

Can someone help me?

Hello,

i need a Expression to make a Indicator for the Heartrate.

Can someone help me?

Hi.

Expression for heartrate is #ZHR#.

Greetings,

Phantasico aka GAUSS

Thanks, this i know, but i need the Expression for the Rotation Hand.

I want it to start at 50 Beats and end at 200 Beats.

Well, this is not that easy to anwer. Didnāt build a rotational yet. It depends as well on the angle the hands should describe. There are no docs yet. Have a look at Tomaja watches, i think he made oneā¦

Hi Tuffij,

Thereās a bunch of other questions on these things you need to answer. your scale is 50-200. what is the dial size? Do your want to sweep from 50 to 200 through a whole circle (360 degrees)? half a circle (180)? three-quarters? (270) two-thirds (240)?

125 is half of your range. 50-125 is on one side and 125-200 is on the other side. Where is the middle 125 point? Is it straight up (12:00 position)? down (6:00)? leftā¦ rightā¦

Maybe just sketch an image and post it?

-john

50 should be an the left at 315 degrees

200 on the right at 45 degrees

Radius should be 40

@tuffij,

The good news is when we drag the timeline at least #ZHR# changes value but thereās two bad news (newses?). LOL two points of bad news.

- ZHR doesnāt move far enough to hit either 50 or 200 values so weāll have to formula our way into the gauge sweep with no testing.
- When you drag the timeline, ZHR doesnāt move in a linear fashion (like steps). It kind of hops all over the place.

Letās just look at your numbers since we canāt do it live. You want the pointer to swing clockwise from 315-degrees (10:30) to 45 degrees (2:30). Thatās a quarter of a circle - a 90 degree swing. Likewise, you want to move 50 to 200 points of ZHR value, thatās 150 point increase clockwise. In short, you want a 150 point increase in 90-degree clockwise swing. 90 divided by 150 is 0.6. So, each increasing value of (1) on ZHR needs to move the needle 0.6 degrees clockwise. Fine.

Ok then, where does the starting value land? Your lowest value 50ā¦ times 0.6 degrees = 30 degrees. Thatās at 2:00 but we donāt want to start at 2:00, we want to start at 10:30 or 315 degrees, which is also -45 degrees. So letās backup that pointer by 75 degrees. 30 degrees (2:00) minus 75 = -45 degrees (10:30).

Then hereās a formulaā¦ ([value] * 0.6) - 75

Does it work for the starting point? (50 * 0.6) - 75 = -45 degrees. Yes it works. Thatās 10:30.

Ok then how about your top value of 200? hopefully it lands on positive 45 degrees (2:30).

Your max point: (200 * 0.6) - 75 = 45 degrees. Yes, the formula still works. Thatās 2:30.

So then there you go: the [value] is #ZHR#. Use this formula in the rotation field of your pointer in your ZHR gauge:

((#ZHR# * 0.6) - 75)

Hopefully my narrative helps to show you how I think about these things when Iām building them. If the formula works for your min and max, and the value movement is linear, then it must work for all values in-between.

-john

EDITED: watch moved down lower in thread

2 Likes

Great work and very good explanation, John!

Thanks @GAUSS!

Oh, @tuffij - one more thing. You want this gauge to pass through 12:00 where degrees resets back to zero. When Iām working in that direction - through zero - I tend to use the negative side of the high degree values (-45 instead of 315).

However if you wanted the gauge to swing the other way without passing through zero then I would work linearly between 45-degrees and 315-degrees.

-john

thank you all!!!

and how about a āBarindicatorā? Hight 5 width 100, should start at 50 (Width 0) an end at 200 (width 100)?

Same Idea @tuffijā¦

For this, I used a Creator SHAPE (line). (a) itās easy to add and (b) when you change width, the line only grows on one side. In other words, the line shape is Left Justified, which is extremely convenient in this case.

So same process. You want the width of the shape to increase to 100 over 150 value change in ZHR. Again, 100 divided by 150 = 2/3rds orā¦ every time ZHR increases by (1) the shape width has to increase (to the right) by 2/3.

Where does that leave you on your lowest value 50? (50 * 2) / 3 = 33.33333. Fine but we need the width to start at zero. So just substract from the total:

Formula: (((#ZHR#*2)/3)-33.33333)

We know it works for your low value: (((50*2)/3)-33.33333) is āpretty damn close to zeroā
The high end 200? (((200*2)/3)-33.33333) = āpretty damn close to 100ā. It works.

I added the bar to my sandbox face.

Letās pause for a moment on āpretty damn closeā¦ā Whenever you have to add or substract some long-winded decimal, youāre never going to land on exact values. Many people bang their heads against the wall trying to get to exact values. They should just load up formulas that are ācloseā or āgood enoughā and at least see what they look like first.

No one can see the difference between this gaugeās width hitting 100 or 100.000006 on a little, tiny watch screen thatās barely 1-1/2 inches wide. Yet, people still spend hours trying to hit that perfect, lengthy formula. I call this the āSheldonā effect LOL. Iām more in the Howard Wolowitz camp (and Iām an Engineer). Yes, you can FLOOR() and CEILING() and whatever() but who cares. If it looks great on the watch already then āpretty damn closeā is good enough.

1 Like

Thank you!!!

just practising my dial construction: (the dark version is for viewing here. Use the light and tint to suit, for watchface.)

90Ā° (+/- 45) arc - heavy marks at 30Ā°, lighter at 6Ā°, and thin at 3Ā°.

*I would normally load into a 300px+ square, correctly centred ā¦ but left that to you to try (if needed). There is a small cross at exact centre of arc.*