mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 17:55:19 +03:00
parent
18c6f6878d
commit
747e6131bc
1 changed files with 7 additions and 2 deletions
|
@ -335,8 +335,9 @@ Return input data for given input and line number
|
|||
* `switch` (number) input switch index
|
||||
* `curveType` (number) curve type (function, expo, custom curve)
|
||||
* `curveValue` (number) curve index
|
||||
* `carryTrim` (boolean) input trims applied
|
||||
|
||||
@status current Introduced in 2.0.0, curveType/curveValue added in 2.3
|
||||
@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3
|
||||
*/
|
||||
static int luaModelGetInput(lua_State *L)
|
||||
{
|
||||
|
@ -354,6 +355,7 @@ static int luaModelGetInput(lua_State *L)
|
|||
lua_pushtableinteger(L, "switch", expo->swtch);
|
||||
lua_pushtableinteger(L, "curveType", expo->curve.type);
|
||||
lua_pushtableinteger(L, "curveValue", expo->curve.value);
|
||||
lua_pushtableinteger(L, "carryTrim", expo->carryTrim);
|
||||
}
|
||||
else {
|
||||
lua_pushnil(L);
|
||||
|
@ -372,7 +374,7 @@ Insert an Input at specified line
|
|||
|
||||
@param value (table) input data, see model.getInput()
|
||||
|
||||
@status current Introduced in 2.0.0, curveType/curveValue added in 2.3
|
||||
@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3
|
||||
*/
|
||||
static int luaModelInsertInput(lua_State *L)
|
||||
{
|
||||
|
@ -413,6 +415,9 @@ static int luaModelInsertInput(lua_State *L)
|
|||
else if (!strcmp(key, "curveValue")) {
|
||||
expo->curve.value = luaL_checkinteger(L, -1);
|
||||
}
|
||||
else if (!strcmp(key, "carryTrim")) {
|
||||
expo->carryTrim= lua_toboolean(L, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue