Skip to content
Snippets Groups Projects
Commit eee53842 authored by Clément Jonglez's avatar Clément Jonglez Committed by Clément Jonglez
Browse files

add valueSpanMapChanged​ method added to ParameterObserver in Orekit 12

parent cd3561b1
No related branches found
No related tags found
1 merge request!8Make rugged compatible with Orekit 12
......@@ -26,8 +26,10 @@ import org.hipparchus.geometry.euclidean.threed.RotationConvention;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.orekit.rugged.utils.DerivativeGenerator;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.ParameterDriver;
import org.orekit.utils.ParameterObserver;
import org.orekit.utils.TimeSpanMap;
/** {@link TimeIndependentLOSTransform LOS transform} based on a fixed rotation.
* @author Luc Maisonobe
......@@ -71,7 +73,14 @@ public class FixedRotation implements TimeIndependentLOSTransform {
this.angleDriver = new ParameterDriver(name, angle, SCALE, -2 * FastMath.PI, 2 * FastMath.PI);
angleDriver.addObserver(new ParameterObserver() {
@Override
public void valueChanged(final double previousValue, final ParameterDriver driver) {
public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) {
// reset rotations to null, they will be evaluated lazily if needed
rotation = null;
rDS = null;
}
@Override
public void valueSpanMapChanged(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) {
// reset rotations to null, they will be evaluated lazily if needed
rotation = null;
rDS = null;
......
......@@ -23,8 +23,10 @@ import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.orekit.rugged.utils.DerivativeGenerator;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.ParameterDriver;
import org.orekit.utils.ParameterObserver;
import org.orekit.utils.TimeSpanMap;
/** {@link TimeIndependentLOSTransform LOS transform} based on a homothety along the Z axis.
* @author Lucie Labatallee
......@@ -65,7 +67,14 @@ public class FixedZHomothety implements TimeIndependentLOSTransform {
this.factorDriver = new ParameterDriver(name, factorvalue, SCALE, 0, Double.POSITIVE_INFINITY);
factorDriver.addObserver(new ParameterObserver() {
@Override
public void valueChanged(final double previousValue, final ParameterDriver driver) {
public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) {
// reset factor to zero, they will be evaluated lazily if needed
factor = 0.0;
factorDS = null;
}
@Override
public void valueSpanMapChanged(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) {
// reset factor to zero, they will be evaluated lazily if needed
factor = 0.0;
factorDS = null;
......
......@@ -28,6 +28,7 @@ import org.orekit.rugged.utils.DerivativeGenerator;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.ParameterDriver;
import org.orekit.utils.ParameterObserver;
import org.orekit.utils.TimeSpanMap;
/** Builder for lines-of-sight list.
* <p>
......@@ -226,7 +227,13 @@ public class LOSBuilder {
final ParameterObserver resettingObserver = new ParameterObserver() {
/** {@inheritDoc} */
@Override
public void valueChanged(final double previousValue, final ParameterDriver driver) {
public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) {
Arrays.fill(transformed, null);
}
/** {@inheritDoc} */
@Override
public void valueSpanMapChanged(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) {
Arrays.fill(transformed, null);
}
};
......
......@@ -32,6 +32,7 @@ import org.orekit.rugged.utils.DerivativeGenerator;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.ParameterDriver;
import org.orekit.utils.ParameterObserver;
import org.orekit.utils.TimeSpanMap;
/** {@link LOSTransform LOS transform} based on a rotation with polynomial angle.
* @author Luc Maisonobe
......@@ -87,7 +88,15 @@ public class PolynomialRotation implements LOSTransform {
this.coefficientsDrivers = new ParameterDriver[angleCoeffs.length];
final ParameterObserver resettingObserver = new ParameterObserver() {
@Override
public void valueChanged(final double previousValue, final ParameterDriver driver) {
public void valueChanged(final double previousValue, final ParameterDriver driver, AbsoluteDate date) {
// reset rotations to null, they will be evaluated lazily if needed
angle = null;
axisDS = null;
angleDS = null;
}
@Override
public void valueSpanMapChanged(TimeSpanMap<Double> previousValueSpanMap, ParameterDriver driver) {
// reset rotations to null, they will be evaluated lazily if needed
angle = null;
axisDS = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment