Skip to content

Commit

Permalink
Merge branch 'develop' into release-11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanCazabonne committed Sep 14, 2021
2 parents 0afde38 + f0165a1 commit 6ef1f79
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 124 deletions.
7 changes: 7 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
to add several step handlers for the same orbit propagation, a new
event detector for angular separation as seen from the spacecraft.
See the list below for a full description of the changes.">
<action dev="bryan" type="update" issue="766" due-to="Gowtham Sivaraman">
Allowed setting of AttitudeProvider to the BoundedPropagator
generated via propagation.
</action>
<action dev="bryan" type="fix" issue="835">
Fixed format symbols for year, month, day in DateComponents#toString().
</action>
<action dev="thomas" type="fix" issue="668">
Added a new event detector for angular separation as seen from the spacecraft.
</action>
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/org/orekit/data/DataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
* Some implementations may fail if the {@link #getOpener() opener}'s
* {@link Opener#openStreamOnce() openStreamOnce} or {@link Opener#openReaderOnce() openReaderOnce}
* methods are called several times or are both called separately. This is particularly
* true in network-based streams.
* <p>
* This class is a simple container without any processing methods.
* true for network-based streams.
* </p>
* @see DataFilter
* @author Luc Maisonobe
Expand Down Expand Up @@ -134,7 +132,7 @@ public interface StreamOpener {
* stream, i.e. to delay this opening (or not open the stream at all).
* It is <em>not</em> intended to open the stream several times. Some
* implementations may fail if an attempt to open a stream several
* times is made. This is particularly true in network-based streams.
* times is made. This is particularly true for network-based streams.
* </p>
* @return opened stream
* @exception IOException if stream cannot be opened
Expand All @@ -151,7 +149,7 @@ public interface ReaderOpener {
* stream, i.e. to delay this opening (or not open the stream at all).
* It is <em>not</em> intended to open the stream several times. Some
* implementations may fail if an attempt to open a stream several
* times is made. This is particularly true in network-based streams.
* times is made. This is particularly true for network-based streams.
* </p>
* @return opened stream
* @exception IOException if stream cannot be opened
Expand Down Expand Up @@ -187,7 +185,7 @@ public interface Opener {
* the {@link #openReaderOnce() characters stream} separately (but opening
* the reader may be implemented by opening the binary stream or vice-versa).
* Implementations may fail if an attempt to open a stream several times is
* made. This is particularly true in network-based streams.
* made. This is particularly true for network-based streams.
* </p>
* @return opened stream or null if there are no data streams at all
* @exception IOException if stream cannot be opened
Expand All @@ -203,7 +201,7 @@ public interface Opener {
* the {@link #openReaderOnce() characters stream} separately (but opening
* the reader may be implemented by opening the binary stream or vice-versa).
* Implementations may fail if an attempt to open a stream several times is
* made. This is particularly true in network-based streams.
* made. This is particularly true for network-based streams.
* </p>
* @return opened reader or null if there are no data streams at all
* @exception IOException if stream cannot be opened
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.hipparchus.ode.DenseOutputModel;
import org.hipparchus.ode.ODEStateAndDerivative;
import org.orekit.attitudes.AttitudeProvider;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.frames.Frame;
Expand Down Expand Up @@ -216,6 +217,17 @@ protected void resetIntermediateState(final SpacecraftState state, final boolean
throw new OrekitException(OrekitMessages.NON_RESETABLE_STATE);
}

/** {@inheritDoc} */
@Override
public void setAttitudeProvider(final AttitudeProvider attitudeProvider) {
super.setAttitudeProvider(attitudeProvider);
if (mapper != null) {
// At the construction, the mapper is not set yet
// However, if the attitude provider is changed afterwards, it must be changed in the mapper too
mapper.setAttitudeProvider(attitudeProvider);
}
}

/** {@inheritDoc} */
public SpacecraftState getInitialState() {
return updateAdditionalStates(basicPropagate(getMinDate()));
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/org/orekit/propagation/integration/StateMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public abstract class StateMapper {
/** Position angle type. */
private final PositionAngle angleType;

/** Attitude provider. */
private final AttitudeProvider attitudeProvider;

/** Central attraction coefficient. */
private final double mu;

/** Inertial frame. */
private final Frame frame;

/** Attitude provider. */
private AttitudeProvider attitudeProvider;

/** Simple constructor.
* <p>
* The position parameter type is meaningful only if {@link
Expand Down Expand Up @@ -89,11 +89,6 @@ public OrbitType getOrbitType() {
return orbitType;
}

/** Set position angle type.
*/
public void setPositionAngleType() {
}

/** Get propagation parameter type.
* @return angle type to use for propagation
*/
Expand Down Expand Up @@ -122,6 +117,13 @@ public AttitudeProvider getAttitudeProvider() {
return attitudeProvider;
}

/** Set the attitude provider.
* @param attitudeProvider the provider to set
*/
public void setAttitudeProvider(final AttitudeProvider attitudeProvider) {
this.attitudeProvider = attitudeProvider;
}

/** Map the raw double time offset to a date.
* @param t date offset
* @return date
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/org/orekit/time/DateComponents.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import java.io.Serializable;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -119,11 +121,14 @@ public class DateComponents implements Serializable, Comparable<DateComponents>
/** Factory for non-leap years. */
private static final MonthDayFactory COMMON_YEAR_FACTORY = new CommonYearFactory();

/** Formatting symbols used in {@link #toString()}. */
private static final DecimalFormatSymbols US_SYMBOLS = new DecimalFormatSymbols(Locale.US);

/** Format for years. */
private static final DecimalFormat FOUR_DIGITS = new DecimalFormat("0000");
private static final DecimalFormat FOUR_DIGITS = new DecimalFormat("0000", US_SYMBOLS);

/** Format for months and days. */
private static final DecimalFormat TWO_DIGITS = new DecimalFormat("00");
private static final DecimalFormat TWO_DIGITS = new DecimalFormat("00", US_SYMBOLS);

/** Offset between J2000 epoch and modified julian day epoch. */
private static final int MJD_TO_J2000 = 51544;
Expand Down
Loading

0 comments on commit 6ef1f79

Please sign in to comment.