MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / makeOutputValue

Method makeOutputValue

pj_scripting/src/lua_mimo_transform.cpp:64–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64PJ::VarValue LuaMimoTransform::makeOutputValue(double computed, const PJ::VarValue& mirror_input) const {
65 switch (out_mode_) {
66 case OutputMode::kInt64:
67 return PJ::VarValue{toInt64(computed)};
68 case OutputMode::kMirror:
69 return std::visit(
70 [computed](auto&& arg) -> PJ::VarValue {
71 using T = std::decay_t<decltype(arg)>;
72 if constexpr (std::is_same_v<T, std::int64_t>) {
73 return PJ::VarValue{toInt64(computed)};
74 } else if constexpr (std::is_same_v<T, std::uint64_t>) {
75 return PJ::VarValue{toUint64(computed)};
76 } else {
77 return PJ::VarValue{computed}; // double or string-input → double output
78 }
79 },
80 mirror_input);
81 case OutputMode::kDouble:
82 default:
83 return PJ::VarValue{computed};
84 }
85}
86
87void LuaMimoTransform::rebuildInstance() {
88 has_session_start_ = false;

Callers

nothing calls this directly

Calls 2

toInt64Function · 0.70
toUint64Function · 0.70

Tested by

no test coverage detected