Epic: Add multiplexing, attributes, J1939 support, and decoded trace export
Description
Extend the DBC core and trace workflow to handle more realistic vehicle databases and export decoded recordings. Deliver this stage incrementally through separate implementation tasks while preserving the shared decoder for live CAN input and trace replay.
Workstreams
1. Multiplexed signals
Represent multiplexor selectors and multiplexed signal conditions in parsed and runtime metadata.
Parse basic M and mN signal markers with strict validation.
Decode the selector first and decode only the signals active for its raw value, while continuing to decode unconditional signals.
Define how inactive signals are represented so consumers can distinguish them from malformed definitions or insufficient payloads.
Validate selector references and allow overlapping bit positions only where multiplexing conditions make them mutually exclusive.
Specify extended or nested multiplexing support explicitly; reject unsupported forms rather than silently interpreting them as ordinary signals.
2. DBC attributes
Add handlers and metadata for BA_DEF_, BA_DEF_DEF_, and BA_ statements.
Support typed definitions, defaults, and assigned values for an explicitly documented set of object scopes.
Validate attribute references, types, and declared ranges.
Preserve relevant attributes in downstream metadata without coupling the core to Qt.
Document which attributes remain metadata and which, if any, affect runtime behavior.
3. J1939 behavior
Make J1939 interpretation explicit rather than assuming every extended CAN frame is J1939.
Validate PGN extraction and matching for PDU1 and PDU2 identifiers, including the relevant page bits.
Provide an explicit J1939 matching policy that can match a PGN across source addresses and handle destination addresses appropriately.
Preserve exact (canId, isExtended) lookup for ordinary CAN databases.
Define ambiguous-match behavior and expose useful PGN/address metadata to consumers.
Keep transport-protocol reassembly outside the initial scope unless separately specified.
4. Decoded trace CSV export
Choose and document an initial trace input format and CSV schema before implementation.
Adapt trace records to the same RawCanFrame and decoder used for live traffic.
Preserve timestamps and export frame/signal identity, exact raw values, physical values, units, and VAL_ descriptions when available.
Define output policies for unknown frames, inactive multiplexed signals, and invalid payloads.
Escape CSV fields correctly and use deterministic numeric formatting.
Process recordings incrementally without requiring the complete trace in memory.
Acceptance criteria
Multiplexing tests demonstrate that inactive branches are not decoded as active data.
J1939 tests cover PDU1/PDU2 PGNs, source/destination address handling, and ordinary extended CAN behavior.
An end-to-end fixture parses a DBC, decodes a timestamped trace, and produces the documented CSV output.
Exact signed and unsigned raw values survive CSV export, including 64-bit boundaries.
Unsupported syntax or protocol features are documented and handled explicitly.
Existing parser and decoder regressions continue to pass.
README documents the supported features and includes a reproducible trace-export example.
Delivery plan
Multiplexing support.
Attribute parsing and metadata.
Explicit J1939 interpretation and matching.
Trace reader and decoded CSV export.
Create focused child issues and branches for these workstreams as their implementation approaches are agreed. This epic tracks the overall milestone rather than a single large change.
Out of scope
Live plotting, signal subscriptions, J1939 transport-protocol reassembly, full DBC grammar coverage, and support for every trace format.
Dependencies
Build on strict signal validation and VAL_ metadata. The Qt model adapter can expose the resulting metadata but is not a prerequisite for core decoding or CSV export.
# Epic: Add multiplexing, attributes, J1939 support, and decoded trace export
## Description
Extend the DBC core and trace workflow to handle more realistic vehicle databases and export decoded recordings. Deliver this stage incrementally through separate implementation tasks while preserving the shared decoder for live CAN input and trace replay.
## Workstreams
### 1. Multiplexed signals
- Represent multiplexor selectors and multiplexed signal conditions in parsed and runtime metadata.
- Parse basic `M` and `mN` signal markers with strict validation.
- Decode the selector first and decode only the signals active for its raw value, while continuing to decode unconditional signals.
- Define how inactive signals are represented so consumers can distinguish them from malformed definitions or insufficient payloads.
- Validate selector references and allow overlapping bit positions only where multiplexing conditions make them mutually exclusive.
- Specify extended or nested multiplexing support explicitly; reject unsupported forms rather than silently interpreting them as ordinary signals.
### 2. DBC attributes
- Add handlers and metadata for `BA_DEF_`, `BA_DEF_DEF_`, and `BA_` statements.
- Support typed definitions, defaults, and assigned values for an explicitly documented set of object scopes.
- Validate attribute references, types, and declared ranges.
- Preserve relevant attributes in downstream metadata without coupling the core to Qt.
- Document which attributes remain metadata and which, if any, affect runtime behavior.
### 3. J1939 behavior
- Make J1939 interpretation explicit rather than assuming every extended CAN frame is J1939.
- Validate PGN extraction and matching for PDU1 and PDU2 identifiers, including the relevant page bits.
- Provide an explicit J1939 matching policy that can match a PGN across source addresses and handle destination addresses appropriately.
- Preserve exact `(canId, isExtended)` lookup for ordinary CAN databases.
- Define ambiguous-match behavior and expose useful PGN/address metadata to consumers.
- Keep transport-protocol reassembly outside the initial scope unless separately specified.
### 4. Decoded trace CSV export
- Choose and document an initial trace input format and CSV schema before implementation.
- Adapt trace records to the same `RawCanFrame` and decoder used for live traffic.
- Preserve timestamps and export frame/signal identity, exact raw values, physical values, units, and `VAL_` descriptions when available.
- Define output policies for unknown frames, inactive multiplexed signals, and invalid payloads.
- Escape CSV fields correctly and use deterministic numeric formatting.
- Process recordings incrementally without requiring the complete trace in memory.
## Acceptance criteria
- [ ] Multiplexing tests demonstrate that inactive branches are not decoded as active data.
- [ ] Attribute tests cover definitions, defaults, assigned values, invalid references, and type/range errors.
- [ ] J1939 tests cover PDU1/PDU2 PGNs, source/destination address handling, and ordinary extended CAN behavior.
- [ ] An end-to-end fixture parses a DBC, decodes a timestamped trace, and produces the documented CSV output.
- [ ] Exact signed and unsigned raw values survive CSV export, including 64-bit boundaries.
- [ ] Unsupported syntax or protocol features are documented and handled explicitly.
- [ ] Existing parser and decoder regressions continue to pass.
- [ ] README documents the supported features and includes a reproducible trace-export example.
## Delivery plan
- [ ] Multiplexing support.
- [ ] Attribute parsing and metadata.
- [ ] Explicit J1939 interpretation and matching.
- [ ] Trace reader and decoded CSV export.
Create focused child issues and branches for these workstreams as their implementation approaches are agreed. This epic tracks the overall milestone rather than a single large change.
## Out of scope
Live plotting, signal subscriptions, J1939 transport-protocol reassembly, full DBC grammar coverage, and support for every trace format.
## Dependencies
Build on strict signal validation and `VAL_` metadata. The Qt model adapter can expose the resulting metadata but is not a prerequisite for core decoding or CSV export.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Epic: Add multiplexing, attributes, J1939 support, and decoded trace export
Description
Extend the DBC core and trace workflow to handle more realistic vehicle databases and export decoded recordings. Deliver this stage incrementally through separate implementation tasks while preserving the shared decoder for live CAN input and trace replay.
Workstreams
1. Multiplexed signals
MandmNsignal markers with strict validation.2. DBC attributes
BA_DEF_,BA_DEF_DEF_, andBA_statements.3. J1939 behavior
(canId, isExtended)lookup for ordinary CAN databases.4. Decoded trace CSV export
RawCanFrameand decoder used for live traffic.VAL_descriptions when available.Acceptance criteria
Delivery plan
Create focused child issues and branches for these workstreams as their implementation approaches are agreed. This epic tracks the overall milestone rather than a single large change.
Out of scope
Live plotting, signal subscriptions, J1939 transport-protocol reassembly, full DBC grammar coverage, and support for every trace format.
Dependencies
Build on strict signal validation and
VAL_metadata. The Qt model adapter can expose the resulting metadata but is not a prerequisite for core decoding or CSV export.