From 558274927cafbf673630022a84bf830200e6625c Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Mon, 2 Jun 2025 20:24:05 +0200 Subject: [PATCH] Try and fix display on real display --- buba/animations/dbf.py | 10 +++++----- buba/animations/time.py | 2 +- buba/static/display.js | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/buba/animations/dbf.py b/buba/animations/dbf.py index 49b7397..e8547fc 100644 --- a/buba/animations/dbf.py +++ b/buba/animations/dbf.py @@ -105,7 +105,7 @@ class DBFAnimation(BubaAnimation): title = self.station else: title = f"{self.station} ({page+1}/{all_len})" - self.buba.text(page=0, row=0, col_start=0, col_end=120, text=title, align=BubaCmd.ALIGN_LEFT) + self.buba.text(page=0, row=0, col_start=0, col_end=92, text=title, align=BubaCmd.ALIGN_LEFT) for i, train in enumerate(trains): if train['isCancelled']: when = "--" @@ -113,11 +113,11 @@ class DBFAnimation(BubaAnimation): when = self.countdown(train) if when < 0: when = 0 - self.buba.text(page=0, row=i + 1, col_start=0, col_end=120, text=self.short_train(train['train'])) - self.buba.text(page=0, row=i + 1, col_start=12, col_end=76, text=self.short_station(train['destination'])) - self.buba.text(page=0, row=i + 1, col_start=105, col_end=120, + self.buba.text(page=0, row=i + 1, col_start=0, col_end=119, text=self.short_train(train['train'])) + self.buba.text(page=0, row=i + 1, col_start=12, col_end=104, text=self.short_station(train['destination'])) + self.buba.text(page=0, row=i + 1, col_start=105, col_end=119, text=str(when), align=BubaCmd.ALIGN_RIGHT) self.buba.set_page(0) for i in range(10): - self.buba.text(page=0, row=0, col_start=93, col_end=120, text=datetime.datetime.now().strftime("%H:%M:%S"), align=BubaCmd.ALIGN_RIGHT) + self.buba.text(page=0, row=0, col_start=93, col_end=119, text=datetime.datetime.now().strftime("%H:%M:%S"), align=BubaCmd.ALIGN_RIGHT) sleep(1) diff --git a/buba/animations/time.py b/buba/animations/time.py index a02d26a..8ae6b6d 100644 --- a/buba/animations/time.py +++ b/buba/animations/time.py @@ -17,5 +17,5 @@ class BubaTime(BubaAnimation): self.buba.set_page(0) for i in range(5): - self.buba.text(page=0, row=0, col_start=93, col_end=120, text=datetime.now().strftime("%H:%M:%S"), align=BubaCmd.ALIGN_RIGHT) + self.buba.text(page=0, row=0, col_start=93, col_end=119, text=datetime.now().strftime("%H:%M:%S"), align=BubaCmd.ALIGN_RIGHT) sleep(1) diff --git a/buba/static/display.js b/buba/static/display.js index 9eabe7d..9228ce8 100644 --- a/buba/static/display.js +++ b/buba/static/display.js @@ -148,6 +148,7 @@ export default class { } text(page, row, col_start, col_end, text, align) { + col_end += 1; let s = this.col_start_for_alignment(col_start, col_end, text, align); if (s < 0) console.log("Out of alignment") @@ -156,7 +157,7 @@ export default class { } simple_text(page, row, col, text, align) { - this.text(page, row, col, this.config.cols, text, align); + this.text(page, row, col, this.config.cols-1, text, align); } defineFont() {