Skip to content
Snippets Groups Projects
Commit 8db453a2 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-698: Add graphviz state diagram to device documentation

parent fbcd5d4f
No related branches found
No related tags found
1 merge request!324Graphviz states
...@@ -28,6 +28,7 @@ author = 'Stichting ASTRON' ...@@ -28,6 +28,7 @@ author = 'Stichting ASTRON'
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [ extensions = [
"sphinx.ext.graphviz"
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
......
...@@ -25,6 +25,33 @@ The state of a device is then queried with ``device.state()``. Each device can b ...@@ -25,6 +25,33 @@ The state of a device is then queried with ``device.state()``. Each device can b
- ``DevState.FAULT``: The device is malfunctioning. Functionality cannot be counted on. - ``DevState.FAULT``: The device is malfunctioning. Functionality cannot be counted on.
- The ``device.state()`` function can throw an error, if the device cannot be reached at all. For example, because it's docker container is not running. See the :ref:`docker` device on how to start it. - The ``device.state()`` function can throw an error, if the device cannot be reached at all. For example, because it's docker container is not running. See the :ref:`docker` device on how to start it.
.. graphviz::
digraph finite_state_machine {
fontname="Helvetica,Arial,sans-serif"
node [fontname="Helvetica,Arial,sans-serif"]
edge [fontname="Helvetica,Arial,sans-serif"]
rankdir=LR;
node [shape = doublecircle fixedsize=true width=0.7]; off;
node [shape = circle fixedsize=true width=0.9];
init -> off [label = "user", color="red"];
standby -> off [label = "user", color="red"];
on -> off [label = "user", color="red"];
alarm -> off [label = "user", color="red"];
off -> init [label = "device", color="green"];
init -> standby [label = "device", color="green"];
standby -> on [label = "device", color="green"];
on -> alarm [label = "device", color="green"];
init -> fault [label = "device", color="green"];
standby -> fault [label = "device", color="green"];
on -> fault [label = "device", color="green"];
alarm -> fault [label = "device", color="green"];
fault -> init [label = "user", color="red"];
fault -> off [label = "user", color="red"];
}
Each device provides the following commands to change the state: Each device provides the following commands to change the state:
:boot(): Turn on the device, and initialise the hardware. Moves from ``OFF`` to ``ON``. :boot(): Turn on the device, and initialise the hardware. Moves from ``OFF`` to ``ON``.
......
...@@ -13,4 +13,6 @@ docker >= 5.0.3 # Apache 2 ...@@ -13,4 +13,6 @@ docker >= 5.0.3 # Apache 2
python-logstash-async >= 2.3.0 # MIT python-logstash-async >= 2.3.0 # MIT
python-casacore >= 3.3.1 # LGPLv3 python-casacore >= 3.3.1 # LGPLv3
etrs-itrs@git+https://github.com/brentjens/etrs-itrs # license pending etrs-itrs@git+https://github.com/brentjens/etrs-itrs # license pending
# numpy must be manually added even though etrs-itrs requires it
numpy >= 1.22.0 # BSD
lofarantpos >= 0.5.0 # Apache 2 lofarantpos >= 0.5.0 # Apache 2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment