Speeduino
Loading...
Searching...
No Matches
Files | Classes | Typedefs | Enumerations | Functions
3D Tables

Structures and functions related to 3D tables, such as VE, Spark Advance, AFR etc. More...

Files

file  table3d.h
 3D table data types and functions
 
file  table3d_axes.h
 3D table axis types and iterators
 
file  table3d_typedefs.h
 Typedefs for primitive 3D table elements.
 

Classes

struct  table3d_t
 

Typedefs

using table3d_dim_t = uint8_t
 Encodes the length of the axes.
 
using table3d_value_t = uint8_t
 The type of each table value.
 
using table3d_axis_t = uint8_t
 The type of each axis value.
 

Enumerations

enum class  TableType : uint8_t { TableType::table_type_None }
 Table type identifiers. Limited compile time RTTI. More...
 
enum class  AxisDomain : uint8_t { AxisDomain::Rpm , AxisDomain::Load }
 Encodes the real world measurement that a table axis captures. More...
 

Functions

template<typename TTable >
struct TABLE3D_TYPENAME_BASE(6, Rpm, Load) struct TABLE3D_TYPENAME_BASE(4, Rpm, Load) struct TABLE3D_TYPENAME_BASE(8, Rpm, Load) struct static TABLE3D_TYPENAME_BASE(16, Rpm, Load) table3d_value_t get3DTableValue (const TTable *pTable, const uint16_t y, const uint16_t x)
 A 3D table with 6 x 6 dimensions, Rpm x-axis and Load y-axis.
 
static constexpr uint16_t getConversionFactor (AxisDomain domain)
 

Detailed Description

Structures and functions related to 3D tables, such as VE, Spark Advance, AFR etc.

Logical:

E.g. for a 3x3 table, this is what the TS table editor would show:

     Y-Max    V6      V7      V8
     Y-Int    V3      V4      V5
     Y-Min    V0      V1      V2
             X-Min   X-Int   X-Max

In memory, we store rows in reverse:

I.e.

     Y-Min    V0      V1      V2
     Y-Int    V3      V4      V5
     Y-Max    V6      V7      V8
             X-Min   X-Int   X-Max

Typedef Documentation

◆ table3d_axis_t

using table3d_axis_t = uint8_t

The type of each axis value.

◆ table3d_dim_t

using table3d_dim_t = uint8_t

Encodes the length of the axes.

◆ table3d_value_t

using table3d_value_t = uint8_t

The type of each table value.

Enumeration Type Documentation

◆ AxisDomain

enum class AxisDomain : uint8_t
strong

Encodes the real world measurement that a table axis captures.

Enumerator
Rpm 

RPM (engine speed)

Load 

Load

◆ TableType

enum class TableType : uint8_t
strong

Table type identifiers. Limited compile time RTTI.

With no virtual functions (they have quite a bit of overhead in both space & time), we have to pass void* around in certain cases. In order to cast that back to a concrete table type, we need to somehow identify the type.

Once approach is to register each type - but that requires a central registry which will use RAM.

Since we have a compile time fixed set of table types, we can map a unique identifier to the type via a cast - this enum is that unique identifier.

Typically used in conjunction with visitTable3d()

Enumerator
table_type_None 

Function Documentation

◆ get3DTableValue()

template<typename TTable >
struct TABLE3D_TYPENAME_BASE(6, Rpm, Load) struct TABLE3D_TYPENAME_BASE(4, Rpm, Load) struct TABLE3D_TYPENAME_BASE(8, Rpm, Load) struct static TABLE3D_TYPENAME_BASE(16, Rpm, Load) table3d_value_t get3DTableValue ( const TTable *  pTable,
const uint16_t  y,
const uint16_t  x 
)
inlinestatic

A 3D table with 6 x 6 dimensions, Rpm x-axis and Load y-axis.

A 3D table with 4 x 4 dimensions, Rpm x-axis and Load y-axis

A 3D table with 8 x 8 dimensions, Rpm x-axis and Load y-axis

A 3D table with 16 x 16 dimensions, Rpm x-axis and Load y-axis

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

◆ getConversionFactor()

static constexpr uint16_t getConversionFactor ( AxisDomain  domain)
staticconstexpr
Here is the caller graph for this function: