Skip to content

Commit e6163da

Browse files
authored
NAV V4 standards (#334)
* Add newer revisions location test * Update latest supported version --------- Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent a8b0444 commit e6163da

File tree

2 files changed

+45
-7
lines changed

2 files changed

+45
-7
lines changed

src/navigation/ephemeris/orbits.rs

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,9 @@ pub(crate) fn closest_nav_standards(
534534
// start by trying to locate desired revision.
535535
// On each mismatch, we decrement and move on to next major/minor combination.
536536
let (mut major, mut minor): (u8, u8) = revision.into();
537+
537538
loop {
538-
// filter on both:
539-
// + Exact Constellation
540-
// + Exact NavMessageType
541-
// + Exact revision we're currently trying to locate
542-
// algorithm: decreasing, starting from desired revision
539+
// Match constellation, message type & revision exactly
543540
let items: Vec<_> = database
544541
.iter()
545542
.filter(|item| {
@@ -556,7 +553,7 @@ pub(crate) fn closest_nav_standards(
556553
// we start @ minor = 10, which is
557554
// larger than most revisions we know
558555
if major == 0 {
559-
// we're done: browsed all possibilities
556+
// we're done
560557
break;
561558
} else {
562559
major -= 1;
@@ -569,6 +566,7 @@ pub(crate) fn closest_nav_standards(
569566
return Some(items[0]);
570567
}
571568
} // loop
569+
572570
None
573571
}
574572

@@ -669,6 +667,7 @@ mod test {
669667
Version::new(3, 0),
670668
NavMessageType::LNAV,
671669
),
670+
// NAV V4 (exact)
672671
(
673672
Constellation::BeiDou,
674673
Version::new(4, 0),
@@ -710,12 +709,14 @@ mod test {
710709
);
711710

712711
let standards = found.unwrap();
712+
713713
assert!(
714714
standards.constellation == constellation,
715715
"bad constellation identified \"{}\", expecting \"{}\"",
716716
constellation,
717717
standards.constellation
718718
);
719+
719720
assert!(
720721
standards.version == rev,
721722
"should have matched {} V{} exactly, because it exists in DB",
@@ -744,8 +745,45 @@ mod test {
744745
Version::new(3, 0),
745746
NavMessageType::LNAV,
746747
),
748+
(
749+
Constellation::BeiDou,
750+
Version::new(4, 2),
751+
Version::new(4, 0),
752+
NavMessageType::CNV1,
753+
),
754+
(
755+
Constellation::BeiDou,
756+
Version::new(4, 2),
757+
Version::new(4, 0),
758+
NavMessageType::CNV2,
759+
),
760+
(
761+
Constellation::BeiDou,
762+
Version::new(4, 2),
763+
Version::new(4, 0),
764+
NavMessageType::CNV3,
765+
),
766+
(
767+
Constellation::Galileo,
768+
Version::new(4, 2),
769+
Version::new(4, 0),
770+
NavMessageType::INAV,
771+
),
772+
(
773+
Constellation::QZSS,
774+
Version::new(4, 2),
775+
Version::new(4, 0),
776+
NavMessageType::LNAV,
777+
),
778+
(
779+
Constellation::QZSS,
780+
Version::new(4, 2),
781+
Version::new(4, 0),
782+
NavMessageType::CNAV,
783+
),
747784
] {
748785
let found = closest_nav_standards(constellation, desired, msg);
786+
749787
assert!(
750788
found.is_some(),
751789
"should have converged for \"{}\" V\"{}\" (\"{}\") to nearest frame revision",

src/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use crate::prelude::ParsingError;
33

44
/// Current `RINEX` version supported to this day
5-
pub const SUPPORTED_VERSION: Version = Version { major: 4, minor: 0 };
5+
pub const SUPPORTED_VERSION: Version = Version { major: 4, minor: 2 };
66

77
/// Version is used to describe RINEX standards revisions.
88
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]

0 commit comments

Comments
 (0)