Commit 41165b24 authored by Luc Maisonobe's avatar Luc Maisonobe

Merge branch 'develop' into issue-474

parents f788358b 985c2d5b
Pipeline #1028 passed with stage
in 25 minutes and 53 seconds
......@@ -21,6 +21,9 @@
</properties>
<body>
<release version="11.0" date="TBD" description="TBD">
<action dev="bryan" type="update" issue="774">
TimeStampedFieldPVCoordinates now implements FieldTimeStamped.
</action>
<action dev="nfialton" type="fix" issue="775">
Fixed NullPointerException in FieldSpacecraftState when orbit is not defined.
</action>
......
......@@ -79,7 +79,7 @@ class ParseUtils {
final Character alpha = ALPHA5_LETTERS.get(highDigits);
if (alpha == null) {
throw new OrekitException(OrekitMessages.TLE_INVALID_PARAMETER,
satelliteNumber, name, alpha);
satelliteNumber, name, "null");
}
return alpha + addPadding(name, lowDigits, '0', 4, true, satelliteNumber);
} else {
......
......@@ -29,6 +29,7 @@ import org.orekit.data.DataContext;
import org.orekit.errors.OrekitInternalError;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.FieldAbsoluteDate;
import org.orekit.time.FieldTimeStamped;
import org.orekit.time.TimeScale;
import org.orekit.time.TimeStamped;
......@@ -39,7 +40,7 @@ import org.orekit.time.TimeStamped;
* @since 7.0
*/
public class TimeStampedFieldPVCoordinates<T extends RealFieldElement<T>>
extends FieldPVCoordinates<T> {
extends FieldPVCoordinates<T> implements FieldTimeStamped<T> {
/** The date. */
private final FieldAbsoluteDate<T> date;
......@@ -587,9 +588,8 @@ public class TimeStampedFieldPVCoordinates<T extends RealFieldElement<T>>
this.date = date;
}
/** Get the date.
* @return date
*/
/** {@inheritDoc} */
@Override
public FieldAbsoluteDate<T> getDate() {
return date;
}
......
......@@ -38,6 +38,7 @@ import org.junit.Test;
import org.orekit.Utils;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.FieldAbsoluteDate;
import org.orekit.time.FieldTimeStamped;
public class TimeStampedFieldPVCoordinatesTest {
......@@ -530,6 +531,31 @@ public class TimeStampedFieldPVCoordinatesTest {
}
@Test
public void testIssue774() {
doTestIssue774(Decimal64Field.getInstance());
}
private <T extends RealFieldElement<T>> void doTestIssue774(final Field<T> field) {
final T zero = field.getZero();
// Epoch
final FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field);
// Coordinates
final FieldPVCoordinates<T> pv =
new FieldPVCoordinates<T>(new FieldVector3D<T>(zero, zero, zero),
new FieldVector3D<T>(zero, zero, zero));
// Time stamped object
final FieldTimeStamped<T> timeStamped =
new TimeStampedFieldPVCoordinates<>(date, pv);
// Verify
Assert.assertEquals(0.0, date.durationFrom(timeStamped.getDate()).getReal(), Double.MIN_VALUE);
}
private PolynomialFunction randomPolynomial(int degree, Random random) {
double[] coeff = new double[ 1 + degree];
for (int j = 0; j < degree; ++j) {
......
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