Ejemplo n.º 1
0
  private boolean validateSimpleSar() {

    // Datum
    if (simpleSarInputPanel.getDatumLat() == -9999) {
      return false;
    }

    if (simpleSarInputPanel.getDatumLon() == -9999) {
      return false;
    }

    Position datum =
        Position.create(simpleSarInputPanel.getDatumLat(), simpleSarInputPanel.getDatumLon());

    // A position
    if (simpleSarInputPanel.getALat() == -9999) {
      return false;
    }

    if (simpleSarInputPanel.getALon() == -9999) {
      return false;
    }

    Position aPos = Position.create(simpleSarInputPanel.getALat(), simpleSarInputPanel.getALon());

    // B Position
    if (simpleSarInputPanel.getBLat() == -9999) {
      return false;
    }

    if (simpleSarInputPanel.getBLon() == -9999) {
      return false;
    }

    Position bPos = Position.create(simpleSarInputPanel.getBLat(), simpleSarInputPanel.getBLon());

    // C Position
    if (simpleSarInputPanel.getCLat() == -9999) {
      return false;
    }

    if (simpleSarInputPanel.getCLon() == -9999) {
      return false;
    }

    Position cPos = Position.create(simpleSarInputPanel.getCLat(), simpleSarInputPanel.getCLon());

    // D Position
    if (simpleSarInputPanel.getDLat() == -9999) {
      return false;
    }

    if (simpleSarInputPanel.getDLon() == -9999) {
      return false;
    }

    Position dPos = Position.create(simpleSarInputPanel.getDLat(), simpleSarInputPanel.getDLon());

    if (!simpleSarInputPanel.checkTime()) {
      return false;
    }

    double xError = simpleSarInputPanel.getInitialPositionError();

    if (xError == -9999) {
      // Error message is handled within function
      return false;
    }

    double yError = simpleSarInputPanel.getNavError();

    if (yError == -9999) {
      // Error message is handled within function
      return false;
    }

    double safetyFactor = simpleSarInputPanel.getSafetyFactor();

    if (safetyFactor == -9999) {
      // Error message is handled within function
      return false;
    }

    int searchObject = simpleSarInputPanel.getSearchItemID();

    // Only valid search objects is value 0 to 19
    if (searchObject < 0 || searchObject > 20) {
      // Error message is handled within function
      // System.out.println("failed search object with id " +
      // searchObject);
      return false;
    }

    voctManager.inputSimpleSarData(
        simpleSarInputPanel.getSARID(),
        simpleSarInputPanel.getLKPDate(),
        simpleSarInputPanel.getCSSDate(),
        xError,
        yError,
        safetyFactor,
        searchObject,
        aPos,
        bPos,
        cPos,
        dPos,
        datum);

    return true;
  }