You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `AppFrame` class is the core data structure that acts as a bridge between the different components. It extends the base `Frame` class to add application-specific metadata like `id`, `name`, `position`, and `duration`.
96
+
The Python backend manages the application logic, database, and hardware communication.
97
97
98
-
It handles three distinct data contracts:
99
-
-**API Contract**: `to_json()` / `from_json()` formats data for the web frontend.
100
-
-**Database Contract**: `to_record()` / `from_record()` formats data for `SQLStore` storage.
101
-
-**Hardware Contract**: `to_board_bytes()` packs pixels into the specific byte format expected by the Arduino sketch.
98
+
-**Data Model (`app_frame.py`)**: The `AppFrame` class is the core data structure that acts as a bridge between the different components. It extends the base `Frame` class to add application-specific metadata like `id`, `name`, `position`, and `duration`. It handles three distinct data contracts:
99
+
-**API Contract**: `to_json()` / `from_json()` formats data for the web frontend.
100
+
-**Database Contract**: `to_record()` / `from_record()` formats data for `SQLStore` storage.
101
+
-**Hardware Contract**: `to_board_bytes()` packs pixels into the specific byte format expected by the Arduino sketch.
102
102
103
103
```python
104
104
classAppFrame(Frame):
@@ -113,10 +113,6 @@ class AppFrame(Frame):
113
113
}
114
114
```
115
115
116
-
### 🔧 Backend (`main.py` & `store.py`)
117
-
118
-
The Python backend manages the application logic, database, and hardware communication.
119
-
120
116
-**Initialization**:
121
117
-`designer = FrameDesigner()`: Initializes the frame designer utility from `arduino.app_utils`, which provides the logic for transformation operations (invert, rotate, flip).
122
118
-`store.init_db()`: Creates the SQLite database and tables for storing frames if they don't exist.
0 commit comments