galjonsfigur 6926c66b16 Polish Lua examples (#2846)
* Add missing globals from luacheck config

* Fix luacheck warnings in all lua files

* Re-enable luacheck in Travis

* Speed up Travis by using preinstalled LuaRocks

* Fix more luacheck warnings in httpserver lua module

* Fix DCC module and add appropriate definitions to luacheck config.

* Change inline comments from ignoring block to only ignore specific line

* Add Luacheck for Windows and enable it for both Windows and Linux

* Change luacheck exceptions and fix errors from 1st round of polishing

* Add retry and timeout params to wget
2020-06-09 22:26:52 +02:00

91 lines
2.1 KiB
Lua

-- luacheck: globals T r disp millis lcg_rnd
local M, module = {}, ...
_G[module] = M
function M.run()
-- make this a volatile module:
package.loaded[module] = nil
print("Running component clip...")
disp:setColor(0, 0x00, 0xd1, 0x5e) -- dark green
disp:setColor(1, 0xff, 0xf7, 0x61) -- yellow
disp:setColor(2, 0xd1, 0xc7, 0x00) -- dark yellow
disp:setColor(3, 0x61, 0xff, 0xa8) -- green
disp:drawGradientBox(0, 0, disp:getWidth(), disp:getHeight())
disp:setColor(255, 255, 255)
disp:setPrintPos(2,18)
disp:setPrintDir(0)
disp:print("ClipRange")
disp:setColor(0xd1, 0x00, 0x073)
disp:setFont(ucg.font_helvB18_hr)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setMaxClipRange()
disp:setColor(0xff, 0xff, 0xff)
disp:drawFrame(20-1,30-1,15+2,20+2)
disp:setClipRange(20, 30, 15, 20)
disp:setColor(0xff, 0x61, 0x0b8)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setMaxClipRange()
disp:setColor(0xff, 0xff, 0xff)
disp:drawFrame(60-1,35-1,25+2,18+2)
disp:setClipRange(60, 35, 25, 18)
disp:setColor(0xff, 0x61, 0x0b8)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setMaxClipRange()
disp:setColor(0xff, 0xff, 0xff)
disp:drawFrame(7-1,58-1,90+2,4+2)
disp:setClipRange(7, 58, 90, 4)
disp:setColor(0xff, 0x61, 0x0b8)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setFont(ucg.font_ncenR14_hr)
disp:setMaxClipRange()
print("...done")
end
return M