From a3167aff1e5de4e6546a2d22a84e55d4e49a7b5a Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Fri, 15 Nov 2024 09:26:58 +0100 Subject: [PATCH] Interrupt all programs on stop instead of running exit routines --- wash/src/wash/control/Wash.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wash/src/wash/control/Wash.java b/wash/src/wash/control/Wash.java index 0f0f4bf..5755321 100644 --- a/wash/src/wash/control/Wash.java +++ b/wash/src/wash/control/Wash.java @@ -32,7 +32,7 @@ public class Wash { // if the user presses button 0, and a program has been started, stop it switch (n) { - case 0 -> t = new WashingProgramStop(io, temp, water, spin); + case 0 -> t.interrupt(); case 1 -> t = new WashingProgram1(io, temp, water, spin); case 2 -> t = new WashingProgram2(io, temp, water, spin); case 3 -> t = new WashingProgram3(io, temp, water, spin); @@ -42,7 +42,8 @@ public class Wash { } } - t.start(); + if (!t.isInterrupted()) + t.start(); } temp.interrupt();