solarpowerlog trunk
"The Capabilites Concept"

This gives an introduction how capabilites works and whats their purpose is. For details, please also see the relevant interfaces, mostly CCapability and IValue.

Further information can also be found on the chapter over Inverters and DataFilters.

"Purpose"

Inverters have some datas to report. These datas might be states, measurements or other information. Solarpowerlog bundles these kind of information into one object type, a Capability. The bundle contains as well the name as also the associated value.

The name of a capability is used to identified the kind of information stored. This way most information are abstraced and brought to the same common denominator:

The inverter (data source) sets up the value and the receiver of the data can query for it by the nameas know exactly how to interpret it, as this is exactly defined.

The inverter is not required to set up the complete set of information -- it will just give the infos it has. On the other side, the receiver can not expect that all information are always available.

Even if this increases complexity of the receivers implementation -- it has to make the features it has dependent on the information diveristy it gets -- it also makes it far more flexible: The program will work on inverters which delivers many information as well with inverters which will deliver only a basic set.

Also, if a inverter decides to give even more information, this data can easily be added: The receiver which do not know about the infos won't care, and the others can make use of it.

Another use-case is, that data receiver can also use redudnt data sources: They can reconstruct (unknown) pieces of information out of others. For example, if the power in and power out is known, a filter can calculate the efficeancy. If the inverter gives that value, the data receiver can use that value. (actually a DataFilter is planned to make use of that...)

See also:
Please see the file Capabilities.h for some defined capabilites.
IValue for the Value storage

"Capability Change Notifications"

The Capability interface is designed using the observer design pattern: The Capability is the Subject and all data sources are the observers, which will get notified on changes.

Note, that this notification is not automated: The one setting the value has still to call the CCapabiltiy::notify() function.

The Subject-Pattern is implemented by inheritating from the IObserverSubject interface.

"Required Capabilites"

In the file Capabilites.h some of the predefined Capbabilites are markes as required. These means, that everyone using the interface has to implement (data source) or at least is required to subscribe to this information.

These Capabilites are helping to manage the capability system.

"Important Implementation Notes"

  • The class also contains a back-link to the generating inverter, using the data field source. A user of this field should always be aware, that the pointer might be NULL.
  • Even if the interface allows you, only the data-source should be change a value.