|
1 | 1 | # Arduino FSM
|
2 | 2 |
|
3 |
| -This Repo provides an Example how to write a Finite-state machine (FSM) which can be nested. |
4 |
| -Based on this Wiki-Article: [Finite-state_machine](https://en.wikipedia.org/wiki/Finite-state_machine) and an example from R.Bonderer (HSR) |
5 |
| - |
6 |
| -<img src="https://raw.githubusercontent.com/LMazzole/ArdFSM/master/doxygen/Fsm_Moore_model_door_control.png" height="400" /> |
| 3 | +This Repo provides an Example how to write a Finite-state machine (FSM) which can be nested in C++. |
| 4 | +It's based on this Wiki-Article: [Finite-state_machine](https://en.wikipedia.org/wiki/Finite-state_machine) and an example by R.Bonderer (HSR) from *Embedded Software Engineering*. |
| 5 | + |
| 6 | +<img src="./doxygen/images/DoorCtrl.png" height="400" /> |
| 7 | + |
| 8 | +## Table of Content |
| 9 | +<!-- TOC Generated with https://magnetikonline.github.io/markdown-toc-generate/ --> |
| 10 | + |
| 11 | +- [Documentation with Doxygen](#documentation-with-doxygen) |
| 12 | + - [Dependency Graph](#dependency-graph) |
| 13 | + - [Collaboration Diagram](#collaboration-diagram) |
| 14 | +- [What is Doxygen?](#what-is-doxygen) |
| 15 | + - [HowTo install Doxygen](#howto-install-doxygen) |
| 16 | + - [HowTo install .dot and graphix](#howto-install-dot-and-graphix) |
| 17 | + - [HowTo run Doxygen](#howto-run-doxygen) |
| 18 | + - [Doxygen and GitHub-Pages](#doxygen-and-github-pages) |
| 19 | +- [Usefull tips](#usefull-tips) |
| 20 | + - [Extension for VSCode](#extension-for-vscode) |
| 21 | + - [How to Write Doxygen Doc Comments](#how-to-write-doxygen-doc-comments) |
7 | 22 |
|
8 | 23 | ## Documentation with Doxygen
|
9 | 24 |
|
10 |
| -[View the GitHub-Page for Documentation](https://lmazzole.github.io/ArdFSM/) |
11 |
| - |
12 |
| -## HowTo use Doxygen in VSCODE |
13 |
| - |
14 |
| -## Install Doxygen |
15 |
| -[Doxygen Installation manual](http://www.doxygen.nl/manual/install.html) |
| 25 | +View the GitHub-Page for the [source-code documentation](https://lmazzole.github.io/ArdFSM/) |
| 26 | + |
| 27 | +### Dependency Graph |
| 28 | +<img src="./docs/main_8cpp__incl.png" height="350" /> |
| 29 | + |
| 30 | +### Collaboration Diagram |
| 31 | +<img src="./docs/class_door_ctrl__coll__graph.png" height="200" /> |
| 32 | + |
| 33 | +## What is Doxygen? |
| 34 | +Doxygen is [Open-Source](https://github.com/doxygen/doxygen) documentation generator. It extracts sourcecode-documentation directly from annoted Code. Doxygen supports a lot of popular programmin languages such as C++, C , Java, Python, etc. |
| 35 | + |
| 36 | +For Doxygen to detect the documentation, special comments are needed. One example is shown below, but there are many more possible variants as shown [here](http://www.doxygen.nl/manual/docblocks.html). |
| 37 | +``` |
| 38 | +/** |
| 39 | + * @brief A short one line description |
| 40 | + * |
| 41 | + * <Longer description> |
| 42 | + * <May span multiple lines or paragraphs as needed> |
| 43 | + * |
| 44 | + * @param Description of method's or function's input parameter |
| 45 | + * @param ... |
| 46 | + * @return Description of the return value |
| 47 | + */ |
| 48 | +``` |
| 49 | +The main benefit of doxygen is, that the documentatiion can be written directly in the sourcode its self and thus is easy to keep up to date. It can also automatically generate the visualization from relations between classes, object, inheritance and other deoendencys |
| 50 | + |
| 51 | +### HowTo install Doxygen |
| 52 | +Detailed instructions how to install Doxygen can be found in the [Doxygen Installation manual](http://www.doxygen.nl/manual/install.html). |
16 | 53 | 1. Download a binary distribution at [Doxygen Download](http://www.doxygen.nl/download.html)
|
17 | 54 | 2. Select "Full Installation" (default option)
|
18 | 55 | 3. Add "c:/doxygen/bin" (or whatever path was used during the installation) to the System PATH variable to run "doxygen" without providing the full path to the binary.
|
19 | 56 |
|
20 | 57 | [Source: [PALISADE](https://git.njit.edu/palisade/PALISADE/wikis/how-to-setup-doxygen-windows) ]
|
21 | 58 |
|
22 |
| -## How to run doxygen |
| 59 | +### HowTo Install .dot and graphix |
| 60 | +If you like to draw class diagrams, collaboration diagrams,overall class hierarchy and dependency graphs you need to install the GraphViz package. |
| 61 | +You can download a stable Windows release on the [Graphviz Website](<https://graphviz.gitlab.io/_pages/Download/Download_windows.html>). |
| 62 | +1. Download the installer for Windows |
| 63 | +2. The default installation path will be C:\Program Files (x86)\GraphvizX.XX\bin (Example: GraphvizX.XX → Graphviz2.38) |
| 64 | +3. Open cmd window as administrator and go the location C:\Program Files (x86)\GraphvizX.XX\bin and run the below command: |
| 65 | + >dot.exe |
| 66 | +
|
| 67 | +4. Exit the command window. |
| 68 | +5. Go to the **Control Panel → System and Security → System**, and on the right side navigation panel, you will see the link Advanced systems settings. |
| 69 | +6. Once there in advance settings, a dialogue box will open which will show the button Environment Variables. Click on the button Environment Variables. |
| 70 | +7. Select the entry "Path" on the system variables section and add C:\Program Files (x86)\Graphviz **X.XX** \bin to the existing path. |
| 71 | + |
| 72 | +[Source: [Atlassin-How to install Graphviz(Windows,Mac,Linux)](<https://bobswift.atlassian.net/wiki/spaces/GVIZ/pages/20971549/How+to+install+Graphviz+software>), [Generating a callgraph in Doxygen](<https://romanegloo.wordpress.com/2012/03/29/generating-a-callgraph-by-using-doxygen-and-graphviz-13/>)] |
| 73 | + |
| 74 | +### HowTo run Doxygen |
23 | 75 |
|
24 | 76 | 1. Start doxywizard (Desktop App)
|
25 | 77 | 2. Click on File->Open and choose Doxyfile in the Folder doxygen
|
26 | 78 | 3. In Doxywizard switch to the Tab Run and Click on Run doxygen
|
27 | 79 | 4. When Doxygen has finished click on Show HTML output.
|
28 | 80 |
|
29 |
| -[Source: [PALISADE](https://git.njit.edu/palisade/PALISADE/wikis/how-to-setup-doxygen-windows) ] |
| 81 | +If you like to generate Diagrams make sure, that in the Tab Wizard/Diagrams the Button "Use dot tool from GraphViz package" is activated. |
| 82 | + |
| 83 | +You can use doxygen also only in console. Check the [Doxygen-Documentation](http://www.doxygen.nl/manual/index.html) if you need to know more. |
30 | 84 |
|
31 |
| -## Doxygen and GitHub-Pages |
| 85 | +### Doxygen and GitHub-Pages |
32 | 86 | 1. Generate your doxyfile direct into /docs.
|
33 | 87 | 2. You need to add an .nojekll file in ./docs.
|
34 | 88 | This is necessary because Jekyll considers Directories that start with underscores to be special resources and does not copy them to the final site.
|
|
0 commit comments