Facade

A dual world time zone analog watch face for most Garmin watches.

Analog watch face with support for dual world wide time zones, features include:

Note the red or green triangle on the outer edge of the dial. This triangle marks the hour hand position for the second time zone (or the first time zone if there is no second timezone selected). This triangle will be red to indicate AM and green to indicate PM. For example, the clock face on the left shows the local time of 10:10AM, the clock face in the middle shows the local time of 10:10PM, and the clock face on the right shows the local time of 11:33AM when it's 5:33PM in Central European Time.

The main timzone is always the analog clock in the center of the display with hour, minute, and second hands. If a second timezone is selected then the hour of that timezone is shown by the triangle on the edge of the face. If the second timezone is not Local then the 3-5 letter abbreviation for that timezone is shown at the bottom of the watch face. Note how the triangle on the outer edge tracks the minutes that have elapsed between the two hour markers. This is important for timezones that don't have a 0 minute offset as you can read the time in the second timezone just from the triangle marker (if the second timezone has a 0 minute offset the the analog minute hand is correct for that timezone).

Daylight Savings Time (DST) is automatically detected for USA/CANADA/EU. The indicated time will be moved forward during DST and the timezone abbreviation displayed with be the one for DST. For other timezones there is a setting that can be set (using Connect IQ or Garmin Express, this is no available on the watch itself as it would make the watch settings too The Main DST and Second DST settings can be set to one of 3 different values:

Timezones can be selected from one of 327 countries.

The bottom right icon changes to show the phase of the moon, all be it just an approximation of the moon phase. More details about the moon phase icon are found in the Moon Phase Indicator section.

The current heart rate is displayed in the uppper right corner (ignoring the fact that this is a round face and there are no corners), while the current step count is displayed in the bottom left corner. Battery percentage is displayed in the upper left corner, changing from green (50% - 100% charge), yellow (25% - 50%), and red (less than 25%).

You can obtain this watchface from the Connect IQ store. or by going to this direct link.

Facade is licensed under the GPL V3.0. The latest source tree is available for browsing here and tarballs for the latest and older versions are located at the following links:

Configuration

The watch face can be configured from the Connect IQ store, the Garmin Express app, or the watch itself. The most convenient way to configure things is from the on device settings (screenshots of these settings are pictured above) on the watch itself: Note that there is no way to cancel changes, the only way out of the configuration menu is to press the back button which will save the current settings.

Timezone configuration

The problem with using the watch itself to configure timezones is that scrolling through 327 timezone options on a limited display is painful in the extreme. To alleviate this problem Facade restricts which timezones you can select from the on device settings.

Every time you use the Connect IQ or the Garmin Express app to set a new timezone (either the main or secondary timezone) the watch will store that timezone in a timezone cache (the cache contains no more than 16 entries and the same cache is used for both the main and secondary timezone) on the watch itself. When setting the timezone through the on device settings you can only select a timezone that is in that cache. For example, I live in the US where we have 6 major timezones. I use the Connect IQ app to configure each of those timezones once and then I can easily use the on device settings to set any US timezone I want. Note that you can always set any of the 327 timezones from the Connect IQ or Garmin Express apps, it's only the on device settings that are limited to the timezone cache.

Other settings

Moon Phase Indicator

The moon phase is displayed as one of the above 8 different icons going from new moon to full moon and back. The new moon and full moon icons are in white to distinguish them from all the other phases. Waxing phases are in green while waning phases are in tan.

Moon phase approximation

(Basically an apology for why Facade is only approximately correct about moon phases.)

There are two issues that make identifying the correct moon phase extremely hard:

This makes computing the precise moon phase extremely difficult and way beyond the capabilities of Facade.

Having said that, Facade attempts to be fairly accurate. It calculates the current lunar day by comparing the current date to the reference date of the new moon on January 1, 1900, modulo 29.5(30588853). This calculation seems to be fairly accurate (it is certainly correct for the 44,206 days from the new moon on January 1, 1900 to the new moon on January 12, 2021). This results in a lunar day of 1 - 29 (actually, some months it turns out to be 1-30 because of roundoff with the lunar period).

The lunar day is then converted to one of 8 icons (representing the moon waxing from new moon to full moon and then waning from full moon to new moon), each icon representing 2-3 days for that particular moon phase. This conversion is offset by 1 day so that the icon appears for the day before the phase, the actual phase itself and then 1 day after the phase (give or take a day depending upon rounding errors).

Building from soure

Building from source is just a matter of installing the source tree in Monkey C Visual Code Studio and then do a build, that should work just fine.

The problem comes in if you need to change the timezone data like adding a new timezone or deleting one. By definition the Garmin architecture requires at least 2 linked source files, the settings.xml file that shows the timezones presented to the user in the settings app and the actual timezone data that is encoded in an MC code file.1 The basic design is to do just that, the settings.xml entries have an index that selects the appropriate entry from the timezone data table.

There are 2 problems with this basic design:

The scond problem is solved by breaking up the timezone data into 50 entry chunks and then storing each chunk is a separate MC file. This way the code only has to have in memory 50 timezone entries at a time rather than 327. The code in Tz.mc does the translation from one of the 327 timezone indices to an appropriate index in the appropriate TzData file.

This unfortunately makes the first problem (keeping multiple files in sync) even worse as now have to keep 7 files (settings.xml and 6 different timezone data files) in sync rather than just two.

The solution is to maintain a canonical timezone data base file, support/country.txt and use the Pearl script support/tz.pl to extrace everything we need from the data file. Running the command tz.pl support/country.txt will generate a settings.xml file and the 6 different TzData files. After generating these 7 files you have to manually (sorry about that, there doesn't seem to be a way to do includes in settings files) add the generated lines in settings.xml to the appropriate places in the actual resources/settings/settings.xml file. Then copy all of the TzData files into source/TzInfo and you should be ready to build.


1. What I really wanted to do was to define a unique table of timezone data and then have the entries in the settings.xml file index into the appropriate entry in that table. Since there are multiple countries that share the same timezone this would reduce the table size needed in the code by about a factor of 2. Unfortunately, that design is not possible because arrays in the settings.xml file have to have unique indices.