Keep track of how many times a function has been run

Fine, but it didn't create pretty pictures or anything. Basically I just made a worksheet with all the distinct states, then another worksheet with a list of routes that defines 'from state', 'to state' and 'action' which basically determines the behavior of the system. I used it to auto-generate arrays and structs so I didn't have to type them by hand. Worked like a charm for the most part; the only annoying parts were the way Excel adds double quotes if you copy-paste stuff to another app and the character limit for the contents of a single cell. Otherwise it was quite convenient. I basically wrote a generic state machine library (actually, a collection of libraries) that perform all fundamental tasks and I could define machine behavior in terms of which outputs to activate at what point etc. by adding lines in the Excel sheet. So none of the actual states, inputs or outputs are hardcoded apart from a few configuration files that contain the auto-generated code from Excel.
Note that the Excel stuff wasn't a substitute for a 2D flow chart, but an intermediary step between the flow chart and the actual C++ code. You could of course take the 'routes' worksheet and turn it into a flowchart pretty easily - or vice versa. That's what Yakindu essentially does as well, but it's a bit bloated if you want to keep your project somewhat basic.

1 Like