From 3e194dea6a1512af28283080cffcd32b7022ec67 Mon Sep 17 00:00:00 2001 From: Thomas Ball Date: Tue, 30 Sep 2025 11:54:53 -0700 Subject: [PATCH 1/4] power consumption example --- sim/dalboard.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sim/dalboard.ts b/sim/dalboard.ts index c4af045ef57..263e76a42ba 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -133,6 +133,11 @@ namespace pxsim { } + // power consumption + powerConsumption(): number { + return 0.0 + } + initAsync(msg: SimulatorRunMessage): Promise { super.initAsync(msg); From 4ed7a13ec0162978b0e96cc26b5c5c6d98abfb2e Mon Sep 17 00:00:00 2001 From: Thomas Ball Date: Wed, 1 Oct 2025 12:10:19 -0700 Subject: [PATCH 2/4] count # of yields --- sim/dalboard.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sim/dalboard.ts b/sim/dalboard.ts index 263e76a42ba..a8760067cd7 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -36,6 +36,8 @@ namespace pxsim { // board hardware version hardwareVersion = 1; + yieldCount = 0 + constructor() { super() @@ -132,10 +134,8 @@ namespace pxsim { } } - - // power consumption - powerConsumption(): number { - return 0.0 + onEveryYield() { + console.log(`yield count = ${this.yieldCount++}`) } initAsync(msg: SimulatorRunMessage): Promise { From b5860b1eff92107507b8135417dd35e5e18394c4 Mon Sep 17 00:00:00 2001 From: Thomas Ball Date: Wed, 1 Oct 2025 12:41:59 -0700 Subject: [PATCH 3/4] print count of leds --- sim/dalboard.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sim/dalboard.ts b/sim/dalboard.ts index a8760067cd7..43949267ad7 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -135,7 +135,11 @@ namespace pxsim { } onEveryYield() { - console.log(`yield count = ${this.yieldCount++}`) + let count = 0 + const data = this.ledMatrixState.image.data + for (let i = 0; i < data.length; ++i) + if (data[i]) count++ + console.log(`led count = ${count}`) } initAsync(msg: SimulatorRunMessage): Promise { From 890367da488e0bc98d330c15d10bbcb724831b75 Mon Sep 17 00:00:00 2001 From: Thomas Ball Date: Wed, 1 Oct 2025 12:55:07 -0700 Subject: [PATCH 4/4] use data vis --- sim/dalboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/dalboard.ts b/sim/dalboard.ts index 43949267ad7..1a67a069a71 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -139,7 +139,7 @@ namespace pxsim { const data = this.ledMatrixState.image.data for (let i = 0; i < data.length; ++i) if (data[i]) count++ - console.log(`led count = ${count}`) + pxsim.control.__log(1, `leds: ${count}\n`) } initAsync(msg: SimulatorRunMessage): Promise {