@@ -30,16 +30,21 @@ impl Default for Cli {
30
30
}
31
31
}
32
32
33
+ pub struct RemoteReferenceSite {
34
+ pub data : QcContext ,
35
+ pub rx_ecef : Option < ( f64 , f64 , f64 ) > ,
36
+ }
37
+
33
38
/// Context defined by User.
34
39
pub struct Context {
35
40
/// Quiet option
36
41
pub quiet : bool ,
37
42
/// Data context defined by user.
38
43
/// In differential opmode, this is the ROVER.
39
44
pub data : QcContext ,
40
- /// Secondary dataset defined by user
41
- /// serves as BASE in differential opmodes .
42
- pub station_data : Option < QcContext > ,
45
+ /// Remote reference site (secondary dataset) defined by User.
46
+ /// Serves as reference point in differential techniques .
47
+ pub reference_site : Option < RemoteReferenceSite > ,
43
48
/// Context name is derived from the primary file loaded in Self,
44
49
/// and mostly used in output products generation.
45
50
pub name : String ,
@@ -83,13 +88,23 @@ impl Context {
83
88
panic ! ( "failed to create {}: {:?}" , path. display( ) , e) ;
84
89
} )
85
90
}
91
+ // Returns True if this context is compatible with RTK positioning
92
+ pub fn rtk_compatible ( & self ) -> bool {
93
+ if let Some ( remote) = & self . reference_site {
94
+ self . data . observation ( ) . is_some ( )
95
+ && self . rx_ecef . is_some ( )
96
+ && remote. data . observation ( ) . is_some ( )
97
+ && remote. rx_ecef . is_some ( )
98
+ } else {
99
+ false
100
+ }
101
+ }
86
102
}
87
103
88
104
impl Cli {
89
105
/// Build new command line interface
90
106
pub fn new ( ) -> Self {
91
- Self {
92
- matches : {
107
+ let cmd =
93
108
Command :: new ( "rinex-cli" )
94
109
. author ( "Guillaume W. Bres, <guillaume.bressaix@gmail.com>" )
95
110
. version ( env ! ( "CARGO_PKG_VERSION" ) )
@@ -167,6 +182,14 @@ but you can extend that with --depth. Refer to -f for more information."))
167
182
By default the $RINEX_WORKSPACE variable is prefered if it is defined.
168
183
You can also use this flag to customize it.
169
184
If none are defined, we will then try to create a local directory named \" WORKSPACE\" like it is possible in this very repo." ) )
185
+ . next_help_heading ( "Output customization" )
186
+ . arg (
187
+ Arg :: new ( "output-name" )
188
+ . short ( 'o' )
189
+ . action ( ArgAction :: Set )
190
+ . help ( "Customize output file or report name.
191
+ In analysis opmode, report is named index.html by default, this will redefine that.
192
+ In file operations (filegen, etc..) we can manually define output filenames with this option." ) )
170
193
. next_help_heading ( "Report customization" )
171
194
. arg (
172
195
Arg :: new ( "report-sum" )
@@ -183,12 +206,6 @@ If none are defined, we will then try to create a local directory named \"WORKSP
183
206
By default, report synthesis happens once per input set (file combnation and cli options).
184
207
Use this option to force report regeneration.
185
208
This has no effect on file operations that do not synthesize a report." ) )
186
- . arg (
187
- Arg :: new ( "report-name" )
188
- . short ( 'o' )
189
- . action ( ArgAction :: Set )
190
- . help ( "Custom report name, otherwise, report is named index.html" )
191
- )
192
209
. arg (
193
210
Arg :: new ( "report-brdc-sky" )
194
211
. long ( "brdc-sky" )
@@ -268,15 +285,17 @@ Otherwise it gets automatically picked up."))
268
285
. value_name ( "\" lat,lon,alt\" coordinates in ddeg [°]" )
269
286
. help ( "Define the (RX) antenna position manualy, in decimal degrees." ) )
270
287
. next_help_heading ( "Exclusive Opmodes: you can only run one at a time." )
271
- . subcommand ( filegen:: subcommand ( ) )
272
- . subcommand ( merge:: subcommand ( ) )
273
- . subcommand ( positioning:: ppp_subcommand ( ) )
274
- . subcommand ( positioning:: rtk_subcommand ( ) )
275
- . subcommand ( split:: subcommand ( ) )
276
- . subcommand ( diff:: subcommand ( ) )
277
- . subcommand ( time_binning:: subcommand ( ) )
278
- . get_matches ( )
279
- } ,
288
+ . subcommand ( filegen:: subcommand ( ) ) ;
289
+
290
+ let cmd = cmd
291
+ . subcommand ( merge:: subcommand ( ) )
292
+ . subcommand ( positioning:: ppp_subcommand ( ) )
293
+ . subcommand ( positioning:: rtk_subcommand ( ) )
294
+ . subcommand ( split:: subcommand ( ) )
295
+ . subcommand ( diff:: subcommand ( ) )
296
+ . subcommand ( time_binning:: subcommand ( ) ) ;
297
+ Self {
298
+ matches : cmd. get_matches ( ) ,
280
299
}
281
300
}
282
301
/// Recursive browser depth
@@ -404,11 +423,14 @@ Otherwise it gets automatically picked up."))
404
423
}
405
424
/// True if File Operations to generate data is being deployed
406
425
pub fn has_fops_output_product ( & self ) -> bool {
407
- match self . matches . subcommand ( ) {
408
- Some ( ( "filegen" , _) ) | Some ( ( "merge" , _) ) | Some ( ( "split" , _) ) | Some ( ( "tbin" , _) )
409
- | Some ( ( "diff" , _) ) => true ,
410
- _ => false ,
411
- }
426
+ matches ! (
427
+ self . matches. subcommand( ) ,
428
+ Some ( ( "filegen" , _) )
429
+ | Some ( ( "merge" , _) )
430
+ | Some ( ( "split" , _) )
431
+ | Some ( ( "tbin" , _) )
432
+ | Some ( ( "diff" , _) )
433
+ )
412
434
}
413
435
/// True if forced report synthesis is requested
414
436
pub fn force_report_synthesis ( & self ) -> bool {
@@ -428,7 +450,7 @@ Otherwise it gets automatically picked up."))
428
450
. chain ( self . rover_files ( ) . into_iter ( ) . sorted ( ) )
429
451
. chain ( self . preprocessing ( ) . into_iter ( ) . sorted ( ) )
430
452
. join ( "," ) ;
431
- if let Some ( custom) = self . custom_report_name ( ) {
453
+ if let Some ( custom) = self . custom_output_name ( ) {
432
454
string. push_str ( custom) ;
433
455
}
434
456
if let Some ( geo) = self . manual_geodetic ( ) {
@@ -456,8 +478,8 @@ Otherwise it gets automatically picked up."))
456
478
force_brdc_skyplot : self . matches . get_flag ( "report-brdc-sky" ) ,
457
479
}
458
480
}
459
- /// Report to be generated for this session
460
- pub fn custom_report_name ( & self ) -> Option < & String > {
461
- self . matches . get_one :: < String > ( "report -name" )
481
+ /// Customized / manually defined output to be generated
482
+ pub fn custom_output_name ( & self ) -> Option < & String > {
483
+ self . matches . get_one :: < String > ( "output -name" )
462
484
}
463
485
}
0 commit comments