@@ -37,31 +37,47 @@ pub const SHOW_LEGEND: &str = "Show Legend";
3737pub const PLOT_HISTORY_MAX : usize = 1000 ;
3838pub const DILUTION_OF_PRECISION_UNITS : f64 = 0.01 ;
3939pub const NUM_GNSS_MODES : usize = 6 ;
40- pub const SPP : & str = "spp" ;
41- pub const DGNSS : & str = "dgnss" ;
42- pub const FLOAT : & str = "float" ;
43- pub const FIXED : & str = "fixed" ;
44- pub const DR : & str = "dr" ;
45- pub const SBAS : & str = "sbas" ;
46-
47- pub const LAT_SPP : & str = "lat_spp" ;
48- pub const LNG_SPP : & str = "lng_spp" ;
49- pub const ALT_SPP : & str = "alt_spp" ;
50- pub const LAT_DGNSS : & str = "lat_dgnss" ;
51- pub const LNG_DGNSS : & str = "lng_dgnss" ;
52- pub const ALT_DGNSS : & str = "alt_dgnss" ;
53- pub const LAT_FLOAT : & str = "lat_float" ;
54- pub const LNG_FLOAT : & str = "lng_float" ;
55- pub const ALT_FLOAT : & str = "alt_float" ;
56- pub const LAT_FIXED : & str = "lat_fixed" ;
57- pub const LNG_FIXED : & str = "lng_fixed" ;
58- pub const ALT_FIXED : & str = "alt_fixed" ;
59- pub const LAT_DR : & str = "lat_dr" ;
60- pub const LNG_DR : & str = "lng_dr" ;
61- pub const ALT_DR : & str = "alt_dr" ;
62- pub const LAT_SBAS : & str = "lat_sbas" ;
63- pub const LNG_SBAS : & str = "lng_sbas" ;
64- pub const ALT_SBAS : & str = "alt_sbas" ;
40+ pub const NO_FIX_LABEL : & str = "No Fix" ;
41+ pub const SPP_LABEL : & str = "SPP" ;
42+ pub const DGNSS_LABEL : & str = "DGPS" ;
43+ pub const FLOAT_LABEL : & str = "RTK float" ;
44+ pub const FIXED_LABEL : & str = "RTK fixed" ;
45+ pub const DR_LABEL : & str = "DR" ;
46+ pub const SBAS_LABEL : & str = "SBAS" ;
47+
48+ pub const NO_FIX : & str = "No Fix" ;
49+ pub const SPP : & str = "SPP" ;
50+ pub const DGNSS : & str = "DGPS" ;
51+ pub const FLOAT : & str = "Float RTK" ;
52+ pub const FIXED : & str = "Fixed RTK" ;
53+ pub const DR : & str = "Dead Reckoning" ;
54+ pub const SBAS : & str = "SBAS" ;
55+ pub const NO_FIX_COLOR : & str = "#FFFFFF" ;
56+ pub const SPP_COLOR : & str = "#0000FF" ;
57+ pub const DGNSS_COLOR : & str = "#00B3FF" ;
58+ pub const FLOAT_COLOR : & str = "#BF00BF" ;
59+ pub const FIXED_COLOR : & str = "#FFA500" ;
60+ pub const DR_COLOR : & str = "#000000" ;
61+ pub const SBAS_COLOR : & str = "#00FF00" ;
62+
63+ pub const LAT_SPP : & str = "lat_SPP" ;
64+ pub const LNG_SPP : & str = "lng_SPP" ;
65+ pub const ALT_SPP : & str = "alt_SPP" ;
66+ pub const LAT_DGNSS : & str = "lat_DGPS" ;
67+ pub const LNG_DGNSS : & str = "lng_DGPS" ;
68+ pub const ALT_DGNSS : & str = "alt_DGPS" ;
69+ pub const LAT_FLOAT : & str = "lat_Float RTK" ;
70+ pub const LNG_FLOAT : & str = "lng_Float RTK" ;
71+ pub const ALT_FLOAT : & str = "alt_Float RTK" ;
72+ pub const LAT_FIXED : & str = "lat_Fixed RTK" ;
73+ pub const LNG_FIXED : & str = "lng_Fixed RTK" ;
74+ pub const ALT_FIXED : & str = "alt_Fixed RTK" ;
75+ pub const LAT_DR : & str = "lat_Dead Reckoning" ;
76+ pub const LNG_DR : & str = "lng_Dead Reckoning" ;
77+ pub const ALT_DR : & str = "alt_Dead Reckoning" ;
78+ pub const LAT_SBAS : & str = "lat_SBAS" ;
79+ pub const LNG_SBAS : & str = "lng_SBAS" ;
80+ pub const ALT_SBAS : & str = "alt_SBAS" ;
6581pub const SOLUTIONS_KEYS : & [ & str ] = & [
6682 LAT_SPP , LNG_SPP , ALT_SPP , LAT_DGNSS , LNG_DGNSS , ALT_DGNSS , LAT_FLOAT , LNG_FLOAT , ALT_FLOAT ,
6783 LAT_FIXED , LNG_FIXED , ALT_FIXED , LAT_DR , LNG_DR , ALT_DR , LAT_SBAS , LNG_SBAS , ALT_SBAS ,
@@ -145,6 +161,7 @@ pub const MPS2KPH: f64 = 3.600000;
145161#[ repr( u8 ) ]
146162#[ derive( Debug , Clone , Copy , Eq , Hash , PartialEq ) ]
147163pub enum GnssModes {
164+ NoFix = 0 ,
148165 Spp = 1 ,
149166 Dgnss = 2 ,
150167 Float = 3 ,
@@ -155,6 +172,7 @@ pub enum GnssModes {
155172impl From < u8 > for GnssModes {
156173 fn from ( s : u8 ) -> Self {
157174 match s {
175+ 0 => GnssModes :: NoFix ,
158176 1 => GnssModes :: Spp ,
159177 2 => GnssModes :: Dgnss ,
160178 3 => GnssModes :: Float ,
@@ -173,6 +191,7 @@ impl ToString for GnssModes {
173191 /// - `key`: The code, which is signal code, and satellite constellation-specific satellite identifier.
174192 fn to_string ( & self ) -> String {
175193 let gnss_mode_str = match self {
194+ GnssModes :: NoFix => NO_FIX ,
176195 GnssModes :: Spp => SPP ,
177196 GnssModes :: Dgnss => DGNSS ,
178197 GnssModes :: Float => FLOAT ,
@@ -183,6 +202,32 @@ impl ToString for GnssModes {
183202 String :: from ( gnss_mode_str)
184203 }
185204}
205+ impl GnssModes {
206+ pub fn get_label ( & self ) -> String {
207+ let gnss_mode_label = match self {
208+ GnssModes :: NoFix => NO_FIX_LABEL ,
209+ GnssModes :: Spp => SPP_LABEL ,
210+ GnssModes :: Dgnss => DGNSS_LABEL ,
211+ GnssModes :: Float => FLOAT_LABEL ,
212+ GnssModes :: Fixed => FIXED_LABEL ,
213+ GnssModes :: Dr => DR_LABEL ,
214+ GnssModes :: Sbas => SBAS_LABEL ,
215+ } ;
216+ String :: from ( gnss_mode_label)
217+ }
218+ pub fn get_color ( & self ) -> String {
219+ let gnss_mode_color = match self {
220+ GnssModes :: NoFix => NO_FIX_COLOR ,
221+ GnssModes :: Spp => SPP_COLOR ,
222+ GnssModes :: Dgnss => DGNSS_COLOR ,
223+ GnssModes :: Float => FLOAT_COLOR ,
224+ GnssModes :: Fixed => FIXED_COLOR ,
225+ GnssModes :: Dr => DR_COLOR ,
226+ GnssModes :: Sbas => SBAS_COLOR ,
227+ } ;
228+ String :: from ( gnss_mode_color)
229+ }
230+ }
186231
187232#[ repr( u8 ) ]
188233#[ derive( Debug , Clone , Copy , Eq , Hash , PartialEq ) ]
0 commit comments