--
HaraldBraeuning - 18 Mar 2009
Designing the Fesa class
Designing the interface
The interface provides the outside access to the class data. Actually, it provides the acces only to the data we publish via the interface. The interface consists of one or more 'properties' which contian one or more 'fields' as well as a 'get' and / or 'set' actions.
The first property we create is a 'Data' property to publish the data value of the class to the outside world. The name of the property can in principle be choosen arbitrarily. However, some guidelines concerning style should be followed. Proeprty names should always be nouns. Furthermore, property names should be meaningful with respect to their function. Thus the property returning the acquired data should be named 'Data'.
To add a property to the interface, we select the interface field and bring up the well known popup menu with the right mouse button. There we select
Add/property. As the property name we enter 'Data'. The property has an automatic sub-item called 'simple'. This indicates that this is a simple property. There are also complex properties, which we get to know later. Simple properties can only reference items from the data field. Complex properties allow more freedom but are also complexer to handle and not needed in here. The designer also creates automatically an empty 'data-field-ref-item' and 'default-action' as part ot the simple field. Because the job of the 'Data' property is to return our acquired data value we select 'value' from the drop down menu of the data-field-ref-item and 'get' grom the drop down menu of the 'default-action'.
Similar, we add a 'Status' property to publish the device status. This is also a simple property with one 'data-field-ref-item', namely 'runTime' and a 'get' default action.
The final property we have to add is the 'Settings' property to modify the 'offset' and 'range' parameters.
In addition to the 'get' default action we also put in a 'set' default action because we want to be able to change the settings. In addition we have added a 'partial-setting allowed' entry for the set action by selecting the set action and using the popup-menu (right mouse button). With this entry, other programs like GUIs are allowed to send only partial data for this property, like only the 'offset' setting or only the 'range' setting.