b6c27b64d4
- Remove `Libraries/Str` - Replaced usage of `TactilityC` FreeRtos features with `TactilityFreeRtos` library - Update `tactility.py` - Removed redundant code from `TactilityCpp`
28 lines
699 B
C++
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;
|
|
}; |