示例#1
0
  public static LinkedHashMap<String, Collection<PayloadFingerprint>> getPayloads(PlanType plan) {
    LinkedHashMap<String, Collection<PayloadFingerprint>> payloads = new LinkedHashMap<>();

    for (Maneuver m : plan.getGraph().getAllManeuvers()) {
      payloads.put(m.getId(), getPayloads(m));
    }

    return payloads;
  }
示例#2
0
  public static Collection<PayloadFingerprint> getPayloads(Maneuver m) {
    Vector<PayloadFingerprint> payloads = new Vector<>();
    IMCMessage[] msgs = m.getStartActions().getAllMessages();

    for (IMCMessage msg : msgs) {
      if (msg instanceof SetEntityParameters) payloads.addAll(parse((SetEntityParameters) msg));
    }

    return payloads;
  }
示例#3
0
 @Override
 public Object clone() {
   Elevator clone = new Elevator();
   super.clone(clone);
   clone.setManeuverLocation(getManeuverLocation());
   clone.startZ = startZ;
   clone.startZUnits = startZUnits;
   clone.setStartFromCurrentPosition(isStartFromCurrentPosition());
   clone.setRadius(getRadius());
   clone.setSpeed(getSpeed());
   clone.setSpeedUnits(getSpeedUnits());
   return clone;
 }
示例#4
0
  @Override
  public void paintOnMap(Graphics2D g2d, PlanElement planElement, StateRenderer2D renderer) {
    super.paintOnMap(g2d, planElement, renderer);
    g2d = (Graphics2D) g2d.create();
    if (!isStartFromCurrentPosition()) {
      // x marks the spot...
      g2d.drawLine(-4, -4, 4, 4);
      g2d.drawLine(-4, 4, 4, -4);
    }
    double radius = this.getRadius() * renderer.getZoom();
    if (isStartFromCurrentPosition()) g2d.setColor(new Color(255, 0, 0, 100));
    else g2d.setColor(new Color(255, 255, 255, 100));
    g2d.fill(new Ellipse2D.Double(-radius, -radius, radius * 2, radius * 2));
    if (isStartFromCurrentPosition()) g2d.setColor(Color.RED);
    else g2d.setColor(Color.GREEN);
    g2d.draw(new Ellipse2D.Double(-radius, -radius, radius * 2, radius * 2));
    g2d.setColor(new Color(255, 0, 0, 200));
    for (double i = this.getRadius() - 2; i > 0; i = i - 2) {
      double r = i * renderer.getZoom();
      g2d.draw(new Ellipse2D.Double(-r, -r, r * 2, r * 2));
    }

    //        g2d.rotate(Math.PI/2);
    g2d.translate(0, -14);
    g2d.setColor(Color.WHITE);
    g2d.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    if (isStartFromCurrentPosition()) {
      g2d.drawLine(-5, 0, 5, 0);
    } else {
      int m = 1;
      if (getManeuverLocation().getAllZ() < getEndZ()) m = -1;
      g2d.drawLine(-5, m * -5, 5, m * -5);
      if (getManeuverLocation().getAllZ() < getEndZ()
          || getManeuverLocation().getAllZ() > getEndZ()) {
        g2d.drawLine(-5, m * 5, 0, 0);
        g2d.drawLine(5, m * 5, 0, 0);
      } else g2d.drawLine(-5, m * 5, 5, m * 5);
    }

    g2d.dispose();
  }
示例#5
0
 @Override
 public void setProperties(Property[] properties) {
   super.setProperties(properties);
   PluginUtils.setPluginProperties(this, properties);
 }