if-number-out-pulse

dinosalvioni/functionslibrary/if-number-out-pulse

No description
if-number-out-pulse
@/if-number-out-pulse
VALUEnumber
EQ1number
EQ2number
EQ3number
EQ4number
UPDpulse
if-number-out-pulse
DONE
OUT1
OUT2
OUT3
OUT4
ERR
VALUE
EQ1
EQ2
EQ3
EQ4
UPD
ERRboolean
OUT4pulse
OUT3pulse
OUT2pulse
OUT1pulse
DONEpulse
To use the node in your project you should have the dinosalvioni/functionslibrary 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 inValue = getValue<input_IN>(ctx);
    //emitValue<output_OUT>(ctx, inValue);
if (isInputDirty<input_UPD>(ctx)){
    
    if (getValue<input_EQ1>(ctx) == getValue<input_VALUE>(ctx)){
      emitValue<output_ERR>(ctx, false);
        emitValue<output_OUT1>(ctx, 1);

        }

    else if (getValue<input_EQ2>(ctx) == getValue<input_VALUE>(ctx)){
        emitValue<output_ERR>(ctx, false);
        emitValue<output_OUT2>(ctx, 1);
        }

    else if (getValue<input_EQ3>(ctx) == getValue<input_VALUE>(ctx)){
        emitValue<output_ERR>(ctx, false);
        emitValue<output_OUT3>(ctx, 1);
        }

    else if (getValue<input_EQ4>(ctx) == getValue<input_VALUE>(ctx)){
        emitValue<output_ERR>(ctx, false);
        emitValue<output_OUT4>(ctx, 1);
        }

    else{
        emitValue<output_ERR>(ctx, true);
        }
    
}
emitValue<output_DONE>(ctx, 1);
}