Skip to content

Instantly share code, notes, and snippets.

@TIS-Edgar
Created February 15, 2022 06:59
Show Gist options
  • Save TIS-Edgar/a8d29750948c4a2fb53a05bb25b6bdaa to your computer and use it in GitHub Desktop.
Save TIS-Edgar/a8d29750948c4a2fb53a05bb25b6bdaa to your computer and use it in GitHub Desktop.
Test program for aravis category node properties
#include <arv.h>
#include <assert.h>
#include <stdio.h>
int main ()
{
GError* err = NULL;
//ArvCamera* camera = arv_camera_new("The Imaging Source Europe GmbH-DFK 33GP1300-33510567", &err);
ArvCamera* camera = arv_camera_new("The Imaging Source-199E19819968-19819968", &err);
ArvGc* genicam_doc = arv_device_get_genicam(arv_camera_get_device(camera));
//* ArvGcCategory objects do not seem to have DisplayName/ToolTip/Visibility/... etc.
/*
<Category Name="LUTControl" NameSpace="Standard">
<Description>Contains the features related to the look-up table (LUT) control.</Description>
<DisplayName>LUT Control</DisplayName>
<Visibility>Expert</Visibility>
<pFeature>LUTSelector</pFeature>
<pFeature>LUTEnable</pFeature>
<pFeature>LUTIndex</pFeature>
<pFeature>LUTValue</pFeature>
<pFeature>LUTValueAll</pFeature>
</Category>
*/
const char* cat_name = "LUTControl";
ArvGcNode* node = arv_gc_get_node(genicam_doc, cat_name);
assert(ARV_IS_GC_FEATURE_NODE(node));
assert(ARV_IS_GC_CATEGORY(node));
const GSList* features = arv_gc_category_get_features(ARV_GC_CATEGORY(node));
assert(features); // features has a valid feature list
const char* category_display_name = arv_gc_feature_node_get_display_name(ARV_GC_FEATURE_NODE(node));
if (category_display_name)
{
printf("Displayname: %s\n", category_display_name);
}
else
{
printf("No displayname\n");
}
const char* category_desc = arv_gc_feature_node_get_description(ARV_GC_FEATURE_NODE(node));
if (category_desc)
{
printf("Description: %s\n", category_display_name);
}
else
{
printf("No description\n");
}
ArvGcVisibility vis = arv_gc_feature_node_get_visibility(ARV_GC_FEATURE_NODE(node));
printf("visibility: %d\n", vis);
g_object_unref(camera);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment