Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
CheckupManager Class Reference

The CheckupManager class handles various checkup operations. More...

#include <checkupManager.hpp>

Collaboration diagram for CheckupManager:
Collaboration graph

Public Types

enum class  CheckupState {
  WAIT_FOR_ASMS , START_TOGGLING_WATCHDOG , WAIT_FOR_WATCHDOG , STOP_TOGGLING_WATCHDOG ,
  CHECK_WATCHDOG , CLOSE_SDC , WAIT_FOR_AATS , WAIT_FOR_TS ,
  TOGGLE_VALVE , CHECK_PRESSURE , CHECK_TIMESTAMPS
}
 The CheckupState enum represents the different states of the initial checkup process. The checkup process is a sequence of checks that the vehicle must pass before it can transition to ready state. More...
 
enum class  CheckupError { WAITING_FOR_RESPONSE , ERROR , SUCCESS }
 

Public Member Functions

MetrogetInitialCheckupTimestamp ()
 Provides access to the initial checkup timestamp timer.
 
 CheckupManager (SystemData *systemData)
 Constructor for the CheckupManager class.
 
void resetCheckupState ()
 Resets the checkup state to the initial state.
 
bool shouldStayManualDriving () const
 Performs a manual driving checkup.
 
bool shouldStayOff (DigitalSender *digitalSender)
 Performs an off checkup.
 
CheckupError initialCheckupSequence (DigitalSender *digitalSender)
 Performs an initial checkup.
 
bool shouldGoReadyFromOff () const
 Performs a last re-check for off to ready transition.
 
bool shouldStayReady () const
 Performs a ready to drive checkup.
 
bool shouldEnterEmergency (State current_state) const
 Performs an emergency checkup.
 
bool shouldStayDriving () const
 
bool shouldStayMissionFinished () const
 Performs a mission finished checkup.
 
bool emergencySequenceComplete () const
 Checks if the emergency sequence is complete and the vehicle can transition to AS_OFF.
 
bool resTriggered () const
 Checks if the RES has been triggered.
 

Public Attributes

Metro _ebsSoundTimestamp {EBS_BUZZER_TIMEOUT}
 Timer for the EBS buzzer sound check.
 
CheckupState checkupState {CheckupState::WAIT_FOR_ASMS}
 Current state of the checkup process.
 

Detailed Description

The CheckupManager class handles various checkup operations.

Definition at line 15 of file checkupManager.hpp.

Member Enumeration Documentation

◆ CheckupError

enum class CheckupManager::CheckupError
strong

This is for easier debugging in case initial checkup fails

Enumerator
WAITING_FOR_RESPONSE 
ERROR 
SUCCESS 

Definition at line 54 of file checkupManager.hpp.

◆ CheckupState

enum class CheckupManager::CheckupState
strong

The CheckupState enum represents the different states of the initial checkup process. The checkup process is a sequence of checks that the vehicle must pass before it can transition to ready state.

Enumerator
WAIT_FOR_ASMS 
START_TOGGLING_WATCHDOG 
WAIT_FOR_WATCHDOG 
STOP_TOGGLING_WATCHDOG 
CHECK_WATCHDOG 
CLOSE_SDC 
WAIT_FOR_AATS 
WAIT_FOR_TS 
TOGGLE_VALVE 
CHECK_PRESSURE 
CHECK_TIMESTAMPS 

Definition at line 37 of file checkupManager.hpp.

Constructor & Destructor Documentation

◆ CheckupManager()

CheckupManager::CheckupManager ( SystemData systemData)
inlineexplicit

Constructor for the CheckupManager class.

Parameters
systemDataPointer to the system data object.

Definition at line 66 of file checkupManager.hpp.

Member Function Documentation

◆ emergencySequenceComplete()

bool CheckupManager::emergencySequenceComplete ( ) const
inline

Checks if the emergency sequence is complete and the vehicle can transition to AS_OFF.

Definition at line 355 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInitialCheckupTimestamp()

Metro & CheckupManager::getInitialCheckupTimestamp ( )
inline

Provides access to the initial checkup timestamp timer.

Returns
Reference to the initial checkup timestamp timer.

Definition at line 27 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ initialCheckupSequence()

CheckupManager::CheckupError CheckupManager::initialCheckupSequence ( DigitalSender digitalSender)
inline

Performs an initial checkup.

Definition at line 149 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetCheckupState()

void CheckupManager::resetCheckupState ( )
inline

Resets the checkup state to the initial state.

Definition at line 126 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ resTriggered()

bool CheckupManager::resTriggered ( ) const
inline

Checks if the RES has been triggered.

This function checks whether the RES has been triggered or not.

Definition at line 362 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ shouldEnterEmergency()

bool CheckupManager::shouldEnterEmergency ( State  current_state) const
inline

Performs an emergency checkup.

Definition at line 266 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shouldGoReadyFromOff()

bool CheckupManager::shouldGoReadyFromOff ( ) const
inline

Performs a last re-check for off to ready transition.

Definition at line 250 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shouldStayDriving()

bool CheckupManager::shouldStayDriving ( ) const
inline

Definition at line 341 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ shouldStayManualDriving()

bool CheckupManager::shouldStayManualDriving ( ) const
inline

Performs a manual driving checkup.

Definition at line 131 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ shouldStayMissionFinished()

bool CheckupManager::shouldStayMissionFinished ( ) const
inline

Performs a mission finished checkup.

Definition at line 348 of file checkupManager.hpp.

Here is the caller graph for this function:

◆ shouldStayOff()

bool CheckupManager::shouldStayOff ( DigitalSender digitalSender)
inline

Performs an off checkup.

Definition at line 140 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shouldStayReady()

bool CheckupManager::shouldStayReady ( ) const
inline

Performs a ready to drive checkup.

Definition at line 258 of file checkupManager.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _ebsSoundTimestamp

Metro CheckupManager::_ebsSoundTimestamp {EBS_BUZZER_TIMEOUT}

Timer for the EBS buzzer sound check.

Definition at line 21 of file checkupManager.hpp.

◆ checkupState

CheckupState CheckupManager::checkupState {CheckupState::WAIT_FOR_ASMS}

Current state of the checkup process.

Definition at line 60 of file checkupManager.hpp.


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