Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion ETHOS/c480x272/SD/scripts/yaaputelemetry/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ function checkEvents()
-- check if we should enable waypoint plotting for this flight mode
-- supported modes are AUTO, GUIDED, LOITER, RTL, QRTL, QLOITER, QLAND, FOLLOW, ZIGZAG
-- see /MAVProxy/modules/mavproxy_map/__init__.py
if status.wpEnabledModeList[string.upper(status.frame.flightModes[status.telemetry.flightMode])] == 1 then
local flightModeName = status.frame.flightModes[status.telemetry.flightMode]
if flightModeName ~= nil and status.wpEnabledModeList[string.upper(flightModeName)] == 1 then
status.wpEnabledMode = 1
else
status.wpEnabledMode = 0
Expand Down
3 changes: 2 additions & 1 deletion ETHOS/c480x320/SD/scripts/yaaputelemetry/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ function checkEvents()
-- check if we should enable waypoint plotting for this flight mode
-- supported modes are AUTO, GUIDED, LOITER, RTL, QRTL, QLOITER, QLAND, FOLLOW, ZIGZAG
-- see /MAVProxy/modules/mavproxy_map/__init__.py
if status.wpEnabledModeList[string.upper(status.frame.flightModes[status.telemetry.flightMode])] == 1 then
local flightModeName = status.frame.flightModes[status.telemetry.flightMode]
if flightModeName ~= nil and status.wpEnabledModeList[string.upper(flightModeName)] == 1 then
status.wpEnabledMode = 1
else
status.wpEnabledMode = 0
Expand Down
3 changes: 2 additions & 1 deletion ETHOS/c800x480/SD/scripts/yaaputelemetry/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ function checkEvents()
-- check if we should enable waypoint plotting for this flight mode
-- supported modes are AUTO, GUIDED, LOITER, RTL, QRTL, QLOITER, QLAND, FOLLOW, ZIGZAG
-- see /MAVProxy/modules/mavproxy_map/__init__.py
if status.wpEnabledModeList[string.upper(status.frame.flightModes[status.telemetry.flightMode])] == 1 then
local flightModeName = status.frame.flightModes[status.telemetry.flightMode]
if flightModeName ~= nil and status.wpEnabledModeList[string.upper(flightModeName)] == 1 then
status.wpEnabledMode = 1
else
status.wpEnabledMode = 0
Expand Down
4 changes: 4 additions & 0 deletions OTX_ETX/bw128x64/SRC/Yaapu/plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum FlightMode {
QAUTOTUNE = 22,
QACRO = 23,
THERMAL = 24,
LOITER_ALT_QLAND = 25,
AUTOLAND = 26,
};
--]]

Expand Down Expand Up @@ -55,6 +57,8 @@ flightModes[22]="QRTL"
flightModes[23]="QAutotune"
flightModes[24]="QAcro"
flightModes[25]="Thermal"
flightModes[26]="LoiterAltQLand"
flightModes[27]="Autoland"
--
return {flightModes=flightModes}

4 changes: 4 additions & 0 deletions OTX_ETX/bw212x64_f2/SRC/Yaapu/plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum FlightMode {
QAUTOTUNE = 22,
QACRO = 23,
THERMAL = 24,
LOITER_ALT_QLAND = 25,
AUTOLAND = 26,
};
--]]

Expand Down Expand Up @@ -55,6 +57,8 @@ flightModes[22]="QRTL"
flightModes[23]="QAutotune"
flightModes[24]="QAcro"
flightModes[25]="Thermal"
flightModes[26]="LoiterAltQLand"
flightModes[27]="Autoland"
--
return {flightModes=flightModes}

4 changes: 4 additions & 0 deletions OTX_ETX/bw212x64_f4/SRC/Yaapu/plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum FlightMode {
QAUTOTUNE = 22,
QACRO = 23,
THERMAL = 24,
LOITER_ALT_QLAND = 25,
AUTOLAND = 26,
};
--]]

Expand Down Expand Up @@ -55,6 +57,8 @@ flightModes[22]="QRTL"
flightModes[23]="QAutotune"
flightModes[24]="QAcro"
flightModes[25]="Thermal"
flightModes[26]="LoiterAltQLand"
flightModes[27]="Autoland"
--
return {flightModes=flightModes}

