@@ -38,6 +38,10 @@ pub struct RNX2BIN<'a> {
38
38
header : & ' a Header ,
39
39
/// RINEX [TypeDependentStreamer]
40
40
streamer : TypeDependentStreamer < ' a > ,
41
+ /// Assert (before deployment) whether the Header should not be serialized (no default!)
42
+ pub skip_header : bool ,
43
+ /// Define (before deployment) a custom message to be included in the announcement.
44
+ pub custom_announce : Option < String > ,
41
45
}
42
46
43
47
#[ derive( Debug , Default , Clone , Copy , PartialEq ) ]
@@ -58,9 +62,11 @@ impl<'a> Iterator for RNX2BIN<'a> {
58
62
let content = match self . state {
59
63
State :: HeaderPkgVersion => {
60
64
let mut geo = self . forge_monument_geo ( ) ;
61
- geo. comments
62
- . push ( format ! ( "RNX2BIN from {}" , self . header. rinex_type) ) ;
63
- geo. comments . push ( "STREAM starting!" . to_string ( ) ) ;
65
+ if let Some ( custom) = & self . custom_announce {
66
+ geo. comments . push ( custom. clone ( ) ) ;
67
+ }
68
+ // announce stream beginning
69
+ geo. comments . push ( "Stream starting!" . to_string ( ) ) ;
64
70
self . state = State :: MonumentGeo ;
65
71
Some ( geo)
66
72
} ,
@@ -87,7 +93,7 @@ impl<'a> Iterator for RNX2BIN<'a> {
87
93
if let Some ( _position) = & self . header . rx_position {
88
94
//geo = geo.with_site_location();
89
95
}
90
- if !self . header . comments . is_empty ( ) {
96
+ if !self . header . comments . is_empty ( ) && ! self . skip_header {
91
97
self . state = State :: AnnounceHeaderComments ;
92
98
} else {
93
99
self . state = State :: AnnounceRecord ;
@@ -169,6 +175,8 @@ impl Rinex {
169
175
meta,
170
176
header : & self . header ,
171
177
state : State :: default ( ) ,
178
+ skip_header : false ,
179
+ custom_announce : Default :: default ( ) ,
172
180
streamer : TypeDependentStreamer :: new ( meta, self ) ,
173
181
} )
174
182
}
0 commit comments