From bd5b687430ecaf045fc5e67c492b740e665e4ecb Mon Sep 17 00:00:00 2001 From: Empire Phoenix Date: Mon, 25 May 2026 23:22:21 +0200 Subject: [PATCH] fix pump test progress bar --- Software/MainBoard/rust/src_webpack/src/main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Software/MainBoard/rust/src_webpack/src/main.ts b/Software/MainBoard/rust/src_webpack/src/main.ts index 996ca2d..5f86e1b 100644 --- a/Software/MainBoard/rust/src_webpack/src/main.ts +++ b/Software/MainBoard/rust/src_webpack/src/main.ts @@ -311,8 +311,11 @@ export class Controller { } testPlant(plantId: number) { + const plantConfig = controller.getConfig().plants[plantId]; + const pumpTimeS = plantConfig.pump_time_s; + let counter = 0 - let limit = 30 + let limit = pumpTimeS > 0 ? Math.ceil(pumpTimeS) : 30 controller.progressview.addProgress("test_pump", counter / limit * 100, "Testing pump " + (plantId + 1) + " for " + (limit - counter) + "s") let timerId: string | number | NodeJS.Timeout | undefined