Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rinex/src/clocks/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub enum Error {
#[error("unknown data code \"{0}\"")]
UnknownDataCode(String),
#[error("failed to parse epoch")]
EpochError(#[from] epoch::Error),
EpochParsingError(#[from] epoch::ParsingError),
#[error("failed to parse # of data fields")]
ParseIntError(#[from] std::num::ParseIntError),
#[error("failed to parse data payload")]
Expand Down Expand Up @@ -187,7 +187,7 @@ pub(crate) fn parse_epoch(
+2+1 // m
+11; // s
let (epoch, rem) = rem.split_at(offset);
let (epoch, _) = epoch::parse(epoch.trim())?;
let (epoch, _) = epoch::parse_utc(epoch.trim())?;

// nb of data fields
let (n, _) = rem.split_at(4);
Expand Down
14 changes: 13 additions & 1 deletion rinex/src/constellation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,20 @@ impl Constellation {
Err(ParsingError::Unrecognized(code.to_string()))
}
}
/// Converts self into time scale
pub fn to_timescale(&self) -> Option<TimeScale> {
match self {
Self::GPS | Self::QZSS => Some(TimeScale::GPST),
Self::Galileo => Some(TimeScale::GST),
Self::BeiDou => Some(TimeScale::BDT),
Self::Geo | Self::SBAS(_) => Some(TimeScale::GPST),
// this is wrong but we can't do better
Self::Glonass | Self::IRNSS => Some(TimeScale::UTC),
_ => None,
}
}
/// Converts self to 1 letter code (RINEX standard code)
pub fn to_1_letter_code(&self) -> &str {
pub(crate) fn to_1_letter_code(&self) -> &str {
match self {
Self::GPS => "G",
Self::Glonass => "R",
Expand Down
Loading