diff options
| author | Raupinger <fgrauper@gmail.com> | 2021-02-23 08:01:58 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-06-11 04:07:35 (GMT) |
| commit | 7f08e2c63608185b741fd5270a0aee4bd225f140 (patch) | |
| tree | 4609699c5608e4d8c23659c8c5dfc31097b28a74 /src/displayapp/screens/Calculator.h | |
| parent | 2ecb4a6fc7b862280281d9ac762953cb14b7eea6 (diff) | |
Add Calculator screen as new App
A calculator based on the Shunting-yard algorithm as described
here: https://en.wikipedia.org/wiki/Shunting-yard_algorithm
Moving the Motion App into the Settings screen to use the tile in the
ApplicationList for the Calculator.
Diffstat (limited to 'src/displayapp/screens/Calculator.h')
| -rw-r--r-- | src/displayapp/screens/Calculator.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/displayapp/screens/Calculator.h b/src/displayapp/screens/Calculator.h new file mode 100644 index 0000000..25c4456 --- /dev/null +++ b/src/displayapp/screens/Calculator.h @@ -0,0 +1,37 @@ + +#pragma once + + +#include "Screen.h" +#include "components/motor/MotorController.h" +#include <array> +#include <string> + +namespace Pinetime { + namespace Applications { + namespace Screens { + + class Calculator : public Screen { + public: + ~Calculator() override; + + Calculator(DisplayApp* app, Controllers::MotorController& motorController); + + void OnButtonEvent(lv_obj_t* obj, lv_event_t event); + + bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override; + + private: + lv_obj_t *result, *returnButton, *buttonMatrix; + + char text[31]; + uint8_t position = 0; + + void eval(); + + Controllers::MotorController& motorController; + }; + + } + } +} |
