Пример #1
0
 public void addStationToParking(TaxiwayParkingModel model) {
   Rectangle2D square = ((java.awt.geom.Ellipse2D.Float) model.getParkingCircle()).getBounds2D();
   SceneryModel sceneryModel = new SceneryModel();
   sceneryModel.setShouldNotify(false);
   sceneryModel.setName("{0da416ee-c523-4d81-a562-9ce503f28468}");
   sceneryModel.setHeading(model.getHeading());
   java.awt.geom.Point2D.Float point =
       new java.awt.geom.Point2D.Float(
           (float) (square.getX() + square.getWidth() / 2D),
           (float) (square.getY() + square.getHeight() / 2D));
   java.awt.geom.Point2D.Float sceneryPoint =
       Utilities.rotatePoint(
           point,
           new java.awt.geom.Point2D.Float(
               (float) (square.getX() + square.getWidth() / 2D),
               (float) (square.getY() - 27.5D * (double) scale)),
           model.getHeading());
   sceneryModel.setLatLon(
       Utilities.getLatLonForPixel(
           model.getCenterPoint().getLat(),
           model.getCenterPoint().getLon(),
           sceneryPoint.getX(),
           sceneryPoint.getY(),
           scale));
   sceneryModel.setShouldNotify(true);
   addSceneryModel(sceneryModel);
 }
Пример #2
0
  public void addTriggerToParking(TaxiwayParkingModel model) {
    Rectangle2D square = ((java.awt.geom.Ellipse2D.Float) model.getParkingCircle()).getBounds2D();
    square.setFrame(
        square.getX() - (double) (20F * scale),
        square.getY() - (double) (20F * scale),
        square.getWidth() + (double) (40F * scale),
        square.getHeight() + (double) (40F * scale));
    TriggerModel triggerModel = new TriggerModel();
    triggerModel.setShouldNotify(false);
    triggerModel.setType73("YES");
    triggerModel.setTypeJet("YES");
    triggerModel.setShouldNotify(true);
    java.awt.geom.Point2D.Float point =
        new java.awt.geom.Point2D.Float(
            (float) (square.getX() + square.getWidth() / 2D),
            (float) (square.getY() + square.getHeight() / 2D));
    java.awt.geom.Point2D.Float vertexPoints[] = new java.awt.geom.Point2D.Float[4];
    vertexPoints[0] =
        Utilities.rotatePoint(
            point,
            new java.awt.geom.Point2D.Float((float) square.getX(), (float) square.getY()),
            model.getHeading());
    vertexPoints[1] =
        Utilities.rotatePoint(
            point,
            new java.awt.geom.Point2D.Float(
                (float) square.getX(), (float) (square.getY() + square.getHeight())),
            model.getHeading());
    vertexPoints[2] =
        Utilities.rotatePoint(
            point,
            new java.awt.geom.Point2D.Float(
                (float) (square.getX() + square.getWidth()),
                (float) (square.getY() + square.getHeight())),
            model.getHeading());
    vertexPoints[3] =
        Utilities.rotatePoint(
            point,
            new java.awt.geom.Point2D.Float(
                (float) (square.getX() + square.getWidth()), (float) square.getY()),
            model.getHeading());
    for (int i = 0; i < 4; i++) {
      VertexModel vertexModel = new VertexModel();
      vertexModel.setShouldNotify(false);
      vertexModel.setLatLon(
          Utilities.getLatLonForPixel(
              model.getCenterPoint().getLat(),
              model.getCenterPoint().getLon(),
              vertexPoints[i].getX(),
              vertexPoints[i].getY(),
              scale));
      vertexModel.setShouldNotify(true);
      triggerModel.addVertexModel(vertexModel);
    }

    addTriggerModel(triggerModel);
  }
Пример #3
0
 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);
 }