From 3c0efc6996b88dfacdd7762319b42d79208c383e Mon Sep 17 00:00:00 2001 From: John Wieland Date: Fri, 26 Apr 2024 11:55:59 -0400 Subject: [PATCH] Updated to V2.10 Comments added for versions 2.8-2.10 for Special function switch = XXX, func =XX numbers in the file at the refresh area --- Color Screen Widget/EdgeTX/main.lua | 57 +++++++++++++++++++---------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/Color Screen Widget/EdgeTX/main.lua b/Color Screen Widget/EdgeTX/main.lua index ec4905d..dbe22b4 100644 --- a/Color Screen Widget/EdgeTX/main.lua +++ b/Color Screen Widget/EdgeTX/main.lua @@ -45,7 +45,7 @@ local function create(zone, options) local tunes = { zone=zone, options=options} model.setGlobalVariable(7,0,1) model.setGlobalVariable(8,0,1) - model.setCustomFunction(62,{switch = 144,func =16,name = playlist[1][2]})--resets playing song on to the 1st song on startup + model.setCustomFunction(62,{switch = 228,func =11,name = playlist[1][2]})--resets playing song on to the 1st song on startup aircraft = Bitmap.open("/IMAGES/" .. model.getInfo().bitmap) return tunes end @@ -243,12 +243,17 @@ local function refreshZoneFull(tunes) local ver = getVersion() --OpenTX Version lcd.drawBitmap(elogo,3,0,53) lcd.drawText(63,4,"V. "..ver) - lcd.drawText(185,23, model.getInfo().name,DBLSIZE)--adjust as needed - lcd.drawBitmap(aircraft,175,55)--adjust as needed + lcd.drawText(185,5, model.getInfo().name,DBLSIZE)--adjust as needed + lcd.drawBitmap(aircraft,170,45,90)--adjust as needed --Transmitter battery local batt = getValue("tx-voltage") lcd.drawText(8, 50,"TX Batt "..round(batt,1).."v") + + --Receiver Voltage battery + + lcd.drawText(100, 50,"RX Batt ") + lcd.drawChannel(160,50,"RxBt") -- Flight Battery Loaded --[[ I use different capacity batteries, the timers are @@ -271,13 +276,19 @@ local function refreshZoneFull(tunes) -- Flight Mode lcd.drawFilledRectangle(380,60,90,2) lcd.drawFilledRectangle(380,105,90,2) - local fmno, fmname = getFlightMode() - if fmname == "" then - fmname = "FM".. fmno - lcd.drawText(410, 63, fmname)else - lcd.drawText(410, 63, "FM"..fmno) - lcd.drawText(380,83, fmname) - end +-- local fmno, fmname = getFlightMode() +-- if fmname == "" then +-- fmname = "FM".. fmno +-- lcd.drawText(410, 63, fmname)else +-- lcd.drawText(410, 63, "FM"..fmno) +-- lcd.drawText(380,83, fmname) +-- end + +-- Speed + lcd.drawText(360,63,"Speed= ") + lcd.drawChannel(420,63,"GSpd") + lcd.drawText(346,83,"Top Spd= ") + lcd.drawChannel(420,83,"GSpd+",2) --Flight Time local fly=model.getTimer(1).value --flight duration timer: 0=timer1, 1=timer2 @@ -296,10 +307,10 @@ local function refreshZoneFull(tunes) -- Altitude lcd.drawText(8,143,"HEIGHT= ") - lcd.drawChannel(80,143,"Alt") + lcd.drawChannel(80,143,"GAlt") lcd.drawText(130, 143,"//Max") - lcd.drawChannel(185,143,"Alt+",2) - + lcd.drawChannel(185,143,"GAlt+",2) + --Tementry separator bar local y = 185 lcd.drawFilledRectangle(6,y-18,462,6,GREY_DEFAULT) @@ -334,26 +345,32 @@ local function refreshZoneFull(tunes) end function refresh(tunes) - listP = getValue("ls63") +--SF commands for songs to play based on Version Installed +-- Edge 2.8 switch = 132,func = 16 +-- Edge 2.9 switch = 144, func =16 +-- Edge 2.10 switch = 228,func =11 + + listP = getValue("ls63") listN = getValue("ls64") prevS = getValue("ls61") nextS = getValue("ls62") SongSw = getFieldInfo("ls60").id --song over + local long=playlist[playingSong][3] if model.getTimer(2).value >= long then if playingSong == #playlist then model.setGlobalVariable(7,0,1) playingSong = model.getGlobalVariable(7,0) flushAudio() - model.setCustomFunction(62,{switch = 144,func =16,name = playlist[playingSong][2]}) + model.setCustomFunction(62,{switch = 228,func =11,name = playlist[playingSong][2]}) model.setTimer(2,{value=0}) else flushAudio() playingSong = playingSong +1 model.setGlobalVariable(7,0,playingSong) - model.setCustomFunction(62,{switch = 144,func =16,name = playlist[playingSong][2]}) + model.setCustomFunction(62,{switch = 228,func =11,name = playlist[playingSong][2]}) model.setTimer(2,{value=0}) end @@ -368,7 +385,7 @@ function refresh(tunes) playingSong = model.getGlobalVariable(7,0) end flushAudio() - model.setCustomFunction(62,{switch = 144,func =16,name = playlist[playingSong][2]}) + model.setCustomFunction(62,{switch = 228,func =11,name = playlist[playingSong][2]}) model.setTimer(2,{value=0}) else nextSongSwitchPressed = false @@ -387,7 +404,7 @@ function refresh(tunes) playingSong = 1 end loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() - model.setCustomFunction(62,{switch = 144,func =16,name = playlist[playingSong][2]}) + model.setCustomFunction(62,{switch = 228,func =11,name = playlist[playingSong][2]}) model.setGlobalVariable(7,0,1) flushAudio() model.setTimer(2,{value=0}) @@ -409,7 +426,7 @@ function refresh(tunes) end loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() - model.setCustomFunction(62,{switch = 144,func =16,name = playlist[playingSong][2]}) + model.setCustomFunction(62,{switch = 228,func =11,name = playlist[playingSong][2]}) model.setGlobalVariable(7,0,1) flushAudio() model.setTimer(2,{value=0}) @@ -427,7 +444,7 @@ function refresh(tunes) playingSong = model.getGlobalVariable(7,0) end flushAudio() - model.setCustomFunction(62,{switch = 144,func =16,name = playlist[playingSong][2]}) + model.setCustomFunction(62,{switch = 228,func =11,name = playlist[playingSong][2]}) model.setTimer(2,{value=0}) end else