Sie verwenden einen veralteten Browser und können nicht alle Funktionen dieser Webseite nutzen. Hier erfahren Sie, wie Sie Ihren Browser aktualisieren können.

Karriere | Investoren

How can I feed generic-style parameter access into native-style parameter access?

In some cases a camera feature might be very new and not yet included into the interface-specific headers used for native-style programming in pylon. This can be the case for custom cameras for example.

In these cases it is always possible to use the feature using generic-style parameter access. You need to know the name and the type of the parameters you want to access. Generic-style parameter access is documented in the programmer's guide and in the ParametrizeCamera_GenericParameterAccess C++ sample, but here are some quick examples:

// your native style code

// A new enum entry Line3FallingEdge has been added to

// an enumeration type parameter, you can use the FromString

// method in such case



// A new enumeration type has been added to the camera

GenApi::CEnumerationPtr (camera.GetNodeMap().GetNode("NewEnumFeatureName"))->FromString("NewEnumItemName");

// A new integer type has been added to the

// camera, for other types you can use CBooleanPtr,

// CStringPtr, CFloatPtr etc.

GenApi::CIntegerPtr (camera.GetNodeMap().GetNode("NewIntegerFeatureName"))->SetValue(23);

// your native style code

// if you access a parameter often, you can create an

// instance of one of the GenApi Ptr classes

GenApi::INodeMap& nodeMap = camera.GetNodeMap();

GenApi::CIntegerPtr newIntegerFeature(nodeMap.GetNode("NewIntegerFeatureName"));

// use the parameter

newIntegerFeature ->SetValue(23);