rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
FallbackSensor Class Referencefinal

#include <fallback_sensor.h>

Inheritance diagram for FallbackSensor:
Inheritance graph
[legend]
Collaboration diagram for FallbackSensor:
Collaboration graph
[legend]

Public Member Functions

 FallbackSensor (SensorType outputType, SensorType primarySensor, SensorType fallbackSensor)
 
SensorResult get () const override
 
void showInfo (const char *sensorName) const override
 
- Public Member Functions inherited from Sensor
bool Register ()
 
const chargetSensorName () const
 
virtual bool hasSensor () const
 
virtual float getRaw () const
 
virtual bool isRedundant () const
 
void unregister ()
 
SensorType type () const
 

Private Attributes

const SensorType m_primary
 
const SensorType m_fallback
 

Additional Inherited Members

- Static Public Member Functions inherited from Sensor
static void showAllSensorInfo ()
 
static void showInfo (SensorType type)
 
static void resetRegistry ()
 
static const SensorgetSensorOfType (SensorType type)
 
static SensorResult get (SensorType type)
 
static float getOrZero (SensorType type)
 
static float getRaw (SensorType type)
 
static bool isRedundant (SensorType type)
 
static bool hasSensor (SensorType type)
 
static void setMockValue (SensorType type, float value, bool mockRedundant=false)
 
static void setInvalidMockValue (SensorType type)
 
static void resetMockValue (SensorType type)
 
static void resetAllMocks ()
 
static void inhibitTimeouts (bool inhibit)
 
static const chargetSensorName (SensorType type)
 
- Protected Member Functions inherited from Sensor
 Sensor (SensorType type)
 
- Static Protected Attributes inherited from Sensor
static bool s_inhibitSensorTimeouts = false
 

Detailed Description

Definition at line 5 of file fallback_sensor.h.

Constructor & Destructor Documentation

◆ FallbackSensor()

FallbackSensor::FallbackSensor ( SensorType  outputType,
SensorType  primarySensor,
SensorType  fallbackSensor 
)
inline

Definition at line 7 of file fallback_sensor.h.

8 : Sensor(outputType)
9 , m_primary(primarySensor)
10 , m_fallback(fallbackSensor)
11 {
12 }
const SensorType m_primary
const SensorType m_fallback

Member Function Documentation

◆ get()

SensorResult FallbackSensor::get ( ) const
inlineoverridevirtual

Implements Sensor.

Definition at line 14 of file fallback_sensor.h.

14 {
15 auto primary = Sensor::get(m_primary);
16
17 if (primary) {
18 return primary;
19 }
20
21 return Sensor::get(m_fallback);
22 }
virtual SensorResult get() const =0
Here is the call graph for this function:

◆ showInfo()

void FallbackSensor::showInfo ( const char sensorName) const
overridevirtual

Implements Sensor.

Definition at line 62 of file sensor_info_printing.cpp.

62 {
63 efiPrintf("Sensor \"%s\" is fallback sensor with primary \"%s\" and fallback \"%s\"", sensorName, getSensorName(m_primary), getSensorName(m_fallback));
64}
const char * getSensorName() const
Definition sensor.h:130
Here is the call graph for this function:

Field Documentation

◆ m_fallback

const SensorType FallbackSensor::m_fallback
private

Definition at line 28 of file fallback_sensor.h.

Referenced by get(), and showInfo().

◆ m_primary

const SensorType FallbackSensor::m_primary
private

Definition at line 27 of file fallback_sensor.h.

Referenced by get(), and showInfo().


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