dSS Architecture


The dSS consists of several subsystems as shown in the following image:

Every subsystem can be enabled or disabled by the command-line or in the configuration.
The center piece of the dSS is its data-model. It provides the API that allows a developer manipulate as well as rearrange devices, zones and groups.
Built on that foundation there is a SOAP interface to make the API accessible to the outside world. In addition to the SOAP interface there is a JSON interface that interacts with JavaScript running in a web-browser.

The DS485Proxy is responsible of controlling the physical and simulated devices. It converts abstract commands from the data-model an converts them to one or several DS485 frames. These frames will then be sent either to a simulated dSM or put on the wire depending on the frame's destination.

Simulated dSM may be extended by plugins. An example is a simulated dSID that controlls a VLC (mediaplayer) instance remotely using its telnet interface.

Startup and properties

On startup the dSS creates all subsystems, which should create and initialize their properties in the constructor. After that the config-file config.xml and the files in config.d/ gets loaded and merged into the property-tree. When finished with loading, properties specified on the command-line (--prop) will be processed.


Model detail view


Each item in the data-model is derived from DeviceInterface:

The abstract class DeviceInterface defines some common methods to control a device or a collection of devices:

    /** Turns the device on.
     *  This will invoke scene "max".
    virtual void turnOn();
    /** Turns the device off.
     * This will invoke scene "min" 
    virtual void turnOff();

    /** Increases the main value (e.g. brightness) */
    virtual void increaseValue() = 0;
    /** Decreases the main value (e.g. brightness) */
    virtual void decreaseValue() = 0;

    /** Starts dimming the given parameter.
     * If _directionUp is true, the value gets increased over time. Else its getting decreased.
    virtual void startDim(const bool _directionUp) = 0;
    /** Stops the dimming */
    virtual void endDim() = 0;
    /** Sets the value of the given parameter */
    virtual void setValue(const double _value) = 0;

    /** Sets the scene on the device.
     * The output value will be set according to the scene lookup table in the device.
    virtual void callScene(const int _sceneNr) = 0;
    /** Stores the current output value into the scene lookup table.
     * The next time scene _sceneNr gets called the output will be set according to the lookup table.
    virtual void saveScene(const int _sceneNr) = 0;
    /** Restores the last set value of _sceneNr
    virtual void undoScene(const int _sceneNr) = 0;

    /** Returns the consumption in mW */
    virtual unsigned long getPowerConsumption() = 0;

    /** Calls the next scene according to the last called scene.
     * @see dss::SceneHelper::getNextScene
    virtual void nextScene() = 0;
    /** Calls the previos scene according to the last called scene.
     * @see dss::SceneHelper::getPreviousScene
    virtual void previousScene() = 0;

model_detail.png - Model detail view (23.7 KB) Patrick Stählin, 02/23/2010 01:07 PM

block.png (33 KB) Patrick Stählin, 02/23/2010 01:10 PM

model_inheritance.png (11.4 KB) Patrick Stählin, 03/05/2010 05:38 PM