使用 Doxygen 绘制控制理论框图

发布于 2024-12-08 17:00:52 字数 322 浏览 0 评论 0原文

我正在从事自动化领域的 C++ 项目,我想开始记录。我决定选择 Doxygen。但是,除了记录特定的数据字段和绘制类层次结构 UML 图之外,我还想用如下框图来记录几种方法的功能: 在此处输入图像描述

解决方案是什么?

我对 LaTeX 很熟悉。我读过 Doxygen 对 LaTeX 有一些支持,但我不知道这能支持到什么程度。是否可以在 Doxygen 中使用任何 LaTeX 包?您会推荐哪些特定的软件包?您能否提供一些简单的示例?

我也愿意接受与 Doxygen 不同的建议。

I'm working on a C++ project in the field of automatics I'd like to start documenting. I'm rather decided for Doxygen. But, apart of documenting particular fields of data and drawing class-hierarchy UML-diagrams, I'd like to document several methods' functionalities with block diagrams like this one:
enter image description here

What are the solutions?

I'm familiar with LaTeX. I've read Doxygen has some support for LaTeX, I don't know how far this goes, though. Is it possible to use any LaTeX package within Doxygen? Which particular packages would you recommend and could you provide some simple examples as well?

I'm also open to recommendations of something different than Doxygen.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流殇 2024-12-15 17:00:52

如果只是记录控制系统结构、变量等,您可以在其他地方生成图表(例如,如果您想使用开源工具,则为 Dia、XFig 或 Inkscape),并通过内部的 image 关键字将它们嵌入到您的 Doxygen 文档中您的代码:

/*!
.. Doxygen doc here..
\image html Data_Model.png "Figure 1: UML Diagram of the Data Source and Data Model Relationships"
*/

为此,您需要在 Doxyfile 文件中告诉 Doxygen 在哪里可以找到图像,并将图像相对于您的 doxygen 路径放置(DOCROOT/images 在此)案例):

# The IMAGE_PATH tag can be used to specify one or more files or 
# directories that contain image that are included in the documentation (see 
# the \image command).

IMAGE_PATH             = images

使用乳胶扩展或其他语言驱动的图形标记从 Doxygen 文档中生成图形,恕我直言,这并不能证明学习语言、配置和对齐工具链的开销是合理的。另一方面,如果您已经有一些自动生成图形的工具(从您的代码或配置文件),那么从 Makefile 中运行该工具应该是一件轻而易举的事,让它生成图像并将图像嵌入到通过 image 关键字获取您的 doxygen 文档。

If it's only about getting the control-systems structure, variables etc. documented you can generate the diagram elsewhere (e.g. Dia, XFig or Inkscape if you want to use open source tools) and embed them into your Doxygen documentation via the image keyword from within your code:

/*!
.. Doxygen doc here..
\image html Data_Model.png "Figure 1: UML Diagram of the Data Source and Data Model Relationships"
*/

To do this you'll need to tell Doxygen in the Doxyfile file where to find the images, and place the images relative to your doxygen path (DOCROOT/images in this case):

# The IMAGE_PATH tag can be used to specify one or more files or 
# directories that contain image that are included in the documentation (see 
# the \image command).

IMAGE_PATH             = images

Using latex extensions or other language driven graphical markups for generating graphs from within Doxygen doc does imho not justify the overhead of learning the language, getting the tool-chain configured and aligned. On the other hand if you have some tool already which is generating the graph automatically (from your code or a config file), it should be a breeze to run the tool from within a Makefile, let it generate the image and embed the image in your doxygen doc via the image keyword.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文