Skip to content

Commit 83cd9a6

Browse files
committed
add sources
Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent 18b248c commit 83cd9a6

File tree

13 files changed

+136
-43
lines changed

13 files changed

+136
-43
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "12:00"
8+
open-pull-requests-limit: 10

.github/workflows/daily.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Daily
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *" # midnight, every day
7+
8+
env:
9+
RUST_BACKTRACE: 1
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
include:
20+
- name: Default build
21+
opts: -r
22+
- name: All Features
23+
opts: --all-features
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: actions-rs/toolchain@v1
28+
name: Install Rust
29+
with:
30+
toolchain: stable
31+
override: true
32+
- name: Install Dependencies
33+
run: |
34+
sudo apt-get update
35+
36+
- name: ${{ matrix.name }}
37+
run: |
38+
cargo clean && cargo update && cargo build ${{ matrix.opts }}

.github/workflows/rust.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
tags:
7+
- "*"
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Build
22+
run: cargo build
23+
- name: Build (all features)
24+
run: cargo build --all-features
25+
- name: Coding style
26+
run: cargo fmt --all -- --check
27+
28+
release:
29+
name: Release
30+
runs-on: ubuntu-latest
31+
needs: [build]
32+
if: github.ref_type == 'tag'
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Install stable toolchain
37+
uses: dtolnay/rust-toolchain@master
38+
with:
39+
toolchain: stable
40+
- name: Publish
41+
env:
42+
TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
43+
run: |
44+
cargo login $TOKEN
45+
cargo publish

rustfmt.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
match_block_trailing_comma = true
2+
newline_style = "Unix"

src/cli/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ Otherwise it gets automatically picked up."))
339339
} else {
340340
Vec::new()
341341
}
342-
}
342+
},
343343
_ => Vec::new(),
344344
}
345345
}
@@ -352,7 +352,7 @@ Otherwise it gets automatically picked up."))
352352
} else {
353353
Vec::new()
354354
}
355-
}
355+
},
356356
_ => Vec::new(),
357357
}
358358
}

src/fops/diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn diff(ctx: &Context, matches: &ArgMatches) -> Result<(), Error> {
3030

3131
//TODO: change this to crnx2rnx_mut()
3232
rinex_a.crnx2rnx().substract(&rinex_b.crnx2rnx())
33-
}
33+
},
3434
t => panic!("operation not feasible for {}", t),
3535
};
3636

src/fops/merge.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@ pub fn merge(ctx: &Context, matches: &ArgMatches) -> Result<(), Error> {
2222
.observation()
2323
.ok_or(Error::MissingObservationRinex)?;
2424
rinex_a.merge(&rinex_b)?
25-
}
25+
},
2626
RinexType::NavigationData => {
2727
let rinex_a = ctx_data
2828
.brdc_navigation()
2929
.ok_or(Error::MissingNavigationRinex)?;
3030
rinex_a.merge(&rinex_b)?
31-
}
31+
},
3232
RinexType::MeteoData => {
3333
let rinex_a = ctx_data.meteo().ok_or(Error::MissingMeteoRinex)?;
3434
rinex_a.merge(&rinex_b)?
35-
}
35+
},
3636
RinexType::IonosphereMaps => {
3737
let rinex_a = ctx_data.ionex().ok_or(Error::MissingIONEX)?;
3838
rinex_a.merge(&rinex_b)?
39-
}
39+
},
4040
RinexType::ClockData => {
4141
let rinex_a = ctx_data.clock().ok_or(Error::MissingClockRinex)?;
4242
rinex_a.merge(&rinex_b)?
43-
}
43+
},
4444
_ => unimplemented!(),
4545
};
4646

src/main.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ fn user_data_parsing(
145145
} else {
146146
error!("BASE STATION Dataset: {:?}", ctx);
147147
}
148-
}
148+
},
149149
_ => {
150150
debug!("{:?}", ctx);
151-
}
151+
},
152152
}
153153

154154
ctx
@@ -200,7 +200,7 @@ pub fn main() -> Result<(), Error> {
200200
lon_ddeg
201201
);
202202
Some((x, y, z))
203-
}
203+
},
204204
None => {
205205
if let Some(data_pos) = ctx_position {
206206
let (x, y, z) = data_pos.to_ecef_wgs84();
@@ -223,7 +223,7 @@ pub fn main() -> Result<(), Error> {
223223
warn!("No RX position defined");
224224
None
225225
}
226-
}
226+
},
227227
};
228228

