Sliding Weather Dot

I’ve been having trouble trying to make the green circle below turn along the green to red slide in accordance to the current low and the current high. The green dot is the current weather temperature, rotating around the origin and I have a clamp expression: clamp(#WCT#, #WTL#, #WTH#) for the rotation but it is obviously not moving. I am new at this and need help.


Thanks to everyone.

Where is the origin of your dot image? ie. is it centred in the middle of the watch or the centre of the dot?

If it is centred in the middle of the watch then you can use the rotation field to rotate the image. If the image is centred in the middle of the dot then you will need to use the XPos and YPos with different expressions to move the dot.

I think the simplest way is to create an image centred in the middle of the watch, just like a “hand”. That is, create an image say 640 high by say 40 wide and place the circle/dot at the right distance from the centre. Then you can just use a simple expression to rotate the “hand” to where you want it.

edit:

If you do as I suggested above, you will need to determine the minimum and maximum rotation angles that correspond to the minimum and maximum temperatures that you want to show. And also if you will need to address the different F and C scales.

An expression for rotation could look like:

( clamp ( angleMin + ( ( #WCT# - TempMin) / (TempMax - TempMin) ) * ( angleMax - angleMin ) , angleMin, angleMax ) )

You would need to substitute your numbers for angleMin, angleMax, TempMin, TempMax and delete the spaces in the above expression.

Note that I am not sure that it will work if you use #WTL# and #WTH# - I seem to remember that there is some strange behaviour with these two tags and #WCT# that might occasionally make #WCT# fall outside the range. Although I suppose the clamp should deal with that.

As for the different temperature scales for F and C …

You could have two identical layers and use #WM# in a boolean expression to change the transparency to only show one of the images depending on the units that the user has set.

2 Likes

Thank you Mike, it worked.

1 Like

Cool, I am glad it worked. :slight_smile: