Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: Add option to set timezone minutes offset & Fix wrong timezone hour offset & Add timezone dst support #3570

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

bkerler
Copy link
Contributor

@bkerler bkerler commented Dec 9, 2023

This fixes the wrong timezone hour offset range (did include only +12 but not up to +14 hours) and also introduces a timezone minutes option to select a timezone offset in minutes (0 min, 30 min and 45 min).

This addresses the issues #3550, #1779 and #3141.

As the timezone eeprom storage value is only uint8_t, the data could be further optimized and compressed into a bitstream as it also saves space, which would be possible.

My recommendation for storing the timezone data compressed in a uint8_t:
struct tz_offset{
uint8_t hours:4; // 0..14 hours offset
uint8_t mins:2; // 0=0, 1=30, 2=45 minutes offset
uint8_t summertime:1; // 0=wintertime, 1=summertime
uint8_t signed:1; // 0=negative gmt hour offset, 1=positive gmt hour offset
};

If that is wanted/needed, I can also add these needed eeprom changes as well to use a compressed structure instead.

@bkerler bkerler changed the title Add option to set timezone minutes offset & Fix wrong timezone hour offset Add option to set timezone minutes offset & Fix wrong timezone hour offset & Add timezone summertime support Dec 10, 2023
@bkerler bkerler force-pushed the Timezone branch 4 times, most recently from 0f07368 to 9b170a2 Compare December 16, 2023 18:21
@jurriaan
Copy link

Not sure how space-limited this firmware is, but embedding something like https://github.com/evq/utz would be even nicer so we would be able select the time zone and have all offsets + DST applied automatically.

@bkerler
Copy link
Contributor Author

bkerler commented Dec 18, 2023

Not sure how space-limited this firmware is, but embedding something like https://github.com/evq/utz would be even nicer so we would be able select the time zone and have all offsets + DST applied automatically.

I tried to also implement a list-based approach using a list of countries / timezone settings (without libraries). The problem is, that this would be static (353 and more timezones that change quite often) and very firmware space consuming. Especially for the mini printers it would cause huge issues because of missing space.

@bkerler bkerler changed the title Add option to set timezone minutes offset & Fix wrong timezone hour offset & Add timezone summertime support gui: Add option to set timezone minutes offset & Fix wrong timezone hour offset & Add timezone dst support Dec 21, 2023
@vorner vorner merged commit 89985d8 into prusa3d:master Jan 23, 2024
@bkerler bkerler deleted the Timezone branch January 23, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants