Interrupt all programs on stop instead of running exit routines

This commit is contained in:
Imbus 2024-11-15 09:26:58 +01:00
parent f195c39db7
commit a3167aff1e

View file

@ -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();