Generic device

The COSMOS namespace provides access to a large number of commonly used devices. For each of these devices, as for example the GPS \ref gpsstruc, items are defined in an internal structure that represent the most commonly used values for this device. These internal values are then mapped to names in the COSMOS Namespace.

If some device is not in the COSMOS namespace then it can be added by extending the code and recompiling. However, one of the driving principles of COSMOS is to provide a generic environment that avoids the necessity of changing and/or recompiling the code to support something new. In the case where changes to the code are not desireable, or the amount of new information does not warrant changes, a \ref telemstruc has been provided. This generic telemetry device allows the assignment of a single value of any type, which then can be accessed as the appropriate type through standard names in the namespace. For further flexibility, these internally defined names can be mapped to user friendly names through \ref tutorial-namespace-aliases.

The example code shows how to use a generic device so that new information can be added witout much effort. Another approach would be to create or add the piece of information directly into the namespace. This approach, although encouraged, requires more work. Please see \ref tutorial-namespace-add-new-device.

The self contained example can be compiled and run using Qt creator from the folder /core/tutorials/namespace/generic-device. First open and compile the agent_generic_device_neighbour.pro file in Qt Creator (this will compile agent_generic_device_neighbour.cpp) then open agent_generic_device_test.pro also in Qt Creator (this will compile agent_generic_device_test.cpp).

results matching ""

    No results matching ""