Skip to content

Commit

Permalink
fix epoch parsing
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume W. Bres <[email protected]>
  • Loading branch information
gwbres committed Sep 18, 2023
1 parent ad6440b commit 440b968
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rinex/src/navigation/stomessage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl StoMessage {

let (epoch, rem) = line.split_at(23);
let (system, _) = rem.split_at(5);
let (epoch, _) = epoch::parse_utc(epoch.trim())?;
let (epoch, _) = epoch::parse_in_timescale(epoch.trim(), ts)?;

let line = match lines.next() {
Some(l) => l,
Expand Down
10 changes: 5 additions & 5 deletions rinex/src/tests/nav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ mod test {
// test last epoch
assert_eq!(
rinex.last_epoch(),
Some(Epoch::from_str("2022-06-10T19:56:48 UTC").unwrap()),
Some(Epoch::from_str("2022-06-10T19:56:48 GPST").unwrap()),
"wrong last epoch",
);

Expand Down Expand Up @@ -884,8 +884,8 @@ mod test {
ion_count += 1; // ION test
let (_msg, _sv, model) = fr;
if let Some(model) = model.as_klobuchar() {
let e0 = Epoch::from_gregorian_utc(2022, 06, 08, 09, 59, 48, 0);
let e1 = Epoch::from_gregorian_utc(2022, 06, 08, 09, 59, 50, 0);
let e0 = Epoch::from_str("2022-06-08T09:59:48 GPST").unwrap();
let e1 = Epoch::from_str("2022-06-08T09:59:50 BDT").unwrap();
if *e == e0 {
assert_eq!(
model.alpha,
Expand Down Expand Up @@ -925,11 +925,11 @@ mod test {
)
);
} else {
panic!("misplaced ION message")
panic!("misplaced ION message {:?} @ {}", model, e)
}
assert_eq!(model.region, KbRegionCode::WideArea);
} else if let Some(model) = model.as_nequick_g() {
assert_eq!(*e, Epoch::from_gregorian_utc(2022, 06, 08, 09, 59, 57, 00));
assert_eq!(*e, Epoch::from_str("2022-06-08T09:59:57 GST").unwrap());
assert_eq!(model.region, NgRegionFlags::empty());
}
}
Expand Down

0 comments on commit 440b968

Please sign in to comment.