lua curve progress

This commit is contained in:
Andrey 2021-11-05 15:25:29 -04:00
parent 2c47f603fc
commit c05376ed5f
2 changed files with 13 additions and 0 deletions

View File

@ -604,6 +604,18 @@ ValueProvider3D *getFSIOTable(int index) {
}
}
/**
* @return zero-based index of curve with given name
*/
int getCurveIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX) {
for (int i = 0;i<SCRIPT_CURVE_COUNT;i++) {
if (strEqualCaseInsensitive(name, engineConfiguration->scriptCurveName[i])) {
return i;
}
}
return EFI_ERROR_CODE;
}
float getCurveValue(int index, float key DECLARE_ENGINE_PARAMETER_SUFFIX) {
// not great code at all :(
switch (index) {

View File

@ -39,5 +39,6 @@ void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfigura
void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE);
float getCurveValue(int index, float key DECLARE_ENGINE_PARAMETER_SUFFIX);
int getCurveIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX);
ValueProvider3D *getFSIOTable(int index);