Commit d189fcd6 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Merge branch 'issue-837' into develop

parents 09e21aed 547e270e
......@@ -21,6 +21,9 @@
</properties>
<body>
<release version="11.1" date="TBD" description="TBD">
<action dev="luc" type="fix" issue="837">
Added getters for raw detectors in event shifter, slope filter and predicate filter.
</action>
<action dev="bryan" type="fix" issue="874">
Fixed initialization of maneuver trigger events when using EventBasedManeuverTriggers.
</action>
......
......@@ -126,6 +126,15 @@ public class EventEnablingPredicateFilter<T extends EventDetector>
return new EventEnablingPredicateFilter<T>(newMaxCheck, newThreshold, newMaxIter, newHandler, rawDetector, enabler);
}
/**
* Get the wrapped raw detector.
* @return the wrapped raw detector
* @since 11.1
*/
public EventDetector getDetector() {
return rawDetector;
}
/** {@inheritDoc} */
public void init(final SpacecraftState s0,
final AbsoluteDate t) {
......
......@@ -112,6 +112,15 @@ public class EventShifter<T extends EventDetector> extends AbstractDetector<Even
detector, useShiftedStates, -increasingOffset, -decreasingOffset);
}
/**
* Get the detector for the raw unshifted event.
* @return the detector for the raw unshifted event
* @since 11.1
*/
public EventDetector getDetector() {
return detector;
}
/** Get the increasing events time shift.
* @return increasing events time shift
*/
......
......@@ -125,6 +125,15 @@ public class EventSlopeFilter<T extends EventDetector> extends AbstractDetector<
return new EventSlopeFilter<T>(newMaxCheck, newThreshold, newMaxIter, newHandler, rawDetector, filter);
}
/**
* Get the wrapped raw detector.
* @return the wrapped raw detector
* @since 11.1
*/
public EventDetector getDetector() {
return rawDetector;
}
/** {@inheritDoc} */
public void init(final SpacecraftState s0,
final AbsoluteDate t) {
......
......@@ -119,6 +119,7 @@ public class EventEnablingPredicateFilterTest {
}
}).withMaxCheck(60.0);
Assert.assertSame(raw, aboveGroundElevationDetector.getDetector());
Assert.assertEquals(0.001, raw.getMaxCheckInterval(), 1.0e-15);
Assert.assertEquals(60.0, aboveGroundElevationDetector.getMaxCheckInterval(), 1.0e-15);
Assert.assertEquals(1.0e-6, aboveGroundElevationDetector.getThreshold(), 1.0e-15);
......
......@@ -140,13 +140,20 @@ public class EventShifterTest {
@Test
public void testIncreasingError() {
propagator.addEventDetector(createRawDetector("raw increasing", "raw decreasing", 2.0e-9));
propagator.addEventDetector(new EventShifter<EclipseDetector>(createRawDetector("-10s increasing", "-10s decreasing", 2.0e-3),
true, -10, -10));
propagator.addEventDetector(new EventShifter<EclipseDetector>(createRawDetector("-100s increasing", "-100s decreasing", 3.0e-2),
true, -100, -100));
propagator.addEventDetector(new EventShifter<EclipseDetector>(createRawDetector("-1000s increasing", "-1000s decreasing", 5.0),
true, -1000, -1000));
final EclipseDetector raw0000 = createRawDetector("raw increasing", "raw decreasing", 2.0e-9);
final EclipseDetector raw0010 = createRawDetector("-10s increasing", "-10s decreasing", 2.0e-3);
final EclipseDetector raw0100 = createRawDetector("-100s increasing", "-100s decreasing", 3.0e-2);
final EclipseDetector raw1000 = createRawDetector("-1000s increasing", "-1000s decreasing", 5.0);
final EventShifter<EclipseDetector> shift0010 = new EventShifter<>(raw0010, true, -10, -10);
final EventShifter<EclipseDetector> shift0100 = new EventShifter<>(raw0100, true, -100, -100);
final EventShifter<EclipseDetector> shift1000 = new EventShifter<>(raw1000, true, -1000, -1000);
Assert.assertSame(raw0010, shift0010.getDetector());
Assert.assertSame(raw0100, shift0100.getDetector());
Assert.assertSame(raw1000, shift1000.getDetector());
propagator.addEventDetector(raw0000);
propagator.addEventDetector(shift0010);
propagator.addEventDetector(shift0100);
propagator.addEventDetector(shift1000);
propagator.propagate(iniDate.shiftedBy(20100));
// the raw eclipses (not all within the propagation range) are at times:
......
......@@ -80,6 +80,7 @@ public class EventSlopeFilterTest {
final EventSlopeFilter<EclipseDetector> filter =
new EventSlopeFilter<EclipseDetector>(detector, FilterType.TRIGGER_ONLY_INCREASING_EVENTS).
withMaxIter(200);
Assert.assertSame(detector, filter.getDetector());
Assert.assertEquals(200, filter.getMaxIterationCount());
propagator.clearEventsDetectors();
......
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