matrix-data

cesars/matrix/matrix-data

No description
matrix-data
@/matrix-data
IDXnumber
Index to select. All values below 1 are considered to be 0. Values of 1 and above are considered to be 1.
INbyte
Input from previous sequence
D1byte
Data in format 01010101b 55h 85d
D2byte
Data in format 01010101b 55h 85d
D3byte
Data in format 01010101b 55h 85d
D4byte
Data in format 01010101b 55h 85d
D5byte
Data in format 01010101b 55h 85d
D6byte
Data in format 01010101b 55h 85d
D7byte
Data in format 01010101b 55h 85d
D8byte
Data in format 01010101b 55h 85d
matrix-data
IDX
IN
D1
D2
D3
D4
D5
D6
D7
D8
_
OUT
OUTbyte
Output in format hex to next sequence
_number
Index to select, second sequence, value (-)
To use the node in your project you should have the cesars/matrix 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

#pragma XOD dirtieness disable

struct State {};

int cond;

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    int x = getValue<input_IDX>(ctx);
    switch(x){
        case 1:
            emitValue<output_OUT>(ctx, getValue<input_D1>(ctx));
            break;
        case 2:
            emitValue<output_OUT>(ctx, getValue<input_D2>(ctx));
            break;
        case 3:
            emitValue<output_OUT>(ctx, getValue<input_D3>(ctx));
            break;
        case 4:
            emitValue<output_OUT>(ctx, getValue<input_D4>(ctx));
            break;
        case 5:
            emitValue<output_OUT>(ctx, getValue<input_D5>(ctx));
            break;
        case 6:
            emitValue<output_OUT>(ctx, getValue<input_D6>(ctx));
            break;
        case 7:
            emitValue<output_OUT>(ctx, getValue<input_D7>(ctx));
            break;
        case 8:
            emitValue<output_OUT>(ctx, getValue<input_D8>(ctx));
            break;
        default:
            emitValue<output_OUT>(ctx, getValue<input_IN>(ctx));
            break;
    }
    emitValue<output__>(ctx, x - 8);
}