8 changes: 8 additions & 0 deletions OTX_ETX/c320x480/SD/WIDGETS/yaapu/lib/plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum FlightMode {
QAUTOTUNE = 22,
QACRO = 23,
THERMAL = 24,
LOITER_ALT_QLAND = 25,
AUTOLAND = 26,
};
--]]
local flightModes = {}
Expand Down Expand Up @@ -52,6 +54,8 @@ flightModes["QRTL"]=22
flightModes["QATN"]=23
flightModes["QACR"]=24
flightModes["THML"]=25
flightModes["LALT"]=26
flightModes["ALND"]=27

-- plane flight modes
flightModes[0]={"",""}
Expand Down Expand Up @@ -80,6 +84,8 @@ flightModes[22]={"QRTL","QRTL"}
flightModes[23]={"QAutotune","QATN"}
flightModes[24]={"QAcro","QACR"}
flightModes[25]={"Thermal","THML"}
flightModes[26]={"LoiterAltQLand","LALT"}
flightModes[27]={"Autoland","ALND"}
--]]

flightModes[0]=""
Expand Down Expand Up @@ -108,6 +114,8 @@ flightModes[22]="QRTL"
flightModes[23]="QAutotune"
flightModes[24]="QAcro"
flightModes[25]="Thermal"
flightModes[26]="LoiterAltQLand"
flightModes[27]="Autoland"
--
return {flightModes=flightModes}

3 changes: 2 additions & 1 deletion OTX_ETX/c320x480/SD/WIDGETS/yaapu/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2111,7 +2111,8 @@ local function checkEvents()
-- check if we should enable waypoint plotting for this flight mode
-- supported modes are AUTO, GUIDED, LOITER, RTL, QRTL, QLOITER, QLAND, FOLLOW, ZIGZAG
-- see /MAVProxy/modules/mavproxy_map/__init__.py
if utils.wpEnabledModeList[string.upper(status.currentFrameType.flightModes[telemetry.flightMode])] == 1 then
local flightModeName = status.currentFrameType.flightModes[telemetry.flightMode]
if flightModeName ~= nil and utils.wpEnabledModeList[string.upper(flightModeName)] == 1 then
status.wpEnabledMode = 1
else
status.wpEnabledMode = 0
Expand Down
5 changes: 4 additions & 1 deletion OTX_ETX/c480x272/SD/WIDGETS/yaapu/lib/hud_def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ local telemetry
local status
local utils
local libs
local colorAirspeedBox

function panel.init(param_status, param_telemetry, param_conf, param_utils, param_libs)
status = param_status
telemetry = param_telemetry
conf = param_conf
utils = param_utils
libs = param_libs
colorAirspeedBox = lcd.RGB(10,20,30)
end

function panel.draw(widget)
Expand Down Expand Up @@ -97,6 +99,7 @@ function panel.draw(widget)
local varioSpeed = math.min(math.abs(0.1*telemetry.vSpeed),5)
local varioH = varioSpeed/varioMax*50
--varioH = varioH + (varioH > 0 and 1 or 0)
local varioY
if telemetry.vSpeed > 0 then
varioY = 18 + (50 - varioH)
lcd.setColor(CUSTOM_COLOR,utils.colors.darkyellow)
Expand Down Expand Up @@ -149,7 +152,7 @@ function panel.draw(widget)

if status.airspeedEnabled == 1 then
speed = telemetry.airspeed * 0.1 * conf.horSpeedMultiplier
lcd.setColor(CUSTOM_COLOR,lcd.RGB(10,20,30))
lcd.setColor(CUSTOM_COLOR,colorAirspeedBox)
lcd.drawRectangle(120, 98, 66, 19, CUSTOM_COLOR)
lcd.drawFilledRectangle(120, 98, 66, 19, CUSTOM_COLOR+SOLID)
lcd.setColor(CUSTOM_COLOR,WHITE)
Expand Down
18 changes: 15 additions & 3 deletions OTX_ETX/c480x272/SD/WIDGETS/yaapu/lib/layoutlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ local conf
local utils
local libs

-- cached values to avoid per-frame lookups
local txVoltageFieldId = nil
local cachedTimeStr = "00:00:00"
local lastTimeSec = -1

-- model and opentx version
local ver, radio, maj, minor, rev = getVersion()

