I'm working in a company that produces measurement devices. They are testet and calibrated on a machine. There are several steps like power test, communication test, calibrating inputs and outputs and so on.
The test and calibration steps are stored in a database. Not each device has the same steps. Some steps might be skipped.
The current code is a horrible spaghetti code written in Delphi with lots of it's and else's. I want to write some demo code in Rust to reproduce the behavior, but I'm not sure which way I should go.
The code should run in a loop to check several in- and outputs. And it should step through the different test and calibration steps.
Should I use a state machine or how can I implement this? I just need a rough sketch to get an idea where to start.