From 194ba729dc1bcdf2ed8ff5bd0d4b051f9e93bc8e Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Sun, 29 Mar 2015 00:33:14 -0500 Subject: [PATCH] Added extra warm-start to the initial boot to help resolve one-off situations where emulator starts in a stuck state --- src/main/java/jace/JaceApplication.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/jace/JaceApplication.java b/src/main/java/jace/JaceApplication.java index f969a9c..137e09b 100644 --- a/src/main/java/jace/JaceApplication.java +++ b/src/main/java/jace/JaceApplication.java @@ -3,7 +3,6 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ - package jace; import java.io.IOException; @@ -19,10 +18,11 @@ import javafx.stage.Stage; * @author blurry */ public class JaceApplication extends Application { + static JaceApplication singleton; Stage primaryStage; JaceUIController controller; - + @Override public void start(Stage stage) throws Exception { singleton = this; @@ -38,7 +38,7 @@ public class JaceApplication extends Application { } catch (IOException exception) { throw new RuntimeException(exception); } - + primaryStage.show(); Emulator emulator = new Emulator(getParameters().getRaw()); javafx.application.Platform.runLater(() -> { @@ -46,23 +46,24 @@ public class JaceApplication extends Application { Thread.yield(); } controller.connectComputer(Emulator.computer); + Emulator.computer.warmStart(); }); - primaryStage.setOnCloseRequest(event->{ - emulator.computer.deactivate(); + primaryStage.setOnCloseRequest(event -> { + Emulator.computer.deactivate(); Platform.exit(); System.exit(0); }); } - + public static JaceApplication getApplication() { return singleton; } - + /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } - + }