EvaluationService with new thresholds and App with Service-init
This commit is contained in:
parent
b68cbe795c
commit
e7b13fb896
@ -1,6 +1,11 @@
|
||||
package efi.projekt.virtueller_gesundheitsassistent;
|
||||
|
||||
import efi.projekt.virtueller_gesundheitsassistent.model.AppState;
|
||||
import efi.projekt.virtueller_gesundheitsassistent.service.DataPersistenceService;
|
||||
import efi.projekt.virtueller_gesundheitsassistent.service.EvaluationService;
|
||||
import efi.projekt.virtueller_gesundheitsassistent.service.MqttClientService;
|
||||
import efi.projekt.virtueller_gesundheitsassistent.service.StatisticsService;
|
||||
import efi.projekt.virtueller_gesundheitsassistent.service.UnrealWebSocketService;
|
||||
import java.io.IOException;
|
||||
import javafx.application.Application;
|
||||
import static javafx.application.Application.launch;
|
||||
@ -16,6 +21,15 @@ import javafx.stage.Stage;
|
||||
*/
|
||||
public class App extends Application {
|
||||
|
||||
private final AppState appState = new AppState();
|
||||
|
||||
// Services
|
||||
private DataPersistenceService persistenceService;
|
||||
private StatisticsService statisticsService;
|
||||
private EvaluationService evaluationService;
|
||||
private UnrealWebSocketService unrealService;
|
||||
private MqttClientService mqttService;
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
|
||||
@ -23,11 +37,20 @@ public class App extends Application {
|
||||
// Services initialisieren
|
||||
// =========================
|
||||
|
||||
// MQTT
|
||||
MqttClientService mqttClientService = new MqttClientService();
|
||||
// Unreal-WebService
|
||||
unrealService = new UnrealWebSocketService("127.0.0.1");
|
||||
|
||||
// Unreal WebSocket
|
||||
// new UnrealWebSocketService("ws://localhost;8080/avatar");
|
||||
// MQTT-Service
|
||||
mqttService = new MqttClientService();
|
||||
|
||||
// Datenbank initialisieren
|
||||
persistenceService = new DataPersistenceService();
|
||||
|
||||
// Statistik-Service
|
||||
statisticsService = new StatisticsService();
|
||||
|
||||
// Evaluationsservice
|
||||
evaluationService = new EvaluationService(statisticsService, appState, unrealService);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -35,9 +35,9 @@ public class EvaluationService {
|
||||
|
||||
if (ratio >= 0.9) {
|
||||
level = ProblemLevel.DISASTER;
|
||||
} else if (ratio >= 0.7) {
|
||||
} else if (ratio >= 0.8) {
|
||||
level = ProblemLevel.HIGH;
|
||||
} else if (ratio >= 0.4) {
|
||||
} else if (ratio >= 0.5) {
|
||||
level = ProblemLevel.WARNING;
|
||||
} else {
|
||||
level = ProblemLevel.NONE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user