sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PwrSample.java
changeset 12 ae255c9aa552
parent 2 b9ab3b238396
equal deleted inserted replaced
11:5b9d4d8641ce 12:ae255c9aa552
    27 {   
    27 {   
    28 	private static final long serialVersionUID = 3943366134331361386L;
    28 	private static final long serialVersionUID = 3943366134331361386L;
    29 	public double current;
    29 	public double current;
    30     public double capacity;
    30     public double capacity;
    31     public double voltage;
    31     public double voltage;
       
    32     public int backlight;
    32     
    33     
    33     public PwrSample( long time, double ampValue, double voltage, double capacity ) 
    34     public PwrSample( long time, double ampValue, double voltage, double capacity ) 
    34 	{
    35 	{
    35         this.current = ampValue;
    36         this.current = ampValue;
    36         this.capacity = capacity;
    37         this.capacity = capacity;
    37         this.voltage = voltage;
    38         this.voltage = voltage;
    38         this.sampleSynchTime = time;
    39         this.sampleSynchTime = time;
    39     }
    40     }
       
    41     
       
    42     public PwrSample( long time, double ampValue, double voltage, double capacity, int backlight) 
       
    43 	{
       
    44         this.current = ampValue;
       
    45         this.capacity = capacity;
       
    46         this.voltage = voltage;
       
    47         this.sampleSynchTime = time;
       
    48         this.backlight = backlight;
       
    49     }
    40 
    50 
    41     public String toString() 
    51     public String toString() 
    42 	{
    52 	{
    43         return Messages.getString("PwrSample.toString1") + this.sampleSynchTime + Messages.getString("PwrSample.toString2") //$NON-NLS-1$ //$NON-NLS-2$
    53         return Messages.getString("PwrSample.toString1") + this.sampleSynchTime + Messages.getString("PwrSample.toString2") //$NON-NLS-1$ //$NON-NLS-2$
    44         		+ this.current + Messages.getString("PwrSample.toString3") + this.voltage + Messages.getString("PwrSample.toString4") //$NON-NLS-1$ //$NON-NLS-2$
    54         		+ this.current + Messages.getString("PwrSample.toString3") + this.voltage + Messages.getString("PwrSample.toString4") //$NON-NLS-1$ //$NON-NLS-2$
    45         		+ this.capacity +Messages.getString("PwrSample.toString5"); //$NON-NLS-1$
    55         		+ this.capacity +Messages.getString("PwrSample.toString5")+ PwrSample.getBacklightInformation(backlight) +Messages.getString("PwrSample.toString6"); //$NON-NLS-1$ //$NON-NLS-2$
    46     }
    56     }
       
    57     
       
    58     public static String getBacklightInformation(int code){
       
    59 		switch (code) {
       
    60 		case 0:	
       
    61 			return Messages.getString("PwrSample.backlightUnknown"); //$NON-NLS-1$
       
    62 		case 1:		
       
    63 			return Messages.getString("PwrSample.backlightOn"); //$NON-NLS-1$
       
    64 		case 2:	
       
    65 			return Messages.getString("PwrSample.backlightOff"); //$NON-NLS-1$
       
    66 		case 3:		
       
    67 			return Messages.getString("PwrSample.backlightBlink"); //$NON-NLS-1$
       
    68 		default:
       
    69 			return Messages.getString("PwrSample.backlightUnknown"); //$NON-NLS-1$
       
    70 		}	
       
    71 	}
       
    72 	
    47 }
    73 }