rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Typedefs | Functions
script_impl.h File Reference

Detailed Description

Date
Oct 5, 2014
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file script_impl.h.

Typedefs

typedef Map3D< SCRIPT_TABLE_8, SCRIPT_TABLE_8, float, int16_t, int16_t > script1_Map3D_f32t
 
typedef Map3D< TABLE_2_RPM_SIZE, TABLE_2_LOAD_SIZE, float, int16_t, int16_t > script2_Map3D_f32t
 
typedef Map3D< SCRIPT_TABLE_8, SCRIPT_TABLE_8, uint8_t, int16_t, int16_t > script3_Map3D_u8t
 
typedef Map3D< TABLE_4_RPM, SCRIPT_TABLE_8, uint8_t, int16_t, int16_t > script4_Map3D_u8t
 

Functions

void initScriptImpl ()
 
float getCurveValue (int index, float key)
 
expected< int > getCurveIndexByName (const char *name)
 
expected< int > getTableIndexByName (const char *name)
 
expected< int > getSettingIndexByName (const char *name)
 
ValueProvider3DgetscriptTable (int index)
 

Typedef Documentation

◆ script1_Map3D_f32t

typedef Map3D<SCRIPT_TABLE_8, SCRIPT_TABLE_8, float, int16_t, int16_t> script1_Map3D_f32t

Definition at line 12 of file script_impl.h.

◆ script2_Map3D_f32t

typedef Map3D<TABLE_2_RPM_SIZE, TABLE_2_LOAD_SIZE, float, int16_t, int16_t> script2_Map3D_f32t

Definition at line 13 of file script_impl.h.

◆ script3_Map3D_u8t

typedef Map3D<SCRIPT_TABLE_8, SCRIPT_TABLE_8, uint8_t, int16_t, int16_t> script3_Map3D_u8t

Definition at line 14 of file script_impl.h.

◆ script4_Map3D_u8t

typedef Map3D<TABLE_4_RPM, SCRIPT_TABLE_8, uint8_t, int16_t, int16_t> script4_Map3D_u8t

Definition at line 15 of file script_impl.h.

Function Documentation

◆ getCurveIndexByName()

expected< int > getCurveIndexByName ( const char name)
Returns
zero-based index of curve with given name

Definition at line 36 of file script_impl.cpp.

36 {
37 for (int i = 0;i<SCRIPT_CURVE_COUNT;i++) {
38 if (strEqualCaseInsensitive(name, engineConfiguration->scriptCurveName[i])) {
39 return i;
40 }
41 }
42
43 return unexpected;
44}
static constexpr engine_configuration_s * engineConfiguration

Referenced by configureRusefiLuaUtilHooks().

Here is the caller graph for this function:

◆ getCurveValue()

float getCurveValue ( int  index,
float  key 
)

Definition at line 66 of file script_impl.cpp.

66 {
67 // not great code at all :(
68 switch (index) {
69 default:
70 return interpolate2d(key, config->scriptCurve1Bins, config->scriptCurve1);
71 case 1:
72 return interpolate2d(key, config->scriptCurve2Bins, config->scriptCurve2);
73 case 2:
74 return interpolate2d(key, config->scriptCurve3Bins, config->scriptCurve3);
75 case 3:
76 return interpolate2d(key, config->scriptCurve4Bins, config->scriptCurve4);
77 case 4:
78 return interpolate2d(key, config->scriptCurve5Bins, config->scriptCurve5);
79 case 5:
80 return interpolate2d(key, config->scriptCurve6Bins, config->scriptCurve6);
81 }
82}
static constexpr persistent_config_s * config

Referenced by configureRusefiLuaHooks().

Here is the caller graph for this function:

◆ getscriptTable()

ValueProvider3D * getscriptTable ( int  index)

Definition at line 19 of file script_impl.cpp.

19 {
20 switch (index) {
21 default:
22 return &scriptTable1;
23 case 1:
24 return &scriptTable2;
25 case 2:
26 return &scriptTable3;
27 case 3:
28 return &scriptTable4;
29 }
30}
static script4_Map3D_u8t scriptTable4
static script1_Map3D_f32t scriptTable1
static script2_Map3D_f32t scriptTable2
static script3_Map3D_u8t scriptTable3

Referenced by configureRusefiLuaHooks().

Here is the caller graph for this function:

◆ getSettingIndexByName()

expected< int > getSettingIndexByName ( const char name)

Definition at line 56 of file script_impl.cpp.

56 {
57 for (int i = 0;i<SCRIPT_SETTING_COUNT;i++) {
58 if (strEqualCaseInsensitive(name, engineConfiguration->scriptSettingName[i])) {
59 return i;
60 }
61 }
62
63 return unexpected;
64}

Referenced by configureRusefiLuaUtilHooks().

Here is the caller graph for this function:

◆ getTableIndexByName()

expected< int > getTableIndexByName ( const char name)

Definition at line 46 of file script_impl.cpp.

46 {
47 for (int i = 0;i<SCRIPT_TABLE_COUNT;i++) {
48 if (strEqualCaseInsensitive(name, engineConfiguration->scriptTableName[i])) {
49 return i;
50 }
51 }
52
53 return unexpected;
54}

Referenced by configureRusefiLuaUtilHooks().

Here is the caller graph for this function:

◆ initScriptImpl()

void initScriptImpl ( )

Definition at line 84 of file script_impl.cpp.

84 {
89}
void initTable(TValueInit(&table)[TRowNum][TColNum], const TXColumnInit(&columnBins)[TColNum], const TRowInit(&rowBins)[TRowNum])
uint8_t scriptTable3[SCRIPT_TABLE_8][SCRIPT_TABLE_8]
float scriptTable2[TABLE_2_LOAD_SIZE][TABLE_2_RPM_SIZE]

Referenced by commonInitEngineController().

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

Go to the source code of this file.