end
function get_display_config()
+
width = tonumber(uci.get(config_name,"display","width"))
height = tonumber(uci.get(config_name,"display","height"))
charwidth = tonumber(uci.get(config_name,"display","charwidth"))
charheight = tonumber(uci.get(config_name,"display","charheight"))
- cols = tonumber(uci.get(config_name,"display","columns"))
title = uci.get(config_name,"display","title")
- col_width = math.floor(width/cols)
pages = {}
pagetitles = {}
pagedurations = {}
+ pagecolumns = {}
+ pagecolwidth = {}
local page, def, line, col, pos
cur.foreach(config_name,"display", function(s)
page = {}
+ local columns = s["columns"]
+ if not columns or columns == "" then
+ columns = 1
+ else
+ columns = tonumber(columns)
+ end
local pagetitle = s["title"]
if not pagetitle then
pagetitle = title
page[#page+1] = def
end
col = col + 1
- if col > cols then
+ if col > columns then
col = 1
line = line + 1
end
pages[#pages+1] = page
pagetitles[#pages] = pagetitle
pagedurations[#pages] = pageduration
+ pagecolumns[#pages] = columns
+ pagecolwidth[#pages] = math.floor(width/columns)
end)
end
function process_vals(vals)
for i,page in pairs(pages) do
+ col_width = pagecolwidth[i]
local pageid = "page"..trim(tostring(i))
for j,def in pairs(page) do
val = vals[def["sensor"]][def["param"]]