public void addLocalizerToILS(ILSModel model) { SceneryModel sceneryModel = new SceneryModel(); sceneryModel.setShouldNotify(false); sceneryModel.setName("{fe978b1b-6b2f-4898-9e5d-a008e8675ed4}"); sceneryModel.setHeading(model.getHeading()); sceneryModel.setLatLon((LatLonPoint) model.getLatLon().clone()); sceneryModel.setShouldNotify(true); addSceneryModel(sceneryModel); }
public void addILSModel(ILSModel ilsModel) { int i = runwayAL.size() - 1; if (i >= 0) { RunwayModel runwayModel = (RunwayModel) runwayAL.get(i); String runwayName = runwayModel.getNumber(); if (runwayModel.getDesignator().length() > 0 && !runwayModel.getDesignator().equals("NONE")) runwayName = (new StringBuilder()) .append(runwayName) .append(" ") .append(runwayModel.getDesignator()) .toString(); else if (runwayModel.getPrimaryDesignator().length() > 0 && !runwayModel.getPrimaryDesignator().equals("NONE")) runwayName = (new StringBuilder()) .append(runwayName) .append(" ") .append(runwayModel.getPrimaryDesignator()) .toString(); ilsModel.setRunway(runwayName); runwayModel.addILSModel(ilsModel); return; } else { return; } }
public void addILSModelToRunway(ILSModel ilsModel, RunwayModel runwayModel, boolean primaryEnd) { ilsModel.setShouldNotify(false); int sizeLength = 0; if (runwayModel.getLengthMeasure().equals("M")) sizeLength = (int) ((runwayModel.getLength() * 3.28F + 2000F) * runwayModel.getScale()); else sizeLength = (int) ((runwayModel.getLength() + 2000F) * runwayModel.getScale()); java.awt.geom.Point2D.Float runwayCP = Utilities.getPixelsBetweenPoints( runwayModel.getCenterPoint().getLat(), runwayModel.getCenterPoint().getLon(), runwayModel.getLatLon().getLat(), runwayModel.getLatLon().getLon(), runwayModel.getScale()); java.awt.geom.Point2D.Float ilsPoint = new java.awt.geom.Point2D.Float( (float) runwayCP.getX(), (float) (runwayCP.getY() - ((double) sizeLength / 2D) * (double) (primaryEnd ? 1 : -1))); ilsPoint = Utilities.rotatePoint(runwayCP, ilsPoint, runwayModel.getHeading()); ilsModel.setLatLon( Utilities.getLatLonForPixel( runwayModel.getCenterPoint().getLat(), runwayModel.getCenterPoint().getLon(), ilsPoint.x, ilsPoint.y, runwayModel.getScale())); if (primaryEnd) ilsModel.setEnd("PRIMARY"); else ilsModel.setEnd("SECONDARY"); ilsModel.setAlt(runwayModel.getAlt()); ilsModel.setAltMeasure(runwayModel.getAltMeasure()); if (primaryEnd) { ilsModel.setHeading(runwayModel.getHeading()); } else { float ilsHeading = runwayModel.getHeading() + 180F; if (ilsHeading >= 360F) ilsHeading -= 360F; ilsModel.setHeading(ilsHeading); } DMEModel dmeModel = new DMEModel(); dmeModel.setShouldNotify(false); dmeModel.setLatLon((LatLonPoint) ilsModel.getLatLon().clone()); dmeModel.setAlt(ilsModel.getAlt()); dmeModel.setAltMeasure(ilsModel.getAltMeasure()); dmeModel.setShouldNotify(true); ilsModel.setDMEModel(dmeModel); GlideSlopeModel glideSlopeModel = new GlideSlopeModel(); glideSlopeModel.setShouldNotify(false); glideSlopeModel.setAlt(ilsModel.getAlt()); glideSlopeModel.setAltMeasure(ilsModel.getAltMeasure()); ilsModel.setGlideSlopeModel(glideSlopeModel); if (runwayModel.getLengthMeasure().equals("M")) sizeLength = (int) ((runwayModel.getLength() * 3.28F - 2000F) * runwayModel.getScale()); else sizeLength = (int) ((runwayModel.getLength() - 2000F) * runwayModel.getScale()); java.awt.geom.Point2D.Float glideSlopePoint = new java.awt.geom.Point2D.Float( (float) runwayCP.getX() - 350F * runwayModel.getScale() * (float) (primaryEnd ? 1 : -1), (float) (runwayCP.getY() - ((double) sizeLength / 2D) * (double) (primaryEnd ? -1 : 1))); glideSlopePoint = Utilities.rotatePoint(runwayCP, glideSlopePoint, runwayModel.getHeading()); glideSlopeModel.setLatLon( Utilities.getLatLonForPixel( runwayModel.getCenterPoint().getLat(), runwayModel.getCenterPoint().getLon(), glideSlopePoint.x, glideSlopePoint.y, runwayModel.getScale())); glideSlopeModel.setShouldNotify(true); String runwayName = runwayModel.getNumber(); if (runwayModel.getDesignator().length() > 0 && !runwayModel.getDesignator().equals("NONE")) runwayName = (new StringBuilder()) .append(runwayName) .append(" ") .append(runwayModel.getDesignator()) .toString(); else if (runwayModel.getPrimaryDesignator().length() > 0 && !runwayModel.getPrimaryDesignator().equals("NONE")) runwayName = (new StringBuilder()) .append(runwayName) .append(" ") .append(runwayModel.getPrimaryDesignator()) .toString(); ilsModel.setRunway(runwayName); runwayModel.addILSModel(ilsModel); ilsModel.setShouldNotify(true); }