use of il.ac.technion.cs.smarthouse.system_presenter.SystemPresenter in project Smartcity-Smarthouse by TechnionYP5777.
the class SmarthouseApplication method launch.
/**
* A static launch function for testing. You can use it the main function in
* order to run the house with the application installed on it.
*
* @param simluator
* @param showSimulatorGui
* @throws Exception
*/
protected static void launch(final SensorsSimulator simluator, final Boolean showSimulatorGui) throws Exception {
final SystemPresenter p = new SystemPresenterFactory().setUseCloudServer(false).setRegularFileSystemListeners(false).addApplicationToInstall(new ApplicationPath(PathType.CLASS_NAME, new Throwable().getStackTrace()[1].getClassName())).initMode(SystemMode.DEVELOPER_MODE).enableModePopup(false).build();
Optional.ofNullable(simluator).ifPresent(s -> new Thread() {
@Override
public void interrupt() {
s.stopSendingMsgsInAllSensors();
super.interrupt();
}
@Override
public void run() {
s.startSendingMsgsInAllSensors();
if (showSimulatorGui)
JavaFxHelper.startGui(new DeveloperSimulatorGui().setSimulator(s));
super.run();
}
}.start());
p.getSystemView().gotoAppsTab();
}
Aggregations