Library to handle sequence running composed by steps and transitions. Each step can trigger several actions.
The main purpose is to interpret "grafcet" sequences. It is not forseen for "production use" (even if it could be enough). It is used for sequences developpment, in collaboration with another library that enable to generate C++ code to "hard-code" sequences, that give more determinism and enable "soft real-time".
We distinguish three kinds of sequences, and all possible combinations that respect the chart constraints:
- Unique Sequence
- Simultaneous Sequence
- Exclusive Sequence
- Run "interpreted sequences", Grafcet like.
- Macro: Reusable sequence subset.
- Check if sequences are crazy: Looping / Too Much Parallelism
- Configurable threading (thread_pool sizing).
- Sequence consistency checks.
- This library is not meant to be able to externally wait on step activation (We get an event notification when a step is activated/deactivated)
- This implementation use a thread_pool whose default threads count is the current ‘hardware thread contexts’ count of the machine (16 on my device)
- Each step run in its own thread (So only 16 steps can run simultaneously on my machine).
Check against EN60848 ? It is probably far to be exhaustive. Feel free to help.
docker build -f docker/Dockerfile -t sfc-mingw .
docker run --name sfc-mingw -d --rm -it sfc-mingw
docker attach sfc-mingw
docker run --rm --platform linux/amd64 -v "$(pwd):/src" --entrypoint /bin/bash sfc-mingw -c '
cd /src;
mkdir -p build && cd build;
cmake -G Ninja -DBUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/mingw/mingw-toolchain.cmake .. && ninja
'
docker run --rm --platform linux/amd64 -v "$(pwd):/src" -v "$(pwd)/docker/output:/output" --entrypoint /bin/bash sfc-mingw -c '
cd /src;
$CXX docker/test.cpp -Iinclude -Ibuild/third_party/mingw-std-threads/cmake_stdheaders_generator/cmake_stdheaders_generator -o /output/sfc_test.exe -std=c++20 -pthread -Lbuild/bin/ -lsfc -static-libgcc -static-libstdc++
'