Files
tactility_apps/Apps/Calculator/main/Source/Calculator.h
T
Ken Van Hoeylandt b39bd6b6f5 Simplify app registration with TactilityCpp (#7)
- Simplified app registration with a C++ wrapper for the TactilityC.
- Rename the various app classes from `Application` to more specific names like `Calculator` etc.
2025-10-05 22:38:26 +02:00

28 lines
674 B
C++

#pragma once
#include "tt_app.h"
#include <lvgl.h>
#include <deque>
#include <Str.h>
#include <TactilityCpp/App.h>
class Calculator final : public App {
lv_obj_t* displayLabel;
lv_obj_t* resultLabel;
char formulaBuffer[128] = {0}; // Stores the full input expression
bool newInput = true;
static void button_event_cb(lv_event_t* e);
void handleInput(const char* txt);
void evaluateExpression();
double computeFormula();
static std::deque<Str> infixToRPN(const Str& infix);
static double evaluateRPN(std::deque<Str> rpnQueue);
void resetCalculator();
public:
void onShow(AppHandle context, lv_obj_t* parent) override;
};