99 lines
3.0 KiB
Markdown
99 lines
3.0 KiB
Markdown
# Smaage Frontend Prototype
|
||
|
||
## TODO
|
||
|
||
- [x] switch save and cancel -> in case save and not abort
|
||
- [x] make recipes available through menu
|
||
- [x] remove calibration tools button in mock
|
||
|
||
## Install Requirements
|
||
|
||
```bash
|
||
uv sync
|
||
```
|
||
|
||
## Run
|
||
|
||
```bash
|
||
uv run -m frontend
|
||
```
|
||
|
||
## Navigation
|
||
|
||
- L: left press
|
||
- LL: left long press
|
||
- R: right press
|
||
- RL: right long press
|
||
- LB: long left and right press
|
||
|
||
```mermaid
|
||
stateDiagram-v2
|
||
[*] --> Main
|
||
|
||
state "Main View<br>(timer + weight)" as Main
|
||
state "Menu<br>(carousel)" as Menu
|
||
state "Bluetooth Pairing<br>(waiting for connection)" as BTPairing
|
||
state "Recipe Selection<br>(carousel)" as RecipeSelection
|
||
state "Do Recipe<br>(step-by-step)" as DoRecipe
|
||
state "Edit Recipe<br>(step list)" as EditRecipe
|
||
state "Edit Recipe – Move Mode<br>(reorder steps)" as MoveMode
|
||
state "Edit Step – Type Selection<br>(list view)" as TypeSelect
|
||
state "Edit Step – Value Entry<br>(morse input)" as ValueEntry
|
||
state "Edit Step – Goal Time Entry<br>(morse input)" as GoalTime
|
||
|
||
Main --> Menu : LB
|
||
Main --> RecipeSelection : RL
|
||
|
||
Menu --> Main : LL [back]
|
||
Menu --> BTPairing : RL [BT Pair]
|
||
Menu --> RecipeSelection : RL [Recipes]
|
||
|
||
BTPairing --> Menu : LL [cancel]
|
||
|
||
RecipeSelection --> Main : LL
|
||
RecipeSelection --> DoRecipe : RL [on recipe → run]
|
||
RecipeSelection --> EditRecipe : LB [on recipe → edit]<br>or RL [on + → add]
|
||
|
||
DoRecipe --> Main : LL [back]<br>or R [last step → done]
|
||
|
||
EditRecipe --> RecipeSelection : LL [back]<br>or RL [on save]
|
||
EditRecipe --> TypeSelect : RL [on step]<br>or RL [on + → add step]
|
||
EditRecipe --> ValueEntry : RL [on name]
|
||
EditRecipe --> MoveMode : LB [on step]
|
||
|
||
MoveMode --> EditRecipe : LB [confirm]<br>or LL [cancel]
|
||
|
||
TypeSelect --> ValueEntry : RL [type with value]
|
||
TypeSelect --> EditRecipe : RL [type w/o value → saved]<br>or RL [delete → deleted]<br>or LL [back]
|
||
|
||
ValueEntry --> EditRecipe : LL [save]<br>or L [cancel]
|
||
ValueEntry --> GoalTime : LL [WEIGH_WITH_TIMER]
|
||
|
||
GoalTime --> EditRecipe : LL [save]<br>or L [cancel]
|
||
```
|
||
|
||
## Tools
|
||
|
||
### `export_loading_frames.py`
|
||
|
||
Renders the loading screen animation and exports every unique frame as both PNG files and a NumPy array.
|
||
|
||
**Usage**
|
||
|
||
```bash
|
||
uv run export_loading_frames.py [--out-dir <directory>]
|
||
```
|
||
|
||
| Argument | Default | Description |
|
||
| ------------- | ----------- | ------------------------------------ |
|
||
| `--out-dir` | `frames/` | Directory to write output files into |
|
||
|
||
**Outputs**
|
||
|
||
| File | Description |
|
||
| ------------------------- | -------------------------------------------------- |
|
||
| `frames/frame_XXXX.png` | One PNG per unique frame, zero-padded index |
|
||
| `frames/frames.npy` | NumPy array of shape `(N, H, W)`, dtype `bool` |
|
||
|
||
Consecutive duplicate frames are collapsed so only visually distinct frames are exported. The script prints the total number of frames rendered and the number of unique frames kept.
|