mil.dod.th.ose.shell/src/mil/dod/th/ose/shell/PowerManagerCommands.java
@Descriptor("Displays platform specific power management information")
    public void info(final CommandSession session) throws IOException
    {
        final PrintStream out = session.getConsole();

        final Configuration config = m_ConfigAdmin.getConfiguration(PlatformPowerManager.CONFIG_PID, null);
        final Dictionary<String, Object> dict = config.getProperties();

        Boolean enabled = null; 
        String isEnabled = "<unknown>";
        if (dict != null)
        {
            enabled = (Boolean)dict.get(PlatformPowerManager.CONFIG_PROP_ENABLED);
            
            if (enabled != null)
            {
                isEnabled = enabled.toString();
            }
        }
        
        String overallStatus = "Enabled";
        String pltfrmPres = "No";
        
        if (m_PlatformPowerManager != null)
        {
            pltfrmPres = "Yes";
        }
        
        if (m_PlatformPowerManager == null || (enabled != null && !enabled))
        {
            overallStatus = "Disabled";
        }
        
        out.format("Overall PlatformPowerManager status: %s%n%n\tEnabled: %s%n\tPlatformPowerManager Present: %s%n%n", 
                overallStatus, isEnabled, pltfrmPres);
        
        final String notAvailable = "N/A";
        String batteryRemValue = notAvailable;
        String batteryVoltValue = notAvailable;
        if (m_PlatformPowerManager != null)
        {
            try
            {
                batteryRemValue = String.format("%d amp-hours", m_PlatformPowerManager.getBatteryAmpHoursRem());
            }
            catch (final UnsupportedOperationException e)
            {
                batteryRemValue = e.toString();
            }
            
            try
            {
                batteryVoltValue = String.format("%d mV", m_PlatformPowerManager.getBatteryVoltage());
            }
            catch (final UnsupportedOperationException e)
            {
                batteryVoltValue = e.toString();
            }
        }
        
        out.format("Battery Remaining: %s%n%n", batteryRemValue);
        out.format("Battery Voltage: %s%n%n", batteryVoltValue);
    }
/**
     * Displays platform specific power management information.
     * 
     * @param session
     *            provides access to the Gogo shell session
     * @throws IOException 
     *            if a configuration for the platform power manager cannot be retrieved
     */
Displays platform specific power management information.

@param session
provides access to the Gogo shell session
@throws IOException
if a configuration for the platform power manager cannot be retrieved
Displays platform specific power management information . @param session provides access to the Gogo shell session @throws IOException if a configuration for the platform power manager cannot be retrieved
@Descriptor("Displays platform specific power management information")
    public void info(final CommandSession session) throws IOException
    {
        final PrintStream out = session.getConsole();
        final Configuration config = m_ConfigAdmin.getConfiguration(PlatformPowerManager.CONFIG_PID, null);
        final Dictionary<String, Object> dict = config.getProperties();
        Boolean enabled = null; 
        String isEnabled = "<unknown>";
        if (dict != null)
        {
            enabled = (Boolean)dict.get(PlatformPowerManager.CONFIG_PROP_ENABLED);
            if (enabled != null)
            {
                isEnabled = enabled.toString();
            }
        }
        String overallStatus = "Enabled";
        String pltfrmPres = "No";
        if (m_PlatformPowerManager != null)
        {
            pltfrmPres = "Yes";
        }
        if (m_PlatformPowerManager == null || (enabled != null && !enabled))
        {
            overallStatus = "Disabled";
        }
        out.format("Overall PlatformPowerManager status: %s%n%n\tEnabled: %s%n\tPlatformPowerManager Present: %s%n%n", 
                overallStatus, isEnabled, pltfrmPres);
        final String notAvailable = "N/A";
        String batteryRemValue = notAvailable;
        String batteryVoltValue = notAvailable;
        if (m_PlatformPowerManager != null)
        {
            try
            {
                batteryRemValue = String.format("%d amp-hours", m_PlatformPowerManager.getBatteryAmpHoursRem());
            }
            catch (final UnsupportedOperationException e)
            {
                batteryRemValue = e.toString();
            }
            try
            {
                batteryVoltValue = String.format("%d mV", m_PlatformPowerManager.getBatteryVoltage());
            }
            catch (final UnsupportedOperationException e)
            {
                batteryVoltValue = e.toString();
            }
        }
        out.format("Battery Remaining: %s%n%n", batteryRemValue);
        out.format("Battery Voltage: %s%n%n", batteryVoltValue);
    }
@ Descriptor ( "Displays platform specific power management information" ) public void info ( final CommandSession session ) throws IOException { final PrintStream out = session . getConsole ( ) ; final Configuration config = m_ConfigAdmin . getConfiguration ( PlatformPowerManager . CONFIG_PID , null ) ; final Dictionary < String , Object > dict = config . getProperties ( ) ; Boolean enabled = null ; String isEnabled = "<unknown>" ; if ( dict != null ) { enabled = ( Boolean ) dict . get ( PlatformPowerManager . CONFIG_PROP_ENABLED ) ; if ( enabled != null ) { isEnabled = enabled . toString ( ) ; } } String overallStatus = "Enabled" ; String pltfrmPres = "No" ; if ( m_PlatformPowerManager != null ) { pltfrmPres = "Yes" ; } if ( m_PlatformPowerManager == null || ( enabled != null && ! enabled ) ) { overallStatus = "Disabled" ; } out . format ( "Overall PlatformPowerManager status: %s%n%n\tEnabled: %s%n\tPlatformPowerManager Present: %s%n%n" , overallStatus , isEnabled , pltfrmPres ) ; final String notAvailable = "N/A" ; String batteryRemValue = notAvailable ; String batteryVoltValue = notAvailable ; if ( m_PlatformPowerManager != null ) { try { batteryRemValue = String . format ( "%d amp-hours" , m_PlatformPowerManager . getBatteryAmpHoursRem ( ) ) ; } catch ( final UnsupportedOperationException e ) { batteryRemValue = e . toString ( ) ; } try { batteryVoltValue = String . format ( "%d mV" , m_PlatformPowerManager . getBatteryVoltage ( ) ) ; } catch ( final UnsupportedOperationException e ) { batteryVoltValue = e . toString ( ) ; } } out . format ( "Battery Remaining: %s%n%n" , batteryRemValue ) ; out . format ( "Battery Voltage: %s%n%n" , batteryVoltValue ) ; }
Displays platform specific power management information.
Displays platform specific power management information .