Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed JSON annotations to enable ODE processing of circle geometries #114

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,39 @@

@JsonPropertyOrder({ "center", "radius", "units" })
public class Circle extends Asn1Object {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;

private Position center;
@JsonProperty("center")
private Position center;

@JsonProperty("radius")
private String radius;
@JsonProperty("radius")
private String radius;

@JsonProperty("units")
private DistanceUnits units;
@JsonProperty("units")
private DistanceUnits units;

@JsonProperty("position")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this is the offending annotation that caused the problem

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a unit test for this use case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is position an invalid property on a Circle Asn1Object in all cases, or is there any scenario where we want to have position present? I'm gathering that, at minimum, we don't want both position and center present, but is there a scenario where we could want position present when center is not (and vice versa)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is position an invalid property on a Circle Asn1Object in all cases, or is there any scenario where we want to have position present? I'm gathering that, at minimum, we don't want both position and center present, but is there a scenario where we could want position present when center is not (and vice versa)?

The ASN.1 representation for a Circle in J2735 only contains center, radius and units. I don't think we'll ever have a scenario where we want to have 'position' present.

public Position getPosition() {
return center;
}
public Position getCenter() {
return center;
}

@JsonProperty("center")
public void setPosition(Position position) {
this.center = position;
}
public void setCenter(Position center) {
this.center = center;
}

public String getRadius() {
return radius;
}
public String getRadius() {
return radius;
}

public void setRadius(String radius) {
this.radius = radius;
}
public void setRadius(String radius) {
this.radius = radius;
}

public Position getCenter() {
return center;
}
public DistanceUnits getUnits() {
return units;
}

public void setCenter(Position center) {
this.center = center;
}

public DistanceUnits getUnits() {
return units;
}

public void setUnits(DistanceUnits units) {
this.units = units;
}
public void setUnits(DistanceUnits units) {
this.units = units;
}

}
Loading
Loading