model.getInfo¶
Gets currently selected Model's information
Syntax¶
model.getInfo()
Parameters¶
none
Return values¶
table containing model information with following fields:
| Field | Type | Decription |
|---|---|---|
| name | string | Model's name set. |
| filename | string | Name of <???> |
| bitmap | string | Name of model's picture file located on SD Card in /IMAGES/ folder |
| extendedLimits | boolean | true if extended limits are enabled otherwise false |
| jitterFilter | number | model level ADC filter |
Warning
bitmap field is not available on BW radios
API Status¶
| Avail | Status | Comment | |
|---|---|---|---|
| BW radios | true | active | |
| Color radios | true | active |
Change log¶
| EdgeTX version | Change |
|---|---|
| 2.4.0 | Introduced |
| 2.6.0 | added filename to return value table. |
| 2.8.0 | added extendedLimits , jitterFilter, labels to return value table. |
Examples¶
Displaying model's name
local modelInfo -- declare variable available to all functions
local function my_init() {
modelInfo = model.getInfo() -- read model's info table
}
local function my_run(event) {
lcd.clear()
lcd.drawText(0, 0, modelInfo.name) -- display model's name
return 0
}
return { run = my_run, init = my_init }
Displaying model's all information
local modelInfo -- declare variable available to all functions
local lineHeight = 8 -- for color radios change to 16
local function my_init() {
modelInfo = model.getInfo() -- read model's info table
}
local function my_run(event) {
lcd.clear()
local y = 0
for fieldName, fieldValue in pairs(modelInfo) do
lcd.drawText( 0, y, fieldName .. ": " .. tostring(fieldValue) ) -- display model's name
y = y + lineHeight
end
return 0
}
return { run = my_run, init = my_init }
[^1]: Name of what?
[^2]: What values are allowed?