From 20ee61e82c9ee50bec07992b5bc00ba6c87a624d Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 20 Mar 2023 15:57:28 +0100 Subject: [PATCH] add info logging of feature accesses proper connection to the correct pylonsrc obj missing for now. requires further restructuring --- ext/pylon/gstpylon.cpp | 5 ++++- gst-libs/gst/pylon/gstpylonobject.cpp | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ext/pylon/gstpylon.cpp b/ext/pylon/gstpylon.cpp index b530ec8..418b939 100644 --- a/ext/pylon/gstpylon.cpp +++ b/ext/pylon/gstpylon.cpp @@ -793,9 +793,11 @@ gboolean gst_pylon_set_configuration(GstPylon *self, const GstCaps *conf, Pylon::CIntegerParameter width(nodemap, "Width"); width.SetValue(gst_width, Pylon::IntegerValueCorrection_None); + GST_INFO("Set Feature Width: %d", gst_width); Pylon::CIntegerParameter height(nodemap, "Height"); height.SetValue(gst_height, Pylon::IntegerValueCorrection_None); + GST_INFO("Set Feature Height: %d", gst_height); Pylon::CBooleanParameter framerate_enable(nodemap, "AcquisitionFrameRateEnable"); @@ -804,13 +806,14 @@ gboolean gst_pylon_set_configuration(GstPylon *self, const GstCaps *conf, framerate_enable.TrySetValue(true); gdouble div = 1.0 * gst_numerator / gst_denominator; - if (self->camera->GetSfncVersion() >= Pylon::Sfnc_2_0_0) { Pylon::CFloatParameter framerate(nodemap, "AcquisitionFrameRate"); framerate.TrySetValue(div, Pylon::FloatValueCorrection_None); + GST_INFO("Set Feature AcquisitionFrameRate: %f", div); } else { Pylon::CFloatParameter framerate(nodemap, "AcquisitionFrameRateAbs"); framerate.TrySetValue(div, Pylon::FloatValueCorrection_None); + GST_INFO("Set Feature AcquisitionFrameRateAbs: %f", div); } } catch (const Pylon::GenericException &e) { diff --git a/gst-libs/gst/pylon/gstpylonobject.cpp b/gst-libs/gst/pylon/gstpylonobject.cpp index 0de16aa..ce9574c 100644 --- a/gst-libs/gst/pylon/gstpylonobject.cpp +++ b/gst-libs/gst/pylon/gstpylonobject.cpp @@ -206,6 +206,7 @@ static void gst_pylon_object_set_pylon_feature(GstPylonObjectPrivate* priv, const gchar* name) { P param(*priv->nodemap, name); param.SetValue(get_value(value)); + GST_INFO("Set Feature %s: %s", name, param.ToString().c_str()); } template <> @@ -223,6 +224,8 @@ void gst_pylon_object_set_pylon_feature( Pylon::EIntegerValueCorrection::IntegerValueCorrection_Nearest); } else param.SetValue(get_value(value)); + + GST_INFO("Set Feature %s: %s", name, param.ToString().c_str()); } template <> @@ -240,6 +243,7 @@ void gst_pylon_object_set_pylon_feature( Pylon::EFloatValueCorrection::FloatValueCorrection_ClipToRange); } else param.SetValue(get_value(value)); + GST_INFO("Set Feature %s: %s", name, param.ToString().c_str()); } template <> @@ -248,6 +252,7 @@ void gst_pylon_object_set_pylon_feature( const gchar* name) { Pylon::CEnumParameter param(*priv->nodemap, name); param.SetIntValue(get_value(value)); + GST_INFO("Set Feature %s: %s", name, param.ToString().c_str()); } /* Get gst property from pylon feature */ @@ -257,6 +262,7 @@ static void gst_pylon_object_get_pylon_feature(GenApi::INodeMap& nodemap, const gchar* name) { P param(nodemap, name); set_value(value, param.GetValue()); + GST_DEBUG("Get Feature %s: %s", name, param.ToString().c_str()); } template <> @@ -265,6 +271,7 @@ void gst_pylon_object_get_pylon_feature( const gchar* name) { Pylon::CEnumParameter param(nodemap, name); set_value(value, param.GetIntValue()); + GST_DEBUG("Get Feature %s: %s", name, param.ToString().c_str()); } template <> @@ -273,6 +280,7 @@ void gst_pylon_object_get_pylon_feature( const gchar* name) { Pylon::CStringParameter param(nodemap, name); set_value(value, param.GetValue().c_str()); + GST_DEBUG("Get Feature %s: %s", name, param.ToString().c_str()); } void gst_pylon_object_set_pylon_selector(GenApi::INodeMap& nodemap, @@ -283,9 +291,15 @@ void gst_pylon_object_set_pylon_selector(GenApi::INodeMap& nodemap, switch (selector_type) { case GenApi::intfIEnumeration: Pylon::CEnumParameter(nodemap, selector_name).SetIntValue(selector_value); + GST_INFO( + "Set Selector-Feature %s: %s", selector_name, + Pylon::CEnumParameter(nodemap, selector_name).ToString().c_str()); break; case GenApi::intfIInteger: Pylon::CIntegerParameter(nodemap, selector_name).SetValue(selector_value); + GST_INFO( + "Set Selector-Feature %s: %s", selector_name, + Pylon::CIntegerParameter(nodemap, selector_name).ToString().c_str()); break; default: std::string error_msg = "Selector \"" + std::string(selector_name) + @@ -300,7 +314,9 @@ template static T gst_pylon_object_get_pylon_property(GenApi::INodeMap& nodemap, const gchar* name) { P param(nodemap, name); - return param.GetValue(); + T val = param.GetValue(); + GST_DEBUG("Get Feature %s: %s", name, param.ToString().c_str()); + return val; } template