It is currently April 27th, 2024, 3:37 am

Hide clock at certain hours?

Get help with creating, editing & fixing problems with skins
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Hide clock at certain hours?

Post by JpsCrazy »

Here's what's going on:
I'm trying to make a clock that is, well, half of a clock.
The top half to be exact.
For this, I'm ONLY using military time (the time won't actually be shown, its for the analog position.) (If you don't know military time, just subtract 12 from any number over 12 to get the regular time)

Now, the idea is the hour hand (all there is) passes by twice each day.
The simplist way to do that is have two clocks opposite of eachother in my mind.
I managed that, and have it so you only have to change your time zone and it changes both.
(If you don't believe me add disabled=1 to msHideClock)

Anywho. I can't get one clock to hide while it's on the bottom half.
Any time from 3-9 or 15-21 (3-9 again) should be hidden.
The real clock is always hidden. (mtClockDay) (Real = white, opposite = gray)
The default format for time is HH:MM:SS so I added a substitute to remove the : and it still works as a clock. That's why the numbers in the calc are so big.

Here's my code:

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=00000001

[Variables]
TimeZone=-5.0

[mtTest]
Meter=String
MeasureName=msTimeDay
Text=%1
DynamicVariables=1

[msTimeDay]
Measure=Time
TimeZone=#TimeZone#
DynamicVariables=1
Substitute=":":""

[msTimeNight]
Measure=Time
TimeZone=[msOpposite]
DynamicVariables=1
Substitute=":":""

[msOpposite]
Measure=Calc
Formula=#TimeZone#+6
DynamicVariables=1

[msHideClock]
Measure=Calc
Formula=(((030000 < [msTimeDay]) && ([msTimeDay] < 090000)) || ((150000 < [msTimeDay]) && ([msTimeDay] < 210000))) ? 0 : 1
DynamicVariables=1
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterShowMeter mtClockDay][!RainmeterHideMeter mtClockNight]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter mtClockDay][!RainmeterShowMeter mtClockNight]
Disabled=0

[mtClockDay]
Meter=RoundLine
MeasureName=msTimeDay
AntiAlias=1
LineWidth=5
LineLength=70
LineColor=FFFFFF
StartAngle=-1.570796
ValueRemainder=43200
W=200
H=200

[mtClockNight]
Meter=RoundLine
MeasureName=msTimeNight
AntiAlias=1
LineWidth=5
LineLength=70
LineColor=AAAAAA
StartAngle=-1.570796
ValueRemainder=43200
W=200
H=200
Last edited by JpsCrazy on June 25th, 2010, 2:06 am, edited 1 time in total.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Hide clock at certain hours?

Post by smurfier »

Shouldn't this:

Formula=(060000 < [msTimeDay] < 180000) ? 0 : 1

be this instead:

Formula=(060000 < [msTimeDay]) && ([msTimeDay] < 180000) ? 0 : 1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
karakteran
Posts: 16
Joined: June 16th, 2010, 9:08 pm

Re: Hide clock at certain hours?

Post by karakteran »

i can't move clock closer to left wall of my screen. anyone knows?

here is its skin:

Code: Select all

[Rainmeter]
10-Foot HUD v1.Xmas (White) - Created by Stephen R Gibson. 
;Metadata added by RainBrowser
;http://rainmeter.net/RainWiki/index.php?title=Rainmeter_101#.5BMetadata.5D

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

;End of added Metadata

[MeasureTime]
Measure=Time
Format=%#I:%M

[MeasureAMPM]
Measure=Time
Format=%p

-------------------------------------METERS--------------------------------------------

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=276
Y=0
FontColor=255,255,255,245
FontSize=90
FontFace=Century Gothic
StringAlign=RIGHT
StringStyle=NORMAL
AntiAlias=1

[MeterAMPM]
MeasureName=MeasureAMPM
Meter=STRING
X=276
Y=16
FontColor=255,255,255,215
FontSize=35
FontFace=Century Gothic
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Hide clock at certain hours?

