It is currently April 16th, 2024, 11:23 am

Time Problem

Get help with creating, editing & fixing problems with skins
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Time Problem

Post by Youkai1977 »

Hello everybody, :-)
I'm new here in the forum and despair. Now I have the soft hope that you can help me.
Just do not laugh, with my english. I speak German and English does not suit me at all. That's what you read here, Aunt Google has translated me. :Whistle :oops:

So my problem is my programmed alarm clock in my clock. If the alarm time is 00:00 (24 hour format), then I am always 0: 0 displayed. I can not get it if the set alarm time is 00: 00h, it is displayed to me as synonymous. Where is the mistake, I can not get it.

Who can help?

Here a Screenshot from my problem: Image

Here the Code (complete):

Code: Select all


[Rainmeter]
Update=1000

[Metadata]
Name=Alarm-Clock
Author=Youkai1977
Version=V1.0 <> 31.10.2018
Information=This Meter is a Part of Terminal-Skin Package
License=Creative Commons BY-NC-SA 3.0

;--------------------------------------------------
;--- VARIABLES & STYLES ---------------------------
;--------------------------------------------------

[Variables]
Images=#@#images\
ImgAlpha=230
SoundPath1=#@#sounds\chimehour.wav
SoundPath2=#@#sounds\alarmclock.wav
DigitColor=0,167,0,230
ValueHourSet=0
ValueMinuteSet=0
FS1=40
FS2=14
FS3=8
FS4=12

[Style1]
FontColor=#DigitColor#
FontFace=Square721 BT
StringAlign=LEFT
StringStyle=Bold
AntiAlias=1

[Style2]
FontColor=#DigitColor#
FontFace=CONSOLAS
StringAlign=LEFT
StringStyle=Bold
AntiAlias=1

;--------------------------------------------------
;--- MEASURES -------------------------------------
;--------------------------------------------------

;--- MEASURES CLOCK, CHIMESOUND & ALARM -----------

[MeasureTime]
Measure=Time
Format=%R

[MeasureSec]
Measure=Time
Format=%S

[MeasureChimeHour]
Measure=Time
Format=%M
IfEqualValue=0
IfEqualAction=[Play "#SoundPath1#"]

