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

Detailed Description

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

Definition in file script_impl.cpp.

Functions

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

Variables

static script1_Map3D_f32t scriptTable1 {"script1"}
 
static script2_Map3D_f32t scriptTable2 {"script2"}
 
static script3_Map3D_u8t scriptTable3 {"script3"}
 
static script4_Map3D_u8t scriptTable4 {"script4"}
 

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:

Variable Documentation

◆ scriptTable1

script1_Map3D_f32t scriptTable1 {"script1"}
static

Definition at line 14 of file script_impl.cpp.

14{"script1"};

Referenced by getscriptTable(), and initScriptImpl().

◆ scriptTable2

script2_Map3D_f32t scriptTable2 {"script2"}
static

Definition at line 15 of file script_impl.cpp.

15{"script2"};

Referenced by getscriptTable(), and initScriptImpl().

◆ scriptTable3

script3_Map3D_u8t scriptTable3 {"script3"}
static

Definition at line 16 of file script_impl.cpp.

16{"script3"};

Referenced by getscriptTable(), and initScriptImpl().

◆ scriptTable4

script4_Map3D_u8t scriptTable4 {"script4"}
static

Definition at line 17 of file script_impl.cpp.

17{"script4"};

Referenced by getscriptTable(), and initScriptImpl().

Go to the source code of this file.