SAE WS_2324
Loading...
Searching...
No Matches
state_machine.StateMachine Class Reference

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.
 

Detailed Description

Statemachine Base Class.

Member Function Documentation

◆ receive_input_event()

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.

Parameters
user_inputThe event passed by the user to the statemachine.

◆ run()

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.

◆ transition()

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.

Parameters
eventA valid event.

Member Data Documentation

◆ events

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.


The documentation for this class was generated from the following file: