Interrupt all programs on stop instead of running exit routines
This commit is contained in:
		
							parent
							
								
									f195c39db7
								
							
						
					
					
						commit
						a3167aff1e
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -32,7 +32,7 @@ public class Wash { | ||||||
|             // if the user presses button 0, and a program has been started, stop it |             // if the user presses button 0, and a program has been started, stop it | ||||||
| 
 | 
 | ||||||
|             switch (n) { |             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 1 -> t = new WashingProgram1(io, temp, water, spin); | ||||||
|                 case 2 -> t = new WashingProgram2(io, temp, water, spin); |                 case 2 -> t = new WashingProgram2(io, temp, water, spin); | ||||||
|                 case 3 -> t = new WashingProgram3(io, temp, water, spin); |                 case 3 -> t = new WashingProgram3(io, temp, water, spin); | ||||||
|  | @ -42,6 +42,7 @@ public class Wash { | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  |             if (!t.isInterrupted()) | ||||||
|                 t.start(); |                 t.start(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus