package Launcher;

import Model.ImageSensor;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;

import Model.Sensor;
import View.ImageSensorController;


import java.io.IOException;

public class Launch extends Application {

    @Override
    public void start(Stage primaryStage) throws IOException {
        ImageSensor imgSens = new ImageSensor(1,"ImageSensor");

        Thread t = new Thread(()->{
            while (true){
                try{
                    Thread.sleep(1000);
                    Platform.runLater(()-> {
                        try{
                            imgSens.getTemperature();
                        }catch (Exception e){
                            throw new RuntimeException(e);
                        }
                    });

                }catch (InterruptedException e){
                    throw new RuntimeException(e);
                }
            }
        });
        t.start();
    }

    public static void main(String args[]) {
        Application.launch(args);
    }
}