Moved the three quarter logic into the wordclock module

This commit is contained in:
ollo 2017-02-28 18:36:08 +01:00
parent 0ec3e0c159
commit 4be4e3fcee
2 changed files with 10 additions and 9 deletions

View File

@ -36,14 +36,8 @@ function generateLEDs(words, color)
buf= buf .. space:rep(4) buf= buf .. space:rep(4)
end end
-- line3---------------------------------------------- -- line3----------------------------------------------
--TODO ggf. auch ueber viertel vor abbildbar
if (words.threequater == 1) then if (words.threequater == 1) then
if (threequater ~= nil) then
buf= buf .. color:rep(11) -- Dreiviertel buf= buf .. color:rep(11) -- Dreiviertel
else
buf= buf .. space:rep(4)
buf= buf .. color:rep(7) -- VIERTEL
end
elseif (words.quater == 1) then elseif (words.quater == 1) then
buf= buf .. space:rep(4) buf= buf .. space:rep(4)
buf= buf .. color:rep(7) -- VIERTEL buf= buf .. color:rep(7) -- VIERTEL
@ -51,7 +45,7 @@ function generateLEDs(words, color)
buf= buf .. space:rep(11) buf= buf .. space:rep(11)
end end
--line 4-------- even row (so inverted) ------------- --line 4-------- even row (so inverted) -------------
if ((words.before == 1) or (words.threequater == 1 and threequater == nil)) then if ((words.before == 1) or (words.threequater == 1)) then
buf=buf .. space:rep(2) buf=buf .. space:rep(2)
buf= buf .. color:rep(3) -- VOR buf= buf .. color:rep(3) -- VOR
else else

View File

@ -62,7 +62,13 @@ function display_timestat(hours, minutes, longmode)
ret.twenty=1 ret.twenty=1
ret.before=1 ret.before=1
elseif (minutes==9) then elseif (minutes==9) then
-- Hande if three quater or quater before is displayed
if (threequater ~= nil) then
ret.threequater=1 ret.threequater=1
else
ret.quater = 1
ret.before = 1
end
elseif (minutes==10) then elseif (minutes==10) then
ret.tenMin=1 ret.tenMin=1
ret.before=1 ret.before=1
@ -125,3 +131,4 @@ function display_timestat(hours, minutes, longmode)
collectgarbage() collectgarbage()
return ret return ret
end end