struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isInputDirty<input_UPD>(ctx))
return;
auto gps = getValue<input_DEV>(ctx);
auto kmphmph = getValue<input_KM>(ctx);
if(gps->speed.isValid()){
if(kmphmph){
emitValue<output_SPE>(ctx, gps->speed.kmph());
}
else{
emitValue<output_SPE>(ctx, gps->speed.mph());
}
}
emitValue<output_KorM>(ctx, kmphmph);
}