This commit is contained in:
deeaitch committed 2026-10-13 08:05:40 -04:00
1 parent 0708316a37
commit 7022c84941
69 files changed
+2696 -1912

No files matched your search

+100 -82
View File
@@ -93,8 +93,8 @@ $(document).ready(function(){initNavTree('md_README.html',''); initResizable();
<div class="headertitle"><div class="title">DBC Parser and Runtime Decode Module Documentation</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="autotoc_md23"></a> </p>
<h1><a class="anchor" id="autotoc_md24"></a>
<div class="textblock"><p><a class="anchor" id="autotoc_md26"></a> </p>
<h1><a class="anchor" id="autotoc_md27"></a>
Overview</h1>
<p>This module provides a minimal but extensible DBC parser and runtime decode foundation for the <b>FrameTap</b> project.</p>
<p>Its purpose is to:</p>
@@ -116,10 +116,10 @@ Overview</h1>
<p>The core library uses C++17 and has no Qt dependency. Qt integration targets the installed Qt 6.8.2, which is the only supported Qt version. Qt Core and Qt Test are used by the regression tests; model tests also link QtGui for graphical metatypes. The optional adapter requires only Qt Core. Live CAN acquisition, trace-file readers, are left to the consuming application. An optional Qt Core model adapter is provided in <code>qt/</code>.</p>
<p>See <a class="el" href="md_changelog.html">changelog.md</a> for the release and development history, <a class="el" href="md_tests_2README.html">tests/README.md</a> for test instructions, and <a href="docs/html/index.html">generated API documentation</a> for the API reference.</p>
<hr />
<h1><a class="anchor" id="autotoc_md26"></a>
<h1><a class="anchor" id="autotoc_md29"></a>
High-Level Architecture</h1>
<p>The module is divided into two main paths.</p>
<h2><a class="anchor" id="autotoc_md27"></a>
<h2><a class="anchor" id="autotoc_md30"></a>
1. Parse and UI path</h2>
<p>Used for:</p>
<ul>
@@ -139,7 +139,7 @@ High-Level Architecture</h1>
<div class="line">TreeNode hierarchy</div>
<div class="line"> ↓</div>
<div class="line">DbcTreeModel → Qt views</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md28"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md31"></a>
2. Runtime decode path</h2>
<p>Used for:</p>
<ul>
@@ -164,7 +164,7 @@ High-Level Architecture</h1>
</div><!-- fragment --><p>This separation is intentional.</p>
<p>The tree is useful for UI, but it is <b>not</b> the main data structure for runtime decoding.</p>
<hr />
<h1><a class="anchor" id="autotoc_md30"></a>
<h1><a class="anchor" id="autotoc_md33"></a>
Why the Runtime Decode Layer Exists</h1>
<p>A tree structure is convenient for browsing, but a runtime decoder needs something different:</p>
<ul>
@@ -181,7 +181,7 @@ Why the Runtime Decode Layer Exists</h1>
</ul>
<p>This avoids forcing UI-oriented structures into a decode role they were not meant for.</p>
<hr />
<h1><a class="anchor" id="autotoc_md32"></a>
<h1><a class="anchor" id="autotoc_md35"></a>
Module Layout</h1>
<div class="fragment"><div class="line">core/ C++17 parser, statement handlers, metadata, tree, and decoder</div>
<div class="line">examples/ Command-line demo (built separately)</div>
@@ -209,9 +209,9 @@ Module Layout</h1>
<td class="markdownTableBodyNone">Build integration </td><td class="markdownTableBodyNone"><code>core/core.pro</code>, <code>core/core_files.pri</code>, <code>core/core.pri</code> </td></tr>
</table>
<hr />
<h1><a class="anchor" id="autotoc_md34"></a>
<h1><a class="anchor" id="autotoc_md37"></a>
Parsed Data Structures</h1>
<h1><a class="anchor" id="autotoc_md35"></a>
<h1><a class="anchor" id="autotoc_md38"></a>
&lt;tt&gt;SignalInfo&lt;/tt&gt;</h1>
<p>Represents one signal as parsed from the DBC file.</p>
<p>Fields:</p>
@@ -238,7 +238,7 @@ Parsed Data Structures</h1>
<p>Physical value rule:</p>
<div class="fragment"><div class="line">physical = raw * factor + offset</div>
</div><!-- fragment --><hr />
<h1><a class="anchor" id="autotoc_md37"></a>
<h1><a class="anchor" id="autotoc_md40"></a>
&lt;tt&gt;FrameInfo&lt;/tt&gt;</h1>
<p>Represents one frame as parsed from the DBC file.</p>
<p>Fields:</p>
@@ -260,7 +260,7 @@ Parsed Data Structures</h1>
<li><code>pgn</code> is derived using simplified J1939 logic when applicable</li>
</ul>
<hr />
<h1><a class="anchor" id="autotoc_md39"></a>
<h1><a class="anchor" id="autotoc_md42"></a>
&lt;tt&gt;DbcDatabase&lt;/tt&gt;</h1>
<p>Top-level parsed DBC container.</p>
<p>Conceptually:</p>
@@ -268,9 +268,9 @@ Parsed Data Structures</h1>
<div class="line"> └── vector&lt;FrameInfo&gt;</div>
</div><!-- fragment --><p>This is the central structure produced by <code><a class="el" href="classDbcParser.html" title="Minimal DBC parser.">DbcParser</a></code>.</p>
<hr />
<h1><a class="anchor" id="autotoc_md41"></a>
<h1><a class="anchor" id="autotoc_md44"></a>
UI Tree Layer</h1>
<h1><a class="anchor" id="autotoc_md42"></a>
<h1><a class="anchor" id="autotoc_md45"></a>
&lt;tt&gt;TreeNode&lt;/tt&gt;</h1>
<p>The UI tree contains three node types:</p>
<ul>
@@ -295,14 +295,14 @@ UI Tree Layer</h1>
<p>The tree supports browsing through the optional <code><a class="el" href="classDbcTreeModel.html">DbcTreeModel</a></code> adapter.</p>
<p>It is <b>not</b> the primary runtime decode structure.</p>
<hr />
<h1><a class="anchor" id="autotoc_md44"></a>
<h1><a class="anchor" id="autotoc_md47"></a>
Runtime Decode Layer</h1>
<h1><a class="anchor" id="autotoc_md45"></a>
<h1><a class="anchor" id="autotoc_md48"></a>
Purpose</h1>
<p>The decode layer exists so that decoding can be fast and independent from UI concerns.</p>
<p>Instead of searching a tree, the decoder uses a prepared database with direct lookup.</p>
<hr />
<h1><a class="anchor" id="autotoc_md47"></a>
<h1><a class="anchor" id="autotoc_md50"></a>
&lt;tt&gt;ByteOrder&lt;/tt&gt;</h1>
<p>Runtime byte order enum:</p>
<ul>
@@ -311,7 +311,7 @@ Purpose</h1>
</ul>
<p>This is better for decode code than passing around raw DBC characters.</p>
<hr />
<h1><a class="anchor" id="autotoc_md49"></a>
<h1><a class="anchor" id="autotoc_md52"></a>
&lt;tt&gt;ValueType&lt;/tt&gt;</h1>
<p>Numeric type enum:</p>
<ul>
@@ -320,7 +320,7 @@ Purpose</h1>
</ul>
<p>This is clearer than combining multiple boolean flags during runtime logic.</p>
<hr />
<h1><a class="anchor" id="autotoc_md51"></a>
<h1><a class="anchor" id="autotoc_md54"></a>
&lt;tt&gt;DecodeSignal&lt;/tt&gt;</h1>
<p>Represents one runtime-ready signal definition.</p>
<p>Fields:</p>
@@ -340,7 +340,7 @@ Purpose</h1>
</ul>
<p>This structure contains all information required for extracting and converting a signal value from raw frame data.</p>
<hr />
<h1><a class="anchor" id="autotoc_md53"></a>
<h1><a class="anchor" id="autotoc_md56"></a>
&lt;tt&gt;DecodeFrame&lt;/tt&gt;</h1>
<p>Represents one runtime-ready frame definition.</p>
<p>Fields:</p>
@@ -357,7 +357,7 @@ Purpose</h1>
</ul>
<p>This structure is used directly by the decoder.</p>
<hr />
<h1><a class="anchor" id="autotoc_md55"></a>
<h1><a class="anchor" id="autotoc_md58"></a>
&lt;tt&gt;FrameKey&lt;/tt&gt;</h1>
<p>Stable identifier for runtime frame matching and application state.</p>
<p>Fields:</p>
@@ -367,7 +367,7 @@ Purpose</h1>
</ul>
<p>This matters because the same numeric identifier must not be confused between standard and extended frames.</p>
<hr />
<h1><a class="anchor" id="autotoc_md57"></a>
<h1><a class="anchor" id="autotoc_md60"></a>
&lt;tt&gt;DecodeDatabase&lt;/tt&gt;</h1>
<p>Immutable runtime snapshot with a private frame index. Build it with <code>DbcDecodeBuilder::Build(parsed)</code> or construct it from <code>std::vector&lt;<a class="el" href="structDecodeFrame.html" title="Runtime-ready frame definition.">DecodeFrame</a>&gt;</code>. Construction rejects duplicate frame keys and duplicate signal names within a frame with <code>std::invalid_argument</code>, including manually supplied metadata.</p>
<ul>
@@ -379,9 +379,9 @@ Purpose</h1>
</ul>
<p>Frame lookup uses a hash index; signal lookup scans the matched frame's signals. Decoding shares the snapshot without copying definitions or allocating ownership objects per signal.</p>
<hr />
<h1><a class="anchor" id="autotoc_md59"></a>
<h1><a class="anchor" id="autotoc_md62"></a>
Decoder Layer</h1>
<h1><a class="anchor" id="autotoc_md60"></a>
<h1><a class="anchor" id="autotoc_md63"></a>
&lt;tt&gt;RawCanFrame&lt;/tt&gt;</h1>
<p>Represents a raw CAN frame to decode.</p>
<p>Fields:</p>
@@ -397,7 +397,7 @@ Decoder Layer</h1>
<li>unit tests</li>
</ul>
<hr />
<h1><a class="anchor" id="autotoc_md62"></a>
<h1><a class="anchor" id="autotoc_md65"></a>
&lt;tt&gt;DecodedSignalValue&lt;/tt&gt;</h1>
<p>Represents one decoded signal result.</p>
<p>Fields:</p>
@@ -410,9 +410,9 @@ Decoder Layer</h1>
<li><code>status</code></li>
</ul>
<hr />
<h2><a class="anchor" id="autotoc_md64"></a>
<h2><a class="anchor" id="autotoc_md67"></a>
Raw value representation and precision</h2>
<p><code><a class="el" href="structDecodedSignalValue.html#a503c90b4b1a610b8252c45e466367c28">DecodedSignalValue::rawValue</a></code> is a C++17 <code>std::variant&lt;std::int64_t, std::uint64_t&gt;</code>. For a valid signal, signed definitions produce the <code>int64_t</code> alternative and unsigned definitions produce the <code>uint64_t</code> alternative. Raw values remain exact across their full 64-bit ranges. Check <code>valid</code> before using the value; an invalid result's default value is not decoded data.</p>
<p><code><a class="el" href="structDecodedSignalValue.html#a503c90b4b1a610b8252c45e466367c28">DecodedSignalValue::rawValue</a></code> is a C++17 <code>std::variant&lt;std::int64_t, std::uint64_t&gt;</code>. For a valid signal, signed definitions produce the <code>int64_t</code> alternative and unsigned definitions produce the <code>uint64_t</code> alternative. Raw values remain exact across their full 64-bit ranges. Check <code>valid</code> before using the physical value. Raw data is also available when <code>status == PhysicalConversionFailed</code>; other invalid results have no decoded numeric data.</p>
<p>Use <code>std::get</code> when the numeric type is known, or <code>std::get_if</code> to handle both:</p>
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (<span class="keyword">const</span> std::int64_t *value = std::get_if&lt;std::int64_t&gt;(&amp;decodedSignal.rawValue)) {</div>
<div class="line"> std::cout &lt;&lt; *value;</div>
@@ -422,7 +422,7 @@ Raw value representation and precision</h2>
</div><!-- fragment --><p>This replaces the previous <code>int64_t</code> field: consumers that read or print <code>rawValue</code> directly must handle the variant.</p>
<p>Physical conversion uses the active numeric type: <code>physicalValue = static_cast&lt;double&gt;(raw) * factor + offset</code>. <code>physicalValue</code> remains a <code>double</code> and is approximate for large integers. On usual IEEE 754 binary64 implementations, integers are exactly representable through 2^53; above that, some integers round to the same floating-point value. For example, unsigned <code>UINT64_MAX</code> remains exact in <code>rawValue</code>, but converts to approximately 18446744073709551616 in binary64 before scaling. Use <code>rawValue</code> whenever exact integer values are required.</p>
<hr />
<h1><a class="anchor" id="autotoc_md66"></a>
<h1><a class="anchor" id="autotoc_md69"></a>
&lt;tt&gt;DecodedFrameValue&lt;/tt&gt;</h1>
<p>Represents one decoded frame result.</p>
<p>Fields:</p>
@@ -431,16 +431,32 @@ Raw value representation and precision</h2>
<li><code>key</code></li>
<li><code>signals</code></li>
<li><code>valid</code></li>
<li><code>status</code></li>
</ul>
<p><code>valid</code> means a matching frame definition was found. Check each signal's <code>valid</code> separately: insufficient payload data can leave individual signals invalid even when the frame is valid. An unknown frame returns <code>valid == false</code>.</p>
<p>The decoder applies factor and offset; it does not clamp physical values to the declared minimum and maximum.</p>
<h2><a class="anchor" id="autotoc_md67"></a>
<p><code>valid</code> means a matching frame definition was found. Check each signal's <code>valid</code> separately: insufficient payload data can leave individual signals invalid even when the frame is valid. An unknown frame returns <code>valid == false</code>, a null definition, its requested key, and an empty signal list.</p>
<p><code>FrameDecodeStatus</code> summarizes the result:</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Status </th><th class="markdownTableHeadNone">Meaning </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>UnknownFrame</code> </td><td class="markdownTableBodyNone">No definition matches both CAN ID and standard/extended type </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>InsufficientPayload</code> </td><td class="markdownTableBodyNone">Actual byte count is less than the declared <code>dlc</code> </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>SignalErrors</code> </td><td class="markdownTableBodyNone">Payload is long enough, but at least one signal failed </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>Valid</code> </td><td class="markdownTableBodyNone">Payload is long enough and every signal is valid or inactive </td></tr>
</table>
<p>Short-payload status takes precedence over signal errors; inspect each signal's status for the individual cause. <code>valid</code> retains its existing meaning of a matched definition and does not imply <code>status == FrameDecodeStatus::Valid</code>.</p>
<p>Payload policy uses <code>dlc</code> as a byte count, including for CAN FD; it is not the encoded wire DLC. A shorter payload is never padded: all signals whose bytes are available still decode, even if other signals fail. A longer payload is accepted; bytes beyond <code>dlc</code> are ignored. Signal bit layouts must fit the declared <code>dlc</code>, so extra bytes cannot rescue an invalid definition. Empty payloads and zero-byte frame definitions follow the same rules. Results include every signal in definition order, preserving successful values and definition handles on partial failures.</p>
<p>The decoder applies factor and offset; it does not clamp physical values to the declared minimum and maximum. Non-finite conversion results (NaN or positive/ negative infinity), including overflow with finite factor/offset, produce <code>PhysicalConversionFailed</code>. The exact raw value and non-finite <code>physicalValue</code> remain available, while signal <code>valid</code> is false. Non-finite factor/offset in manually constructed definitions follow this same conversion-result check. Physical conversion failure of a selector does not prevent raw branch selection.</p>
<h2><a class="anchor" id="autotoc_md70"></a>
Definition ownership and reload</h2>
<p><code><a class="el" href="structDecodedFrameValue.html#a33e971ba10030506007aa201c89f351d">DecodedFrameValue::definition</a></code> and <code><a class="el" href="structDecodedSignalValue.html#a828b5ef7faefc14fbf5dbd46249bcad2">DecodedSignalValue::definition</a></code> are owning <code>std::shared_ptr&lt;const ...&gt;</code> handles. Each handle retains the immutable runtime snapshot. Definitions remain valid until the last database copy, lookup handle, or decoded result owning that snapshot is released. An independently copied signal result retains its definition even after the parent frame result is removed. Copying or moving results preserves ownership.</p>
<p>Reload by assigning a newly built database. Stored results continue to describe the old DBC, including its units, scaling, comments, and <code>VAL_</code> descriptions; subsequent decoding uses the new DBC. Removed definitions cannot be found in the new database, but old results safely retain their old definitions. Keeping even one signal handle retains the whole old snapshot; release stored results when that metadata is no longer needed.</p>
<p><code>GetFrames()</code> is a borrowed view. References, iterators, and raw pointers obtained from it or from a handle's <code>.get()</code> do not retain ownership. Keep an owning handle or an unchanged database copy while using them. Do not retain mutable aliases into a vector moved into the database constructor. The raw string pointer from <code>GetValueDescription()</code> follows the same rule: keep the signal definition handle alive while using the string.</p>
<p>Parsed <code><a class="el" href="structDbcDatabase.html" title="Parsed DBC content stored in a simple internal form.">DbcDatabase</a></code>/<code><a class="el" href="structFrameInfo.html" title="Describes one CAN frame from a DBC file.">FrameInfo</a></code>/<code><a class="el" href="structSignalInfo.html" title="Describes one signal inside a DBC frame.">SignalInfo</a></code> remain ordinary mutable value containers: borrowed pointers follow standard vector invalidation rules. Builders copy their metadata, so parsed input may be changed or destroyed after building. Tree nodes own metadata copies; the Qt model owns its tree and invalidates model indexes on reset. Runtime handles do not depend on the parsed database or tree. Synchronize replacement of a shared database variable with decoding; immutable snapshots do not make concurrent assignment to the same object safe.</p>
<h2><a class="anchor" id="autotoc_md68"></a>
<h2><a class="anchor" id="autotoc_md71"></a>
Stable frame and signal identifiers</h2>
<p><code><a class="el" href="structDecodedFrameValue.html#a32143efe2023a1ecd977a9ae93e50b73">DecodedFrameValue::key</a></code> is a <code><a class="el" href="structFrameKey.html" title="Stable frame identifier: normalized CAN ID and frame type.">FrameKey</a></code> (normalized <code>canId</code>, <code>isExtended</code>), also available through <code>DecodeFrame::GetKey()</code>. <code><a class="el" href="structDecodedSignalValue.html#a33df0fcd92b23b3e08539906fc6b4c4a">DecodedSignalValue::key</a></code> is a <code><a class="el" href="structSignalKey.html">SignalKey</a></code> (frame key, exact case-sensitive signal name). Both are value types with equality and hashers (<code><a class="el" href="structFrameKeyHasher.html" title="Hasher for frame key.">FrameKeyHasher</a></code>, <code><a class="el" href="structSignalKeyHasher.html">SignalKeyHasher</a></code>) for application maps and saved selections. Construct the same keys from parsed metadata when needed; do not use addresses or vector positions as identifiers.</p>
<p>Keys stay equal across reloads and reordering when their components stay equal. Frame renaming and changes to units, bit layout, scaling, or descriptions do not change a key. Changing a CAN ID/frame type or renaming a signal produces a new key. The same name in different frames and standard/extended frames with the same numeric CAN ID remain distinct. Keys identify definitions within one logical DBC database; applications combining databases must add their own database ID. A key is not a version identifier: matching keys in different snapshots may have different metadata. Use <code>valid</code>/the definition handle to distinguish a matched result; default keys alone do not indicate successful decoding.</p>
@@ -455,17 +471,17 @@ Stable frame and signal identifiers</h2>
<div class="line">}</div>
<div class="ttc" id="aclassDbcDecodeBuilder_html"><div class="ttname"><a href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a></div><div class="ttdoc">Converts parsed DBC data into runtime decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decode__builder_8h_source.html#l00021">dbc_decode_builder.h:21</a></div></div>
<div class="ttc" id="aclassDbcDecodeBuilder_html_a2bc6386dfb5e58976c42e22c19ec471b"><div class="ttname"><a href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">DbcDecodeBuilder::Build</a></div><div class="ttdeci">DecodeDatabase Build(const DbcDatabase &amp;source) const</div><div class="ttdoc">Build runtime decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decode__builder_8cpp_source.html#l00015">dbc_decode_builder.cpp:15</a></div></div>
<div class="ttc" id="aclassDbcDecoder_html"><div class="ttname"><a href="classDbcDecoder.html">DbcDecoder</a></div><div class="ttdoc">Runtime CAN decoder using prebuilt decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00074">dbc_decoder.h:74</a></div></div>
<div class="ttc" id="aclassDbcDecoder_html_a345951ffe5d943a70d3a1ea1f39e74f7"><div class="ttname"><a href="classDbcDecoder.html#a345951ffe5d943a70d3a1ea1f39e74f7">DbcDecoder::Decode</a></div><div class="ttdeci">DecodedFrameValue Decode(const DecodeDatabase &amp;database, const RawCanFrame &amp;frame) const</div><div class="ttdoc">Decode one raw CAN frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8cpp_source.html#l00021">dbc_decoder.cpp:21</a></div></div>
<div class="ttc" id="aclassDbcDecoder_html"><div class="ttname"><a href="classDbcDecoder.html">DbcDecoder</a></div><div class="ttdoc">Runtime CAN decoder using prebuilt decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00084">dbc_decoder.h:84</a></div></div>
<div class="ttc" id="aclassDbcDecoder_html_a345951ffe5d943a70d3a1ea1f39e74f7"><div class="ttname"><a href="classDbcDecoder.html#a345951ffe5d943a70d3a1ea1f39e74f7">DbcDecoder::Decode</a></div><div class="ttdeci">DecodedFrameValue Decode(const DecodeDatabase &amp;database, const RawCanFrame &amp;frame) const</div><div class="ttdoc">Decode one raw CAN frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8cpp_source.html#l00022">dbc_decoder.cpp:22</a></div></div>
<div class="ttc" id="aclassDecodeDatabase_html"><div class="ttname"><a href="classDecodeDatabase.html">DecodeDatabase</a></div><div class="ttdoc">Immutable runtime snapshot. Copies share storage; reload replaces a snapshot. Owning lookup handles a...</div><div class="ttdef"><b>Definition</b> <a href="decode__database_8h_source.html#l00087">decode_database.h:87</a></div></div>
<div class="ttc" id="astructDecodedFrameValue_html"><div class="ttname"><a href="structDecodedFrameValue.html">DecodedFrameValue</a></div><div class="ttdoc">Fully decoded frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00062">dbc_decoder.h:62</a></div></div>
<div class="ttc" id="astructDecodedFrameValue_html_a4f51c31110dba1f73a763c596372beb0"><div class="ttname"><a href="structDecodedFrameValue.html#a4f51c31110dba1f73a763c596372beb0">DecodedFrameValue::valid</a></div><div class="ttdeci">bool valid</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00066">dbc_decoder.h:66</a></div></div>
<div class="ttc" id="astructDecodedSignalValue_html"><div class="ttname"><a href="structDecodedSignalValue.html">DecodedSignalValue</a></div><div class="ttdoc">One decoded signal value.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00043">dbc_decoder.h:43</a></div></div>
<div class="ttc" id="astructDecodedSignalValue_html_a33df0fcd92b23b3e08539906fc6b4c4a"><div class="ttname"><a href="structDecodedSignalValue.html#a33df0fcd92b23b3e08539906fc6b4c4a">DecodedSignalValue::key</a></div><div class="ttdeci">SignalKey key</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00045">dbc_decoder.h:45</a></div></div>
<div class="ttc" id="astructDecodedFrameValue_html"><div class="ttname"><a href="structDecodedFrameValue.html">DecodedFrameValue</a></div><div class="ttdoc">Fully decoded frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00071">dbc_decoder.h:71</a></div></div>
<div class="ttc" id="astructDecodedFrameValue_html_a4f51c31110dba1f73a763c596372beb0"><div class="ttname"><a href="structDecodedFrameValue.html#a4f51c31110dba1f73a763c596372beb0">DecodedFrameValue::valid</a></div><div class="ttdeci">bool valid</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00075">dbc_decoder.h:75</a></div></div>
<div class="ttc" id="astructDecodedSignalValue_html"><div class="ttname"><a href="structDecodedSignalValue.html">DecodedSignalValue</a></div><div class="ttdoc">One decoded signal value.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00052">dbc_decoder.h:52</a></div></div>
<div class="ttc" id="astructDecodedSignalValue_html_a33df0fcd92b23b3e08539906fc6b4c4a"><div class="ttname"><a href="structDecodedSignalValue.html#a33df0fcd92b23b3e08539906fc6b4c4a">DecodedSignalValue::key</a></div><div class="ttdeci">SignalKey key</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00054">dbc_decoder.h:54</a></div></div>
<div class="ttc" id="astructSignalKey_html"><div class="ttname"><a href="structSignalKey.html">SignalKey</a></div><div class="ttdef"><b>Definition</b> <a href="definition__key_8h_source.html#l00042">definition_key.h:42</a></div></div>
</div><!-- fragment --><p><b>API migration:</b> replace reads of <code>runtime.frames</code> with <code>runtime.GetFrames()</code>. To edit runtime definitions, prepare a vector and construct a new database; <code>frameIndexByKey</code> is now private and built automatically. <code><a class="el" href="classDbcDecoder.html#a4005c4311f57b7faf21c0cb31463039c" title="Find frame definition by CAN ID.">DbcDecoder::FindFrame</a></code> and result <code>definition</code> fields now use owning handles instead of raw pointers; <code>definition-&gt;name</code>, boolean/null checks, and existing decode calls remain usable. Use <code>.get()</code> only for temporary raw-pointer interoperation with an owner alive.</p>
<hr />
<h1><a class="anchor" id="autotoc_md70"></a>
<h1><a class="anchor" id="autotoc_md73"></a>
&lt;tt&gt;DbcDecoder&lt;/tt&gt;</h1>
<p>Main runtime decoder class.</p>
<p>Responsibilities:</p>
@@ -482,7 +498,7 @@ Stable frame and signal identifiers</h2>
<li><code>Decode(...)</code></li>
</ul>
<hr />
<h1><a class="anchor" id="autotoc_md72"></a>
<h1><a class="anchor" id="autotoc_md75"></a>
Parser Support</h1>
<p>The current parser supports the following DBC elements:</p>
<ul>
@@ -493,7 +509,7 @@ Parser Support</h1>
<li><code>VAL_</code> signal value descriptions</li>
<li>basic <code>M</code> / <code>mN</code> multiplexing</li>
</ul>
<h2><a class="anchor" id="autotoc_md73"></a>
<h2><a class="anchor" id="autotoc_md76"></a>
Structured diagnostics</h2>
<p><code>ParseFileWithDiagnostics(path)</code> returns <code><a class="el" href="structDbcParseResult.html">DbcParseResult</a></code> containing <code>database</code> and <code>diagnostics</code>. Each <code><a class="el" href="structDbcDiagnostic.html">DbcDiagnostic</a></code> has <code>severity</code>, <code>code</code>, <code>filePath</code>, <code>lineNumber</code>, and <code>message</code>. Paths preserve the caller's supplied spelling. Lines are one-based physical lines, including blank lines; file-level errors use zero.</p>
<div class="fragment"><div class="line"><span class="keyword">const</span> <a class="code hl_class" href="classDbcParser.html">DbcParser</a> parser;</div>
@@ -533,9 +549,9 @@ Structured diagnostics</h2>
<p>Common <code>VERSION</code>, <code>NS_</code>, <code>BS_</code>, and <code>BU_</code> headers produce no diagnostics. Single-token symbols inside the <code>NS_</code> declaration list are quiet regardless of indentation, even when they name unsupported syntax. Frame, signal, bus, and node definitions or a line with arguments end the list. Actual unsupported statements outside that list are reported. Node and bus metadata are not stored. Other comment forms (<code>CM_</code>, <code>CM_ BU_</code>, <code>CM_ EV_</code>) are ignored by the comment handler; comments only attach to already parsed frames/signals. Supported statements currently require one physical line.</p>
<p><code>ParseFile(path)</code> remains compatible: it returns the database, discards warnings, and throws <code>std::runtime_error</code> on the first error with the existing <code>path:line:</code> format. Use <code>ParseFileWithDiagnostics</code> to see skipped syntax. Resource failures such as allocation errors may still throw.</p>
<hr />
<h1><a class="anchor" id="autotoc_md75"></a>
<h1><a class="anchor" id="autotoc_md78"></a>
Supported DBC Syntax</h1>
<h1><a class="anchor" id="autotoc_md76"></a>
<h1><a class="anchor" id="autotoc_md79"></a>
Frame definition</h1>
<p>Example:</p>
<div class="fragment"><div class="line">BO_ 256 EngineData: 8 EEC1</div>
@@ -547,7 +563,7 @@ Frame definition</h1>
<li>transmitter ECU</li>
</ul>
<hr />
<h2><a class="anchor" id="autotoc_md78"></a>
<h2><a class="anchor" id="autotoc_md81"></a>
Frame validation and parse errors</h2>
<p><code>BO_</code> definitions require a decimal CAN ID, a nonempty single-token frame name, a colon, a decimal payload length, and a transmitter token. Spaces or tabs may separate fields, and whitespace before the colon is accepted. Additional trailing fields are rejected.</p>
<p>Numeric fields must contain decimal digits only; signs, hexadecimal notation, fractional values, suffixes, and overflow are rejected. CAN IDs may contain the 29-bit identifier plus the optional DBC extended flag (bit 31). Bits 29 and 30 are rejected rather than silently discarded. For compatibility, unflagged IDs above <code>0x7FF</code> are still treated as extended.</p>
@@ -556,7 +572,7 @@ Frame validation and parse errors</h2>
<div class="fragment"><div class="line">example.dbc:3: Invalid CAN ID: invalid</div>
</div><!-- fragment --><p>Frame and signal definitions are validated as described here; comprehensive DBC grammar coverage is still planned. File-open exceptions contain the path but no line number. The structured diagnostic API uses line zero for file-level errors.</p>
<hr />
<h1><a class="anchor" id="autotoc_md80"></a>
<h1><a class="anchor" id="autotoc_md83"></a>
Signal definition</h1>
<p>Example:</p>
<div class="fragment"><div class="line">SG_ EngineSpeed : 0|16@1+ (0.125,0) [0|8000] &quot;rpm&quot; ECU1,ECU2</div>
@@ -575,7 +591,7 @@ Signal definition</h1>
<li>receivers</li>
</ul>
<hr />
<h2><a class="anchor" id="autotoc_md82"></a>
<h2><a class="anchor" id="autotoc_md85"></a>
Signal validation and parse errors</h2>
<p><code>SG_</code> statements are matched completely. Signal names must be nonempty and contain no whitespace. Spaces and tabs are accepted between syntax elements; byte order and signedness remain adjacent (<code>@0+</code>, <code>@0-</code>, <code>@1+</code>, or <code>@1-</code>). A quoted unit (which may be empty) and a nonempty comma-separated receiver list are required. Unexpected trailing fields are rejected.</p>
<p>Start bits must be unsigned decimal integers fitting <code>uint32_t</code>; lengths must be within <code>1..64</code> bits. Signs, fractional values, numeric suffixes, and overflow are rejected for these fields. Every signal bit must fit within the frame's declared payload length, using Intel increasing bit positions or Motorola sawtooth traversal. This uses the stored payload length without introducing an additional CAN or CAN FD payload limit.</p>
@@ -583,7 +599,7 @@ Signal validation and parse errors</h2>
<p>Basic multiplexing markers <code>M</code> and <code>mN</code> are supported as described below. Overlapping signals are rejected unless their branch values differ. Duplicate frame keys and signal names within a frame are rejected.</p>
<p>Invalid signal definitions stop parsing with <code>path:line: description</code>, including when the signal exceeds the declared payload length.</p>
<hr />
<h1><a class="anchor" id="autotoc_md84"></a>
<h1><a class="anchor" id="autotoc_md87"></a>
Basic multiplexing</h1>
<div class="fragment"><div class="line">BO_ 256 Status: 3 ECU</div>
<div class="line"> SG_ Mode M : 0|8@1+ (1,0) [0|255] &quot;&quot; ECU</div>
@@ -606,11 +622,13 @@ Basic multiplexing</h1>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>InsufficientPayload</code> </td><td class="markdownTableBodyNone">Selected or unconditional signal bytes are missing </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>InvalidDefinition</code> </td><td class="markdownTableBodyNone">Invalid bit length or missing/invalid selector in manually built runtime metadata </td></tr>
<td class="markdownTableBodyNone"><code>InvalidDefinition</code> </td><td class="markdownTableBodyNone">Invalid length, byte order, numeric type, multiplexing role, layout outside declared DLC, or missing/invalid selector in manually built runtime metadata </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>PhysicalConversionFailed</code> </td><td class="markdownTableBodyNone">Raw value is available, but the converted physical value is NaN or infinity </td></tr>
</table>
<p>All statuses except <code>Valid</code> have <code>valid == false</code>; their numeric fields contain no decoded data and <code>GetValueDescription()</code> returns nullptr. Check <code>status</code> to distinguish inactive branches from errors. Consumers constructing runtime metadata manually must obey the same non-overlap rules as the parser. Extended and nested multiplexing are outside this stage and are explicitly rejected, rather than silently decoded as unconditional signals.</p>
<p>All statuses except <code>Valid</code> have <code>valid == false</code> and <code>GetValueDescription()</code> returns nullptr. <code>PhysicalConversionFailed</code> preserves extracted raw data and the non-finite conversion result; other invalid statuses have no decoded numeric data. Check <code>status</code> to distinguish inactive branches from errors. Consumers constructing runtime metadata manually must obey the same non-overlap rules as the parser. Extended and nested multiplexing are outside this stage and are explicitly rejected, rather than silently decoded as unconditional signals.</p>
<hr />
<h1><a class="anchor" id="autotoc_md86"></a>
<h1><a class="anchor" id="autotoc_md89"></a>
Comments</h1>
<p>Frame comment example:</p>
<div class="fragment"><div class="line">CM_ BO_ 256 &quot;Engine data frame&quot;;</div>
@@ -622,7 +640,7 @@ Comments</h1>
<li><code><a class="el" href="structSignalInfo.html#ac99ba7563a5dad01e39c4257216953f5">SignalInfo::comment</a></code></li>
</ul>
<hr />
<h1><a class="anchor" id="autotoc_md88"></a>
<h1><a class="anchor" id="autotoc_md91"></a>
CAN ID Normalization</h1>
<p>The parser normalizes frame identifiers.</p>
<p>Common DBC behavior:</p>
@@ -637,7 +655,7 @@ CAN ID Normalization</h1>
</ul>
<p>This is important both for correct lookup and for future interoperability with live CAN APIs.</p>
<hr />
<h1><a class="anchor" id="autotoc_md90"></a>
<h1><a class="anchor" id="autotoc_md93"></a>
PGN Extraction</h1>
<p>PGN is derived only when the frame is treated as extended.</p>
<p>The current logic is simplified J1939 extraction:</p>
@@ -648,7 +666,7 @@ PGN Extraction</h1>
</ul>
<p>This is enough for a practical start but should not be treated as full J1939 validation.</p>
<hr />
<h1><a class="anchor" id="autotoc_md92"></a>
<h1><a class="anchor" id="autotoc_md95"></a>
Decode Flow</h1>
<p>Typical runtime decode flow:</p>
<div class="fragment"><div class="line">RawCanFrame</div>
@@ -663,7 +681,7 @@ Decode Flow</h1>
<div class="line"> ↓</div>
<div class="line">DecodedFrameValue</div>
</div><!-- fragment --><hr />
<h1><a class="anchor" id="autotoc_md94"></a>
<h1><a class="anchor" id="autotoc_md97"></a>
Intel and Motorola Extraction</h1>
<p>The decoder currently has separate extraction paths:</p>
<ul>
@@ -674,7 +692,7 @@ Intel and Motorola Extraction</h1>
<p>Intel and Motorola require different bit extraction logic.</p>
<p>This is one of the main reasons why the runtime decode layer should be explicit and prepared in advance.</p>
<hr />
<h1><a class="anchor" id="autotoc_md96"></a>
<h1><a class="anchor" id="autotoc_md99"></a>
Example Usage</h1>
<p>Include the public headers from the <code>core/</code> include directory supplied by <code>core/core.pri</code>:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="dbc__parser_8h.html">dbc_parser.h</a>&quot;</span></div>
@@ -685,23 +703,23 @@ Example Usage</h1>
<div class="ttc" id="adbc__decoder_8h_html"><div class="ttname"><a href="dbc__decoder_8h.html">dbc_decoder.h</a></div><div class="ttdoc">Created: 2026-03-13 Author: Deeaitch (Dim. Himro)</div></div>
<div class="ttc" id="adbc__parser_8h_html"><div class="ttname"><a href="dbc__parser_8h.html">dbc_parser.h</a></div><div class="ttdoc">Created: 2026-03-13 Author: Deeaitch (Dim. Himro)</div></div>
<div class="ttc" id="adbc__tree__builder_8h_html"><div class="ttname"><a href="dbc__tree__builder_8h.html">dbc_tree_builder.h</a></div><div class="ttdoc">Created: 2026-03-13 Author: Deeaitch (Dim. Himro)</div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md97"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md100"></a>
Parse DBC</h2>
<div class="fragment"><div class="line"><a class="code hl_class" href="classDbcParser.html">DbcParser</a> parser;</div>
<div class="line"><a class="code hl_struct" href="structDbcDatabase.html">DbcDatabase</a> database = parser.<a class="code hl_function" href="classDbcParser.html#aef72826942c9095d653fafa435855e56">ParseFile</a>(<span class="stringliteral">&quot;example.dbc&quot;</span>);</div>
<div class="ttc" id="aclassDbcParser_html_aef72826942c9095d653fafa435855e56"><div class="ttname"><a href="classDbcParser.html#aef72826942c9095d653fafa435855e56">DbcParser::ParseFile</a></div><div class="ttdeci">DbcDatabase ParseFile(const std::string &amp;filePath) const</div><div class="ttdoc">Parse DBC file.</div><div class="ttdef"><b>Definition</b> <a href="dbc__parser_8cpp_source.html#l00031">dbc_parser.cpp:31</a></div></div>
<div class="ttc" id="astructDbcDatabase_html"><div class="ttname"><a href="structDbcDatabase.html">DbcDatabase</a></div><div class="ttdoc">Parsed DBC content stored in a simple internal form.</div><div class="ttdef"><b>Definition</b> <a href="dbc__database_8h_source.html#l00022">dbc_database.h:22</a></div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md98"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md101"></a>
Build UI tree</h2>
<div class="fragment"><div class="line"><a class="code hl_class" href="classDbcTreeBuilder.html">DbcTreeBuilder</a> treeBuilder;</div>
<div class="line">std::unique_ptr&lt;TreeNode&gt; root = treeBuilder.<a class="code hl_function" href="classDbcTreeBuilder.html#a7e57d067d831b14b383947fd125edd4b">Build</a>(database);</div>
<div class="ttc" id="aclassDbcTreeBuilder_html"><div class="ttname"><a href="classDbcTreeBuilder.html">DbcTreeBuilder</a></div><div class="ttdoc">Builds a simple tree from parsed DBC database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__tree__builder_8h_source.html#l00023">dbc_tree_builder.h:23</a></div></div>
<div class="ttc" id="aclassDbcTreeBuilder_html_a7e57d067d831b14b383947fd125edd4b"><div class="ttname"><a href="classDbcTreeBuilder.html#a7e57d067d831b14b383947fd125edd4b">DbcTreeBuilder::Build</a></div><div class="ttdeci">std::unique_ptr&lt; TreeNode &gt; Build(const DbcDatabase &amp;database) const</div><div class="ttdoc">Build tree representation of parsed DBC data.</div><div class="ttdef"><b>Definition</b> <a href="dbc__tree__builder_8cpp_source.html#l00014">dbc_tree_builder.cpp:14</a></div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md99"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md102"></a>
Build runtime decode database</h2>
<div class="fragment"><div class="line"><a class="code hl_class" href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a> decodeBuilder;</div>
<div class="line"><a class="code hl_class" href="classDecodeDatabase.html">DecodeDatabase</a> decodeDatabase = decodeBuilder.<a class="code hl_function" href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">Build</a>(database);</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md100"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md103"></a>
Decode a raw frame</h2>
<div class="fragment"><div class="line"><a class="code hl_struct" href="structRawCanFrame.html">RawCanFrame</a> rawFrame;</div>
<div class="line">rawFrame.<a class="code hl_variable" href="structRawCanFrame.html#a2d0e7fa0e3d5c20bbed55ed8f7888ff4">canId</a> = 256; <span class="comment">// EngineData from the DBC example above</span></div>
@@ -715,7 +733,7 @@ Decode a raw frame</h2>
<div class="ttc" id="astructRawCanFrame_html_a2d0e7fa0e3d5c20bbed55ed8f7888ff4"><div class="ttname"><a href="structRawCanFrame.html#a2d0e7fa0e3d5c20bbed55ed8f7888ff4">RawCanFrame::canId</a></div><div class="ttdeci">std::uint32_t canId</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00025">dbc_decoder.h:25</a></div></div>
<div class="ttc" id="astructRawCanFrame_html_a462193d275adc1dba8bd18ffa0e36bb7"><div class="ttname"><a href="structRawCanFrame.html#a462193d275adc1dba8bd18ffa0e36bb7">RawCanFrame::isExtended</a></div><div class="ttdeci">bool isExtended</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00026">dbc_decoder.h:26</a></div></div>
</div><!-- fragment --><hr />
<h1><a class="anchor" id="autotoc_md102"></a>
<h1><a class="anchor" id="autotoc_md105"></a>
Unified Decode Strategy</h1>
<p>A key design goal is that the same decoder should work for both:</p>
<ul>
@@ -723,7 +741,7 @@ Unified Decode Strategy</h1>
<li>trace replay frames</li>
</ul>
<p>That means this architecture supports:</p>
<h2><a class="anchor" id="autotoc_md103"></a>
<h2><a class="anchor" id="autotoc_md106"></a>
live path</h2>
<div class="fragment"><div class="line">live CAN input</div>
<div class="line"> ↓</div>
@@ -732,7 +750,7 @@ live path</h2>
<div class="line">DbcDecoder</div>
<div class="line"> ↓</div>
<div class="line">decoded signal values</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md104"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md107"></a>
trace path</h2>
<div class="fragment"><div class="line">trace reader</div>
<div class="line"> ↓</div>
@@ -743,7 +761,7 @@ trace path</h2>
<div class="line">decoded signal values</div>
</div><!-- fragment --><p>This avoids duplicating decode logic in two separate parts of the application.</p>
<hr />
<h1><a class="anchor" id="autotoc_md106"></a>
<h1><a class="anchor" id="autotoc_md109"></a>
Intended Use in FrameTap</h1>
<p>This module is meant to support at least the following FrameTap workflows:</p>
<ul>
@@ -769,7 +787,7 @@ Intended Use in FrameTap</h1>
<div class="line"> - live frames</div>
<div class="line"> - trace replay</div>
</div><!-- fragment --><hr />
<h1><a class="anchor" id="autotoc_md108"></a>
<h1><a class="anchor" id="autotoc_md111"></a>
Why the Tree Is Not Enough</h1>
<p>The tree exists for browsing.</p>
<p>However, runtime decode should not rely on tree traversal because that would introduce unnecessary coupling and inefficiency.</p>
@@ -781,7 +799,7 @@ Why the Tree Is Not Enough</h1>
</ul>
<p>That is why <code><a class="el" href="classDecodeDatabase.html" title="Immutable runtime snapshot. Copies share storage; reload replaces a snapshot. Owning lookup handles a...">DecodeDatabase</a></code> is a separate layer.</p>
<hr />
<h1><a class="anchor" id="autotoc_md110"></a>
<h1><a class="anchor" id="autotoc_md113"></a>
Statement Handler Factory</h1>
<p><code><a class="el" href="classDbcParser.html" title="Minimal DBC parser.">DbcParser</a></code> owns file reading, trimming, line numbers, and error reporting. Each <code>ParseFile()</code> call creates a fresh <code><a class="el" href="structDbcParseContext.html">DbcParseContext</a></code> and a <code><a class="el" href="classDbcStatementDispatcher.html">DbcStatementDispatcher</a></code>. The context contains the parsed database and current frame; handlers receive it by reference and retain no parsing state.</p>
<p>The dispatcher uses <code><a class="el" href="classTypeFactory.html" title="Registry-based factory for creating objects by runtime identifier.">TypeFactory</a>&lt;std::string, <a class="el" href="classDbcStatementHandler.html">DbcStatementHandler</a>&gt;</code> to create registered handlers once per parsing session, then reuses them for all matching lines:</p>
@@ -802,7 +820,7 @@ Statement Handler Factory</h1>
</div><!-- fragment --><p>Registration creates one handler; replacing a registration replaces that instance. Register during initialization before dispatching. A line is routed using its full first whitespace-delimited keyword, so <code>BO_TX_BU_</code> cannot match <code>BO_</code>. Unregistered keywords produce <code>UnsupportedStatement</code> warnings through <code>ParseFileWithDiagnostics</code>. <code>SG_</code> and <code>CM_</code> accept spaces and tabs after their keywords.</p>
<p>This factory handles statements inside DBC files. A separate format-level factory can be introduced when another file format is implemented. The decoder and database builders remain independent of statement dispatch.</p>
<hr />
<h1><a class="anchor" id="autotoc_md112"></a>
<h1><a class="anchor" id="autotoc_md115"></a>
Signal value descriptions (&lt;tt&gt;VAL_&lt;/tt&gt;)</h1>
<p>Signal descriptions attach text to exact raw integer values:</p>
<div class="fragment"><div class="line">BO_ 256 Status: 8 ECU</div>
@@ -852,7 +870,7 @@ are outside this implementation; the optional Qt adapter exposes signal mappings
&lt;hr&gt;
@section autotoc_md114 Current Limitations
@section autotoc_md117 Current Limitations
This is still a minimal implementation.
@@ -886,11 +904,11 @@ byte boundaries, and 64-bit values.
&lt;hr&gt;
@section autotoc_md116 Recommended Next Steps
@section autotoc_md119 Recommended Next Steps
A practical development order would be:
@subsection autotoc_md117 Stage 1 - already implemented
@subsection autotoc_md120 Stage 1 - already implemented
- &lt;tt&gt;BO_&lt;/tt&gt;
- &lt;tt&gt;SG_&lt;/tt&gt;
@@ -905,13 +923,13 @@ A practical development order would be:
- runtime decode database
- runtime decoder
@subsection autotoc_md118 Stage 2
@subsection autotoc_md121 Stage 2
Recommended additions:
- selective decoding of only chosen signals
@subsection autotoc_md119 Stage 3
@subsection autotoc_md122 Stage 3
Recommended additions:
@@ -921,7 +939,7 @@ Recommended additions:
- CSV export of decoded traces
- optimized filtering and signal selection
@subsection autotoc_md120 Stage 4
@subsection autotoc_md123 Stage 4
Advanced functionality:
@@ -932,7 +950,7 @@ Advanced functionality:
&lt;hr&gt;
@section autotoc_md122 Build Integration
@section autotoc_md125 Build Integration
The repository supplies qmake projects. A C++17 compiler is required; the root
build also requires Qt Core and Qt Test development packages. Other build
@@ -963,7 +981,7 @@ source lists live in &lt;tt&gt;tests/parser_tests.pri&lt;/tt&gt; and &lt;tt&gt;t
When building a consumer separately, pass
&lt;tt&gt;DBC_CORE_BUILD_DIR=/absolute/path/to/build/core&lt;/tt&gt; to qmake.
@subsection autotoc_md123 Build core without Qt libraries
@subsection autotoc_md126 Build core without Qt libraries
From the repository root:
@@ -976,7 +994,7 @@ make -j
qmake is still the build tool; this target does not link Qt libraries.
@subsection autotoc_md124 Optional Qt model adapter
@subsection autotoc_md127 Optional Qt model adapter
The adapter and its &lt;tt&gt;QAbstractItemModelTester&lt;/tt&gt; suite use Qt 6.8.2.
The adapter itself links only Qt Core.
@@ -1097,7 +1115,7 @@ Valid items are enabled and selectable, with no editing support.
<p></code></p>
<p><code>Each value-description entry contains <code>value</code> (qlonglong for negative keys, qulonglong for nonnegative keys) and <code>description</code> (QString). This preserves the full signed/unsigned 64-bit range without converting through double. An unmapped signal returns an empty list. Data comes from <code><a class="el" href="structSignalInfo.html#a43f47d0433d0cc39076bd7278b46af9c">SignalInfo::valueDescriptions</a></code>. Unsupported roles return invalid QVariant.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md125"></a>
<h2><a class="anchor" id="autotoc_md128"></a>
Standalone tree tests without Qt</h2>
<p><code></code></p>
<p><code>From the repository root, use only a C++17 compiler:</code></p>
@@ -1106,7 +1124,7 @@ Standalone tree tests without Qt</h2>
<div class="line">/tmp/dbc_tree_node_test</div>
</div><!-- fragment --><p></code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md126"></a>
<h2><a class="anchor" id="autotoc_md129"></a>
Build and run the demo</h2>
<p><code></code></p>
<p><code>After building core, run these commands from the repository root:</code></p>
@@ -1118,7 +1136,7 @@ Build and run the demo</h2>
</div><!-- fragment --><p></code></p>
<p><code>The demo prints the parsed tree and decodes eight zero bytes using the first frame definition. Replace that sample payload in <code><a class="el" href="examples_2main_8cpp.html" title="Created: 2026-03-13 Author: Deeaitch (Dim. Himro)">examples/main.cpp</a></code> to feed live CAN data or trace records.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md127"></a>
<h2><a class="anchor" id="autotoc_md130"></a>
Generate API documentation</h2>
<p><code></code></p>
<p><code>With Doxygen installed, run from the repository root:</code></p>
@@ -1128,17 +1146,17 @@ Generate API documentation</h2>
<p><code></p><hr />
<p></code></p>
<p><code></code></p>
<h1><a class="anchor" id="autotoc_md129"></a>
<h1><a class="anchor" id="autotoc_md132"></a>
Regression tests</h1>
<p><code></code></p>
<p><code>See <a class="el" href="md_tests_2README.html">tests/README.md</a> for QtTest build and execution commands. Tests cover frame validation and error locations, Intel and Motorola extraction, signal syntax and payload bounds, <code>VAL_</code> syntax and reference validation, raw description lookup and preservation through both builders, statement dispatch, signed and unsigned 64-bit boundaries, physical conversion, numeric output, and invalid signal payloads.</code></p>
<p><code></code></p>
<h1><a class="anchor" id="autotoc_md130"></a>
<h1><a class="anchor" id="autotoc_md133"></a>
Measuring code coverage</h1>
<p><code></code></p>
<p><code>Coverage instrumentation is separate from the QtTest suite named <code>CoverageTest</code>: that suite runs extra regression checks, but coverage counters require a specially instrumented build. Use a separate build directory for each coverage tool.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md131"></a>
<h2><a class="anchor" id="autotoc_md134"></a>
GCC, gcov, and LCOV on Debian/Ubuntu</h2>
<p><code></code></p>
<p><code>Install the build and report tools:</code></p>
@@ -1192,7 +1210,7 @@ GCC, gcov, and LCOV on Debian/Ubuntu</h2>
<p><code>After adding direct comment-handler and ambiguous <code>VAL_</code> reference tests, the same configuration measured 98.4% line coverage (728/740) and 71.4% branch coverage (841/1178).</code></p>
<p><code>See <a href="https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html">GCC instrumentation options</a> and the <a href="https://github.com/linux-test-project/lcov">LCOV project documentation</a>.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md132"></a>
<h2><a class="anchor" id="autotoc_md135"></a>
Configure the GCC coverage build in Qt Creator</h2>
<p><code></code></p>
<p><code></p><ol type="1">
@@ -1208,7 +1226,7 @@ Configure the GCC coverage build in Qt Creator</h2>
</ol>
<p></code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md133"></a>
<h2><a class="anchor" id="autotoc_md136"></a>
Configure all build variants in Qt Creator</h2>
<p><code></code></p>
<p><code>The local <code>dbc.pro.user</code> stores machine-specific kit IDs and build/run settings. It is ignored by Git (<code>*.user</code>) and should not be committed or copied between machines. Recreate the configurations below through the UI when setting up a new checkout. The <code>Qt4ProjectManager</code> identifiers inside <code>.user</code> are historical Qt Creator setting names; the project still requires Qt 6.8.2.</code></p>