Skip to content

Conversation

@SomethingNew71
Copy link
Collaborator

This PR integrates UltraLog with the https://github.com/ClassicMiniDIY/OECUASpecs, providing standardized adapter and protocol definitions for ECU log parsing and CAN bus communication. Additionally, all Rust dependencies have been reviewed and updated to their latest compatible versions.

📋 Changes Overview

🔧 OpenECU Alliance Adapter & Protocol Integration

Core Architecture:

  • Git submodule: Integrated OECUASpecs repository at spec/OECUASpecs/
  • Build system: Added build.rs with automatic spec download fallback if submodule is missing
  • New modules: Created src/adapters/ for spec-driven parsing and metadata

Adapters (Log File Formats):

  • ✅ 8 adapter specs embedded at compile-time: Haltech NSP, ECUMaster EMU CSV, Link LLG, AiM XRK, RomRaider CSV, Speeduino MLG, rusEFI MLG, Emerald LG
  • ✅ Spec-driven channel normalization using source_names arrays
  • ✅ Channel metadata enrichment (min/max ranges, precision, categories)
  • ✅ Integration with existing normalize.rs (spec as fallback after custom/built-in mappings)

Protocols (CAN Bus Definitions):

  • ✅ 9 protocol specs embedded: Haltech, ECUMaster, Speeduino, rusEFI, AEM, Megasquirt, MaxxECU, Syvecs, Emtron
  • ✅ Protocol registry API: get_protocols(), get_protocol_by_id(), find_protocols_by_vendor()
  • ✅ Type definitions: ProtocolSpec, MessageSpec, SignalSpec with full CAN message structure
  • 🔮 Future: Real-time CAN streaming, message encoding/decoding, DBC export

Enhanced Parsers:

  • AiM parser (src/parsers/aim.rs): Added comprehensive unit inference from channel names (230+ lines)
    • Recognizes 15+ unit types: RPM, temperature, pressure, speed, g-force, angles, lambda/AFR, etc.
    • Smart pattern matching for AiM data logger conventions
  • Channel metadata (src/parsers/types.rs): New methods on Channel enum:
    • display_min() / display_max(): Spec-aware range detection
    • precision(): Decimal place precision from specs
    • category(): Channel categorization (Engine, Fuel, Boost, Ignition, etc.)
    • spec_metadata(): Full ChannelMetadata struct access

Normalization Priority:

  1. Custom user mappings (highest priority)
  2. Built-in hard-coded mappings
  3. OpenECU Alliance spec source_names (fallback)

📦 Dependency Updates

Major Updates (Patch/Minor):

  • eframe: 0.33 → 0.33.3 (GUI framework)
  • egui_plot: 0.34 → 0.34.0 (plotting library)
  • egui_extras: 0.33 → 0.33.3 (extra widgets)
  • rust-i18n: 3 → 3.1 (internationalization)
  • thiserror: 2.0 → 2.0.17 (error handling)
  • ureq: 3.0 → 3.1 (HTTP client for auto-updates)
  • objc2: 0.6 → 0.6.3 (macOS Objective-C bindings)
  • objc2-foundation: 0.3 → 0.3.2 (macOS Foundation bindings)

Transitive Updates:

  • 38 indirect dependencies updated via cargo update

Deferred (Breaking Changes):

  • zip: 2.2 → 7.0 available (requires API refactoring in updater)
  • printpdf: 0.7 → 0.8 available (extensive API redesign for PDF export)

Version Bump:

  • UltraLog: 2.1.2 → 2.1.4

🎯 Key Benefits

  1. Standardization: Adopts industry-standard OpenECU Alliance specs for cross-platform compatibility
  2. Extensibility: New ECU formats can be added via YAML specs without code changes (future)
  3. Metadata Enrichment: Charts and UI can leverage spec-defined min/max ranges and precision
  4. CAN Protocol Foundation: Groundwork for real-time CAN bus streaming support
  5. Maintainability: Reduced hard-coded normalization mappings, easier to update
  6. Community: Aligns with OpenECU Alliance ecosystem and shared spec repository
  7. Up-to-date Dependencies: Latest bug fixes and performance improvements

📁 New Files

  • spec/OECUASpecs/ - Git submodule (17 YAML specs)
  • ULTRALOG_INTEGRATION.md - Comprehensive integration documentation
  • UltraLog.code-workspace - VS Code workspace configuration
  • build.rs - Build script for spec embedding
  • src/adapters/mod.rs - Module exports
  • src/adapters/types.rs - 490 lines: Adapter/Protocol type definitions
  • src/adapters/registry.rs - 355 lines: Spec loading and lookup APIs

🔍 Modified Files

  • src/parsers/aim.rs - Added unit inference (+231 lines)
  • src/parsers/types.rs - Added metadata methods (+197 lines)
  • src/normalize.rs - Integrated spec-based normalization (+37 lines)
  • src/lib.rs - Exported adapters module
  • Cargo.toml - Updated dependencies, added serde_yaml
  • Cargo.lock - Locked updated dependency versions
  • README.md - Updated build instructions
  • .gitmodules - Added OECUASpecs submodule

✅ Testing

  • ✅ Build: Release build successful
  • ✅ Tests: All 177 tests passing
  • ✅ Parsers: Existing parser tests validate backward compatibility
  • ✅ Adapters: Adapter registry tested with embedded specs

📚 Documentation

Comprehensive integration guide added: ULTRALOG_INTEGRATION.md

  • Architecture diagrams
  • API usage examples
  • Normalization flow
  • Future roadmap

🚧 Future Work (Not in This PR)

  • Runtime adapter loading from user config directory
  • Generic CSV/binary parser driven entirely by specs
  • CAN bus message encoder/decoder
  • Real-time CAN streaming with protocol specs
  • DBC file export from protocol definitions
  • Adapter marketplace integration
  • Migration to zip v7.0 and printpdf v0.8 (breaking changes)

🔗 Related Links

…c adapters moving forward

Signed-off-by: Cole Gentry <peapod2007@gmail.com>
Signed-off-by: Cole Gentry <peapod2007@gmail.com>
Signed-off-by: Cole Gentry <peapod2007@gmail.com>
Signed-off-by: Cole Gentry <peapod2007@gmail.com>
@SomethingNew71 SomethingNew71 added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 13, 2026
@SomethingNew71 SomethingNew71 marked this pull request as ready for review January 13, 2026 17:52
- Updates rfd from 0.16 to 0.17.2
- Resolves ashpd v0.11.0 + zbus v5.13.1 incompatibility on Linux
- rfd v0.17 removes problematic Linux portal dependencies
- All 177 tests passing

Fixes #CI-Linux-Build-Failure
@SomethingNew71 SomethingNew71 merged commit 54cc78e into main Jan 14, 2026
9 checks passed
@SomethingNew71 SomethingNew71 deleted the ultra-spec branch January 14, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants