Index: docs/SDD/CodeGenPipeline.puml =================================================================== diff -u -rb915ccc1a72fcca21908c35140af7ac7df1f1f37 -r8b98ff34313ee5d3f5d49672d622162acfc755c9 --- docs/SDD/CodeGenPipeline.puml (.../CodeGenPipeline.puml) (revision b915ccc1a72fcca21908c35140af7ac7df1f1f37) +++ docs/SDD/CodeGenPipeline.puml (.../CodeGenPipeline.puml) (revision 8b98ff34313ee5d3f5d49672d622162acfc755c9) @@ -9,71 +9,60 @@ start :LeahiUnhandled.conf\n(CAN message definitions); -fork +|Build system| +if (build system) then (qmake) + :extra-compilers "proto", "msgdefs", "canrouting"\nin MsgUtils.pro / CloudConnect.pro; +else (cmake) + :generate_protobuf(),\ngenerate_msg_defs_cpp(),\ngenerate_can_routing_ini()\nin lib/MsgUtils/cmake; +endif +:invoke the generator scripts\n(GenerateProtobuf.py, GenerateMsgDefsCpp.py,\nGenerateCanRoutingIni.py)\nusing the shared Python venv; - ' ── Pipeline A: Protobuf schema ────────────────────────────── - |cmake| - :generate_protobuf()\ninvokes GenerateProtobuf.py; +|MsgUtils Python| +:MsgData.loadConf() parses .conf —\nmessage names, IDs,\nfield names and types; - |MsgUtils Python| - :MsgData loads .conf —\nparses message names, IDs,\nfield names and types; +fork + ' ── Pipeline A: Protobuf schema ────────────────────────────── |Jinja2 Templates| :MsgDefs_proto.jinja\nrenders LeahiMsgDefs.proto; |protoc| - :protoc compiles .proto\ninto C++ stubs\n(LeahiMsgDefs.pb.h / .pb.cc); + :protoc --cpp_out compiles .proto\ninto C++ stubs\n(LeahiMsgDefs.pb.h / .pb.cc); - |CMake build| - :pb stubs compiled\ninto MsgUtils library; + |Build| + :pb.h/cpp files compiled\ninto MsgUtils library; fork again ' ── Pipeline B: C++ message structs ───────────────────────── - |cmake| - :generate_msg_defs_cpp()\ninvokes GenerateMsgDefsCpp.py; - - |MsgUtils Python| - :MsgData loads .conf —\nparses message names, IDs,\nfield names and types; - |Jinja2 Templates| - :MsgDefs_h.jinja renders\nLeahiMsgDefs.h\n(typed structs + toProtobuf /\nfromQByteArray + msgIdString()); - :MsgDefs_cpp.jinja renders\nLeahiMsgDefs.cpp\n(method implementations +\ncanMessageToProtobufByteArray() +\nmsgIdString() switch body); + :MsgDefs_h.jinja renders\nLeahiMsgDefs.h\n(msg structs with fromQByteArray /\ntoQByteArray); + :MsgDefs_cpp.jinja renders\nLeahiMsgDefs.cpp; :MsgProtoUtils_h.jinja renders\nLeahiMsgProtoUtils.h; - :MsgProtoUtils_cpp.jinja renders\nLeahiMsgProtoUtils.cpp; + :MsgProtoUtils_cpp.jinja renders\nLeahiMsgProtoUtils.cpp\n(canMessageToProtobufByteArray()); - |CMake build| + |Build| :MsgDefs + MsgProtoUtils compiled\ninto MsgUtils library; fork again - ' ── Pipeline C: Message handling INI ──────────────────────── - |cmake| - :generate_msg_handling_ini()\ninvokes GenerateMsgHandlingIni.py; - + ' ── Pipeline C: CAN routing INI ───────────────────────────── |MsgUtils Python| - :MsgHandlingIni loads .conf —\nseeds each msgId with\naction=drop, topic=; - :loadIni() merges existing\nLeahiMsgHandling.ini —\npreserves hand-edited\naction + topic values; + :CanRoutingIni.loadConf() extends it —\nto add CAN message handling; + :loadIni() merges the existing\nLeahiCanRouting.ini —\nto preserve changes to original file; |Jinja2 Templates| - :MsgHandlingIni.jinja renders\nLeahiMsgHandling.ini\n(per-msgId: msg_id, action, topic); + :CanRoutingIni.jinja renders\nLeahiCanRouting.ini\n(msg_id, action, topic); end fork |Runtime| -:CloudConnectController::loadMsgHandling()\nreads LeahiMsgHandling.ini at startup; -:onMessageReceive() looks up msgId\nin _msgHandling → drop / send_always /\nsend_delta policy, MQTT topic; -:canMessageToProtobufByteArray()\nconverts CAN → protobuf bytes; -:msgIdString() used in log output; +:**CloudConnectController** +==== +* loadConfig(): reads CloudConnect.ini +* loadCanRouting(): reads LeahiCanRouting.ini +* onCanMessageReceive(): CAN msg → protobuf and routes msg +* canMessageToProtobufByteArray(): converts CAN → protobuf; stop -note right - Pipelines A and B are triggered by - the MsgUtils library cmake target; - Pipeline C is triggered by the - CloudConnect executable cmake target. - All three regenerate whenever - the .conf file changes. -end note - @enduml