Commit 5f34799f authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

fixed a mode handling error in NumericalPropagator: when a propagator was reused

with a new mode setting, the previous step handlers were still used in addition to
the new ones instead of replacing them
parent b2c8760f
......@@ -266,28 +266,55 @@ public class NumericalPropagator implements Propagator {
return mode;
}
/** {@inheritDoc} */
/** {@inheritDoc}
* <p>Note that this method has the side effect of replacing the step handlers
* of the underlying integrator set up in the {@link
* #NumericalPropagator(FirstOrderIntegrator) constructor} or the {@link
* #setIntegrator(FirstOrderIntegrator) setIntegrator} method. So if a specific
* step handler is needed, it should be added after this method has been callled.</p>
*/
public void setSlaveMode() {
integrator.clearEventHandlers();
integrator.addStepHandler(DummyStepHandler.getInstance());
modeHandler = null;
mode = SLAVE_MODE;
}
/** {@inheritDoc} */
/** {@inheritDoc}
* <p>Note that this method has the side effect of replacing the step handlers
* of the underlying integrator set up in the {@link
* #NumericalPropagator(FirstOrderIntegrator) constructor} or the {@link
* #setIntegrator(FirstOrderIntegrator) setIntegrator} method. So if a specific
* step handler is needed, it should be added after this method has been callled.</p>
*/
public void setMasterMode(final double h, final OrekitFixedStepHandler handler) {
setMasterMode(new OrekitStepNormalizer(h, handler));
}
/** {@inheritDoc} */
/** {@inheritDoc}
* <p>Note that this method has the side effect of replacing the step handlers
* of the underlying integrator set up in the {@link
* #NumericalPropagator(FirstOrderIntegrator) constructor} or the {@link
* #setIntegrator(FirstOrderIntegrator) setIntegrator} method. So if a specific
* step handler is needed, it should be added after this method has been callled.</p>
*/
public void setMasterMode(final OrekitStepHandler handler) {
integrator.clearEventHandlers();
final AdaptedStepHandler wrapped = new AdaptedStepHandler(handler);
integrator.addStepHandler(wrapped);
modeHandler = wrapped;
mode = MASTER_MODE;
}
/** {@inheritDoc} */
/** {@inheritDoc}
* <p>Note that this method has the side effect of replacing the step handlers
* of the underlying integrator set up in the {@link
* #NumericalPropagator(FirstOrderIntegrator) constructor} or the {@link
* #setIntegrator(FirstOrderIntegrator) setIntegrator} method. So if a specific
* step handler is needed, it should be added after this method has been callled.</p>
*/
public void setEphemerisMode() {
integrator.clearEventHandlers();
final IntegratedEphemeris ephemeris = new IntegratedEphemeris();
integrator.addStepHandler(ephemeris);
modeHandler = ephemeris;
......
......@@ -104,6 +104,11 @@
added a reset feature in all propagators, allowing to reuse an already configured
propagator for several different orbits
</action>
<action dev="luc" type="fix" >
fixed a mode handling error in NumericalPropagator: when a propagator was reused
with a new mode setting, the previous step handlers were still used in addition to
the new ones instead of replacing them
</action>
<action dev="luc" type="fix" >
fixed an interpolation error for orbits crossing the -PI/+PI singularity between
entries in the Ephemeris class
......
Supports Markdown
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