Skip to content

Commit

Permalink
Merge pull request #626 from teyrana/fix/555/fff/update
Browse files Browse the repository at this point in the history
[Resolves #555] editing FreeformFins now updates main window
  • Loading branch information
teyrana committed Apr 25, 2020
2 parents a230d42 + da2fea3 commit 1c7171e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ public void setPoint(final int index, final double xRequest, final double yReque
log.error(String.format("ERROR: found an intersection while setting fin point #%d to [%6.4g, %6.4g] <body frame> : ABORTING setPoint(..) !! ", index, xRequest, yRequest));
return;
}

fireComponentChangeEvent(ComponentChangeEvent.AEROMASS_CHANGE);
}

private void movePoints(final double delta_x, final double delta_y) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ public void testSetFirstPoint() {
}{ // case 3:
fins.setAxialOffset( AxialMethod.MIDDLE, 0.0);
fins.setPoints(initialPoints);
assertEquals(0.0, fins.getAxialOffset(), EPSILON);
assertEquals(0.3, fins.getFinFront().x, EPSILON);

// vvvv function under test vvvv
Expand All @@ -514,8 +515,8 @@ public void testSetFirstPoint() {
assertEquals(0.05, fins.getAxialOffset(), EPSILON);
assertEquals(0.3, fins.getLength(), EPSILON);

assertEquals(0.35, fins.getFinFront().x, EPSILON);
assertEquals(0.825, fins.getFinFront().y, EPSILON);
assertEquals(0.4, fins.getFinFront().x, EPSILON);
assertEquals(0.8, fins.getFinFront().y, EPSILON);

final Coordinate[] postPoints = fins.getFinPoints();
assertEquals(postPoints.length, 3);
Expand All @@ -530,13 +531,15 @@ public void testSetFirstPoint() {
}{ // case 4:
fins.setAxialOffset( AxialMethod.MIDDLE, 0.0);
fins.setPoints(initialPoints);
assertEquals(0.3, fins.getFinFront().x, EPSILON);
assertEquals(0.85, fins.getFinFront().y, EPSILON);

// vvvv function under test vvvv
fins.setPoint( 0, -0.1, 0.1f);
fins.setPoint( 0, -0.1, 0.1f);
// ^^^^ function under test ^^^^

assertEquals(0.25, fins.getFinFront().x, EPSILON);
assertEquals(0.875, fins.getFinFront().y, EPSILON);
assertEquals(0.2, fins.getFinFront().x, EPSILON);
assertEquals(0.9, fins.getFinFront().y, EPSILON);

final Coordinate[] postPoints = fins.getFinPoints();
assertEquals(postPoints.length, 3);
Expand Down

0 comments on commit 1c7171e

Please sign in to comment.