rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
TableFunc< TBin, TValue, TSize, TOutputScale > Class Template Referencefinal

#include <table_func.h>

Inheritance diagram for TableFunc< TBin, TValue, TSize, TOutputScale >:
Inheritance graph
[legend]
Collaboration diagram for TableFunc< TBin, TValue, TSize, TOutputScale >:
Collaboration graph
[legend]

Public Member Functions

 TableFunc (TBin(&bins)[TSize], TValue(&values)[TSize])
 
SensorResult convert (float inputValue) const override
 
void showInfo (float) const override
 
- Public Member Functions inherited from SensorConverter
 SensorConverter (const SensorConverter &)=delete
 
 SensorConverter ()=default
 

Private Attributes

TBin(& m_bins )[TSize]
 
TValue(& m_values )[TSize]
 

Detailed Description

template<class TBin, class TValue, int TSize, typename TOutputScale = efi::ratio<1>>
class TableFunc< TBin, TValue, TSize, TOutputScale >
Author
Matthew Kennedy, (c) 2021

A function to convert input voltage output value based on a 2d table.

Definition at line 15 of file table_func.h.

Constructor & Destructor Documentation

◆ TableFunc()

template<class TBin , class TValue , int TSize, typename TOutputScale = efi::ratio<1>>
TableFunc< TBin, TValue, TSize, TOutputScale >::TableFunc ( TBin(&)  bins[TSize],
TValue(&)  values[TSize] 
)
inline

Definition at line 17 of file table_func.h.

18 : m_bins(bins)
19 , m_values(values)
20 {
21 }
TBin(& m_bins)[TSize]
Definition table_func.h:30
TValue(& m_values)[TSize]
Definition table_func.h:31

Member Function Documentation

◆ convert()

template<class TBin , class TValue , int TSize, typename TOutputScale = efi::ratio<1>>
SensorResult TableFunc< TBin, TValue, TSize, TOutputScale >::convert ( float  inputValue) const
inlineoverridevirtual

Implements SensorConverter.

Definition at line 23 of file table_func.h.

23 {
24 return interpolate2d(inputValue, m_bins, m_values) * TOutputScale::asFloat();
25 }

◆ showInfo()

template<class TBin , class TValue , int TSize, typename TOutputScale = efi::ratio<1>>
void TableFunc< TBin, TValue, TSize, TOutputScale >::showInfo ( float  ) const
inlineoverridevirtual

Reimplemented from SensorConverter.

Definition at line 27 of file table_func.h.

27{ }

Field Documentation

◆ m_bins

template<class TBin , class TValue , int TSize, typename TOutputScale = efi::ratio<1>>
TBin(& TableFunc< TBin, TValue, TSize, TOutputScale >::m_bins)[TSize]
private

◆ m_values

template<class TBin , class TValue , int TSize, typename TOutputScale = efi::ratio<1>>
TValue(& TableFunc< TBin, TValue, TSize, TOutputScale >::m_values)[TSize]
private

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