229229
// Form context
@@ -270,7 +270,7 @@ pub fn main() -> Result<(), Error> {
270270
error!("remote site does not have its geodetic marker defined: current CLI limitation.");
271271
None
272272
}
273-
}
273+
},
274274
_ => None,
275275
}
276276
},
@@ -298,32 +298,32 @@ pub fn main() -> Result<(), Error> {
298298
Some(("filegen", submatches)) => {
299299
fops::filegen(&ctx, &cli.matches, submatches)?;
300300
return Ok(());
301-
}
301+
},
302302
Some(("merge", submatches)) => {
303303
fops::merge(&ctx, submatches)?;
304304
return Ok(());
305-
}
305+
},
306306
Some(("split", submatches)) => {
307307
fops::split(&ctx, submatches)?;
308308
return Ok(());
309-
}
309+
},
310310
Some(("tbin", submatches)) => {
311311
fops::time_binning(&ctx, &cli.matches, submatches)?;
312312
return Ok(());
313-
}
313+
},
314314
Some(("diff", submatches)) => {
315315
fops::diff(&ctx, submatches)?;
316316
return Ok(());
317-
}
317+
},
318318
Some(("ppp", submatches)) => {
319319
let chapter = positioning::precise_positioning(&cli, &ctx, false, submatches)?;
320320
extra_pages.push(chapter);
321-
}
321+
},
322322
Some(("rtk", submatches)) => {
323323
let chapter = positioning::precise_positioning(&cli, &ctx, true, submatches)?;
324324
extra_pages.push(chapter);
325-
}
326-
_ => {}
325+
},
326+
_ => {},
327327
}
328328

329329
// report

src/positioning/cggtts/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitSource>(
7575
Some(tracking) => {
7676
info!("Using custom tracking duration {:?}", *tracking);
7777
*tracking
78-
}
78+
},
7979
_ => {
8080
let tracking = Duration::from_seconds(Scheduler::BIPM_TRACKING_DURATION_SECONDS.into());
8181
info!("Using default tracking duration {:?}", tracking);
8282
tracking
83-
}
83+
},
8484
};
8585

8686
let mut trk_duration = cv_duration;
@@ -224,10 +224,10 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitSource>(
224224
match clock.next_clock_at(*t, *sv) {
225225
Some(corr) => {
226226
candidate.set_clock_correction(corr);
227-
}
227+
},
228228
None => {
229229
error!("{} ({}) - no clock correction available", *t, *sv);
230-
}
230+
},
231231
}
232232

233233
if let Some((_, _, eph)) = eph.borrow_mut().select(*t, *sv) {
@@ -263,7 +263,7 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitSource>(
263263
// initialize new tracker
264264
trackers.insert((*sv, observable.clone()), SVTracker::default());
265265
trackers.get_mut(target).unwrap()
266-
}
266+
},
267267
Some(tracker) => tracker,
268268
};
269269

@@ -360,14 +360,14 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitSource>(
360360
Method::CPP | Method::PPP => {
361361
// TODO: grab IONOD from PVTSol
362362
None
363-
}
363+
},
364364
_ => None,
365365
},
366366
0, // TODO "rcvr_channel" > 0 if known
367367
GlonassChannel::default(), //TODO
368368
&ref_observable,
369369
)
370-
}
370+
},
371371
_ => {
372372
Track::new(
373373
*sv,
@@ -381,20 +381,20 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitSource>(
381381
Method::CPP | Method::PPP => {
382382
// TODO: grab IONOD from PVTSol
383383
None
384-
}
384+
},
385385
_ => None,
386386
},
387387
0, // TODO "rcvr_channel" > 0 if known
388388
&ref_observable,
389389
)
390-
}
390+
},
391391
}; // match constellation
392392
tracks.push(track);
393-
}
393+
},
394394
Err(e) => {
395395
warn!("{} - track fitting error: \"{}\"", t, e);
396396
// TODO: most likely we should reset the SV signal tracker here
397-
}
397+
},
398398
} //.fit()
399399
}
400400
// time to release a track
@@ -406,7 +406,7 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitSource>(
406406
else {
407407
tracker.latch_measurement(t, fitdata);
408408
}
409-
}
409+
},
410410
Err(e) => {
411411
/*
412412
* Any PVT resolution failures would introduce a data gap
@@ -416,7 +416,7 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitSource>(
416416
// if let Some(tracker) = trackers.get_mut(&(*sv, observable.clone())) {
417417
// tracker.reset();
418418
// }
419-
}
419+
},
420420
} //.pvt resolve
421421
// after release, reset so we start a new track
422422
if should_release {

src/positioning/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ pub fn precise_positioning(
257257

258258
info!("Using custom solver configuration: {:#?}", cfg);
259259
cfg
260-
}
260+
},
261261
None => {
262262
let method = Method::default();
263263
let mut cfg = Config::static_ppp_preset(method);
@@ -276,7 +276,7 @@ pub fn precise_positioning(
276276

277277
info!("Using {:?} default preset: {:#?}", method, cfg);
278278
cfg
279-
}
279+
},
280280
};
281281
/* Verify requirements and print helpful comments */
282282
assert!(

0 commit comments

Comments
 (0)