コード例 #1
0
ファイル: ToLocalFile.java プロジェクト: brianmay27/piPrinter
  @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;
  }
コード例 #2
0
ファイル: ToLocalFile.java プロジェクト: brianmay27/piPrinter
  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!");
    }
  }