.. _ocapowersupply: 1.2.7 OcaPowerSupply ===================== Class Hierarchy: :ref:`OcaRoot ` : :ref:`OcaAgent ` : :ref:`OcaPowerSupply ` .. cpp:class:: OcaPowerSupply: OcaAgent A power supply. **Properties**: .. _ocapowersupply_charging: .. cpp:member:: OcaBoolean Charging True if and only if charging. For rechargable supplies (obviously). This property has id ``3.4``. .. _ocapowersupply_classid: .. cpp:member:: static const OcaClassID ClassID = "1.2.7" Number that uniquely identifies the class. Note that this differs from the object number, which identifies the instantiated object. This property is an override of the **OcaRoot** property. This property has id ``1.1``. .. _ocapowersupply_classversion: .. cpp:member:: static const OcaClassVersionNumber ClassVersion = 3 Identifies the interface version of the class. Any change to the class definition leads to a higher class version. This property is an override of the **OcaRoot** property. This property has id ``1.2``. .. _ocapowersupply_loadfractionavailable: .. cpp:member:: OcaFloat32 LoadFractionAvailable Fraction of power supply's load capacity that is currently **not** being used. Readonly. Normal value range 0...1. A negative value indicates this data is unavailable. This property has id ``3.5``. .. _ocapowersupply_location: .. cpp:member:: const OcaPowerSupplyLocation Location Physical location of power supply - internal or external. This property has id ``3.7``. .. _ocapowersupply_modelinfo: .. cpp:member:: OcaString ModelInfo Model information for power supply. Text; content is implementation-dependent. This property has id ``3.2``. .. _ocapowersupply_state: .. cpp:member:: OcaPowerSupplyState State State of power supply: off, unavailable, available, active. This property has id ``3.3``. .. _ocapowersupply_storagefractionavailable: .. cpp:member:: OcaFloat32 StorageFractionAvailable Fraction of power supply's energy storage that remains available. For battery supplies. Readonly. Normal value range 0...1. A negative value indicates this data is unavailable. This property has id ``3.6``. .. _ocapowersupply_type: .. cpp:member:: OcaPowerSupplyType Type Type of power supply. This property has id ``3.1``. Properties inherited from :ref:`ocaagent`: - :cpp:texpr:`OcaClassID` :ref:`OcaRoot::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaRoot::ClassVersion ` - :cpp:texpr:`OcaBoolean` :ref:`OcaRoot::Lockable ` - :cpp:texpr:`OcaLockState` :ref:`OcaRoot::LockState ` - :cpp:texpr:`OcaONo` :ref:`OcaRoot::ObjectNumber ` - :cpp:texpr:`OcaString` :ref:`OcaRoot::Role ` - :cpp:texpr:`OcaClassID` :ref:`OcaAgent::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaAgent::ClassVersion ` - :cpp:texpr:`OcaString` :ref:`OcaAgent::Label ` - :cpp:texpr:`OcaONo` :ref:`OcaAgent::Owner ` **Methods**: .. _ocapowersupply_gettype: .. cpp:function:: OcaStatus GetType(OcaPowerSupplyType &type) Gets the type of the power supply. This method has id ``3.1``. - :cpp:expr:`type`: Output parameter. .. _ocapowersupply_getmodelinfo: .. cpp:function:: OcaStatus GetModelInfo(OcaString &info) Gets the power supply's model information text. This method has id ``3.2``. - :cpp:expr:`info`: Output parameter. .. _ocapowersupply_getstate: .. cpp:function:: OcaStatus GetState(OcaPowerSupplyState &state) Gets the state of the power supply. This method has id ``3.3``. - :cpp:expr:`state`: Output parameter. .. _ocapowersupply_setstate: .. cpp:function:: OcaStatus SetState(OcaPowerSupplyState state) Changes the power supply's state. This method has id ``3.4``. - :cpp:expr:`state`: Input parameter. .. _ocapowersupply_getcharging: .. cpp:function:: OcaStatus GetCharging(OcaBoolean &charging) Gets the value of property **Charging**. This method has id ``3.5``. - :cpp:expr:`charging`: Output parameter. .. _ocapowersupply_getloadfractionavailable: .. cpp:function:: OcaStatus GetLoadFractionAvailable(OcaFloat32 &fraction) Gets the available load fraction. This method has id ``3.6``. - :cpp:expr:`fraction`: Output parameter. .. _ocapowersupply_getstoragefractionavailable: .. cpp:function:: OcaStatus GetStorageFractionAvailable(OcaFloat32 &fraction) Gets the available storage fraction. This method has id ``3.7``. - :cpp:expr:`fraction`: Output parameter. .. _ocapowersupply_getlocation: .. cpp:function:: OcaStatus GetLocation(OcaPowerSupplyLocation &Location) Gets the power supply physical location. This method has id ``3.8``. - :cpp:expr:`Location`: Output parameter. Methods inherited from :ref:`ocaagent`: - :ref:`OcaAgent::GetClassIdentification ` - :ref:`OcaAgent::GetLockable ` - :ref:`OcaAgent::GetLockState ` - :ref:`OcaAgent::GetRole ` - :ref:`OcaAgent::SetLockNoWrite ` - :ref:`OcaAgent::SetLockNoReadWrite ` - :ref:`OcaAgent::Unlock ` - :ref:`OcaAgent::GetLabel ` - :ref:`OcaAgent::GetOwner ` - :ref:`OcaAgent::GetPath ` - :ref:`OcaAgent::SetLabel `