Do not draw blocked graph if there is little or no activity.

This commit is contained in:
Nikopol 2025-04-20 00:04:44 +04:00
parent 11720bcf3d
commit e6b884ee97
2 changed files with 11 additions and 10 deletions

View File

@ -228,14 +228,15 @@ def drawout(sclpo, sclbl, maxcanv, failture, restart, distance, dots):
currpoint = 1 currpoint = 1
targetpx = 128 - distance targetpx = 128 - distance
while currpoint < len(sclbl): while currpoint < len(sclbl):
if (sclbl[currpoint - 1] < sclbl[currpoint]): if sclbl[currpoint] != 0 :
draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint - 1])], fill="white") if (sclbl[currpoint - 1] < sclbl[currpoint]):
#cliout(f"RectDBG (less): X1: {targetpx}, Y1: {47 - sclbl[currpoint - 1]}, X2:{targetpx + distance}, Y2: 47",4) draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint - 1])], fill="white")
draw.rectangle((targetpx, 47 - sclbl[currpoint - 1], targetpx + distance, 47), fill="white") #cliout(f"RectDBG (less): X1: {targetpx}, Y1: {47 - sclbl[currpoint - 1]}, X2:{targetpx + distance}, Y2: 47",4)
else: draw.rectangle((targetpx, 47 - sclbl[currpoint - 1], targetpx + distance, 47), fill="white")
draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx + distance, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint])], fill="white") else:
#cliout(f"RectDBG (more): X1: {targetpx}, Y1: {47 - sclbl[currpoint]}, X1: {targetpx + distance}, Y2: 47", 4) draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx + distance, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint])], fill="white")
draw.rectangle((targetpx, 47 - sclbl[currpoint], targetpx + distance, 47), fill="white") #cliout(f"RectDBG (more): X1: {targetpx}, Y1: {47 - sclbl[currpoint]}, X1: {targetpx + distance}, Y2: 47", 4)
draw.rectangle((targetpx, 47 - sclbl[currpoint], targetpx + distance, 47), fill="white")
currpoint += 1 currpoint += 1
targetpx -= distance targetpx -= distance
@ -295,7 +296,7 @@ def cliout(data, code):
print(f"[{codes}] [{time}] {data}") print(f"[{codes}] [{time}] {data}")
def main(): def main():
cliout("Blocky Graph Monitor for OLED v0.91b", 0) cliout("Blocky Graph Monitor for OLED v0.9.2b", 0)
cliout("Nikopol 2025", 0) cliout("Nikopol 2025", 0)
cliout("Init...", 0) cliout("Init...", 0)

View File

@ -1,4 +1,4 @@
# BlockyGrapher v0.91b # BlockyGrapher v0.9.2b
![Example setup using this software](./images/displaydemo.jpg) ![Example setup using this software](./images/displaydemo.jpg)
Physical display query grapher for Blocky DNS Server (v0.25). Physical display query grapher for Blocky DNS Server (v0.25).