Getting Information about the Recipes

The provided API for communication plug-ins offers various functions to get information about your recipes. This page gives a small insight to the possibilities on how and which information you can query about your recipe files. For more information about the available functions, see the reference documentation of mv_recipe_store.h.

Getting the List of Recipe Files

To get a list of all recipes, you can use the following function which returns the available recipes in MVRecipeList_t.

extern MVLibExport MVCode_t MV_GetRecipeList(MVPlugin_t handle, MVRecipeList_t* pList);

There are some further functions with respect to recipe lists, for example, to get the size of the recipe list or to get recipes by their ID. For more informatoin about the available functions, see the reference documentation of mv_recipe_store.h.

Querying the Recipe Parameters

You can also query the input and output parameters of the respective recipe files that were returned in MVRecipeList_t. The input parameters represent the tool parameters that have been specified as MVApp parameters in the respective MVApp that is associated with the recipe whereas the output parameters reflect the MVApp results of the same MVApp.

To query the input and output parameters of a recipe MVRecipe_t in the recipe list MVRecipeList_t, use the following functions:

extern MVLibExport MVRecipeParam_t MV_Recipe_InputParam_Next(MVRecipe_t recipe);
extern MVLibExport MVRecipeParam_t MV_Recipe_OutputParam_Next(MVRecipe_t recipe);
#define MV_Recipe_OutputParam_foreach(recipe, param)
for ((param) = MV_Recipe_OutputParam_Next(recipe); (param); (param) = MV_Recipe_OutputParam_Next(recipe))

Example

The following example shows how the information of the recipe output parameters, that is, MVApp results of the associated MVApp, are queried in the example plug-in "action-sender".

MVRecipeParam_t param;
MV_Recipe_OutputParam_foreach(recipe, param)
{
MVValue_t val;
MV_RecipeParam_GetParameter(param, MV_PARAM_RECIPEPARAM_NAME, &val);
char param_name[32];
MV_Value_Scalar_GetString(val, 32, param_name);
MV_Value_Clear(&val);
MV_RecipeParam_GetParameter(param, MV_PARAM_RECIPEPARAM_DESCRIPTION, &val);
char param_description[128];
MV_Value_Scalar_GetString(val, 128, param_description);
MV_Value_Clear(&val);
MV_RecipeParam_GetParameter(param, MV_PARAM_RECIPEPARAM_DATATYPE, &val);
uint32_t param_type_numeric;
MV_Value_Scalar_GetUInt32(val, &param_type_numeric);
MV_Value_Clear(&val);
char const* param_type = MVDataTypeToString(static_cast<MVDataType_t>(param_type_numeric));
char param_line[256];
snprintf(param_line, 256, " %-8s %-32s %s", param_type, param_name, param_description);
MV_Log(handle, eMVSeverity_Info, param_line);
}