This commit is contained in:
workD12
2026-07-31 20:16:28 +03:00
commit 8e24f19a07
20 changed files with 10037 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
# rcalc
Desktop calculator for Linux/Windows/macOS, inspired by the Windows Calculator (standard mode).
Built with Rust + [Slint](https://slint.dev).
## Run
```bash
cargo run --release
# or
./dist/rcalc
```
### Icon (Linux / Wayland)
On **Wayland** the window `icon` property is ignored — the desktop uses
`.desktop` + `app_id`. Install once:
```bash
./scripts/install-desktop.sh
```
Then start **rcalc** from the app menu (or `~/.local/bin/rcalc`), not by
clicking a random binary path, so KDE/GNOME can match `app_id=rcalc` to
`rcalc.desktop` and show the icon.
## Features
- Modes: **Standard**, **Programmer**, **Convert**
- Standard: `+ − × ÷`, `%`, `±`, `1/x`, `x²`, `√x`, memory
- Programmer: simultaneous **HEX / DEC / OCT / BIN**, sizes **QWORD / DWORD / DINT / WORD / INT / BYTE**,
bitwise ops, clickable bits
(WORD/DWORD — unsigned DEC; INT/DINT — signed)
- Convert: **float32 ↔ two 16-bit words** with endian **AB CD / CD AB / BA DC / DC BA**
- Convert → **Ratio**: float → minimal **num/den** for electronic gear (Byte≤255 / Word≤65535)
- Convert → **ASCII**: Char ↔ Hex ↔ Dec (control names for NUL…DEL)
- **CRC**: Modbus RTU CRC-16 + Modbus ASCII LRC from hex bytes (`01 03 00 00 00 0A`)
- Keyboard input
## Project layout
- `src/engine.rs` — standard calculator logic
- `src/programmer.rs` — programmer mode logic
- `src/convert.rs` — float32 / word endian convert
- `src/main.rs` — UI wiring
- `ui/app.slint` — Slint interface
- `dist/rcalc` — release binary