Commit 1d1c03ef authored by Greg Carbott's avatar Greg Carbott Committed by Evan Ward

Fix restarting propagation with a maneuver

Previously if propagation stopped in the middle of a maneuver the engines would
be left on, even if the initial state was reset to a different date. Now the
firing state of the engines is reset every time propagation starts. Also added
several test cases.
parent 0d230e63
......@@ -144,6 +144,19 @@ public class ConstantThrustManeuver extends AbstractForceModel {
}
@Override
public void init(final SpacecraftState s0, final AbsoluteDate t) {
// set the initial value of firing
final AbsoluteDate sDate = s0.getDate();
final boolean isForward = sDate.compareTo(t) < 0;
final boolean isBetween =
startDate.compareTo(sDate) < 0 && endDate.compareTo(sDate) > 0;
final boolean isOnStart = startDate.compareTo(sDate) == 0;
final boolean isOnEnd = endDate.compareTo(sDate) == 0;
firing = isBetween || (isForward && isOnStart) || (!isForward && isOnEnd);
}
/** Get the thrust.
* @return thrust force (N).
*/
......
......@@ -22,6 +22,10 @@
<body>
<release version="8.0" date="TBC"
description="TBC">
<action dev="evan" type="fix" due-to="Greg Carbott">
Fix bug in restarting propagation with a ConstantThrustManeuver with an
updated initial condition.
</action>
<action dev="luc" type="fix">
Fixed a display error for dates less than 0.5ms before a leap second.
</action>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment