render

xod-dev/ssd1306-display/render

Renders a tree of graphic elements and display them on the device.
render
@/render
Renders a tree of graphic elements and display them on the device.
DEV@/ssd1306-128x64-i2c-device
The display device.
GFXxod/graphics/graphics
A tree of graphic elements created using the xod/graphics library.
DOpulse
Triggers a new rendering process.
render
DEV
GFX
DO
DONE
DEV'
DEV'@/ssd1306-128x64-i2c-device
The display device.
DONEpulse
Pulses when the rendering process is done.
To use the node in your project you should have the xod-dev/ssd1306-display library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    void evaluate(Context ctx) {
        auto dev = getValue<input_DEV>(ctx);

        if (isSettingUp())
            emitValue<output_DEVU0027>(ctx, dev);

        if (!isInputDirty<input_DO>(ctx))
            return;

        auto gfx = getValue<input_GFX>(ctx);

        if (gfx) {
            gfx->render(dev);
            dev->sendBuffer();
        }

        emitValue<output_DONE>(ctx, 1);
    }
}