summaryrefslogtreecommitdiff
path: root/wasp/apps/calc.py
AgeCommit message (Collapse)Author
2021-12-26Optimize flash usage of calc appFrancesco Gazzetta
Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2021-10-16Calc app: fill gapsRudy Ges
Closes #262 Signed-off-by: k <k@klabz.org>
2021-01-13simulator: test_qa: Add some basic docstring testsDaniel Thompson
This one picked up a lot of inconsistancy so the changes here are pretty big. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31apps: calc: Use the UI colours to generate a backgroundDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Remember the results between invocationsDaniel Thompson
Currently if you spend more then 15 seconds looking up figures or transcribing the answer then the system will switch back to the clock and the answer will be lost. Fix this by remembering the output between invocations. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Rewrite the display and calculation engineDaniel Thompson
Currently calculations such as 22/7 do not work correctly on the simulator (which uses double precision floating point). Fix this by explicitly truncating the strings when needed. Additionally the current calculate() method has some problems when the calculation cannot be evaluated since it will needlessly clear out the calculation. Push calculate (and the exception handling) into the caller and report errors using the vibration motor instead. Finally we rename display_output() to the more idiomatic _update(). Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Optimize the fields lookup structureDaniel Thompson
Currently the fields is a list of lists of strings. This will needlessly consume RAM so lets switch it over to a simple string (which is immutable and can be stored in flash). We also replace indices with simple x and y variables. In addition to avoiding a (temporary) memory allocation this is also easier to use when looking up in fields. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Draw a closed gridDaniel Thompson
Currently the calculator uses an open grid. It's a matter of taste but I prefer a closed grid. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Correct after draw565 bug fixDaniel Thompson
Currently the coordindates used for line drawing are "tuned" for a bug in the line drawing code (and now draw off the edge of the screen). Fix this. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28apps: calc: Adopt the system theme for accent colorsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28apps: calc: Move the copyright header to the top of the file.Daniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28apps: calc: Created memory-saving calculator appJohannes Wache
Signed-off-by: Johannes Wache <jbwa@posteo.de>