Test passed
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import java.util.Timer;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import impl.Afficheur;
|
||||
import impl.Canal;
|
||||
@@ -15,13 +18,19 @@ public class main {
|
||||
Scheduler scheduler = new Scheduler(NB_CANAUX);
|
||||
Capteur c = new CapteurImpl();
|
||||
|
||||
for(int i = 0; i<NB_CANAUX; i++){
|
||||
Afficheur a=new Afficheur();
|
||||
Canal canal=new Canal(c,scheduler,a);
|
||||
a.setCanal(canal);
|
||||
|
||||
c.attach(canal);
|
||||
|
||||
/*
|
||||
for(int i = 0; i<NB_CANAUX; i++){
|
||||
ObserverdeCapteur afficheur = new Afficheur();
|
||||
new Canal(c, scheduler, afficheur);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
ScheduledExecutorService clock = Executors.newScheduledThreadPool(1);
|
||||
clock.scheduleAtFixedRate(() -> c.tick(), 0, 500, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user