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

Method transformRecipeJson

pj_runtime/src/DataProcessorService.cpp:695–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695std::optional<std::string> DataProcessorService::transformRecipeJson(std::string_view namespaced_key) const {
696 const auto it = transform_recipes_.find(std::string(namespaced_key));
697 if (it == transform_recipes_.end()) {
698 return std::nullopt;
699 }
700 const TransformRecipe& recipe = it->second;
701 nlohmann::json doc;
702 doc["inputs"] = recipe.inputs;
703 doc["outputs"] = recipe.outputs;
704 doc["backend"] = recipe.backend;
705 // params is structured; embed it as an object (fall back to {} on malformed input).
706 nlohmann::json params = nlohmann::json::parse(recipe.params_json, nullptr, /*allow_exceptions=*/false);
707 doc["params"] = params.is_discarded() ? nlohmann::json::object() : params;
708 return doc.dump();
709}
710
711std::vector<DataProcessorService::TransformRecipe> DataProcessorService::transformRecipes() const {
712 std::vector<TransformRecipe> out;

Callers 1

onConfigMethod · 0.80

Calls 3

parseFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected