if(brunch)

koadrobot/logics/if(brunch)

IF - BRUNCH TRIG ? (COND ? T : F ) : - Routes an incoming pulse to either of outputs depending on condition
if(brunch)
@/if(brunch)
IF - BRUNCH TRIG ? (COND ? T : F ) : - Routes an incoming pulse to either of outputs depending on condition
CONDboolean
Condition value
TRIGpulse
if(brunch)
COND
TRIG
T
F
Fpulse
Tpulse
To use the node in your project you should have the koadrobot/logics 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) {
    if (!isInputDirty<input_TRIG>(ctx))
        return;

    if (getValue<input_COND>(ctx)) {
        emitValue<output_T>(ctx, 1);
    } else {
        emitValue<output_F>(ctx, 1);
    }

}

Tabular tests

CONDTRIGTF
falsepulseno-pulsepulse
truepulsepulseno-pulse
falseno-pulseno-pulseno-pulse
trueno-pulseno-pulseno-pulse
trueno-pulseno-pulseno-pulse