pub struct Event {
pub parameter: StateParameter,
pub desired_value: f64,
pub epoch_precision: Unit,
pub value_precision: f64,
pub obs_frame: Option<Frame>,
}
Expand description
Defines a state parameter event finder
Fields§
§parameter: StateParameter
The state parameter
desired_value: f64
The desired self.desired_value, must be in the same units as the state parameter
epoch_precision: Unit
The time precision after which the solver will report that it cannot find any more precise
value_precision: f64
The precision on the desired value
obs_frame: Option<Frame>
An optional frame in which to search this – it IS recommended to convert the whole trajectory instead of searching in a given frame!
Implementations§
Source§impl Event
impl Event
Sourcepub fn new(parameter: StateParameter, desired_value: f64) -> Self
pub fn new(parameter: StateParameter, desired_value: f64) -> Self
Match a specific event for the parameter to hit the specified value. By default, the time precision is 1 millisecond and the value precision is 1e-3 of whatever unit is the default for that parameter. For example, a radius event will seek the requested value at the meter level, and an angle event will seek it at the thousands of a degree.
Sourcepub fn within_tolerance(
parameter: StateParameter,
desired_value: f64,
value_precision: f64,
) -> Self
pub fn within_tolerance( parameter: StateParameter, desired_value: f64, value_precision: f64, ) -> Self
Match a specific event for the parameter to hit the specified value with the provided tolerance on the value
Sourcepub fn specific(
parameter: StateParameter,
desired_value: f64,
value_precision: f64,
epoch_precision: Unit,
) -> Self
pub fn specific( parameter: StateParameter, desired_value: f64, value_precision: f64, epoch_precision: Unit, ) -> Self
Match a specific event for the parameter to hit the specified value with the provided tolerance on the value and time
Sourcepub fn mean_surface(body: &Ellipsoid) -> Self
pub fn mean_surface(body: &Ellipsoid) -> Self
Match the central body’s mean equatorial radius. This is useful for detecting when an object might impact the central body.
Sourcepub fn in_frame(
parameter: StateParameter,
desired_value: f64,
target_frame: Frame,
) -> Self
pub fn in_frame( parameter: StateParameter, desired_value: f64, target_frame: Frame, ) -> Self
Match a specific event in another frame, using the default epoch precision and value.
Trait Implementations§
Source§impl EventEvaluator<Spacecraft> for Event
impl EventEvaluator<Spacecraft> for Event
Source§fn eval(
&self,
state: &Spacecraft,
almanac: Arc<Almanac>,
) -> Result<f64, EventError>
fn eval( &self, state: &Spacecraft, almanac: Arc<Almanac>, ) -> Result<f64, EventError>
fn epoch_precision(&self) -> Duration
fn value_precision(&self) -> f64
Source§fn eval_string(
&self,
state: &Spacecraft,
_almanac: Arc<Almanac>,
) -> Result<String, EventError>
fn eval_string( &self, state: &Spacecraft, _almanac: Arc<Almanac>, ) -> Result<String, EventError>
fn eval_crossing( &self, prev_state: &S, next_state: &S, almanac: Arc<Almanac>, ) -> Result<bool, EventError>
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.