Present library implements an object StateMachine
, representing an advanced finite state machine useful to build a complex automation process.
Present StateMachine
object is conceived to be as more general as possible: it allowe building Moore finite state machines (where output depends only by states) or Mealy finite state machines (where output depends by inputs and state), and it embeds some time-based counters that allows to implement an advanced error handling behavior.
Every state of present automata consist of:
- Status function, or actions to execute when system is in present state;
- ChangeState function, to determine if there are conditions to change state, and to what state you are going to go (next state)
- Dropout function, or actions to execute when exiting present state;
- Transition function, or actions to execute when exiting from present state an enter in the next state;
- Pickup function, or actions to execute when system enters present state;
- Counter to store the time elapsed in present state;
- Maximum allowed time to stack in present state;
- String storing state information