Skip to content

Commit

Permalink
Merge pull request #130 from lox-space/implement_oem_type
Browse files Browse the repository at this point in the history
Implement oem type
  • Loading branch information
matzipan authored Jul 18, 2024
2 parents 7246b5a + 46235dd commit 3bb9ac9
Show file tree
Hide file tree
Showing 9 changed files with 1,815 additions and 117 deletions.
386 changes: 315 additions & 71 deletions crates/lox-derive/src/lib.rs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions crates/lox-io/src/ndm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
//! covariance matrix section. But this will cause the comments for the
//! following section, the maneuver parameters list, to be discarded.
//!
//! The KVN parsing currently does not support user-defined fields and ddd date
//! format types.
//!
//! Check the respective submodules for more information.
pub mod json;
Expand Down
20 changes: 18 additions & 2 deletions crates/lox-io/src/ndm/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,15 @@ pub struct StateVectorType {
pub z_dot: VelocityType,
}

#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[derive(
Clone,
Debug,
Default,
PartialEq,
serde::Deserialize,
serde::Serialize,
lox_derive::KvnDeserialize,
)]
#[serde(default)]
pub struct StateVectorAccType {
#[serde(rename = "EPOCH")]
Expand Down Expand Up @@ -860,7 +868,15 @@ pub struct SolarFluxType {
pub units: Option<SolarFluxUnits>,
}

#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[derive(
Clone,
Debug,
Default,
PartialEq,
serde::Deserialize,
serde::Serialize,
lox_derive::KvnDeserialize,
)]
#[serde(default)]
pub struct OemCovarianceMatrixType {
#[serde(rename = "COMMENT")]
Expand Down
3 changes: 3 additions & 0 deletions crates/lox-io/src/ndm/kvn/deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ pub enum KvnDeserializerErr<I> {
InvalidDateTimeFormat { input: I },
InvalidNumberFormat { input: I },
InvalidStringFormat { input: I },
InvalidStateVectorFormat { input: I },
InvalidCovarianceMatrixFormat { input: I },
KeywordNotFound { expected: I },
// Has a second meaning: it stops the iterator for vector type deserializers
UnexpectedKeyword { found: I, expected: I },
EmptyKeyword { input: I },
EmptyValue { input: I },
Expand Down
Loading

0 comments on commit 3bb9ac9

Please sign in to comment.