-
TeroS
-
Autor
-
Offline
-
Platinum Boarder
-
-
RC-Thoughts
-
Beiträge: 527
-
Dank erhalten: 370
-
-
-
-
|
16 could maybe do that, I have mot tried it. I'm running the whole RFID-app inside my "full-screen app" so that is not possible in 16.
If you want to make your own here's the drawing of main screen:
----------------------------------------------------------------------
-- Draw the telemetry windows
local function printBattery()
local txtr,txtg,txtb
local bgr,bgg,bgb = lcd.getBgColor()
if (bgr+bgg+bgb)/3 >128 then
txtr,txtg,txtb = 0,0,0
else
txtr,txtg,txtb = 255,255,255
end
chgY = 53 + (100 - percVal)
chgH = percVal
if(alert == 1) then
lcd.setColor(240,0,0)
else
lcd.setColor(0,220,0)
end
lcd.setColor(0,255,0)
if(redAlert == 1) then
lcd.setColor(255,0,0)
lcd.drawRectangle(111,11,89,36,10)
lcd.drawRectangle(112,12,87,34,10)
lcd.drawText((310 - lcd.getTextWidth(FONT_MAXI,"LOW"))/2,8,"LOW",FONT_MAXI)
else
if (battLow) then
lcd.setColor(255,0,0)
lcd.drawRectangle(111,11,89,36,10)
lcd.drawRectangle(112,12,87,34,10)
lcd.drawText((310 - lcd.getTextWidth(FONT_MAXI,string.format("%.0f%%",percVal)))/2,8,string.format("%.0f%%",percVal),FONT_MAXI)
else
lcd.drawRectangle(111,11,89,36,10)
lcd.drawRectangle(112,12,87,34,10)
lcd.drawText((310 - lcd.getTextWidth(FONT_MAXI,string.format("%.0f%%",percVal)))/2,8,string.format("%.0f%%",percVal),FONT_MAXI)
end
end
lcd.drawFilledRectangle(138,chgY,39,chgH)
lcd.setColor(txtr,txtg,txtb)
-- Battery symbol inside capacity-bar
lcd.drawRectangle(146,138,22,12)
lcd.drawRectangle(147,139,20,10)
lcd.drawFilledRectangle(144,141,3,5)
-- Outline
lcd.drawRectangle(136,51,42,104)
lcd.drawRectangle(137,52,40,102)
collectgarbage()
end
----------------------------------------------------------------------
local function display(width,height)
--if (tagValid == 1 and percVal > 0) then
if(1 == 1) then
-- Headspeed
lcd.drawText(22,5,"Headspeed",FONT_MINI)
lcd.drawText(84 - lcd.getTextWidth(FONT_MAXI,string.format("%.0f",rpmValue)),13,string.format("%.0f",rpmValue),FONT_MAXI)
lcd.drawText(86,35,"rpm",FONT_MINI)
lcd.drawText(12,49,"Min/Max:",FONT_MINI)
lcd.drawText(65,49,string.format("%s - %s", rpmMin, rpmMax),FONT_MINI)
-- Current
lcd.drawText(20,71,"Motor Current",FONT_MINI)
lcd.drawText(95 - lcd.getTextWidth(FONT_MAXI,string.format("%.1f",curValue)),78,string.format("%.1f",curValue),FONT_MAXI)
lcd.drawText(95,101,"A",FONT_MINI)
lcd.drawText(12,113,"Min/Max:",FONT_MINI)
lcd.drawText(65,113,string.format("%s - %s", curMin, curMax),FONT_MINI)
-- Battery info
--lcd.drawText(225,5,"Battery Info",FONT_MINI)
lcd.drawText(310 - lcd.getTextWidth(FONT_MINI,string.format("%s",battDspName)),5,string.format("%s",battDspName),FONT_MINI)
lcd.drawText(285 - lcd.getTextWidth(FONT_MAXI,string.format("%.0f",mahCapaLog)),13,string.format("%.0f",mahCapaLog),FONT_MAXI)
lcd.drawText(287,35,"mAh",FONT_MINI)
lcd.drawText(310 - lcd.getTextWidth(FONT_MINI,string.format("Flightlog: %.0f Cycles",tagCount)),49,string.format("Flightlog: %.0f Cycles",tagCount),FONT_MINI)
-- Timer
lcd.drawText(225,71,"Flight Time",FONT_MINI)
lcd.drawText(295 - lcd.getTextWidth(FONT_MAXI,fTimer),78,fTimer,FONT_MAXI)
lcd.drawText(213,113,"Date:",FONT_MINI)
lcd.drawText(243,113,today,FONT_MINI)
-- Bottom values
-- Rx Voltage
lcd.drawText(5,138,"Rx:",FONT_NORMAL)
lcd.drawText(52 - lcd.getTextWidth(FONT_BIG,string.format("%.1f",rxV)),135,string.format("%.1f",rxV),FONT_BIG)
lcd.drawText(53,138,"V",FONT_NORMAL)
-- Rx Quality
lcd.drawText(66,138,"Q:",FONT_NORMAL)
lcd.drawText(110 - lcd.getTextWidth(FONT_BIG,string.format("%.0f",rxQ)),135,string.format("%.0f",rxQ),FONT_BIG)
lcd.drawText(111,138,"%",FONT_NORMAL)
-- Batt Temps
lcd.drawText(185,138,"LiPo:",FONT_NORMAL)
lcd.drawText(265 - lcd.getTextWidth(FONT_BIG,string.format("%.1f/",battA)),135,string.format("%.1f/",battA),FONT_BIG)
lcd.drawText(299 - lcd.getTextWidth(FONT_BIG,string.format("%.1f",battB)),135,string.format("%.1f",battB),FONT_BIG)
lcd.drawText(300,138,"°C",FONT_NORMAL)
-- Draw battery
printBattery()
-- Lines x,y,width,height
lcd.setColor(183,28,28)
lcd.drawFilledRectangle(5,67,115,2) -- Left middle
lcd.drawFilledRectangle(197,67,115,2) -- Right middle
lcd.drawFilledRectangle(5,131,115,2) -- Left bottom
lcd.drawFilledRectangle(197,131,115,2) -- Right bottom
lcd.setColor(244,67,44)
lcd.drawFilledRectangle(0,0,329,3) -- Long line to center main label
collectgarbage()
else
lcd.drawImage((310-image.width)/2, -17, image)
lcd.setColor(244,67,44)
lcd.drawFilledRectangle(0,0,329,2) -- Long line to center main label
end
collectgarbage()
end
----------------------------------------------------------------------
Remember to register the screen with:
system.registerTelemetry(1," Logo 800 Xxtreme - Powered by RC-Thoughts.com",4,display)
Folgende Benutzer bedankten sich: skyfreak, IG-Modellbau
|