To use the node in your project you should have the samele1222/ship-data 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_IN1>(ctx);
auto Value = getValue<input_IN2>(ctx);
auto ValIf = getValue<input_IF>(ctx);
auto ValElse = getValue<input_ELSE>(ctx);
uint8_t ValCond = getValue<input_COND>(ctx);
uint32_t val;
switch(ValCond){
case 0:
val = (inValue>Value)? ValIf : ValElse;
break;
case 1:
val = (inValue<Value)? ValIf : ValElse;
break;
case 2:
val = (inValue>=Value)? ValIf : ValElse;
break;
case 3:
val = (inValue<=Value)? ValIf : ValElse;
break;
case 4:
val = (inValue==Value)? ValIf : ValElse;
break;
case 5:
val = (inValue!=Value)? ValIf : ValElse;
break;
}
emitValue<output_OUT>(ctx, val);
}