Expand All @@ -53,8 +58,11 @@ function layoutLib.drawTopBar()
end
-- flight time
local time = getDateTime()
local strtime = string.format("%02d:%02d:%02d",time.hour,time.min,time.sec)
lcd.drawText(LCD_W, 0, strtime, SMLSIZE+RIGHT+CUSTOM_COLOR)
if time.sec ~= lastTimeSec then
cachedTimeStr = string.format("%02d:%02d:%02d",time.hour,time.min,time.sec)
lastTimeSec = time.sec
end
lcd.drawText(LCD_W, 0, cachedTimeStr, SMLSIZE+RIGHT+CUSTOM_COLOR)
-- RSSI
if utils.telemetryEnabled() == false then
lcd.setColor(CUSTOM_COLOR,utils.colors.red)
Expand All @@ -64,7 +72,11 @@ function layoutLib.drawTopBar()
end
lcd.setColor(CUSTOM_COLOR,utils.colors.white)
-- tx voltage
local vtx = string.format("%.1fv",getValue(getFieldInfo("tx-voltage").id))
if txVoltageFieldId == nil then
local fi = getFieldInfo("tx-voltage")
if fi then txVoltageFieldId = fi.id end
end
local vtx = txVoltageFieldId and string.format("%.1fv",getValue(txVoltageFieldId)) or "---"
lcd.drawText(391,0, vtx, 0+CUSTOM_COLOR+SMLSIZE)
end

Expand Down
8 changes: 8 additions & 0 deletions OTX_ETX/c480x272/SD/WIDGETS/yaapu/lib/plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum FlightMode {
QAUTOTUNE = 22,
QACRO = 23,
THERMAL = 24,
LOITER_ALT_QLAND = 25,
AUTOLAND = 26,
};
--]]
local flightModes = {}
Expand Down Expand Up @@ -52,6 +54,8 @@ flightModes["QRTL"]=22
flightModes["QATN"]=23
flightModes["QACR"]=24
flightModes["THML"]=25
flightModes["LALT"]=26
flightModes["ALND"]=27

-- plane flight modes
flightModes[0]={"",""}
Expand Down Expand Up @@ -80,6 +84,8 @@ flightModes[22]={"QRTL","QRTL"}
flightModes[23]={"QAutotune","QATN"}
flightModes[24]={"QAcro","QACR"}
flightModes[25]={"Thermal","THML"}
flightModes[26]={"LoiterAltQLand","LALT"}
flightModes[27]={"Autoland","ALND"}
--]]

flightModes[0]=""
Expand Down Expand Up @@ -108,6 +114,8 @@ flightModes[22]="QRTL"
flightModes[23]="QAutotune"
flightModes[24]="QAcro"
flightModes[25]="Thermal"
flightModes[26]="LoiterAltQLand"
flightModes[27]="Autoland"
--
return {flightModes=flightModes}

9 changes: 6 additions & 3 deletions OTX_ETX/c480x272/SD/WIDGETS/yaapu/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1829,8 +1829,10 @@ local function setSensorValues()
end
end

local colorMsgLabel -- initialized in utils.initColors via drawMessagesTelemetryBar first call
local function drawMessagesTelemetryBar()
local colorLabel = lcd.RGB(140,140,140)
if colorMsgLabel == nil then colorMsgLabel = lcd.RGB(140,140,140) end
local colorLabel = colorMsgLabel
-- CELL
lcd.setColor(CUSTOM_COLOR,colorLabel)
lcd.drawText(LCD_W-2, 20-3, string.upper(status.battsource).." V", SMLSIZE+CUSTOM_COLOR+RIGHT)
Expand Down Expand Up @@ -2118,7 +2120,8 @@ local function checkEvents()
-- check if we should enable waypoint plotting for this flight mode
-- supported modes are AUTO, GUIDED, LOITER, RTL, QRTL, QLOITER, QLAND, FOLLOW, ZIGZAG
-- see /MAVProxy/modules/mavproxy_map/__init__.py
if utils.wpEnabledModeList[string.upper(status.currentFrameType.flightModes[telemetry.flightMode])] == 1 then
local flightModeName = status.currentFrameType.flightModes[telemetry.flightMode]
if flightModeName ~= nil and utils.wpEnabledModeList[string.upper(flightModeName)] == 1 then
status.wpEnabledMode = 1
else
status.wpEnabledMode = 0
Expand Down Expand Up @@ -2787,7 +2790,7 @@ local function drawFullScreen(widget)
if math.max(1,widget.options["Screen Type"]) == 1 then
-- run bg tasks only if we are not resetting, this prevent cpu limit kill
if not (resetPending or resetLayoutPending) then
backgroundTasks(widget,15)
backgroundTasks(widget,telemetryPopLoops)
end
end
-- map pages to multiple screens
Expand Down
5 changes: 4 additions & 1 deletion OTX_ETX/c480x320/SD/WIDGETS/yaapu/lib/hud_def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ local telemetry
local status
local utils
local libs
local colorAirspeedBox

function panel.init(param_status, param_telemetry, param_conf, param_utils, param_libs)
status = param_status
telemetry = param_telemetry
conf = param_conf
utils = param_utils
libs = param_libs
colorAirspeedBox = lcd.RGB(10,20,30)
end

function panel.draw(widget)
Expand Down Expand Up @@ -97,6 +99,7 @@ function panel.draw(widget)
local varioSpeed = math.min(math.abs(0.1*telemetry.vSpeed),5)
local varioH = varioSpeed/varioMax*50
--varioH = varioH + (varioH > 0 and 1 or 0)
local varioY
if telemetry.vSpeed > 0 then
varioY = 18 + (50 - varioH)
lcd.setColor(CUSTOM_COLOR,utils.colors.darkyellow)
Expand Down Expand Up @@ -149,7 +152,7 @@ function panel.draw(widget)

if status.airspeedEnabled == 1 then
speed = telemetry.airspeed * 0.1 * conf.horSpeedMultiplier
lcd.setColor(CUSTOM_COLOR,lcd.RGB(10,20,30))
lcd.setColor(CUSTOM_COLOR,colorAirspeedBox)
lcd.drawRectangle(120, 98, 66, 19, CUSTOM_COLOR)
lcd.drawFilledRectangle(120, 98, 66, 19, CUSTOM_COLOR+SOLID)
lcd.setColor(CUSTOM_COLOR,WHITE)
Expand Down
18 changes: 15 additions & 3 deletions OTX_ETX/c480x320/SD/WIDGETS/yaapu/lib/layoutlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ local conf
local utils
local libs

-- cached values to avoid per-frame lookups
local txVoltageFieldId = nil
local cachedTimeStr = "00:00:00"
local lastTimeSec = -1

-- model and opentx version
local ver, radio, maj, minor, rev = getVersion()

Expand All @@ -53,8 +58,11 @@ function layoutLib.drawTopBar()
end
-- flight time
local time = getDateTime()
local strtime = string.format("%02d:%02d:%02d",time.hour,time.min,time.sec)
lcd.drawText(LCD_W, 0, strtime, SMLSIZE+RIGHT+CUSTOM_COLOR)
if time.sec ~= lastTimeSec then
cachedTimeStr = string.format("%02d:%02d:%02d",time.hour,time.min,time.sec)
lastTimeSec = time.sec
end
lcd.drawText(LCD_W, 0, cachedTimeStr, SMLSIZE+RIGHT+CUSTOM_COLOR)
-- RSSI
if utils.telemetryEnabled() == false then
lcd.setColor(CUSTOM_COLOR,utils.colors.red)
Expand All @@ -64,7 +72,11 @@ function layoutLib.drawTopBar()
end
lcd.setColor(CUSTOM_COLOR,utils.colors.white)
-- tx voltage
local vtx = string.format("%.1fv",getValue(getFieldInfo("tx-voltage").id))
if txVoltageFieldId == nil then
local fi = getFieldInfo("tx-voltage")
if fi then txVoltageFieldId = fi.id end
end
local vtx = txVoltageFieldId and string.format("%.1fv",getValue(txVoltageFieldId)) or "---"
lcd.drawText(391,0, vtx, 0+CUSTOM_COLOR+SMLSIZE)
end

Expand Down
8 changes: 8 additions & 0 deletions OTX_ETX/c480x320/SD/WIDGETS/yaapu/lib/plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum FlightMode {
QAUTOTUNE = 22,
QACRO = 23,
THERMAL = 24,
LOITER_ALT_QLAND = 25,
AUTOLAND = 26,
};
--]]
local flightModes = {}
Expand Down Expand Up @@ -52,6 +54,8 @@ flightModes["QRTL"]=22
flightModes["QATN"]=23
flightModes["QACR"]=24
flightModes["THML"]=25
flightModes["LALT"]=26
flightModes["ALND"]=27

-- plane flight modes
flightModes[0]={"",""}
Expand Down Expand Up @@ -80,6 +84,8 @@ flightModes[22]={"QRTL","QRTL"}
flightModes[23]={"QAutotune","QATN"}
flightModes[24]={"QAcro","QACR"}
flightModes[25]={"Thermal","THML"}
flightModes[26]={"LoiterAltQLand","LALT"}
flightModes[27]={"Autoland","ALND"}
--]]

flightModes[0]=""
Expand Down Expand Up @@ -108,6 +114,8 @@ flightModes[22]="QRTL"
flightModes[23]="QAutotune"
flightModes[24]="QAcro"
flightModes[25]="Thermal"
flightModes[26]="LoiterAltQLand"
flightModes[27]="Autoland"
--
return {flightModes=flightModes}

Loading