diff --git a/sim/dalboard.ts b/sim/dalboard.ts index c4af045ef57..a4c7c5bf48a 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,7 +134,23 @@ namespace pxsim { } } + private energyVariables: Variables = { + ledCount: 0 + } + getVariables() { + return this.energyVariables + } + + onEveryYield() { + let count = 0 + const data = this.ledMatrixState.image.data + for (let i = 0; i < data.length; ++i) + if (data[i]) count++ + this.energyVariables.ledCount = count + pxsim.control.__log(0,`${this.energyVariables}`) + } + initAsync(msg: SimulatorRunMessage): Promise { super.initAsync(msg);