@Override public boolean finished() { if (setupFailed) return true; if (!directBuilder.finished()) return false; try { sdcc.endFileCapture(); Base.logger.info("Finished writing to file!"); } catch (IOException e) { Base.logger.log(Level.WARNING, "Could not finish writing to file"); } return true; }
public ToLocalFile(Driver driver, GCodeSource source, String remoteName) { if (!(driver instanceof SDCardCapture)) { Base.logger.log(Level.WARNING, "Build to a file requires a driver with SDCardCapture!"); return; } sdcc = (SDCardCapture) driver; try { sdcc.beginFileCapture(remoteName); directBuilder = new Direct(driver, source); setupFailed = false; } catch (FileNotFoundException e) { Base.logger.log(Level.WARNING, "Build to file failed: File Not Found!"); } }