Row and col are zero-based
All checks were successful
docker-image / docker (push) Successful in 9m42s
All checks were successful
docker-image / docker (push) Successful in 9m42s
This commit is contained in:
parent
6d0dab84eb
commit
6d14fa0fe8
2 changed files with 17 additions and 17 deletions
|
@ -22,14 +22,14 @@ class BubaTime(BubaAnimation):
|
|||
super().__init__(buba)
|
||||
|
||||
def run(self):
|
||||
self.buba.simple_text(page=0, row=1, col=1, text="Buba")
|
||||
self.buba.simple_text(page=0, row=2, col=1, text="CCC Hansestadt Hamburg")
|
||||
self.buba.simple_text(page=0, row=3, col=1, text="")
|
||||
self.buba.simple_text(page=0, row=4, col=1, text="Hello, world!")
|
||||
self.buba.simple_text(page=0, row=0, col=0, text="Buba")
|
||||
self.buba.simple_text(page=0, row=1, col=0, text="CCC Hansestadt Hamburg")
|
||||
self.buba.simple_text(page=0, row=2, col=0, text="")
|
||||
self.buba.simple_text(page=0, row=3, col=0, text="Hello, world!")
|
||||
self.buba.set_page(0)
|
||||
|
||||
for i in range(15):
|
||||
self.buba.simple_text(page=0, row=1, col=94, text=datetime.now().strftime("%H:%M:%S"))
|
||||
self.buba.simple_text(page=0, row=0, col=93, text=datetime.now().strftime("%H:%M:%S"))
|
||||
sleep(1)
|
||||
|
||||
|
||||
|
@ -38,10 +38,10 @@ class BubaCharset(BubaAnimation):
|
|||
super().__init__(buba)
|
||||
|
||||
def run(self):
|
||||
self.buba.simple_text(page=0, row=1, col=1, text=" !\"#$%&'()*+,-./0123456789:;<=>?")
|
||||
self.buba.simple_text(page=0, row=2, col=1, text="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_")
|
||||
self.buba.simple_text(page=0, row=3, col=1, text="`abcdefghijklmnopqrstuvwxyz{|}~\u2302")
|
||||
self.buba.simple_text(page=0, row=4, col=1, text="That's all, folks!")
|
||||
self.buba.simple_text(page=0, row=0, col=0, text=" !\"#$%&'()*+,-./0123456789:;<=>?")
|
||||
self.buba.simple_text(page=0, row=1, col=0, text="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_")
|
||||
self.buba.simple_text(page=0, row=2, col=0, text="`abcdefghijklmnopqrstuvwxyz{|}~\u2302")
|
||||
self.buba.simple_text(page=0, row=3, col=0, text="That's all, folks!")
|
||||
sleep(10)
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ export default class {
|
|||
s.removeAttribute("style");
|
||||
}
|
||||
this.container.innerHTML = "";
|
||||
for (let r = 1; r <= 4; r++) {
|
||||
for (let r = 0; r < this.config.rows; r++) {
|
||||
const rowDiv = document.createElement("div");
|
||||
this.container.appendChild(rowDiv);
|
||||
rowDiv.id = `geavision__row_${r}`
|
||||
|
@ -50,11 +50,11 @@ export default class {
|
|||
// rowSvg.setAttribute("width", "320");
|
||||
// rowSvg.setAttribute("height", "15");
|
||||
|
||||
for (let c = 1; c <= this.config.cols; c++) {
|
||||
for (let c = 0; c < this.config.cols; c++) {
|
||||
let g = document.createElementNS(this.svgns, "g");
|
||||
rowSvg.appendChild(g);
|
||||
g.id = `geavision__row_${r}_${c}`;
|
||||
g.setAttribute("transform", `translate(${this.config.stripWidth * (c - 1)} 0)`);
|
||||
g.setAttribute("transform", `translate(${this.config.stripWidth * (c)} 0)`);
|
||||
// segmentElements must be in the correct order in the SVG
|
||||
for (let s = 1; s <= segmentElements.length; s++) {
|
||||
const clone = segmentElements[s - 1].cloneNode(true);
|
||||
|
@ -72,19 +72,19 @@ export default class {
|
|||
if (e) {
|
||||
e.classList = "gvsoff";
|
||||
} else {
|
||||
console.log(`Unable to find element #geavision__row_${row}_${col}_${i} for segment '${c}'`)
|
||||
console.log(`Unable to find element #geavision__row_${row}_${col}_${i} for segment '${i}'`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eraseCols(row, col_start, col_end) {
|
||||
for (let i = col_start; i <= col_end; i++) {
|
||||
for (let i = col_start; i < col_end; i++) {
|
||||
this.eraseCol(row, i);
|
||||
}
|
||||
}
|
||||
|
||||
eraseRow(row) {
|
||||
this.eraseCol(row, 1, this.config.cols);
|
||||
this.eraseCol(row, 0, this.config.cols);
|
||||
}
|
||||
|
||||
applyCharacter(row, col, char) {
|
||||
|
@ -92,7 +92,7 @@ export default class {
|
|||
if (f === undefined)
|
||||
return 0;
|
||||
for (let c of this.font[char]) {
|
||||
if (col > this.config.cols)
|
||||
if (col >= this.config.cols)
|
||||
return this.font[char].length;
|
||||
for (let s = 0; s < c.length; s++) {
|
||||
const e = this.container.querySelector(`#geavision__row_${row}_${col}_${s + 1}`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue