Skip to content

Commit 4d7c9cd

Browse files
authored
Fix OBS V2, V3 SBAS formatting issue (#339)
* Fix OBS V2, V3 SBAS formatting issue --------- Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent a1798d6 commit 4d7c9cd

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

db/NAV/orbits.json

100755100644
File mode changed.

src/observation/formatting.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,21 @@ impl Observations {
5353
self.format_epoch_v2(w, key, sv_list, numsat)?;
5454

5555
for sv in sv_list.iter() {
56-
// following header specs (strictly)
56+
// V2 is too badly specified to permit correct SBAS handling
5757
let observables = if sv.constellation.is_sbas() {
58-
observables
59-
.get(&Constellation::SBAS)
60-
.ok_or(FormattingError::MissingObservableDefinition)?
58+
observables.get(&Constellation::SBAS)
6159
} else {
62-
observables
63-
.get(&sv.constellation)
64-
.ok_or(FormattingError::MissingObservableDefinition)?
60+
observables.get(&sv.constellation)
61+
};
62+
63+
let observables = match observables {
64+
Some(observables) => observables, // correctly identified
65+
None => continue, // abort
6566
};
6667

6768
let mut modulo = 0;
6869

70+
// following header specs (strictly)
6971
for (nth, observable) in observables.iter().enumerate() {
7072
// retrieve observed signal (if any)
7173
if let Some(observation) = self
@@ -181,14 +183,11 @@ impl Observations {
181183
write!(w, "{:x}", sv)?;
182184

183185
// following header definitions
184-
let observables = if sv.constellation.is_sbas() {
185-
observables
186-
.get(&Constellation::SBAS)
187-
.ok_or(FormattingError::MissingObservableDefinition)?
188-
} else {
189-
observables
190-
.get(&sv.constellation)
191-
.ok_or(FormattingError::MissingObservableDefinition)?
186+
let observables = observables.get(&sv.constellation);
187+
188+
let observables = match observables {
189+
Some(observables) => observables, // correctly identified
190+
None => continue, // abort
192191
};
193192

194193
for observable in observables.iter() {

src/tests/production.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mod test {
2525
println!("Formatting test passed for \"{}\"", path);
2626

2727
// remove copy
28-
// let _ = std::fs::remove_file(tmp_path);
28+
let _ = std::fs::remove_file(tmp_path);
2929
}
3030

3131
#[test]

0 commit comments

Comments
 (0)