Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/weirdnox/generic-grafcet

Generic Grafcet implementation, in C, using metaprogramming.
https://github.com/weirdnox/generic-grafcet

c generic grafcet macros metaprogramming preprocessor system

Last synced: 23 days ago
JSON representation

Generic Grafcet implementation, in C, using metaprogramming.

Awesome Lists containing this project

README

        

* Generic Grafcet
This is a program that implements generic Grafcet systems with the help of very simple
macros. It is not provided as a library, but it should be easy to adapt it and embed it in
other programs.

It works by having the source be fed to a preprocessor, which generates custom functions
and enums in another file (preprocessor_output.h) that will be included by the original
one. This is a technique called [[https://en.wikipedia.org/wiki/Metaprogramming][metaprogramming]].

[[https://youtu.be/t8XrhOiZT2E][Watch a screencast here!]]

** Features
- Generic grafcet system, with a variable number of grafcets, states and transitions
- Customizable inputs and outputs
- With rising and falling edges
- Colorful, automatic debug information
- State timers
- Supervising
- Hierarchy (grafcets with lower index are updated first)
- Grafcet freeze function

** The preprocessor
It was based on the simple preprocessor made on [[https://handmadehero.org/][Handmade Hero]] (which is a huge inspiration
for me!). It uses a pseudo [[https://en.wikipedia.org/wiki/Recursive_descent_parser][Recursive Descent]] which only parses some tokens of interest,
from all that are scanned.

** Some things missing
- Grafcet reset utility (set it to the starting point)
- Grafcet pausing

** License
This is made available in the MIT License, with some third party code documented as such.