...and move GameOfLife out to make space
The gallery app needs too much memory to run from bytecode, and has to
be frozen in micropython.zip instead
Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
When I created the weather app I didn't have GadgetBridge installed, so I tried to follow the protocol on the [espurino website](https://www.espruino.com/Gadgetbridge), but it wasn't very helpful and I made some mistakes. This commit should fix these mistakes to stop the weather app from crashing, and so it displays the correct values. I have also added a new settings option called "Units", where apps can see what units the user would prefer (metric/imperial).
Signed-off-by: Tait Berlette <54515877+taitberlette@users.noreply.github.com>
Currently the final word of wrapped text will always appear as a single
word on its own line. Fix this by rearranging the break cases to avoid
searching for the most recent space when we get to the end of the text.
Fixes: #230
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Reduce the number of applications imported by the manager and alter
the way applications are initially registered to allow main.py
complete control over the initial applications (but only if it wants
it).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This app is functional... although it lacking in almost every
costmetic way, from the icon to the main screen.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This is purely a refactoring for the purposes of code reuse. No change
of behaviour is expected.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the ChronoApp example code is both broken (missing apps. prefix)
and doesn't use the latest API for registering watch faces. Fix this.
Whilst here let's also provide an example for the DemoApp since that
is not included in the Software chooser.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The demo app is of somewhat niche interest and is disabled by default
but arguable that makes it more important to document it fully since
this app is harder to find the many others.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This app is enabled by default and allows users to select a watch face
based on a fullscreen preview of how the app will draw the screen.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
wasp-os uses an drawing optimization technique to automatically place
a single pixel line on the right of glyphs when rendering them. This
results in a change to the bounding box for a rendered string (by adding
a single pixel on the right of the final character). Fix the bounding box
calculations accordingly. Among other things this eliminates graphical
artifacts when rendering labels in 2048.
Fixes: #203
Fixes: 58b5c0378e ("draw565: Optimize the string drawing")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: thefenriswolf <stefan.rohrbacher97@gmail.com>
[daniel@redfelineninja.org.uk: fixed up the manifest]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Benoît HERVIER <b@rvier.fr>
[daniel@redfelineninja.org.uk: Removed unused dual clock fonts from
clock_dual.py, fixed up the manifest]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently, if we ask the simulator to draw out-of-bounds then it will
do exactly that, it will draw outside of the "screen" and corrupt the
pixels of the watch frame that surrounds it. This is an obviously poor
simulation of the real watch and when the out-of-bounds error is only
an out-by-one error can be easily overlooked until we load the code on
the device.
Let's just throw an exception if we draw out-of-bounds. That can easily
be picked up during testing.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The code is not yet enabled by default but it can be tested by adding
custom code to an interested user's main.py .
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Add tests to make sure every app has a screenshot... and fix the
problems picked up by the new tests!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently many first-time users excitedly install wasp-os and then
struggle to set the time using the various BLE based methods
(REPL, wasptool, GadgetBridge, etc). This results in "is there
another way to set the time" being *the* frequently asked
question.
Whilst getting the BLE tools is highly recommened to get the best
from wasp-os we can delivery a better out-of-the-box experience
for first time users is we provide on board date/time setting.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2048 is a popular sliding block puzzle game in which tiles are combined
to make the number 2048.
It's one of the few games that are enjoyable to play on such a small
form factor.
This started as a port of a TkInter implementation of the 2048 game. I
implemented all of the TkInter APIs used by the game and it worked on
wasp-os without any code change in the game. However, the performance
was very poor and it consumed too much RAM. I have since reimplemented
the whole game from scratch and managed to achieve acceptable
performance, although more improvements could still be made.
Because names in Python can't start with numbers, I had some trouble
naming things. The module is called "ttfe" (two-thousand-forty-eight),
the class name is Play2048App, and the software.py entry is "Play 2048".
Signed-off-by: Miguel Rochefort <miguelrochefort@gmail.com>
[daniel@redfelineninja.org.uk: Renamed the python filename, normalized
the screenshot and included the app in the docs]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Wolfgang Ginolas <wolfgang.ginolas@gwif.eu>
[daniel@redfelineninja.org.uk: squashed into a single commit, rebase to
latest master, integrate with the Software application and rename the
screenshots to match the application name]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the simulator shows redraw artifacts that are concealed
on the real device by using display on/off. We can improve this by
avoiding the refresh when the display is off. This does not match
the behaviour of the real hardware (which goes dark during transitions)
but does make the simulator feel much more comfortable to use.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Relaunching the simulator to run tests quickly gets frustrating if
the Self Test is disabled by default. Change this.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Replace the pixelated Yes/No buttons with text based alternatives.
This also required changes to the pager to change the way the
redraw after changing view is implemented (improved muting and a reset
of the colours).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Enabling software by default allows us disable several other applications
by default because there is now a GUI based route to enable them.
This does require a few tweaks to the test suite and allows allows us to
remove a lot of boilerplate text from the application library document
since it is no longer relavent.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Add functions to generate shades from a single (usually theme provided)
basic palette colour.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently `make check` doesn't test any not-default applications.
Fix this by automatically discovering constructors and ensure that the
application can be started and stopped without generating an exception.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This makes the simulator look nicer when it starts up... but it
doesn't help the simulator.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently we can act on the controls but we cannot "see" the display
in the test suite. That leads us to a slightly odd form of "grey box"
testing. It's functionally black box testing but some of the asserts
have to reach inside the components instead of looking at the display.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the tests do little more than fire up the simulator and
switch into (and out of) the built in applications. However this is
useful and allows us to fully integrate as a CI job.
Unfortunately the numpy warning from pysdl2 mean we have been forced
to disable all warnings to prevent pytest from collecting and reporting
them.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Carlos Gil Gonzalez <carlosgilglez@gmail.com>
[daniel@redfelineninja.org.uk: Fixed board support for simulator and
sphinx (a.k.a. doc builder)]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>