From e6b884ee97f14ccc7b68bfbf89eb2fff0d881505 Mon Sep 17 00:00:00 2001 From: Nikopol Date: Sun, 20 Apr 2025 00:04:44 +0400 Subject: [PATCH] Do not draw blocked graph if there is little or no activity. --- BlockyGrapher.py | 19 ++++++++++--------- README.md | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/BlockyGrapher.py b/BlockyGrapher.py index 44f5044..24a898c 100644 --- a/BlockyGrapher.py +++ b/BlockyGrapher.py @@ -228,14 +228,15 @@ def drawout(sclpo, sclbl, maxcanv, failture, restart, distance, dots): currpoint = 1 targetpx = 128 - distance while currpoint < len(sclbl): - if (sclbl[currpoint - 1] < sclbl[currpoint]): - draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint - 1])], fill="white") - #cliout(f"RectDBG (less): X1: {targetpx}, Y1: {47 - sclbl[currpoint - 1]}, X2:{targetpx + distance}, Y2: 47",4) - draw.rectangle((targetpx, 47 - sclbl[currpoint - 1], targetpx + distance, 47), fill="white") - else: - draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx + distance, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint])], 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") + if sclbl[currpoint] != 0 : + if (sclbl[currpoint - 1] < sclbl[currpoint]): + draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint - 1])], fill="white") + #cliout(f"RectDBG (less): X1: {targetpx}, Y1: {47 - sclbl[currpoint - 1]}, X2:{targetpx + distance}, Y2: 47",4) + draw.rectangle((targetpx, 47 - sclbl[currpoint - 1], targetpx + distance, 47), fill="white") + else: + draw.polygon([(targetpx + distance, 47 - sclbl[currpoint - 1]), (targetpx + distance, 47 - sclbl[currpoint]), (targetpx, 47 - sclbl[currpoint])], 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 targetpx -= distance @@ -295,7 +296,7 @@ def cliout(data, code): print(f"[{codes}] [{time}] {data}") 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("Init...", 0) diff --git a/README.md b/README.md index 979b08e..d0313a6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# BlockyGrapher v0.91b +# BlockyGrapher v0.9.2b ![Example setup using this software](./images/displaydemo.jpg) Physical display query grapher for Blocky DNS Server (v0.25).