Post by JpsCrazy »

smurfier wrote:Shouldn't this:
Formula=(060000 < [msTimeDay] < 180000) ? 0 : 1

be this instead:
Formula=(060000 < [msTimeDay]) && ([msTimeDay] < 180000) ? 0 : 1
That worked better... I think.
But for the life of me I can't get it to work properly.
You know what I just thought of? This clock most likely still tells time in 12h format, like 12 hours on the clock, and goes around twice rather than a 24h clock, which I would love to see sometime by the way.
So I changed the formula to: (((030000 < [msTimeDay]) && ([msTimeDay] < 090000)) || ((150000 < [msTimeDay]) && ([msTimeDay] < 210000))) ? 0 : 1
So any time from 3-9 or 15-21 (3-9 again) should be hidden. (It shouldn't be && because well, it can't be BOTH times.)

The same code with a new formula:

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=00000001

[Variables]
TimeZone=-5.0

[mtTest]
Meter=String
MeasureName=msTimeDay
Text=%1
DynamicVariables=1

[msTimeDay]
Measure=Time
TimeZone=#TimeZone#
DynamicVariables=1
Substitute=":":""

[msTimeNight]
Measure=Time
TimeZone=[msOpposite]
DynamicVariables=1
Substitute=":":""

[msOpposite]
Measure=Calc
Formula=#TimeZone#+6
DynamicVariables=1

[msHideClock]
Measure=Calc
Formula=(((030000 < [msTimeDay]) && ([msTimeDay] < 090000)) || ((150000 < [msTimeDay]) 

&& ([msTimeDay] < 210000))) ? 0 : 1
DynamicVariables=1
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterShowMeter mtClockDay][!RainmeterHideMeter 

mtClockNight]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter mtClockDay][!RainmeterShowMeter 

mtClockNight]
Disabled=0

[mtClockDay]
Meter=RoundLine
MeasureName=msTimeDay
AntiAlias=1
LineWidth=5
LineLength=70
LineColor=FFFFFF
StartAngle=-1.570796
ValueRemainder=43200
W=200
H=200

[mtClockNight]
Meter=RoundLine
MeasureName=msTimeNight
AntiAlias=1
LineWidth=5
LineLength=70
LineColor=AAAAAA
StartAngle=-1.570796
ValueRemainder=43200
W=200
H=200

That other guy's problem...
karakteran wrote:i can't move clock closer to left wall of my screen. anyone knows?
Hey! This is MY topic!
Just kidding.
But if you want to get good responses you should start your own topic.
Right click on the skin and go to Skin Menu and turn off Snap to Edges and Keep on Screen.
Also, post codes in the

Code: Select all

 tags.[/spoiler]
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Hide clock at certain hours?

Post by JpsCrazy »

...bump.

Here's what's going on:
I'm trying to make a clock that is, well, half of a clock.
The top half to be exact.
For this, I'm ONLY using military time (the time won't actually be shown, its for the analog position.) (If you don't know military time, just subtract 12 from any number over 12 to get the regular time)

Now, the idea is the hour hand (all there is) passes by twice each day.
The simplist way to do that is have two clocks opposite of eachother in my mind.
I managed that, and have it so you only have to change your time zone and it changes both.
(If you don't believe me add disabled=1 to msHideClock)

Anywho. I can't get one clock to hide while it's on the bottom half.
Any time from 3-9 or 15-21 (3-9 again) should be hidden.
The real clock is always hidden. (mtClockDay) (Real = white, opposite = gray)
The default format for time is HH:MM:SS so I added a substitute to remove the : and it still works as a clock. That's why the numbers in the calc are so big.

Here's my code:

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=00000001

[Variables]
TimeZone=-5.0

[mtTest]
Meter=String
MeasureName=msTimeDay
Text=%1
DynamicVariables=1

[msTimeDay]
Measure=Time
TimeZone=#TimeZone#
DynamicVariables=1
Substitute=":":""

[msTimeNight]
Measure=Time
TimeZone=[msOpposite]
DynamicVariables=1
Substitute=":":""

[msOpposite]
Measure=Calc
Formula=#TimeZone#+6
DynamicVariables=1

[msHideClock]
Measure=Calc
Formula=(((030000 < [msTimeDay]) && ([msTimeDay] < 090000)) || ((150000 < [msTimeDay]) && ([msTimeDay] < 210000))) ? 0 : 1
DynamicVariables=1
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterShowMeter mtClockDay][!RainmeterHideMeter mtClockNight]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter mtClockDay][!RainmeterShowMeter mtClockNight]
Disabled=0

[mtClockDay]
Meter=RoundLine
MeasureName=msTimeDay
AntiAlias=1
LineWidth=5
LineLength=70
LineColor=FFFFFF
StartAngle=-1.570796
ValueRemainder=43200
W=200
H=200

[mtClockNight]
Meter=RoundLine
MeasureName=msTimeNight
AntiAlias=1
LineWidth=5
LineLength=70
LineColor=AAAAAA
StartAngle=-1.570796
ValueRemainder=43200
W=200
H=200
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Hide clock at certain hours?

Post by jsmorley »

karakteran wrote:i can't move clock closer to left wall of my screen. anyone knows?

here is its skin:

Code: Select all

[Rainmeter]
10-Foot HUD v1.Xmas (White) - Created by Stephen R Gibson. 
;Metadata added by RainBrowser
;http://rainmeter.net/RainWiki/index.php?title=Rainmeter_101#.5BMetadata.5D

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

;End of added Metadata

[MeasureTime]
Measure=Time
Format=%#I:%M

[MeasureAMPM]
Measure=Time
Format=%p

-------------------------------------METERS--------------------------------------------

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=276
Y=0
FontColor=255,255,255,245
FontSize=90
FontFace=Century Gothic
StringAlign=RIGHT
StringStyle=NORMAL
AntiAlias=1

[MeterAMPM]
MeasureName=MeasureAMPM
Meter=STRING
X=276
Y=16
FontColor=255,255,255,215
FontSize=35
FontFace=Century Gothic
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
Right click the skin and turn off "Stay on Screen".
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Hide clock at certain hours?

Post by smurfier »

Maybe try something like this.

Code: Select all

[mHour]
Measure=Time
Format=%#H

[mMinute]
Measure=Time
Format=%M

[mSeconds]
Measure=Time
Format=%S

[cTimeCode]
;Calculate the time in terms of seconds
Measure=Calc
Formula=(mHour*3600)+(mMinute*60)+mseconds

[cRoundTime]
;Calculate ratio of PI based on time. Remember PI is half of a 360 circle using radians.
Measure=Calc
Formula=mHour<12?(cTimeCode/43200)*3.14:((cTimeCode-43200)/43200)*3.14
MaxValue=6.28

[mtClock]
Meter=RoundLine
MeasureName=cRoundTime
AntiAlias=1
LineWidth=5
LineLength=70
LineColor=FFFFFF
StartAngle=-1.570796
W=200
H=200
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Hide clock at certain hours?

Post by JpsCrazy »

I see what you're getting at, but calcs don't seem to work with Roundline...
It's always straight up.

That's why I used two clocks and just hide one at specific times. (...at least that's what I'm trying to do.)
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Hide clock at certain hours?

Post by Alex2539 »

You need to set MaxValue and MinValue in the calc. The default values for these are 1 and 0.
ImageImageImageImage
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Hide clock at certain hours?

Post by JpsCrazy »

Alex2539 wrote:You need to set MaxValue and MinValue in the calc. The default values for these are 1 and 0.
There's a MaxValue=6.28 in the calc used for the roundline and the min is the default value of 0, threw it in just in case. Didn't do anything. I checked to see if it's correct, and it is.
Added Max/MinValue's for the calc used in that calc, and still no results.

Tried bracketing the measure names in the calcs but nothing happened.