Files
tactility_apps/Apps/Calculator/main/Source/Calculator.h
T
Ken Van Hoeylandt b6c27b64d4 Tactility.py 3.0.0 and SDK updates for 0.7.0-dev (#19)
- Remove `Libraries/Str`
- Replaced usage of `TactilityC` FreeRtos features with `TactilityFreeRtos` library
- Update `tactility.py`
- Removed redundant code from `TactilityCpp`
2026-01-04 02:20:06 +01:00

28 lines
699 B
C++

#pragma once
#include "tt_app.h"
#include <lvgl.h>
#include <deque>
#include <string>
#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<std::string> infixToRPN(const std::string& infix);
static double evaluateRPN(std::deque<std::string> rpnQueue);
void resetCalculator();
public:
void onShow(AppHandle context, lv_obj_t* parent) override;
};