@@ -9,25 +9,36 @@ const fn default_clock_sigma() -> f64 {
99}
1010
1111/// Default user [Profile]
12- const fn default_user_profile ( ) -> Option < Profile > {
13- Some ( Profile :: Pedestrian )
12+ const fn default_user_profile ( ) -> Profile {
13+ Profile :: Pedestrian
1414}
1515
16- /// Receiver [Profile], which is application dependent.
17- /// [Profile::Static] is our default value: any roaming application needs to customize its profile.
16+ /// Receiver [Profile], which is application dependent.
17+ /// Operating under incorrect parametrization ([Profile] not matching your use case),
18+ /// will not prohibit obtaining results. It's just that they could be improved
19+ /// by adapting your profile to your use case correctly.
1820#[ derive( Default , Debug , Clone , Copy , PartialEq ) ]
1921#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
2022pub enum Profile {
21- /// [Profile::Pedestrian]: < 10 km/h very low velocity
23+ /// [Profile::Static] applies to user applications where
24+ /// the receiver antenna is held static at all times.
25+ /// This is not our prefered mode, because this apply to particular use cases.
26+ Static ,
27+
28+ /// [Profile::Pedestrian]: < 10 km/h very low velocity.
29+ /// This is our default mode.
2230 #[ cfg_attr( feature = "serde" , serde( alias = "pedestrian" , alias = "Pedestrian" ) ) ]
2331 #[ default]
2432 Pedestrian ,
33+
2534 /// [Profile::Car]: < 100 km/h slow velocity
2635 #[ cfg_attr( feature = "serde" , serde( alias = "car" , alias = "Car" ) ) ]
2736 Car ,
37+
2838 /// [Profile::Airplane]: < 1000 km/h high velocity
2939 #[ cfg_attr( feature = "serde" , serde( alias = "airplane" , alias = "airplane" ) ) ]
3040 Airplane ,
41+
3142 /// [Profile::Rocket]: > 1000 km/h ultra high velocity
3243 #[ cfg_attr( feature = "serde" , serde( alias = "rocket" , alias = "rocket" ) ) ]
3344 Rocket ,
@@ -39,6 +50,7 @@ impl std::str::FromStr for Profile {
3950 let s = s. to_lowercase ( ) ;
4051 let trimmed = s. trim ( ) ;
4152 match trimmed {
53+ "static" => Ok ( Self :: Static ) ,
4254 "pedestrian" => Ok ( Self :: Pedestrian ) ,
4355 "car" => Ok ( Self :: Car ) ,
4456 "airplane" => Ok ( Self :: Airplane ) ,
@@ -51,6 +63,7 @@ impl std::str::FromStr for Profile {
5163impl std:: fmt:: Display for Profile {
5264 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
5365 match self {
66+ Self :: Static => write ! ( f, "Static" ) ,
5467 Self :: Pedestrian => write ! ( f, "Pedestrian" ) ,
5568 Self :: Car => write ! ( f, "car" ) ,
5669 Self :: Airplane => write ! ( f, "airplane" ) ,
@@ -65,9 +78,8 @@ impl std::fmt::Display for Profile {
6578#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
6679pub struct User {
6780 /// Custom user [Profile] which is application dependent.
68- /// This is disregarded by solvers dedicated to static applications.
6981 #[ cfg_attr( feature = "serde" , serde( default ) ) ]
70- pub profile : Option < Profile > ,
82+ pub profile : Profile ,
7183
7284 /// Receiver clock prediction perturbation (instantaneous bias) in seconds.
7385 /// Standard values are:
@@ -88,12 +100,7 @@ pub struct User {
88100
89101impl std:: fmt:: Display for User {
90102 fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
91- if let Some ( profile) = self . profile {
92- write ! ( f, "Profile=\" {}\" " , profile) ?;
93- } else {
94- write ! ( f, "Profile=Static " ) ?;
95- }
96-
103+ write ! ( f, "Profile=\" {}\" " , self . profile) ?;
97104 write ! ( f, "clock-sigma={}s" , self . clock_sigma_s)
98105 }
99106}
0 commit comments