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

watchfaces: add LCARS #2072

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

w4tsn
Copy link

@w4tsn w4tsn commented Jun 3, 2024

This adds an LCARS watchface, a UI known from the Star Trek series.

The following issues are still open and I might need a hand with these:

  • the background image is around 170 kB. I suspect because of it's size (240x240) and the embedded text. This could be reduced by a lot I guess if converted to point-rendering in lvgl similar to Infineat
  • there are alignment issues currently only solvable through calling the lv_obj_align function (again) after calling the local label_make function, which I added to reduce duplicate code
  • coming from the settings screen the watchface loads quite slowly, probably because of the size of the background image
  • needs rebase to latest development branch, currently tracks 1.14.0
  • the app is currently fully integrated (as default in the build) because I did not catch how to make it a "UserApp" that can be selected when invoking cmake

Screenshot from 2024-06-03 18-34-32

image

Screencast.from.2024-06-03.18-34-02.webm

EDIT: here the pre-build OTA files for the firmware and resources.

pinetime-mcuboot-app-dfu-1.14.0.zip
infinitime-resources-1.14.0.zip

This adds an LCARS watchface, a UI known from the Star Trek series.

The following issues are still open and I might need a hand with these:

- the background image is around 170 kB. I suspect because of it's size
  (240x240) and the embedded text. This could be reduced by a lot I
  guess if converted to point-rendering in lvgl similar to Infineat
- there are alignment issues currently only solvable through calling the
  lv_obj_align function (again) after calling the local label_make
  function, which I added to reduce duplicate code
- coming from the settings screen the watchface loads quite slowly,
  probably because of the size of the background image
- needs rebase to latest development branch, currently tracks 1.14.0
@w4tsn w4tsn mentioned this pull request Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed

@ljahn
Copy link

ljahn commented Jun 4, 2024

I'm more of a TNG fan 😉 but this looks nice 👍

Having the background as an image really is using a lot of storage space. Alas, you can not render images from the SPI flash, so making this fit is going to be difficult. Have you been able to run it on the device, not the simulator?
If you decide to convert it to be rendered "vector graphics style" with lvgl, watch out for the heap memory usage. If you go crazy detailed (like I did once with my watch face), you can easily fill the heap completely and get weird behaviour that does not show on the sim.
For an immediate size decrease of the background picture, you could also use one of lvgl's indexed color modes. If you convert to 4 or 8 bit indexed color, you can only have 16 or 265 colors, respectively (16 will certainly make your curves look less anti-aliased), but the storage use would decrease to 29kB or 58kB.

You alignment issue is a funny one that definitely never happened to anyone I know 😉.
You pass the value -5 to an argument of type uint8_t.

Edit: Marked wrong statement

@w4tsn
Copy link
Author

w4tsn commented Jun 5, 2024

I'm more of a TNG fan 😉 but this looks nice 👍

Thanks! Your TNG Version is also pretty cool, but as you can guess I'm more of a Voyager fan :D

Having the background as an image really is using a lot of storage space. Alas, you can not render images from the SPI flash, so making this fit is going to be difficult. Have you been able to run it on the device, not the simulator? If you decide to convert it to be rendered "vector graphics style" with lvgl, watch out for the heap memory usage. If you go crazy detailed (like I did once with my watch face), you can easily fill the heap completely and get weird behaviour that does not show on the sim. For an immediate size decrease of the background picture, you could also use one of lvgl's indexed color modes. If you convert to 4 or 8 bit indexed color, you can only have 16 or 265 colors, respectively (16 will certainly make your curves look less anti-aliased), but the storage use would decrease to 29kB or 58kB.

Thanks, I'll look into that!

You alignment issue is a funny one that definitely never happened to anyone I know 😉. You pass the value -5 to an argument of type uint8_t.

Oh my....

@ljahn
Copy link

ljahn commented Jun 5, 2024

Alas, you can not render images from the SPI flash

This is wrong. I got mixed up while thinking about how I went to optimize the storage needs of my development.
I tried to save space by re-using duplicate parts, but I could not get the rotation features of lvgl to work.
It turned out it is not possible to rotate images that are displayed from the SPI flash.

You clearly can render images from SPI flash (actually you do it). But I would also think this is the reason the watch face loads slowly.
Nevertheless indexed color will probably speed things up by giving you size reduction.

@L3br4nd
Copy link

L3br4nd commented Jun 25, 2024

@w4tsn I really like this watchface. Do you think it is possible to additionally add the current weather information? Probably the most useful way would be to make it configurable. E.g. I don't use the heart rate measurement because it drains the battery so fast but I like to know the (rough) temperature. An option to configure the available information like in the PineTimeStyle watchface were awesome but I understand if this takes some time since it increases the complexity of the watch face considerably.

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.

None yet

3 participants