It is currently May 5th, 2024, 4:56 pm

Cogs Moon Sun

Clocks and timer skins
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Cogs Moon Sun

Post by Mordasius »

This is an addition to the Cogs Tubes and Gauges collection posted on DA more than a decade ago. Large and medium-sized variants show the time along with the current position of the sun and moon. Click in the center of the clock to toggle the skin bevel on and off.
MoonSunCogs-Screen.jpg
Hover the mouse over the sun or moon images to show the respective rise / set times and other information. The 12-hr clock is in the center. The bronze radial arms show the sun rise and sun set times on a 24-hr clock. A few of the cogs and the radial rings rotate at varying rates.

Settings for skins in the CTG collection were all manually entered in a single UserVariables.inc file - as was common in 2012/13. These skins have three right-click options to make setting the locationa little easier. The options are:
1) search for a location (adapted from WeatherComCode by J.S.Morley),
2) auto-detect your current location from the IP address (adapted from WeatherView AutoLocation by Eclectric Tech), and
3) use Google Maps to find the latitude and longitude you want and then use your ever reliable text editor to set the location manually (note that the correct time zone will be automatically set by the skin).

Updated 23rd May to include SilverAzide's fix for a potential DST error.
Updated 26th May - reverted to checking the UTC/GMT offset with Weather.com. This allows users to set the skin to show the sun and moon times any where else in the world without changing the o.s. time zone.
CogsMoonSun_26052023.rmskin
You do not have the required permissions to view the files attached to this post.
Last edited by Mordasius on May 26th, 2023, 6:31 am, edited 3 times in total.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2618
Joined: March 23rd, 2015, 5:26 pm

Re: Cogs Moon Sun

Post by SilverAzide »

Woohoo! Get out your clock key and stoke up the coal furnace... new CTG skins! I can finally figure out where the sun and moon are in the sky without having to go outside and look up!

I had to make a few tweaks to a couple measures (CTG-Measures.inc) to get the time and sun/moon positions to match my local time.

Code: Select all

[mLocationTimeNow]
Measure=Time
DaylightSavingTime=0
TimeZone=#tZone#

[mTimeAngleNow]
Measure=Time
DaylightSavingTime=0
TimeZone=#tZone#
Format=( ( %#H + ( %#M/60 ) )*15)
Without the DaylightSavingTime=0 option, everything is off by an hour. I think the tZone variable already includes the DST offset, but I'm not sure. I can never seem to get this right.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7199
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Cogs Moon Sun

Post by Yincognito »

SilverAzide wrote: May 21st, 2023, 5:03 pmWithout the DaylightSavingTime=0 option, everything is off by an hour. I think the tZone variable already includes the DST offset, but I'm not sure. I can never seem to get this right.
In case it helps (not sure if it's true here as Mordasius knows better how his skin works, but anyway)...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Cogs Moon Sun

Post by Mordasius »

SilverAzide wrote: May 21st, 2023, 5:03 pm Without the DaylightSavingTime=0 option, everything is off by an hour. I think the tZone variable already includes the DST offset, but I'm not sure.
Thanks for picking that up and thanks again for coming up with what might be a simple fix. I inadvertently introduced the error because I wanted to test the skins in other locations and at other times than those set on my computer.

This was most easily done by setting the tZone variable to be +/- the DST offset (as you correctly deduced). Unfortunately, I think I may have compounded the error by adding the the CTG-DSTchecker.inc file which includes measures to get the CurrentTimeOffset from Weather.com and use this to overwrite the value of the tZone variable in VARS-LatLongTzone.inc. This was intended to save users from having to update the value of tZone manually when DST kicks in or out.

Out of interest, what was it that was off by one hour? Was it the clock, the sun/moon rise times or both?
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Cogs Moon Sun

Post by Mordasius »

Yincognito wrote: May 21st, 2023, 6:33 pm In case it helps
Thanks. I think there might be a better way to accommodate changes to the DST in that than the way I'd tried to do it. Something to play around with at the very least.
User avatar
Yincognito
Rainmeter Sage
Posts: 7199
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Cogs Moon Sun

Post by Yincognito »

Mordasius wrote: May 22nd, 2023, 10:11 am Thanks. I think there might be a better way to accommodate changes to the DST in that than the way I'd tried to do it. Something to play around with at the very least.
No problem. I wrote that approach for arbitrary past / future dates in the native Rainmeter version of my rotating Earth skin (the Javascript version doesn't require it) so it was built with that purpose in mind, but the approach should be able to be adapted to more present and "down to Earth" like scenarios, if suited and needed. JsMorley's link on that page might be of use too.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2618
Joined: March 23rd, 2015, 5:26 pm

Re: Cogs Moon Sun

Post by SilverAzide »

Mordasius wrote: May 22nd, 2023, 7:24 am Out of interest, what was it that was off by one hour? Was it the clock, the sun/moon rise times or both?
Dang, I don't recall exactly. Sorry about that. It might have been both. I first noticed in the tooltip that the local time (and clock) was off by an hour, so I traced that bit down and saw the two measures that handle that and the angles. I fixed those and then all was well. The sun/moon set/rise times match my own skins, which is not too surprising since I use Lua code I originally obtained from your old Sunset-Moonrise skin, LOL...
Gadgets Wiki GitHub More Gadgets...
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Cogs Moon Sun

Post by Mordasius »

Yincognito wrote: May 22nd, 2023, 10:39 am JsMorley's link on that page might be of use too.
Yup that's a much neater method of checking for changes to the UTC/GMT offset. I've included that along with the changes suggested by SilverAzide in the .rmskin in the first post. Thanks to you both.
User avatar
Yincognito
Rainmeter Sage
Posts: 7199
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Cogs Moon Sun

Post by Yincognito »

Mordasius wrote: May 22nd, 2023, 3:12 pm Yup that's a much neater method of checking for changes to the UTC/GMT offset. I've included that along with the changes suggested by SilverAzide in the .rmskin in the first post. Thanks to you both.
Technically, all of them are variants of the same method, only the envisioned time scope is different (any date vs recent date vs current date). AFAIK, your skin needs the latter, so it made perfect sense to focus on that and discard the rest. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Cogs Moon Sun

Post by Mordasius »

Mordasius wrote: May 22nd, 2023, 3:12 pm Yup that's a much neater method of checking for changes to the UTC/GMT offset.
Neater it may be but I've reverted to the original method of checking the current GMT/UTC offset using weather.com in the .rmskin in the first post. This allows users to see what the sun and moon are doing in any location without having to change the timezone used by their computer.