Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ src/
├── units.rs # Unit preference types and conversions
├── normalize.rs # Field name normalization system
├── computed.rs # Computed channels data types and library
├── expression.rs # Formula parsing and evaluation engine
├── expression/
│ ├── mod.rs # Formula parsing, channel refs, time shifts, evaluation
│ └── engine.rs # Built-in expression compiler/evaluator (replaced meval)
├── updater.rs # Auto-update functionality
├── analytics.rs # Privacy-respecting analytics
├── i18n.rs # rust-i18n language/locale selection
Expand Down Expand Up @@ -160,11 +162,12 @@ src/
- `ComputedChannelLibrary` - Global persistent library stored as JSON
- Support for time-shifting: index offsets (e.g., `RPM[-1]`) and time offsets (e.g., `RPM@-0.1s`)

- **`expression.rs`** - Formula evaluation engine:
- Parses mathematical expressions using meval
- Extracts channel references with time-shift syntax
- **`expression/`** - Formula evaluation engine:
- `engine.rs` - Self-contained expression compiler/evaluator (zero deps; replaced the unmaintained meval crate while preserving its exact grammar: `+ - * / % ^` with standard precedence, right-assoc `^`, `-2^2 == -4`, variadic `min`/`max`, `pi`/`e`/`tau`/`phi` constants)
- Formulas compile once to an RPN instruction list; per-record evaluation fills variable slots from log data with no parsing, hashing, or allocation in the loop
- Extracts channel references with time-shift syntax (regex preprocessing, unchanged)
- Validates formulas against available channels
- Evaluates formulas across all log records with proper time-shifting
- Statistical variables (`_mean_X`, `_stdev_X`, ...) resolve to constants at compile time — callers must pass statistics via `evaluate_all_records_with_stats` when `formula_uses_statistics()` is true (a formula using them without statistics is now an error instead of silent zeros)

- **`updater.rs`** - Auto-update system:
- Checks GitHub releases for new versions
Expand Down Expand Up @@ -399,7 +402,6 @@ Handled in `UltraLogApp::handle_keyboard_shortcuts` (`src/app.rs`); ignored whil
- **open** (5) - Cross-platform URL/email opening
- **strum** (0.28) - Enum string conversion for channel types
- **regex** (1.12) - Log file parsing
- **meval** (0.2) - Mathematical expression evaluation for computed channels
- **ureq** (3.3) - HTTP client for auto-updates and OpenECU Alliance API
- **semver** (1.0) - Version comparison
- **serde_yml** (0.0.12) - YAML parsing for adapter/protocol specs (replaces deprecated `serde_yaml`)
Expand All @@ -420,6 +422,8 @@ Handled in `UltraLogApp::handle_keyboard_shortcuts` (`src/app.rs`); ignored whil
- **thiserror** / **anyhow** - Error handling
- **tracing** / **tracing-subscriber** - Structured logging

Computed-channel formula evaluation is handled by the built-in `src/expression/engine.rs` (no external crate — do not re-add meval or an expression-evaluator dependency; meval was removed because it was unmaintained and its `nom` 1.2.4 transitive dep will be rejected by future Rust).

## Test Data

Example log files are in `exampleLogs/` organized by ECU type:
Expand Down
27 changes: 2 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ regex = "1.12"
strum = { version = "0.28", features = ["derive"] }
rayon = "1.11" # Parallel iteration for parsing

# Expression evaluation (for computed channels)
meval = "0.2"

# Platform-specific directories
dirs = "6.0"

Expand Down
Loading
Loading