Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1409

Help: Rainmeter Skins • Re: CurrentObservationTime - Time measure to calculate X-position in shape meter

$
0
0
Dear Team, I have the following measure containing the current time:
Image

Simple problem (stupid user): I want to use [@CurrentObservationTime] in a meter, drawing a vertical line (via shape) at an X-position based on the current hour. This is what I have, but it fails with the error below ... Why does the meter not calculate with the numerical value (15) -> the measure has the correct number as you can see. Can I prevent that the string is being used here?

Shape=Line (100+3*[@CurrentObservationTime]),1,(100+3*[@CurrentObservationTime]),100
Formula: Logical expression error: (100+3*15:45)

However, my final goal is to convert the current time (hour+minutes) to a full decimal number that I can use in the meter X-position calculation. In this example at 15:45 (current time from [@CurrentObservationTime]) I would like to calculate X = 100+3*15.75 giving 147 px. So the current time should be converted to a full decimal number, like this: HH + MM/60 ...

Can anybody show me a working measure giving this numerical value based on [@CurrentObservationTime] to be used in the shape meter? Thanks so much.
I'm on my phone so can't post tested code, but you have at least 2 possibilities:
- use that string in a Time measure, then use its Timestamp, TimestampFormat and [YourTimeMeasure:Timestamp] to convert the string into a decimal numerical representation:
https://docs.rainmeter.net/manual/measures/time/
- use a (regex) Substitute in a String measure that has your [@CurrentObservationTime] as its value, to transform the "15:45" string into a "(15*60+45)" one or similar, so that the latter can be used directly in your Shape formula

The 2nd possibility is the easiest one, of course. Make sure you have DynamicVariables=1 in the right places.

Statistics: Posted by Yincognito — Today, 4:25 pm



Viewing all articles
Browse latest Browse all 1409

Trending Articles