|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
#include <LandmarksUtils.h>
Static Public Member Functions | |
| static void | FloatToDesL (TReal aFloat, TDes &aDes, TRealFormat aRealFormat) |
| static void | LatLongToDes (TReal aFloat, TDes &aDes) |
| static void | LatLongFloatToDegMinSecDesL (TReal aLatLong, TDes &aDes) |
| static void | Panic (TInt aReason) |
Classes | |
| struct | SDegMinSec |
| Internal struct for LatLongFloatToDegMinSecDesL. More... | |
Definition at line 22 of file LandmarksUtils.h.
|
||||||||||||||||
|
Converts a float to a descriptor. Handles the case when the float is NaN
Definition at line 29 of file LandmarksUtils.cpp. 00030 { 00031 if (Math::IsNaN(aFloat)) 00032 { 00033 aDes = KNullDesC; 00034 } 00035 else 00036 { 00037 User::LeaveIfError(aDes.Num(aFloat, aRealFormat)); 00038 } 00039 }
|
|
||||||||||||
|
Converts a float lat/long to a descriptor. Handles the case when the float is NaN
Definition at line 45 of file LandmarksUtils.cpp. 00046 { 00047 if (Math::IsNaN(aFloat)) 00048 { 00049 aDes = KNullDesC; 00050 } 00051 else 00052 { 00053 aDes.Format(KLatLongFormat, aFloat); 00054 } 00055 }
|
|
||||||||||||
|
Converts a latitude or longitude in float format to a descriptor containing degrees, minutes and seconds.
Definition at line 61 of file LandmarksUtils.cpp. References LandmarksUtils::SDegMinSec::iDegrees, LandmarksUtils::SDegMinSec::iMinutes, and LandmarksUtils::SDegMinSec::iSeconds. 00062 { 00063 if (!Math::IsNaN(aLatLong)) 00064 { 00065 // Convert to deg min sec 00066 SDegMinSec degMinSec; 00067 00068 // Fetch degrees 00069 User::LeaveIfError(Math::Int(degMinSec.iDegrees, Abs(aLatLong))); 00070 00071 // Fetch minutes 00072 TReal minutes = (Abs(aLatLong) - degMinSec.iDegrees) * KMinutesPerDegree; 00073 User::LeaveIfError(Math::Int(degMinSec.iMinutes, minutes)); 00074 00075 // Fetch seconds 00076 degMinSec.iSeconds = 00077 ((minutes - degMinSec.iMinutes) * KSecondsPerMinute); 00078 00079 // Check if seconds is going to be rounded to 60 00080 const TReal KMaxSeconds = 59.999; 00081 if (degMinSec.iSeconds > KMaxSeconds) 00082 { 00083 degMinSec.iSeconds = 0; 00084 degMinSec.iMinutes++; 00085 if (degMinSec.iMinutes == KMinutesPerDegree) 00086 { 00087 degMinSec.iMinutes = 0; 00088 degMinSec.iDegrees++; 00089 // We do not need to check if degress > 90 or if degrees > 180. 00090 // Landmarks FW takes care of that. 00091 } 00092 } 00093 00094 // Format output descriptor 00095 if (aLatLong >= 0) 00096 { 00097 aDes.Format(KListBoxLatLongFormat, &KPositiveSign, 00098 degMinSec.iDegrees, KDegreeSign, degMinSec.iMinutes, 00099 degMinSec.iSeconds); 00100 } 00101 else 00102 { 00103 aDes.Format(KListBoxLatLongFormat, &KNegativeSign, 00104 Abs(degMinSec.iDegrees), KDegreeSign, Abs(degMinSec.iMinutes), 00105 Abs(degMinSec.iSeconds)); 00106 } 00107 } 00108 else 00109 { 00110 aDes.Zero(); 00111 } 00112 }
|
|
|
Panics the application due to some programming error
Definition at line 118 of file LandmarksUtils.cpp.
|
|
© Nokia 2006 |