[MeasureMinMaxHourAlarm]
measure=calc
formula=#ValueHourSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueHourSet# < 0)
IfTrueAction=[!SetVariable ValueHourSet "23"]
IfCondition2=(#ValueHourSet# >= 24)
IfTrueAction2=[!SetVariable ValueHourSet "0"]
Disabled=1
Group=mALARM | ALARM

[MeasureMinMaxMinuteAlarm]
measure=calc
formula=#ValueMinuteSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueMinuteSet# < 0)
IfTrueAction=[!SetVariable ValueMinuteSet "55"]
IfCondition2=(#ValueMinuteSet# >= 60)
IfTrueAction2=[!SetVariable ValueMinuteSet "0"]
Disabled=1
Group=mALARM | ALARM

[MeasureDigitPrefixerAlarm]
Measure=calc
Formula=00
Dynamicvariables=1
IfCondition=(#ValueHourSet# >= 0) && (#ValueHourSet# <= 9)
IfTrueAction=[!SetOption HourAlarm Prefix "0"]
IfFalseAction=[!SetOption HourAlarm Prefix ""]
IfCondition2=(#ValueMinuteSet# >= 0) && (#ValueMinuteSet# <= 9)
IfTrueAction2=[!SetOption MinuteAlarm Prefix "0"]
IfFalseAction2=[!SetOption MinuteAlarm Prefix ""]
Disabled=1
Group=mALARM | ALARM

[MeasureHourAlarm]
Measure=Time
Format=%H
Disabled=1
Group=ALARM

[MeasureMinuteAlarm]
Measure=Time
Format=%M
Disabled=1
Group=ALARM

[Alarm]
Measure=calc
Formula=0
DynamicVariables=1
IfCondition=(MeasureHourAlarm = #ValueHourSet#) && (MeasureMinuteAlarm = #ValueMinuteSet#)
IfTrueAction=[PlayLoop #SoundPath2#][!Redraw]
Disabled=1
Group=ALARM

;--- MEASURE DATE ---------------------------------

[MeasureDate]
Measure=Time
Format=%d.%m.%Y

;--------------------------------------------------
;--- BACKGROUND -----------------------------------
;--------------------------------------------------

[Background]
Meter=Image
ImageName=#Images#bg_cl_we.png
AntiAlias=1
X=0
Y=0
W=270
H=82

[SetClockBG]
Meter=Image
SolidColor=0,0,0,1
X=0
Y=0
W=270
H=72
LeftMouseUpAction=[!ToggleMeasure MeasureChimeHour][!ToggleMeter ChimeSoundOFF][!Redraw]
MiddleMouseUpAction=[%windir%\system32\control.exe timedate.cpl]
RightMouseUpAction=[!EnableMeasureGroup ALARM][!DisableMeasure MeasureChimeHour][!ShowMeterGroup ALARMSET][!HideMeterGroup CLOCK][!HideMeter ChimeSoundOFF][!ShowMeter ChimeSoundALARM][!HideMeter SetClockBG][!Update]

;--------------------------------------------------
;--- CLOCK, ALARM ---------------------------------
;--------------------------------------------------

;--- Clock ----------------------------------------

[Time]
Meter=String
MeasureName=MeasureTime
MeterStyle=Style1
FontSize=#FS1#
X=0
Y=-2
Group=CLOCK

[Seconds]
Meter=String
MeasureName=MeasureSec
FontSize=#FS2#
MeterStyle=Style1
X=180r
Y=35r
Group=CLOCK

;--- Alarm ----------------------------------------

[AlarmBG]
Meter=Image
solidcolor=0,0,0,1
X=0
Y=0
W=270
H=72
Hidden=1
Group=ALARMSET
MouseLeaveAction=[!HideMeterGroup ALARMSET][!ShowMeterGroup CLOCK][!ShowMeter AlarmIconON][!ShowMeterGroup ALARMON][!HideMeter AlarmSetIcon][!Redraw]

[HourAlarm]
Meter=String
MeterStyle=Style1
FontSize=#FS1#
Text="#ValueHourSet#"
X=0
Y=-2
DynamicVariables=1
Hidden=1
Group=ALARMSET
MouseScrollUpAction=[!SetVariable ValueHourSet (#ValueHourSet#+1)][!UpdateMeasureGroup mALARM][!UpdateMeter HourAlarm][!Redraw]
MouseScrollDownAction=[!SetVariable ValueHourSet (#ValueHourSet#-1)][!UpdateMeasureGroup mALARM][!UpdateMeter HourAlarm][!Redraw]

[ColonAlarm]
Meter=string
MeterStyle=Style1
FontSize=#FS1#
Text=":"
X=76r
Y=r
Hidden=1
Group=ALARMSET

[MinuteAlarm]
Meter=String
MeterStyle=Style1
FontSize=#FS1#
Text="#ValueMinuteSet#"
X=20r
Y=r
DynamicVariables=1
Hidden=1
Group=ALARMSET
MouseScrollUpAction=[!SetVariable ValueMinuteSet (#ValueMinuteSet#+1)][!UpdateMeasureGroup mALARM][!UpdateMeter MinuteAlarm][!Redraw]
MouseScrollDownAction=[!SetVariable ValueMinuteSet (#ValueMinuteSet#-1)][!UpdateMeasureGroup mALARM][!UpdateMeter MinuteAlarm][!Redraw]

;--- DATE -----------------------------------------

[Day]
Meter=String
MeasureName=MeasureDate
MeterStyle=Style1
FontSize=#FS4#
X=80
Y=58

;--------------------------------------------------
;--- BUTTONS CLOCK/ALARM-SET ----------------------
;--------------------------------------------------

[ChimeSoundOFF]
Meter=Image
ImageName=#Images#Chime_off.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=188
Y=10
W=16
H=16
ToolTipText="ChimeSound is OFF"
Hidden=1

[ChimeSoundALARM]
Meter=Image
ImageName=#Images#Chime_off.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=r
Y=r
W=16
H=16
ToolTipText="Disabled in Alarm-Mode"
Hidden=1

[AlarmSetIcon]
Meter=Image
ImageName=#Images#setalarm.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=22r
Y=r
W=24
H=16
Hidden=1
Group=ALARMSET

[AlarmSetText]
Meter=STRING
MeterStyle=Style2
FontSize=#FS3#
Text=SET 
X=23r
Y=r
Hidden=1
Group=ALARMSET

[AlarmTimeON]
Meter=String
MeasureName=MeasureMinMaxHourAlarm
MeasureName2=MeasureMinMaxMinuteAlarm
MeterStyle=Style1
FontSize=#FS3#
Text=%1:%2
X=-18r
Y=-1r
Hidden=1
Group=ALARMON
LeftMouseUpAction=[!ShowMeterGroup ALARMSET][!HideMeterGroup CLOCK][!HideMeter AlarmIconON][!HideMeterGroup ALARMON][!ShowMeter AlarmSetIcon][!Redraw]
RightMouseUpAction=[!DisableMeasureGroup ALARM][!EnableMeasure MeasureChimeHour][!HideMeter AlarmIconON][!HideMeter AlarmTimeON][!HideMeter ChimeSoundALARM][PlayStop "#SoundPath2#"][!ShowMeter SetClockBG][!Redraw]

[AlarmIconON]
Meter=Image
ImageName=#Images#alarm_on.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=-18r
Y=-1r
W=10
H=10
ToolTipText="Set/Stop Alarm"
Hidden=1
Group=ALARMON
LeftMouseUpAction=[!ShowMeterGroup ALARMSET][!HideMeterGroup CLOCK][!HideMeter AlarmIconON][!HideMeterGroup ALARMON][!ShowMeter AlarmSetIcon][!Redraw]
RightMouseUpAction=[!DisableMeasureGroup ALARM][!EnableMeasure MeasureChimeHour][!HideMeter AlarmIconON][!HideMeter AlarmTimeON][!HideMeter ChimeSoundALARM][PlayStop "#SoundPath2#"][!ShowMeter SetClockBG][!Redraw]

I say thanks
Greez Youkai1977
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Time Problem

Post by eclectic-tech »

Add RegExpSubstitute to your 2 MinMax measures [MeasureMinMaxHourAlarm] & [MeasureMinMaxMinuteAlarm]
This will add a zero to the string value if the measure value is only 1 digit. Because these are used in a string meter [AlarmTimeON], the substituted string values will be used; the number values of the measures will still be single digits.

Code: Select all

...

[MeasureMinMaxHourAlarm]
measure=calc
formula=#ValueHourSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueHourSet# < 0)
IfTrueAction=[!SetVariable ValueHourSet "23"]
IfCondition2=(#ValueHourSet# >= 24)
IfTrueAction2=[!SetVariable ValueHourSet "0"]
Disabled=1
Group=mALARM | ALARM
RegExpSubstitute=1
Substitute="^(\d$)":"0\1"

[MeasureMinMaxMinuteAlarm]
measure=calc
formula=#ValueMinuteSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueMinuteSet# < 0)
IfTrueAction=[!SetVariable ValueMinuteSet "55"]
IfCondition2=(#ValueMinuteSet# >= 60)
IfTrueAction2=[!SetVariable ValueMinuteSet "0"]
Disabled=1
Group=mALARM | ALARM
RegExpSubstitute=1
Substitute="^(\d$)":"0\1"

...
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Time Problem

Post by Youkai1977 »

Yes Perfect. That was what I was looking for. You are my hero of the day :thumbup: :thumbup:

I have to admit, I'm working longer with Rainmeter. But my handling or programming of skins is based on looking at what code is causing. Due to the fact that the help for Rainmeter is mostly only available in English, it makes it difficult for me to learn problems with skin programming. In short, actually, it is often obvious if one would understand the language :oops:

Ok, as a thank you there is my alarm clock to download. Maybe somebody might like him: -> https://filehorst.de/d/cGHwbAtD
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Time Problem

Post by jsmorley »

Youkai1977 wrote: November 1st, 2018, 1:18 pm Yes Perfect. That was what I was looking for. You are my hero of the day :thumbup: :thumbup:

I have to admit, I'm working longer with Rainmeter. But my handling or programming of skins is based on looking at what code is causing. Due to the fact that the help for Rainmeter is mostly only available in English, it makes it difficult for me to learn problems with skin programming. In short, actually, it is often obvious if one would understand the language :oops:

Ok, as a thank you there is my alarm clock to download. Maybe somebody might like him: -> https://filehorst.de/d/cGHwbAtD
I'm sure you are aware of this, but you can view the manual in your preferred language, with a caveat.

https://translate.google.com/translate?hl=&sl=auto&tl=de&u=https%3A%2F%2Fdocs.rainmeter.net%2Fmanual%2F&sandbox=1

I will caution however, that this will also "translate" the keywords used in Rainmeter, which you must not do in your skins. I guess you could have two tabs open, one in English, to be sure you are using the correct syntax, and one in German, where perhaps the explanations and other text are more clear. As clear as Google Translate gets at least...

Never be afraid to ask here if you are not sure about something. Folks here are glad to help.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Time Problem

Post by eclectic-tech »

Youkai1977 wrote: November 1st, 2018, 1:18 pm Yes Perfect. That was what I was looking for. You are my hero of the day :thumbup: :thumbup:
Happy to help! :welcome:
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Time Problem

Post by Youkai1977 »

@jsmorley:

The programming terms are also translated into German I know. Did that already * lol *. But well, as long as you know to use brain.exe reasonably well, that should be the case :D

Do not worry, I will continue to have a question. And in the future maybe someone can help. Even if you have to guess, thanks to Google Translator, one or the other of my texts, what the dear Youkai means :oops: :rofl:

Therefore, I'm glad to have found a forum, where people still like to help :thumbup:
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Time Problem

Post by sl23 »

I've just searched for an alarm clock and your's was the first I came across.
Excellent job, thank you for sharing it :thumbup:
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Time Problem

Post by sl23 »

Is there a way to get it to both remember the alarm time and stay active?
Currently, it resets after activating the alarm.

There also appears to be a 'bug' where the skin is wider than visible until you click to show alarm setting.
- MuLab -