locationsystemui/locationsysui/locblidsatelliteinfo/inc/CSatelliteEng.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: This is a header file for engine class of Location satellite info
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SATELLITEENG_H__
       
    20 #define __SATELLITEENG_H__
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <s32std.h>
       
    25 #include <lbs.h>
       
    26 #include <lbssatellite.h>
       
    27 #include "MSatelliteEng.h"
       
    28 #include "msatellitemeasurementsettingobserver.h"
       
    29 
       
    30 
       
    31 // FORWARD DECLARATION
       
    32 class CEikonEnv;
       
    33 class CSatelliteMeasurementSetting;
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36  *
       
    37  */
       
    38 NONSHARABLE_CLASS( CSatelliteEng ) : public CActive, public MSatelliteEng,
       
    39 									public MSatelliteMeasurementSettingObserver
       
    40     {
       
    41     public:
       
    42         /**
       
    43          * Two-phased constructor.
       
    44          *
       
    45          * @return CSatelliteEng object.
       
    46          */
       
    47         static CSatelliteEng* NewL();
       
    48 
       
    49         /**
       
    50          * Destructor.
       
    51          */
       
    52         ~CSatelliteEng();
       
    53 
       
    54     private:
       
    55         /**
       
    56          * By default Symbian 2nd phase constructor is private.
       
    57          */
       
    58         void ConstructL();
       
    59 
       
    60         /**
       
    61          * C++ default constructor.
       
    62          */
       
    63         CSatelliteEng();
       
    64 
       
    65     public: // from CActive
       
    66         void RunL();
       
    67         void DoCancel();
       
    68         TInt RunError(TInt aError);        
       
    69 
       
    70     private: //from MSatelliteEng
       
    71         void SetObserver(MEngObserver& aObserver);
       
    72         void RequestSatelliteDataL( const TDesC& aNameOfRule );
       
    73         TInt GetSatelliteData(TUint aIndex, 
       
    74                               TSatelliteData& aSatelliteData) const;
       
    75 		
       
    76 		void GetPosition(TPosition& aPosition);
       
    77         void GetCourse(TCourse& aCourse);
       
    78         TLocSystemofMeasurementValues SysOfMeasurementL();
       
    79         TInt NumberOfSatellitesUsed();
       
    80         TInt NumberOfSatellites();
       
    81         void StopRequesting();
       
    82         void StartRequestingL();
       
    83         void SortVisibleSatellitesDataL();
       
    84         void UpdateIntervalL();
       
    85         void ClearSatelliteData();
       
    86         TBool IsSatelliteDataAvailable();
       
    87         void ObjectElevationAzimuth(TInt aIndex, TReal& aAzimuth, TReal& aElevation );
       
    88         void SortSatelliteDataL();
       
    89         void GetSunAzimuthElevation(TReal& aAzimuth, TReal& aElevation );
       
    90         void GetMoonAzimuthElevation(TReal& aAzimuth, TReal& aElevation );
       
    91         void Julian(TReal& aJulianDay,
       
    92         			TReal& aJulianCentury, 
       
    93         			TInt aDay,
       
    94         			TInt aMonth,
       
    95         			TInt aYear,
       
    96         			TReal universalTime);
       
    97         void TrueLongToRaDeltadec(TReal& aRa,TReal& aDd,TReal aTrueLongitude);
       
    98         TReal Kepler(TReal aE, TReal aM);
       
    99         void LocationCoordinates(TReal& aAzimuth, 
       
   100 								 TReal& aElevation, 
       
   101 								 TReal aTau,
       
   102 								 TReal aDd, 
       
   103 								 TReal aLatitude);
       
   104 		TReal SideRealTime(TReal aJulianDay, 
       
   105 						   TReal aJulianCentury,
       
   106 						   TReal aLongitude,
       
   107 						   TReal aRa);		
       
   108         
       
   109     private: //from MSatelliteMeasurementSettingObserver
       
   110 		void HandleSysMeasureValueL();
       
   111 
       
   112     private:    // data
       
   113         /// Own: iServer
       
   114         RPositionServer iServer;
       
   115 
       
   116         /// Own: RPositioner
       
   117         RPositioner iPositioner;
       
   118 
       
   119         /// Own: TPositionSatelliteInfo
       
   120         TPositionSatelliteInfo iSatelliteInfo;
       
   121         
       
   122         /// Own: CSatelliteMeasurementSetting
       
   123         CSatelliteMeasurementSetting* iMeasurementSetting;
       
   124         
       
   125         /// Ref: Refrence to the observer for position notification
       
   126         MEngObserver* iObserver;
       
   127 
       
   128         /// Own: Start and stop requesting
       
   129         TBool iRequesting;
       
   130 
       
   131         /// Number of modules
       
   132         TUint iNumberOfModules;
       
   133 
       
   134         /// used modules index
       
   135         TInt iModuleIndex;
       
   136 
       
   137         /// used as an sorted index array to the satellite info data
       
   138         TFixedArray<TUint8, KPositionMaxSatellitesInView> iSortIndices;
       
   139         
       
   140         // Own: Array to sort the satellite data in increasing order of 
       
   141         // the signal strengths
       
   142         RArray<TSatelliteData> iSortedSatData;
       
   143         
       
   144         // Keplers constant for sun and moon position calculations
       
   145         struct TKeplers
       
   146         	{
       
   147         	struct params
       
   148         		{
       
   149         		TReal iA0;
       
   150         		TReal iA1;
       
   151         		};
       
   152         	params iM;
       
   153         	params iW;
       
   154         	params iE;
       
   155         	};
       
   156         TKeplers iKeplers[2];
       
   157     };
       
   158 
       
   159 #endif // __SATELLITEENG_H__
       
   160 
       
   161 // End of File