Hi, I will try to do my best because english is not my language.
I need to isolate each digit of the current time to be displayed in my skin at specific X-Y location.
Example: if the time is 12:37:54, I need to diplay only the number 5 at X=100 and the number 4 at X=120, etc..... Same thing for the minute and again for the hour.
This is possible???
Thanks alot
It is currently April 28th, 2024, 2:53 am
How to isolate each clock digits
-
- Posts: 27
- Joined: August 30th, 2017, 10:36 pm
-
- Rainmeter Sage
- Posts: 16182
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to isolate each clock digits
It definitely is. You probably have there a Time measure, which returns the time. Something like:Rambytes wrote:I need to isolate each digit of the current time to be displayed in my skin at specific X-Y location.
Example: if the time is 12:37:54, I need to diplay only the number 5 at X=100 and the number 4 at X=120, etc..... Same thing for the minute and again for the hour.
This is possible???
Thanks alot
Code: Select all
[MeasureTime]
Measure=Time
Format=%H:%M:%S
Code: Select all
[MeasureDigitH1]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.)(.):(.)(.):(.)(.)$":"\1"
DynamicVariables=1
[MeasureDigitH2]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.)(.):(.)(.):(.)(.)$":"\2"
DynamicVariables=1
[MeasureDigitM1]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.)(.):(.)(.):(.)(.)$":"\3"
DynamicVariables=1
[MeasureDigitM2]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.)(.):(.)(.):(.)(.)$":"\4"
DynamicVariables=1
[MeasureDigitS1]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.)(.):(.)(.):(.)(.)$":"\5"
DynamicVariables=1
[MeasureDigitS2]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.)(.):(.)(.):(.)(.)$":"\6"
DynamicVariables=1
-
- Posts: 27
- Joined: August 30th, 2017, 10:36 pm
Re: How to isolate each clock digits
Wow... thanks alot for the quick response... I will try right now.
-
- Posts: 27
- Joined: August 30th, 2017, 10:36 pm
Re: How to isolate each clock digits
The hour is not working, maybe is because my time format is this:
My format is a 12h time display and no "zero" for the hour
Code: Select all
[MeasureTime]
Measure=Time
Format=%#I:%M:%S
-
- Rainmeter Sage
- Posts: 16182
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to isolate each clock digits
Yep, that's why it's not working. Replace the Substitute option on the previously posted String measures, as it follows (leave untouched the other options):Rambytes wrote:My format is a 12h time display and no "zero" for the hour
Code: Select all
[MeasureDigitH1]
...
Substitute="^(.):(.)(.):(.)(.)$":"0","^(.)(.):(.)(.):(.)(.)$":"\1"
[MeasureDigitH2]
...
Substitute="^(.):(.)(.):(.)(.)$":"\1","^(.)(.):(.)(.):(.)(.)$":"\2"
[MeasureDigitM1]
...
Substitute="^(.):(.)(.):(.)(.)$":"\2","^(.)(.):(.)(.):(.)(.)$":"\3"
[MeasureDigitM2]
...
Substitute="^(.):(.)(.):(.)(.)$":"\3","^(.)(.):(.)(.):(.)(.)$":"\4"
[MeasureDigitS1]
...
Substitute="^(.):(.)(.):(.)(.)$":"\4","^(.)(.):(.)(.):(.)(.)$":"\5"
[MeasureDigitS2]
...
Substitute="^(.):(.)(.):(.)(.)$":"\5","^(.)(.):(.)(.):(.)(.)$":"\6"
-
- Posts: 27
- Joined: August 30th, 2017, 10:36 pm
Re: How to isolate each clock digits
mmmm.... the hour still display two digits..... Right now here in Montreal is 4:29:00. But the display is 04:29:00. With this new code, the zero BEFORE the 04 is still there.
-
- Posts: 27
- Joined: August 30th, 2017, 10:36 pm
Re: How to isolate each clock digits
This is my full code
Code: Select all
[Rainmeter]
[Variables]
StartX=60
Gap=100
[MeasureTime]
Measure=Time
Format=%#I:%M:%S
[TextStyle]
FontFace=Jersey Sharp
FontColor=255,255,255
FontSize=100
AntiAlias=1
StringStyle=Bold
[MeasureDigitH1]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.):(.)(.):(.)(.)$":"0","^(.)(.):(.)(.):(.)(.)$":"\1"
DynamicVariables=1
[MeasureDigitH2]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.):(.)(.):(.)(.)$":"\1","^(.)(.):(.)(.):(.)(.)$":"\2"
DynamicVariables=1
[MeasureDigitM1]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.):(.)(.):(.)(.)$":"\2","^(.)(.):(.)(.):(.)(.)$":"\3"
DynamicVariables=1
[MeasureDigitM2]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.):(.)(.):(.)(.)$":"\3","^(.)(.):(.)(.):(.)(.)$":"\4"
DynamicVariables=1
[MeasureDigitS1]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.):(.)(.):(.)(.)$":"\4","^(.)(.):(.)(.):(.)(.)$":"\5"
DynamicVariables=1
[MeasureDigitS2]
Measure=String
String=[MeasureTime]
RegExpSubstitute=1
Substitute="^(.):(.)(.):(.)(.)$":"\5","^(.)(.):(.)(.):(.)(.)$":"\6"
DynamicVariables=1
[LesHeures_1]
X=#StartX#
Y=0
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureDigitH1
StringAlign=CENTER
[LesHeures_2]
X=#Gap#r
Y=0
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureDigitH2
StringAlign=CENTER
[LesMinutes_1]
X=((#Gap#)+(#Gap#/2))r
Y=0
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureDigitM1
StringAlign=CENTER
[LesMinutes_2]
X=#Gap#r
Y=0
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureDigitM2
StringAlign=CENTER
[LesSecondes_1]
X=((#Gap#)+(#Gap#/2))r
Y=0
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureDigitS1
StringAlign=CENTER
[LesSecondes_2]
X=#Gap#r
Y=0
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureDigitS2
StringAlign=CENTER
[OnReset]
X=0
[LesDeuxPoints_1]
X=((#Gap#*2)+(#Gap#/2)-15)
Y=-15
Meter=String
MeterStyle=TextStyle
StringAlign=CENTER
Text=":"
[LesDeuxPoints_2]
X=((#Gap#*2)+(#Gap#/2)+0)r
Y=-15
Meter=String
MeterStyle=TextStyle
StringAlign=CENTER
Text=":"
-
- Rainmeter Sage
- Posts: 16182
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to isolate each clock digits
Yeah, because if the hour has one single digit, the first digit of the hours is set to 0. Just take a look at the Substitute option of the [MeasureDigitH1]. It is Substitute="^[color=#FF0000](.)[/color]:(.)(.):(.)(.)$":"[color=#0000FF]0[/color]","^(.)(.):(.)(.):(.)(.)$":"\1", which means that if the hours has one digit (red above), it is substituted with a 0 (blue above).Rambytes wrote:mmmm.... the hour still display two digits..... Right now here in Montreal is 4:29:00. But the display is 04:29:00. With this new code, the zero BEFORE the 04 is still there.
If you'd like nothing to be shown in such cases, just remove the blue zero, from the previous Substitute option: Substitute="^(.):(.)(.):(.)(.)$":"","^(.)(.):(.)(.):(.)(.)$":"\1"
-
- Posts: 27
- Joined: August 30th, 2017, 10:36 pm
Re: How to isolate each clock digits
Thanks you very much for the help..... very appreciated, but very very!!!!!
Thanks and kudos!!!
Thanks and kudos!!!
-
- Rainmeter Sage
- Posts: 16182
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania