ajoue d'un for dans le thread pour tester les capteurs virtuels

master
thchazot1 2 years ago
parent 2934812ae7
commit 24fb798142

@ -36,6 +36,11 @@ public class Launch extends Application {
Platform.runLater(() -> { Platform.runLater(() -> {
for (Capteur capteurs1 : capteurs) { for (Capteur capteurs1 : capteurs) {
try { try {
if (capteurs1 instanceof CapteurVirtuel){
for (Capteur capteur: ((CapteurVirtuel) capteurs1).getLesCapteurs().values()) {
capteur.genTemp();
}
}
capteurs1.genTemp(); capteurs1.genTemp();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

@ -11,6 +11,6 @@ public class RandomGenerator implements CaptorGeneratorStrategy{
@Override @Override
public float generate() throws IOException { public float generate() throws IOException {
Random random = new Random(); Random random = new Random();
return random.nextFloat(50); return random.nextFloat(-20, 50);
} }
} }
Loading…
Cancel
Save