|
SAE WS_2324
|
Statemachine Base Class. More...
Public Member Functions | |
| transition (self, event) | |
| Method to perform a state transition based on the incoming event. | |
| run (self) | |
| Main module of the statemachine implementation. | |
| get_valid_event (self) | |
| Method to compare the input event recieved by the state machine module and to check its validity. | |
| receive_input_event (self, user_input) | |
| A method to pass the event received by the user to the internal input event field. | |
Public Attributes | |
| states | |
| The list of valid states currently implemented. | |
| transitions | |
| Transition table containing Current State, Switching Event, Next Event. | |
| events | |
| {"current_state": "s_semi_auto_mode", "event": "E_STOP", "next_state": "s_init_0"}, | |
| current_state | |
| The current state of the module implementation. | |
| input_event | |
| incoming event passed to the state machine. | |
Statemachine Base Class.
| state_machine.StateMachine.receive_input_event | ( | self, | |
| user_input ) |
A method to pass the event received by the user to the internal input event field.
| user_input | The event passed by the user to the statemachine. |
| state_machine.StateMachine.run | ( | self | ) |
Main module of the statemachine implementation.
In this module the statemachine implementation runs. It first checks if the event recieved by the stateamchine is a valid event. If the valid event is received then a state transition is performed using the state transition table.
| state_machine.StateMachine.transition | ( | self, | |
| event ) |
Method to perform a state transition based on the incoming event.
The incoming event validity is previosly checked and based on it this method will scan the list of the transition table and perform a state switch.
| event | A valid event. |
| state_machine.StateMachine.events |
{"current_state": "s_semi_auto_mode", "event": "E_STOP", "next_state": "s_init_0"},
A list containing valid Events, only events contained in this list are accepted for state switching.