if(pulse-else)

koadrobot/logics/if(pulse-else)

IF - GATE R=TRIG? T : F Allows values to pass through only if TRIG pulse.
if(pulse-else)
@/if(pulse-else)
IF - GATE R=TRIG? T : F Allows values to pass through only if TRIG pulse.
TRIGpulse
Tnumber
Value to be output if condition is true
Fnumber
Value to be output if condition is false
if(pulse-else)
TRIG
T
F
R
Rnumber
Outputs value of `T` if `COND` is true, and `F` otherwise
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

#pragma XOD dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (isInputDirty<input_TRIG>(ctx))
        emitValue<output_R>(ctx, getValue<input_T>(ctx));
    else
        emitValue<output_R>(ctx, getValue<input_F>(ctx));
}

Tabular tests

TRIGTFR
no-pulse0.51.251.25
no-pulse102020
pulse102010