display-text

amperka/segm8/display-text

A text string to display. The string should consist of next characters: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "b", "C", "d", "E", "F", "G", "H", "I", "J", "L", "O", "P", "q", "r", "S", "t", "U", "Y", space, dot , "-" , "[", "]", quote, double quote, underscore, degree. Instead of unsupported characters, the overline is displayed. The dot "." character does not occupy the entire segM8 module.
display-text
@/display-text
A text string to display. The string should consist of next characters: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "b", "C", "d", "E", "F", "G", "H", "I", "J", "L", "O", "P", "q", "r", "S", "t", "U", "Y", space, dot , "-" , "[", "]", quote, double quote, underscore, degree. Instead of unsupported characters, the overline is displayed. The dot "." character does not occupy the entire segM8 module.
DEV@/segm8-device
The SegM8 device.
TEXTstring
Text to be displayed on the daisy-chain of indicator modules.
POSnumber
In a daisy chain, the ordinal SegM8 module number from which the text display begins. The module numbering in a daisy chain starts from 0, from left module to right.
Wnumber
The width of the displayed text in segM8 modules.
UPDpulse
Triggers a new display of the text.
display-text
DEV
TEXT
POS
W
UPD
DEV'
DONE
DONEpulse
Pulses when the display of the text is done.
DEV'@/segm8-device
The SegM8 device.
To use the node in your project you should have the amperka/segm8 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

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto chain = getValue<input_DEV>(ctx);
    auto text = getValue<input_TEXT>(ctx);
    auto position = getValue<input_POS>(ctx);
    auto width = getValue<input_W>(ctx);

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

    if(isInputDirty<input_UPD>(ctx)) {
        char* buf = new char(length(text)+1);
        dump(text, buf);
        for(uint8_t i = 0; i < width; i++) chain->writeSegments( 0, position + i); // clear field, put spaces
        chain->display(buf, position, width, SEGM8_ALIGN_LEFT);
        delete buf;
        emitValue<output_DONE>(ctx, true);
    }
}