nyx_space/dynamics/sequence/discrete_event.rs
1/*
2 Nyx, blazing fast astrodynamics
3 Copyright (C) 2018-onwards Christopher Rabotin <christopher.rabotin@gmail.com>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19use anise::{
20 frames::Frame,
21 structure::spacecraft::{DragData, Mass, SRPData},
22};
23use serde::{Deserialize, Serialize};
24use serde_dhall::StaticType;
25
26use crate::dynamics::guidance::mnvr::ImpulsiveManeuver;
27
28#[derive(Clone, Debug, Serialize, Deserialize, StaticType)]
29pub enum DiscreteEvent {
30 Staging {
31 impulsive_maneuver: Option<ImpulsiveManeuver>,
32 decrement_properties: Option<PhysicalProperties>,
33 },
34 Docking {
35 impulsive_maneuver: Option<ImpulsiveManeuver>,
36 increment_properties: Option<PhysicalProperties>,
37 },
38 FrameSwap {
39 new_frame: Frame,
40 },
41}
42
43#[derive(Clone, Debug, Serialize, Deserialize, StaticType)]
44pub struct PhysicalProperties {
45 pub mass: Option<Mass>,
46 pub srp: Option<SRPData>,
47 pub drag: Option<DragData>,
48}