\hypertarget{md_README_autotoc_md1}{}\doxysection{Overview}\label{md_README_autotoc_md1} This module provides a minimal but extensible DBC parser and runtime decode foundation for the {\bfseries{Frame\+Tap}} project. Its purpose is to\+: \begin{DoxyItemize} \item parse DBC files \item store parsed frame and signal metadata \item build a tree for future UI integration \item build a runtime-\/ready decode database \item decode live CAN frames \item decode CAN trace records using the same decoder \end{DoxyItemize} The implementation follows a simple and practical design\+: \begin{DoxyItemize} \item parser logic is separated from UI logic \item runtime decode structures are separated from tree structures \item Qt is not required at the parser or decoder level \item the same decode engine can be reused for live traffic and trace replay \end{DoxyItemize} This is {\bfseries{not a full production-\/grade DBC implementation yet}}, but it is a strong architectural base. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md3}{}\doxysection{High-\/\+Level Architecture}\label{md_README_autotoc_md3} The module is divided into two main paths.\hypertarget{md_README_autotoc_md4}{}\doxysubsection{1. Parse and UI path}\label{md_README_autotoc_md4} Used for\+: \begin{DoxyItemize} \item browsing frames and signals \item later integration with Qt {\ttfamily Model/\+View} \item displaying metadata \end{DoxyItemize} Pipeline\+: \begin{DoxyCode}{0} \DoxyCodeLine{DBC file} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcParser} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcDatabase} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcTreeBuilder} \DoxyCodeLine{ ↓} \DoxyCodeLine{TreeNode hierarchy} \DoxyCodeLine{ ↓} \DoxyCodeLine{future Qt UI} \end{DoxyCode} \hypertarget{md_README_autotoc_md5}{}\doxysubsection{2. Runtime decode path}\label{md_README_autotoc_md5} Used for\+: \begin{DoxyItemize} \item live CAN decoding \item CAN trace decoding \item fast lookup by CAN ID \end{DoxyItemize} Pipeline\+: \begin{DoxyCode}{0} \DoxyCodeLine{DBC file} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcParser} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcDatabase} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcDecodeBuilder} \DoxyCodeLine{ ↓} \DoxyCodeLine{DecodeDatabase} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcDecoder} \DoxyCodeLine{ ↓} \DoxyCodeLine{Decoded values} \end{DoxyCode} This separation is intentional. The tree is useful for UI, but it is {\bfseries{not}} the main data structure for runtime decoding. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md7}{}\doxysection{Why the Runtime Decode Layer Exists}\label{md_README_autotoc_md7} A tree structure is convenient for browsing, but a runtime decoder needs something different\+: \begin{DoxyItemize} \item fast lookup by CAN ID \item direct access to signal decode definitions \item minimal overhead during repeated decoding \item the same logic for live frames and trace frames \end{DoxyItemize} Because of that, the design uses a dedicated runtime-\/ready structure\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{structDecodeDatabase}{Decode\+Database}}} \item {\ttfamily \mbox{\hyperlink{structDecodeFrame}{Decode\+Frame}}} \item {\ttfamily \mbox{\hyperlink{structDecodeSignal}{Decode\+Signal}}} \end{DoxyItemize} This avoids forcing UI-\/oriented structures into a decode role they were not meant for. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md9}{}\doxysection{Module Layout}\label{md_README_autotoc_md9} \hypertarget{md_README_autotoc_md10}{}\doxysubsection{Parsed DBC structures}\label{md_README_autotoc_md10} Files\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{signal__info_8h}{signal\+\_\+info.\+h}}} \item {\ttfamily \mbox{\hyperlink{frame__info_8h}{frame\+\_\+info.\+h}}} \item {\ttfamily \mbox{\hyperlink{dbc__database_8h}{dbc\+\_\+database.\+h}}} \end{DoxyItemize} These store a readable representation of the parsed DBC file.\hypertarget{md_README_autotoc_md11}{}\doxysubsection{UI tree structures}\label{md_README_autotoc_md11} Files\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{tree__node_8h}{tree\+\_\+node.\+h}}} \item {\ttfamily \mbox{\hyperlink{tree__node_8cpp}{tree\+\_\+node.\+cpp}}} \item {\ttfamily \mbox{\hyperlink{dbc__tree__builder_8h}{dbc\+\_\+tree\+\_\+builder.\+h}}} \item {\ttfamily \mbox{\hyperlink{dbc__tree__builder_8cpp}{dbc\+\_\+tree\+\_\+builder.\+cpp}}} \end{DoxyItemize} These convert parsed DBC content into a tree hierarchy suitable for UI and model/view usage later.\hypertarget{md_README_autotoc_md12}{}\doxysubsection{Runtime decode structures}\label{md_README_autotoc_md12} Files\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{decode__database_8h}{decode\+\_\+database.\+h}}} \item {\ttfamily \mbox{\hyperlink{dbc__decode__builder_8h}{dbc\+\_\+decode\+\_\+builder.\+h}}} \item {\ttfamily \mbox{\hyperlink{dbc__decode__builder_8cpp}{dbc\+\_\+decode\+\_\+builder.\+cpp}}} \end{DoxyItemize} These convert parsed DBC content into a structure optimized for decoding.\hypertarget{md_README_autotoc_md13}{}\doxysubsection{Runtime decoder}\label{md_README_autotoc_md13} Files\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{dbc__decoder_8h}{dbc\+\_\+decoder.\+h}}} \item {\ttfamily \mbox{\hyperlink{dbc__decoder_8cpp}{dbc\+\_\+decoder.\+cpp}}} \end{DoxyItemize} These perform actual decoding of raw CAN frames using {\ttfamily \mbox{\hyperlink{structDecodeDatabase}{Decode\+Database}}}.\hypertarget{md_README_autotoc_md14}{}\doxysubsection{Parser}\label{md_README_autotoc_md14} Files\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{dbc__parser_8h}{dbc\+\_\+parser.\+h}}} \item {\ttfamily \mbox{\hyperlink{dbc__parser_8cpp}{dbc\+\_\+parser.\+cpp}}} \end{DoxyItemize} These parse the DBC file itself.\hypertarget{md_README_autotoc_md15}{}\doxysubsection{Demo}\label{md_README_autotoc_md15} File\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{main_8cpp}{main.\+cpp}}} \end{DoxyItemize} Used as a small integration example. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md17}{}\doxysection{Parsed Data Structures}\label{md_README_autotoc_md17} \hypertarget{md_README_autotoc_md18}{}\doxysection{$<$tt$>$\+Signal\+Info$<$/tt$>$}\label{md_README_autotoc_md18} Represents one signal as parsed from the DBC file. Fields\+: \begin{DoxyItemize} \item {\ttfamily name} \item {\ttfamily start\+Bit} \item {\ttfamily length} \item {\ttfamily is\+Little\+Endian} \item {\ttfamily is\+Signed} \item {\ttfamily factor} \item {\ttfamily offset} \item {\ttfamily minimum} \item {\ttfamily maximum} \item {\ttfamily unit} \item {\ttfamily receivers} \item {\ttfamily comment} \end{DoxyItemize} Notes\+: \begin{DoxyItemize} \item {\ttfamily receivers} is a list because a signal may have more than one receiver ECU \item {\ttfamily factor} and {\ttfamily offset} define physical conversion \item this structure is close to DBC content and easy to inspect \end{DoxyItemize} Physical value rule\+: \begin{DoxyCode}{0} \DoxyCodeLine{physical = raw * factor + offset} \end{DoxyCode} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md20}{}\doxysection{$<$tt$>$\+Frame\+Info$<$/tt$>$}\label{md_README_autotoc_md20} Represents one frame as parsed from the DBC file. Fields\+: \begin{DoxyItemize} \item {\ttfamily name} \item {\ttfamily can\+Id} \item {\ttfamily is\+Extended} \item {\ttfamily pgn} \item {\ttfamily has\+Pgn} \item {\ttfamily dlc} \item {\ttfamily transmitter} \item {\ttfamily comment} \item {\ttfamily signals} \end{DoxyItemize} Notes\+: \begin{DoxyItemize} \item {\ttfamily signals} is a list of {\ttfamily \mbox{\hyperlink{structSignalInfo}{Signal\+Info}}} \item {\ttfamily is\+Extended} is determined during CAN ID normalization \item {\ttfamily pgn} is derived using simplified J1939 logic when applicable \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md22}{}\doxysection{$<$tt$>$\+Dbc\+Database$<$/tt$>$}\label{md_README_autotoc_md22} Top-\/level parsed DBC container. Conceptually\+: \begin{DoxyCode}{0} \DoxyCodeLine{DbcDatabase} \DoxyCodeLine{ └── vector} \end{DoxyCode} This is the central structure produced by {\ttfamily \mbox{\hyperlink{classDbcParser}{Dbc\+Parser}}}. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md24}{}\doxysection{UI Tree Layer}\label{md_README_autotoc_md24} \hypertarget{md_README_autotoc_md25}{}\doxysection{$<$tt$>$\+Tree\+Node$<$/tt$>$}\label{md_README_autotoc_md25} The UI tree contains three node types\+: \begin{DoxyItemize} \item {\ttfamily Root} \item {\ttfamily Frame} \item {\ttfamily Signal} \end{DoxyItemize} Example hierarchy\+: \begin{DoxyCode}{0} \DoxyCodeLine{dbc} \DoxyCodeLine{ ├── EngineData} \DoxyCodeLine{ │ ├── EngineSpeed} \DoxyCodeLine{ │ ├── OilTemp} \DoxyCodeLine{ │ └── CoolantTemp} \DoxyCodeLine{ └── VehicleData} \DoxyCodeLine{ ├── VehicleSpeed} \DoxyCodeLine{ └── Odometer} \end{DoxyCode} Each node stores either\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{structFrameInfo}{Frame\+Info}}} \item {\ttfamily \mbox{\hyperlink{structSignalInfo}{Signal\+Info}}} \end{DoxyItemize} The tree is intended for browsing and later Qt model integration. It is {\bfseries{not}} the primary runtime decode structure. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md27}{}\doxysection{Runtime Decode Layer}\label{md_README_autotoc_md27} \hypertarget{md_README_autotoc_md28}{}\doxysection{Purpose}\label{md_README_autotoc_md28} The decode layer exists so that decoding can be fast and independent from UI concerns. Instead of searching a tree, the decoder uses a prepared database with direct lookup. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md30}{}\doxysection{$<$tt$>$\+Byte\+Order$<$/tt$>$}\label{md_README_autotoc_md30} Runtime byte order enum\+: \begin{DoxyItemize} \item {\ttfamily Intel} \item {\ttfamily Motorola} \end{DoxyItemize} This is better for decode code than passing around raw DBC characters. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md32}{}\doxysection{$<$tt$>$\+Value\+Type$<$/tt$>$}\label{md_README_autotoc_md32} Numeric type enum\+: \begin{DoxyItemize} \item {\ttfamily Unsigned} \item {\ttfamily Signed} \end{DoxyItemize} This is clearer than combining multiple boolean flags during runtime logic. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md34}{}\doxysection{$<$tt$>$\+Decode\+Signal$<$/tt$>$}\label{md_README_autotoc_md34} Represents one runtime-\/ready signal definition. Fields\+: \begin{DoxyItemize} \item {\ttfamily name} \item {\ttfamily start\+Bit} \item {\ttfamily length} \item {\ttfamily byte\+Order} \item {\ttfamily value\+Type} \item {\ttfamily factor} \item {\ttfamily offset} \item {\ttfamily minimum} \item {\ttfamily maximum} \item {\ttfamily unit} \item {\ttfamily receivers} \item {\ttfamily comment} \end{DoxyItemize} This structure contains all information required for extracting and converting a signal value from raw frame data. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md36}{}\doxysection{$<$tt$>$\+Decode\+Frame$<$/tt$>$}\label{md_README_autotoc_md36} Represents one runtime-\/ready frame definition. Fields\+: \begin{DoxyItemize} \item {\ttfamily name} \item {\ttfamily can\+Id} \item {\ttfamily is\+Extended} \item {\ttfamily dlc} \item {\ttfamily pgn} \item {\ttfamily has\+Pgn} \item {\ttfamily transmitter} \item {\ttfamily comment} \item {\ttfamily signals} \end{DoxyItemize} This structure is used directly by the decoder. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md38}{}\doxysection{$<$tt$>$\+Frame\+Key$<$/tt$>$}\label{md_README_autotoc_md38} Fast lookup key for runtime frame matching. Fields\+: \begin{DoxyItemize} \item {\ttfamily can\+Id} \item {\ttfamily is\+Extended} \end{DoxyItemize} This matters because the same numeric identifier must not be confused between standard and extended frames. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md40}{}\doxysection{$<$tt$>$\+Decode\+Database$<$/tt$>$}\label{md_README_autotoc_md40} Top-\/level runtime decode container. Fields\+: \begin{DoxyItemize} \item {\ttfamily frames} \item {\ttfamily frame\+Index\+By\+Key} \end{DoxyItemize} Conceptually\+: \begin{DoxyCode}{0} \DoxyCodeLine{DecodeDatabase} \DoxyCodeLine{ ├── vector} \DoxyCodeLine{ └── unordered\_map} \end{DoxyCode} This gives the decoder fast access to a frame definition using CAN ID and frame type. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md42}{}\doxysection{Decoder Layer}\label{md_README_autotoc_md42} \hypertarget{md_README_autotoc_md43}{}\doxysection{$<$tt$>$\+Raw\+Can\+Frame$<$/tt$>$}\label{md_README_autotoc_md43} Represents a raw CAN frame to decode. Fields\+: \begin{DoxyItemize} \item {\ttfamily can\+Id} \item {\ttfamily is\+Extended} \item {\ttfamily data} \end{DoxyItemize} This same structure can be used for\+: \begin{DoxyItemize} \item live CAN bus input \item replayed trace records \item unit tests \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md45}{}\doxysection{$<$tt$>$\+Decoded\+Signal\+Value$<$/tt$>$}\label{md_README_autotoc_md45} Represents one decoded signal result. Fields\+: \begin{DoxyItemize} \item {\ttfamily definition} \item {\ttfamily raw\+Value} \item {\ttfamily physical\+Value} \item {\ttfamily valid} \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md47}{}\doxysection{$<$tt$>$\+Decoded\+Frame\+Value$<$/tt$>$}\label{md_README_autotoc_md47} Represents one decoded frame result. Fields\+: \begin{DoxyItemize} \item {\ttfamily definition} \item {\ttfamily signals} \item {\ttfamily valid} \end{DoxyItemize} This is the decoder output for one raw frame. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md49}{}\doxysection{$<$tt$>$\+Dbc\+Decoder$<$/tt$>$}\label{md_README_autotoc_md49} Main runtime decoder class. Responsibilities\+: \begin{DoxyItemize} \item find a frame definition by CAN ID \item decode all signals in a frame \item extract raw values \item sign-\/extend signed values \item convert raw values into physical values \end{DoxyItemize} Main methods\+: \begin{DoxyItemize} \item {\ttfamily Find\+Frame(...)} \item {\ttfamily Decode(...)} \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md51}{}\doxysection{Parser Support}\label{md_README_autotoc_md51} The current parser supports the following DBC elements\+: \begin{DoxyItemize} \item {\ttfamily BO\+\_\+} \item {\ttfamily SG\+\_\+} \item {\ttfamily CM\+\_\+ BO\+\_\+} \item {\ttfamily CM\+\_\+ SG\+\_\+} \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md53}{}\doxysection{Supported DBC Syntax}\label{md_README_autotoc_md53} \hypertarget{md_README_autotoc_md54}{}\doxysection{Frame definition}\label{md_README_autotoc_md54} Example\+: \begin{DoxyCode}{0} \DoxyCodeLine{BO\_ 256 EngineData: 8 EEC1} \end{DoxyCode} Parsed fields\+: \begin{DoxyItemize} \item frame CAN ID \item frame name \item DLC \item transmitter ECU \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md56}{}\doxysection{Signal definition}\label{md_README_autotoc_md56} Example\+: \begin{DoxyCode}{0} \DoxyCodeLine{SG\_ EngineSpeed : 0|16@1+ (0.125,0) [0|8000] "{}rpm"{} ECU1,ECU2} \end{DoxyCode} Parsed fields\+: \begin{DoxyItemize} \item signal name \item start bit \item signal length \item byte order \item signedness \item factor \item offset \item minimum \item maximum \item unit \item receivers \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md58}{}\doxysection{Comments}\label{md_README_autotoc_md58} Frame comment example\+: \begin{DoxyCode}{0} \DoxyCodeLine{CM\_ BO\_ 256 "{}Engine data frame"{};} \end{DoxyCode} Signal comment example\+: \begin{DoxyCode}{0} \DoxyCodeLine{CM\_ SG\_ 256 EngineSpeed "{}Actual engine speed"{};} \end{DoxyCode} Stored in\+: \begin{DoxyItemize} \item {\ttfamily \mbox{\hyperlink{structFrameInfo_ace75121294f9d89b762080ab5643293c}{Frame\+Info\+::comment}}} \item {\ttfamily \mbox{\hyperlink{structSignalInfo_ac99ba7563a5dad01e39c4257216953f5}{Signal\+Info\+::comment}}} \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md60}{}\doxysection{CAN ID Normalization}\label{md_README_autotoc_md60} The parser normalizes frame identifiers. Common DBC behavior\+: \begin{DoxyItemize} \item extended identifiers may be stored with bit 31 set \item the actual 29-\/bit identifier must be extracted from that value \end{DoxyItemize} The parser therefore stores\+: \begin{DoxyItemize} \item normalized {\ttfamily can\+Id} \item separate {\ttfamily is\+Extended} flag \end{DoxyItemize} This is important both for correct lookup and for future interoperability with live CAN APIs. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md62}{}\doxysection{PGN Extraction}\label{md_README_autotoc_md62} PGN is derived only when the frame is treated as extended. The current logic is simplified J1939 extraction\+: \begin{DoxyItemize} \item {\ttfamily pf} \item {\ttfamily ps} \item {\ttfamily dp} \end{DoxyItemize} This is enough for a practical start but should not be treated as full J1939 validation. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md64}{}\doxysection{Decode Flow}\label{md_README_autotoc_md64} Typical runtime decode flow\+: \begin{DoxyCode}{0} \DoxyCodeLine{RawCanFrame} \DoxyCodeLine{ ↓} \DoxyCodeLine{Find frame in DecodeDatabase} \DoxyCodeLine{ ↓} \DoxyCodeLine{For each signal:} \DoxyCodeLine{ extract raw bits} \DoxyCodeLine{ apply sign extension if needed} \DoxyCodeLine{ convert to physical value} \DoxyCodeLine{ ↓} \DoxyCodeLine{DecodedFrameValue} \end{DoxyCode} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md66}{}\doxysection{Intel and Motorola Extraction}\label{md_README_autotoc_md66} The decoder currently has separate extraction paths\+: \begin{DoxyItemize} \item {\ttfamily Extract\+Intel(...)} \item {\ttfamily Extract\+Motorola(...)} \end{DoxyItemize} This is important because byte order is not just metadata once decoding starts. Intel and Motorola require different bit extraction logic. This is one of the main reasons why the runtime decode layer should be explicit and prepared in advance. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md68}{}\doxysection{Example Usage}\label{md_README_autotoc_md68} \hypertarget{md_README_autotoc_md69}{}\doxysection{Parse DBC}\label{md_README_autotoc_md69} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{classDbcParser}{DbcParser}} parser;} \DoxyCodeLine{\mbox{\hyperlink{structDbcDatabase}{DbcDatabase}} database = parser.\mbox{\hyperlink{classDbcParser_aef72826942c9095d653fafa435855e56}{ParseFile}}(\textcolor{stringliteral}{"{}example.dbc"{}});} \end{DoxyCode} \hypertarget{md_README_autotoc_md70}{}\doxysection{Build UI tree}\label{md_README_autotoc_md70} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{classDbcTreeBuilder}{DbcTreeBuilder}} treeBuilder;} \DoxyCodeLine{std::unique\_ptr root = treeBuilder.\mbox{\hyperlink{classDbcTreeBuilder_a7e57d067d831b14b383947fd125edd4b}{Build}}(database);} \end{DoxyCode} \hypertarget{md_README_autotoc_md71}{}\doxysection{Build runtime decode database}\label{md_README_autotoc_md71} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{classDbcDecodeBuilder}{DbcDecodeBuilder}} decodeBuilder;} \DoxyCodeLine{\mbox{\hyperlink{structDecodeDatabase}{DecodeDatabase}} decodeDatabase = decodeBuilder.\mbox{\hyperlink{classDbcDecodeBuilder_a2bc6386dfb5e58976c42e22c19ec471b}{Build}}(database);} \end{DoxyCode} \hypertarget{md_README_autotoc_md72}{}\doxysection{Decode a raw frame}\label{md_README_autotoc_md72} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{structRawCanFrame}{RawCanFrame}} rawFrame;} \DoxyCodeLine{rawFrame.\mbox{\hyperlink{structRawCanFrame_a2d0e7fa0e3d5c20bbed55ed8f7888ff4}{canId}} = 0x123;} \DoxyCodeLine{rawFrame.\mbox{\hyperlink{structRawCanFrame_a462193d275adc1dba8bd18ffa0e36bb7}{isExtended}} = \textcolor{keyword}{false};} \DoxyCodeLine{rawFrame.\mbox{\hyperlink{structRawCanFrame_a0acb487612104c99c9907344c035df83}{data}} = \{0x01, 0x02, 0x03, 0x04\};} \DoxyCodeLine{} \DoxyCodeLine{\mbox{\hyperlink{classDbcDecoder}{DbcDecoder}} decoder;} \DoxyCodeLine{\mbox{\hyperlink{structDecodedFrameValue}{DecodedFrameValue}} decoded = decoder.\mbox{\hyperlink{classDbcDecoder_a345951ffe5d943a70d3a1ea1f39e74f7}{Decode}}(decodeDatabase, rawFrame);} \end{DoxyCode} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md74}{}\doxysection{Unified Decode Strategy}\label{md_README_autotoc_md74} A key design goal is that the same decoder should work for both\+: \begin{DoxyItemize} \item live CAN frames \item trace replay frames \end{DoxyItemize} That means this architecture supports\+:\hypertarget{md_README_autotoc_md75}{}\doxysubsection{live path}\label{md_README_autotoc_md75} \begin{DoxyCode}{0} \DoxyCodeLine{live CAN input} \DoxyCodeLine{ ↓} \DoxyCodeLine{RawCanFrame} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcDecoder} \DoxyCodeLine{ ↓} \DoxyCodeLine{decoded signal values} \end{DoxyCode} \hypertarget{md_README_autotoc_md76}{}\doxysubsection{trace path}\label{md_README_autotoc_md76} \begin{DoxyCode}{0} \DoxyCodeLine{trace reader} \DoxyCodeLine{ ↓} \DoxyCodeLine{RawCanFrame} \DoxyCodeLine{ ↓} \DoxyCodeLine{DbcDecoder} \DoxyCodeLine{ ↓} \DoxyCodeLine{decoded signal values} \end{DoxyCode} This avoids duplicating decode logic in two separate parts of the application. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md78}{}\doxysection{Intended Use in Frame\+Tap}\label{md_README_autotoc_md78} This module is meant to support at least the following Frame\+Tap workflows\+: \begin{DoxyItemize} \item load a DBC file \item browse frames and signals \item search signals \item drag a signal into a plot later \item decode live CAN traffic \item decode recorded traces \item convert raw values into physical values \item show metadata like units, comments, transmitter, receivers, and PGN \end{DoxyItemize} Example combined workflow\+: \begin{DoxyCode}{0} \DoxyCodeLine{Load DBC} \DoxyCodeLine{ ↓} \DoxyCodeLine{Parse into DbcDatabase} \DoxyCodeLine{ ↓} \DoxyCodeLine{Build UI tree} \DoxyCodeLine{ ↓} \DoxyCodeLine{Build DecodeDatabase} \DoxyCodeLine{ ↓} \DoxyCodeLine{Use same decode engine for:} \DoxyCodeLine{ -\/ live frames} \DoxyCodeLine{ -\/ trace replay} \end{DoxyCode} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md80}{}\doxysection{Why the Tree Is Not Enough}\label{md_README_autotoc_md80} The tree exists for browsing. However, runtime decode should not rely on tree traversal because that would introduce unnecessary coupling and inefficiency. A runtime decoder needs\+: \begin{DoxyItemize} \item fast key-\/based access \item minimal interpretation at decode time \item direct signal definitions already prepared \end{DoxyItemize} That is why {\ttfamily \mbox{\hyperlink{structDecodeDatabase}{Decode\+Database}}} is a separate layer. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md82}{}\doxysection{Why No Abstract Factory Is Used}\label{md_README_autotoc_md82} At the current stage, abstract factory is intentionally avoided. The current design is already clean\+: \begin{DoxyCode}{0} \DoxyCodeLine{parser → parsed database → decode database} \DoxyCodeLine{ ↘ tree builder → UI tree} \end{DoxyCode} Introducing factory layers now would increase complexity without solving an immediate problem. If later the project requires multiple output representations or multiple build strategies, that can be added then. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md84}{}\doxysection{Current Limitations}\label{md_README_autotoc_md84} This is still a minimal implementation. Not supported yet\+: \begin{DoxyItemize} \item multiplexed signals \item {\ttfamily VAL\+\_\+} tables \item {\ttfamily BA\+\_\+} attributes \item {\ttfamily BA\+\_\+\+DEF\+\_\+} definitions \item advanced comment handling \item full DBC grammar coverage \item full J1939 validation \item extensive edge-\/case handling for unusual DBC formatting \end{DoxyItemize} Motorola extraction is implemented, but it should still be verified carefully against real-\/world DBC files and expected values. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md86}{}\doxysection{Recommended Next Steps}\label{md_README_autotoc_md86} A practical development order would be\+:\hypertarget{md_README_autotoc_md87}{}\doxysubsection{Stage 1 -\/ already implemented}\label{md_README_autotoc_md87} \begin{DoxyItemize} \item {\ttfamily BO\+\_\+} \item {\ttfamily SG\+\_\+} \item {\ttfamily CM\+\_\+} \item normalized CAN ID \item {\ttfamily is\+Extended} \item transmitter \item receivers \item comments \item tree representation \item runtime decode database \item runtime decoder \end{DoxyItemize}\hypertarget{md_README_autotoc_md88}{}\doxysubsection{Stage 2}\label{md_README_autotoc_md88} Recommended additions\+: \begin{DoxyItemize} \item parent pointer in {\ttfamily \mbox{\hyperlink{classTreeNode}{Tree\+Node}}} \item Qt model adapter \item {\ttfamily VAL\+\_\+} support for enum-\/style signals \item better display strings for UI \item selective decoding of only chosen signals \end{DoxyItemize}\hypertarget{md_README_autotoc_md89}{}\doxysubsection{Stage 3}\label{md_README_autotoc_md89} Recommended additions\+: \begin{DoxyItemize} \item multiplexing support \item attribute parsing \item richer J1939 support \item CSV export of decoded traces \item optimized filtering and signal selection \end{DoxyItemize}\hypertarget{md_README_autotoc_md90}{}\doxysubsection{Stage 4}\label{md_README_autotoc_md90} Advanced functionality\+: \begin{DoxyItemize} \item live plot integration \item signal subscriptions \item per-\/signal trace decode pipelines \item decoder-\/assisted export formats \end{DoxyItemize} \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md92}{}\doxysection{Build Integration}\label{md_README_autotoc_md92} The module does not depend on any specific build system. It can be integrated with\+: \begin{DoxyItemize} \item CMake \item qmake \item Makefile \end{DoxyItemize} Just add the source files to the project. \DoxyHorRuler{0} \hypertarget{md_README_autotoc_md94}{}\doxysection{Summary}\label{md_README_autotoc_md94} This module is now split into two intentionally separate layers\+:\hypertarget{md_README_autotoc_md95}{}\doxysubsection{Parsed representation}\label{md_README_autotoc_md95} Used for\+: \begin{DoxyItemize} \item storing parsed DBC content \item browsing \item UI tree generation \end{DoxyItemize}\hypertarget{md_README_autotoc_md96}{}\doxysubsection{Runtime decode representation}\label{md_README_autotoc_md96} Used for\+: \begin{DoxyItemize} \item fast frame lookup \item live CAN decode \item trace decode \item physical value conversion \end{DoxyItemize} That separation is the main architectural improvement. In short, the system now looks like this\+: \begin{DoxyCode}{0} \DoxyCodeLine{DBC parser → DbcDatabase → DecodeDatabase → DbcDecoder} \DoxyCodeLine{ ↘ TreeNode → future UI} \end{DoxyCode} This gives Frame\+Tap a much better foundation for real use, because both browsing and decoding are supported without forcing one representation to do the other\textquotesingle{}s job.