You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is nasty bug introduced in 2.10 branch that will affect many LUA scripts
getFieldInfo() can take as argument field name or source list index number.
In case argument is source list index function returns nil instead of table
TX16S as example
getFieldInfo('sa') is returning proper table
getFieldInfo(126) is returning nil
Expected Behavior
getFieldInfo() has to return table
Steps To Reproduce
Testing script
local toolName = "TNS|Sources|TNE"
return {
run = function(e)
lcd.clear()
local swID = getSourceIndex(CHAR_SWITCH..'SA')
lcd.drawText(0,0,swID,0)
local swName = getSourceName(swID)
lcd.drawText(0,20,swName,0)
local swValue = getSourceValue('sa')
lcd.drawText(0,40,tostring(swValue),0)
lcd.drawText(0,80,'getFieldInfo('..swID..')',0)
local fieldInfo = getFieldInfo(swID)
if fieldInfo ~= nil then
lcd.drawText(0,100,fieldInfo.id,0)
lcd.drawText(0,120,fieldInfo.name,0)
lcd.drawText(0,140,fieldInfo.desc,0)
else
lcd.drawText(0,100,'field info is nil',0)
end
lcd.drawText(200,80,'getFieldInfo("sa")',0)
local fieldInfo = getFieldInfo('sa')
if fieldInfo ~= nil then
lcd.drawText(200,100,fieldInfo.id,0)
lcd.drawText(200,120,fieldInfo.name,0)
lcd.drawText(200,140,fieldInfo.desc,0)
else
lcd.drawText(200,100,'Field info is nil',0)
end
return 0
end,
}
Output on 2.9.4
Output on 2.10 and 2.10.1
Version
2.10.1
Transmitter
RadioMaster TX16S / TX16SMK2
Operating System (OS)
macOS
OS Version
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this problem?
What part of EdgeTX is the focus of this bug?
Transmitter firmware
Current Behavior
There is nasty bug introduced in 2.10 branch that will affect many LUA scripts
getFieldInfo() can take as argument field name or source list index number.
In case argument is source list index function returns nil instead of table
TX16S as example
getFieldInfo('sa') is returning proper table
getFieldInfo(126) is returning nil
Expected Behavior
getFieldInfo() has to return table
Steps To Reproduce
Testing script
Output on 2.9.4
![screenshot_tx16s_24-06-22_09-55-04](https://private-user-images.githubusercontent.com/46420768/341951875-cbddd439-3412-485f-9db1-6bd6534fd9fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTgzNTMsIm5iZiI6MTczODkxODA1MywicGF0aCI6Ii80NjQyMDc2OC8zNDE5NTE4NzUtY2JkZGQ0MzktMzQxMi00ODVmLTlkYjEtNmJkNjUzNGZkOWZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA4NDczM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM2YTMzNWE2Mjg1Y2ZjNTFlMjZjMGUyM2Q0ZWRkNjk4MGY4NTBmNDBhN2FiMjUwZTVkYmMzYzQ4MDM1MTVmNGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xilEqyWhVTO8w67BHake0jnBwmV8C34uWiDXhg6r-OA)
Output on 2.10 and 2.10.1
![screenshot_tx16s_24-06-22_09-54-25](https://private-user-images.githubusercontent.com/46420768/341951894-127a5a5f-6db8-417c-bf7d-c87c895e577e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTgzNTMsIm5iZiI6MTczODkxODA1MywicGF0aCI6Ii80NjQyMDc2OC8zNDE5NTE4OTQtMTI3YTVhNWYtNmRiOC00MTdjLWJmN2QtYzg3Yzg5NWU1NzdlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA4NDczM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5NjAwNDc1NDM2OTFkZjQxYzAxMjQ4N2JjZDI4OGU1NDg2MTEwOTA4NjEwNTc4YTFjM2M1MDM3NmNhM2IxZTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ow0vPiNkesatUQpcRcRr4VFFhxJKgmhB2mW-WWJyipA)
Version
2.10.1
Transmitter
RadioMaster TX16S / TX16SMK2
Operating System (OS)
macOS
OS Version
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: