perfsrv/piprofiler/plugins/PWRplugin/inc/PwrPlugin.h
changeset 62 1c2bb2fc7c87
parent 51 98307c651589
equal deleted inserted replaced
56:aa2539c91954 62:1c2bb2fc7c87
    18 #ifndef BAPPEA_PWR_SAMPLER_H
    18 #ifndef BAPPEA_PWR_SAMPLER_H
    19 #define BAPPEA_PWR_SAMPLER_H
    19 #define BAPPEA_PWR_SAMPLER_H
    20 
    20 
    21 //#define PWR_SAMPLER_BACKLIGHT
    21 //#define PWR_SAMPLER_BACKLIGHT
    22 
    22 
    23 //#include "PIProfilerConfigInternal.h"
       
    24 
       
    25 // system definitions
    23 // system definitions
    26 #include <w32std.h>
    24 #include <w32std.h>
    27 #include <e32std.h>
    25 #include <e32std.h>
    28 
    26 
    29 #include <e32property.h>
    27 #include <e32property.h>
    30 #include <HWRMPower.h>
    28 #include <hwrmpower.h>
    31 #include <HWRMLight.h>
    29 #include <hwrmlight.h>
    32 
    30 
    33 // user definitions
    31 // user definitions
    34 #include <piprofiler/SamplerPluginInterface.h>
    32 #include <piprofiler/SamplerPluginInterface.h>
    35 #include <piprofiler/ProfilerGenericClassesUsr.h>
    33 #include <piprofiler/ProfilerGenericClassesUsr.h>
    36 
    34 
   105     CArrayFixFlat<TSamplerAttributes>* iSamplerAttributes;
   103     CArrayFixFlat<TSamplerAttributes>* iSamplerAttributes;
   106 public:
   104 public:
   107     TUint32*                iSampleTime;
   105     TUint32*                iSampleTime;
   108 };
   106 };
   109 
   107 
   110 #ifdef PWR_SAMPLER_BACKLIGHT
       
   111 class CProfilerPowerListener : public CBase, public MHWRMBatteryPowerObserver, public MHWRMLightObserver
   108 class CProfilerPowerListener : public CBase, public MHWRMBatteryPowerObserver, public MHWRMLightObserver
   112 #else
       
   113 class CProfilerPowerListener : public CBase, public MHWRMBatteryPowerObserver
       
   114 #endif
       
   115 {
   109 {
   116 public:
   110 public:
   117     static  CProfilerPowerListener* NewL(CPwrPlugin* aSampler);
   111     static  CProfilerPowerListener* NewL(CPwrPlugin* aSampler);
   118             ~CProfilerPowerListener();
   112             ~CProfilerPowerListener();
   119 
   113 
   126     TInt    Stop();
   120     TInt    Stop();
   127     TInt    DisplayNotifierL(const TDesC& aLine1, const TDesC& aLine2, const TDesC& aButton1, const TDesC& aButton2);
   121     TInt    DisplayNotifierL(const TDesC& aLine1, const TDesC& aLine2, const TDesC& aButton1, const TDesC& aButton2);
   128 
   122 
   129     // From MHWRMBatteryPowerObserver
   123     // From MHWRMBatteryPowerObserver
   130     virtual void PowerMeasurement(TInt aErr, CHWRMPower::TBatteryPowerMeasurementData& aMeasurement);
   124     virtual void PowerMeasurement(TInt aErr, CHWRMPower::TBatteryPowerMeasurementData& aMeasurement);
   131 #ifdef PWR_SAMPLER_BACKLIGHT
       
   132     // From MHWRMLightObserver
   125     // From MHWRMLightObserver
   133     virtual void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus);
   126     virtual void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus);
   134 #endif
       
   135 
   127 
   136 private:
   128 private:
   137     void    Sample();
   129     void    Sample();
   138 
   130 
   139 public:
   131 public:
   142     // Value that is read from Central Repository and restored after sampling
   134     // Value that is read from Central Repository and restored after sampling
   143     TInt                    iOriginalReportingPeriod;
   135     TInt                    iOriginalReportingPeriod;
   144 
   136 
   145 private:
   137 private:
   146 
   138 
   147 #ifdef PWR_SAMPLER_BACKLIGHT
       
   148     TUint8                  iSample[13];
   139     TUint8                  iSample[13];
   149 #else
       
   150     TUint8                  iSample[12];
       
   151 #endif
       
   152 
   140 
   153     TUint16                 iNominalCapa;
   141     TUint16                 iNominalCapa;
   154     TUint16                 iVoltage;
   142     TUint16                 iVoltage;
   155     TUint16                 iCurrent;
   143     TUint16                 iCurrent;
   156 
   144 
   157     CPwrPlugin*             iSampler;
   145     CPwrPlugin*             iSampler;
   158     CHWRMPower*             iPowerAPI;
   146     CHWRMPower*             iPowerAPI;
   159 
   147 
   160 #ifdef PWR_SAMPLER_BACKLIGHT
       
   161     CHWRMLight*             iLightAPI;
   148     CHWRMLight*             iLightAPI;
   162     CHWRMLight::TLightStatus iBackLightStatus;
   149     CHWRMLight::TLightStatus iBackLightStatus;
   163 #endif
       
   164 };
   150 };
   165 
   151 
   166 #endif
   152 #endif
   167 
   153