Impact Acquire SDK C++
Porting Existing Code

This chapter contains a detailed description about changes in the interface that have been made, that either might break existing code or lead to the deprecation of certain functions and structures and data types.

For each release version of the interface where changes that are important for development have been introduced this chapter will contain a section that will explain as detailed as necessary what these changes are and how to modify the code to run with the latest version of the interface.

Apart from that possible impacts on existing applications will be described as well.

Normally there won't be changes that require the developer to change his code. However when changes have been made it will only take a few minutes to port code to the latest version of the interface when sticking to this document.

Porting Existing Code Written With Versions Smaller Than 1.3.0

General Changes

The large customer's feedback required some major revision of the initial version of the C++ wrapper code. Apart from that the link dependency to the mvPropHandling-lib has been eliminated and the mvDeviceManager.h now offers a complete 'C' compliant interface, which can be used from other programming languages like Delphi© or Visual Basic© as well.

To port existing code to the new version of the interface your complete application needs to be recompiled and re-linked with the mvDeviceManager-lib and should no longer directly link the mvPropHandling-lib.

If you encounter error message during the compilation please use the following list of changes to port your code:

  • the C++ wrapper no longer needs the 'mvPropHandling.h' and only links the 'mvDeviceManager' now. The direct dependency between user application and mvPropHandling-lib has been removed.
  • the type CompID has been removed and replaced by HOBJ, HDRV, HDEV and HLIST.
  • the function mvIMPACT::acquire::Device::driver_id() became mvIMPACT::acquire::Device::hDrv().
  • the function mvIMPACT::acquire::Device::device_id() became mvIMPACT::acquire::Device::hDev().
  • the function mvIMPACT::acquire::Component::id() became mvIMPACT::acquire::Component::hObj().
  • changes in the structure 'ImageBuffer':
  • UValue Method::call( UParams* pParams, size_t parCnt ) became int Method::call( const std::string& params, const std::string& delimiters) the union UValue has been removed completely from the interface.
  • NEW FUNCTION std::string mvIMPACT::acquire::Request::getParamS( TImageRequestParam param ) const; replaces:
    • mvIMPACT::acquire::ImageBuffer::pixelFormatStringRep (available via Request::getParamS)
    • mvIMPACT::acquire::RequestResult::stateStringRep (available via Request::getParamS)
    • mvIMPACT::acquire::RequestResult::resultStringRep (available via Request::getParamS)
  • size_t maxStringLength = DEFAULT_STRING_SIZE_LIMIT parameter removed in functions mvIMPACT::acquire::Property::readSArray and some others.
  • compiler warning 4786 disabled for the VS 6 compiler.
  • the complete 'C' API is imported into the namespace mvIMPACT::acquire now.
  • type MV_RESULT removed and replaced either by TDMR_ERROR or TPROPHANDLING_ERROR.
  • return type of mvIMPACT::acquire::ComponentAccess::changedCounter changed from unsigned long to unsigned int.
  • mvIMPACT::acquire::FunctionInterface::imageRequestSingle( int requestCtrlNr ) const became mvIMPACT::acquire::FunctionInterface::imageRequestSingle( int requestCtrlNr, int* pRequestUsed ) const and only returns an error code now. The 2nd parameter can be omitted, so this change does not break existing code.
  • new class ImageBufferDesc which handles allocated ImageBuffer structures.
  • adapted to new mvDeviceManager.h interface.

Advantages

These changes involve some advantages:

  • The user has to link the mvDeviceManager-lib only.
  • More code moved from the C++ wrapper into the libraries. Therefore, more updates and bugfixes can be done by simply exchanging the library without the need to recompile or re-link the application.
  • The interface can be used with other languages like Delphi© easily.
Warning
Applications compiled with older versions of this interface will NOT run with this version of the driver. It's mandatory to recompile your application. Major changes like them won't occur once the package leaves its beta stadium!

The class mvIMPACT::acquire::ImageBufferDesc

The class mvIMPACT::acquire::ImageBufferDesc no longer supports the constructors

explicit mvIMPACT::acquire::ImageBufferDesc( ImageBuffer* p,bool boTakeOwnership = false );
A wrapper class to handle mvIMPACT::acquire::ImageBuffer structures.
Definition mvIMPACT_acquire.h:8104

and

explicit mvIMPACT::acquire::ImageBufferDesc( const ImageBuffer& source );

The reason for this change is an enhanced method of image buffer handling. The user can now allocate complete image buffers including memory for the pixel data in the same format as the driver with the new constructor

explicit mvIMPACT::acquire::ImageBufferDesc( TImageBufferPixelFormat pixelFormat, int width, int height );

The image buffers handled by the class ImageBufferDesc are now reference counted resulting in a more powerful image management. However these means that calling the normal copy constructor will NOT allocate new memory for the buffer describing structure or the pixel data. So modifying the object created with the copy constructor will also modify the original object. To create a deep copy of the image the function mvIMPACT::acquire::ImageBufferDesc::clone( void ) const can be used. Porting existing code should be straight forward:

Example

(taken from the ImpactControlCenter source code)

ImageBufferDesc rgb_img( m_CurrentImage );
ImageBuffer* pRGB = rgb_img.getBuffer();
ImageBuffer* pCur = m_CurrentImage.getBuffer();
pRGB->vpData = new char[ pCur->iWidth * pCur->iHeight * 3 ];
ConvertYUVImageToRGB( pCur, pRGB );
SaveBMP( fileDlg.GetPathName().GetBuffer(), (const char*)pRGB->vpData, pRGB->iWidth, pRGB->iHeight, pRGB->pChannels[0].iLinePitch, pRGB->pChannels[0].iPixelPitch*8 );
delete [] pRGB->vpData;

became

ImageBuffer* pCur = m_CurrentImage.getBuffer();
ImageBufferDesc rgb_img( ibpfRGBx888Packed, pCur->iWidth, pCur->iHeight );
ImageBuffer* pRGB = rgb_img.getBuffer();
ConvertYUVImageToRGB( pCur, pRGB );
SaveBMP( fileDlg.GetPathName().GetBuffer(), (const char*)pRGB->vpData, pRGB->iWidth, pRGB->iHeight, pRGB->pChannels[0].iLinePitch, pRGB->pChannels[0].iPixelPitch*8 );

Which is shorter and more logical.

Porting Existing Code Written With Versions Smaller Than 1.4.0

  • typedef for IntDict and FloatDict removed from interface.
  • Replace
    • each occurrence of FloatDict by
      std::vector<std::pair<std::string, double> >
    • each occurrence of IntDict by
      std::vector<std::pair<std::string, int> >
  • class local enum for Property limits made global.
  • Property::minValue became plMinValue
  • Property::maxValue became plMaxValue
  • Property::stepWidth became plStepWidth
  • mvIMPACT::acquire::RTCtrProgram::programSize became mvIMPACT::acquire::RTCtrProgram::getProgramSize.

These changes where necessary for creating the .NET interface and might force you to change existing code.

The string property Device::userData, which has been introduced in version 1.3.8 of the interface has been replaced by a much more flexible method to handle user data in the devices non-volatile memory. See the description of the class's mvIMPACT::acquire::UserData and mvIMPACT::acquire::UserDataEntry for details.

Porting Existing Code Written With Versions Smaller Than 1.5.0

General Changes

The public properties mvIMPACT::acquire::IOSubSystem::inputRegister and mvIMPACT::acquire::IOSubSystem::outputRegister have been removed to achieve a more general class layout. The same information is available via other functions like e.g. mvIMPACT::acquire::IOSubSystem::readInputRegister.

Deprecated Stuff

Some functions have been declared deprecated. This means the are still part of the interface, but their use is not recommended anymore and they might be removed in future releases of the interface. To remove deprecated calls from your code

Porting Existing Code Written With Versions Smaller Than 1.6.0

Replace each occurrence of mvIMPACT::acquire::ImageRequestControlVector by std::vector<mvIMPACT::acquire::ImageRequestControl*>

Deprecated Stuff

Some functions have been declared deprecated. This means the are still part of the interface, but their use is not recommended anymore and they might be removed in future releases of the interface. To remove deprecated calls from your code

Porting Existing Code Written With Versions Smaller Than 1.8.0

The declaration of the function mvIMPACT::acquire::EventSubSystem::waitFor has been modified. The old declaration looked like this:

int mvIMPACT::acquire::EventSubSystem::waitFor( int timeout_ms, TDeviceEventType mask, TDeviceEventType& resultMask );

while the new one looks like this:

EventWaitResults mvIMPACT::acquire::EventSubSystem::waitFor( int timeout_ms, TDeviceEventType mask );

This was necessary to achieve a constant interface under .NET and also is more flexible for future enhancements.

Porting Existing Code Written With Versions Smaller Than 1.9.0

The already declared as deprecated class mvIMPACT::acquire::Settings has been modified. Its member cameraSetting is no longer of type mvIMPACT::acquire::CameraSettings, but mvIMPACT::acquire::CameraSettingsBlueFOX now as mvIMPACT::acquire::CameraSettings has been declared as deprecated as well and the usage of deprecated types and functions will result in compile time warnings now. Apart from that only the mvBlueFOX supported all the properties offered by this class anyway. So if you have written code like this:

// ...
mvIMPACT::acquire::Settings cs(pDev);
// ...
mvIMPACT::acquire::CameraSettings& = cs.cameraSetting;

you can rewrite it like this:

// ...
mvIMPACT::acquire::Settings cs(pDev);
// ...
mvBlueFOX related camera settings(Device specific interface layout only).
Definition mvIMPACT_acquire.h:20010

or (better) you use one of the device specific class, as the class mvIMPACT::acquire::Settings has been declared deprecated as well.

Device specific replacement:

Porting Existing Code Written With Versions Smaller Than 1.10.0

Deprecated Stuff

All versions of the functions mvIMPACT::acquire::Request::getInfo and mvIMPACT::acquire::Request::getResult have been declared deprecated. They might disappear in future releases of this interface. Replace calls to these function by directly accessing the newly published properties in the class mvIMPACT::acquire::Request such as mvIMPACT::acquire::Request::requestResult or mvIMPACT::acquire::Request::infoGain_dB. This is more efficient and much more flexible.

Changed Compile-time Behavior

Functions and classes that have been declared deprecated for some time now have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes and functions that have been removed and their replacement:

Porting Existing Code Written With Versions Smaller Than 1.11.0

Functions and classes that have been declared deprecated for some time now have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Changed Run-time Behavior

Porting Existing Code Written With Versions Smaller Than 1.12.0

The release of version 1.12.0 of the Impact Acquire interface does no longer contain interface members, that have been declared as deprecated in previous versions. The following list can be used to port code to this release. These changes will NOT affect existing binaries, thus application compiled with code from this list, will continue to work, but can't be built with a new interface release.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Changed Run-time Behavior

  • The class mvIMPACT::acquire::Request did support a property 'UserData' for mvBlueCOUGAR-P and mvBlueLYNX-M7 devices. This feature has been renamed to 'ChunkUserData' and resides in a sublist now. Even though this feature has never been officially published it might have been used by existing applications and therefore might break existing binaries! When your application did or does use this property you need to change the name, rebuild and redistribute your software in order to work with newer driver versions.

Porting Existing Code Written With Versions Smaller Than 2.0.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

If re-building your application please note that when linking against the new export names of the display library, the display library on the target system must be updated as well.

Porting Existing Code Written With Versions Smaller Than 2.6.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

  • mvIMPACT::acquire::dilGeneric.
    When you still need this call mvIMPACT::acquire::Device::interfaceLayout.writeS("Generic") instead.

Porting Existing Code Written With Versions Smaller Than 2.7.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.10.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.12.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.15.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

  • mvIMPACT::acquire::cfUserAllocatedMemory.
  • mvIMPACT::acquire::PROPHANDLING_NO_USER_ALLOCATED_MEMORY.
  • mvIMPACT::acquire::ENoUserAllocatedMemory.
    There is NO direct replacement for all these things, as they haven't been used internally or externally anyway. Simply remove all references from your code.

Porting Existing Code Written With Versions Smaller Than 2.16.0

Changed Run-time Behavior

The support for the Generic interface layout has finally been removed. Please port your applications to use the interface layout mvIMPACT::acquire::dilGenICam instead. Systems depending on the generic interface layout will NO LONGER work starting from this version of Impact Acquire!

Porting Existing Code Written With Versions Smaller Than 2.17.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.20.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.25.0

Functions and classes that have been declared deprecated for some time have been removed from the interface. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed as the products supporting them are no longer available:

Changed Compile-time Behavior

  • mvIMPACT::acquire::GenICam::DeviceControl::mvDeviceSensor
  • mvIMPACT::acquire::GenICam::ImageFormatControl::mvDebayerAlgorithm
  • mvIMPACT::acquire::GenICam::ImageFormatControl::mvOffsetYSensorB
  • mvIMPACT::acquire::GenICam::ImageFormatControl::mvSensorLineOffsetSelector
  • mvIMPACT::acquire::GenICam::ImageFormatControl::mvSensorLineOffset
  • mvIMPACT::acquire::GenICam::ImageFormatControl::mvSensorLinePeriod
  • mvIMPACT::acquire::GenICam::AnalogControl::mvVCAL
  • mvIMPACT::acquire::GenICam::AnalogControl::mvVBLACK
  • mvIMPACT::acquire::GenICam::AnalogControl::mvVOFFSET
  • mvIMPACT::acquire::GenICam::mvOMAPPreviewConfig
  • mvIMPACT::acquire::GenICam::mvXLampControl
  • mvIMPACT::acquire::GenICam::mvSPIControl
  • mvIMPACT::acquire::GenICam::mvDACParams
  • mvIMPACT::acquire::GenICam::mvACCControl

Simply remove all references from your code.

Porting Existing Code Written With Versions Smaller Than 2.27.0

Functions and classes that have been declared deprecated for a long time have been removed from the interface as they also have from the SFNC some time ago. This will not break existing binaries, but will force you to change your code during rebuilds when deprecated code was used by your application.

List of classes, functions and data types that have been removed as they have been declared deprecated for a very long time

Changed Compile-time Behavior

  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionalCommandsUserDefinedName
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionalCommandsSerialNumber
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionalCommandsEVENTDATA
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionalCommandsEVENT
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionalCommandsPACKETRESEND
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionalCommandsWRITEMEM
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionalCommandsConcatenation
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedIPConfigurationLLA
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedIPConfigurationDHCP
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedIPConfigurationPersistentIP
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevCurrentIPConfiguration

All the features above might be accessible using the mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOptionSelector and mvIMPACT::acquire::GenICam::TransportLayerControl::gevSupportedOption if supported by the device.

  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestEntrySelector
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestXMLMajorVersion
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestXMLMinorVersion
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestXMLSubMinorVersion
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestSchemaMajorVersion
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestSchemaMinorVersion
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestPrimaryURL
  • mvIMPACT::acquire::GenICam::TransportLayerControl::gevManifestSecondaryURL

All the features above might be accessible using the mvIMPACT::acquire::GenICam::DeviceControl::deviceManifestEntrySelector and other manifest table related features in the mvIMPACT::acquire::GenICam::DeviceControl category if supported by the device.

If the device you are using depends on any of the removed properties and does not support the recommended replacement derive from the existing classes the features have been removed from and add the features you need there. Therefore the code from an earlier release of this SDK can be used to copy most of the code from.

Note
Most likely the Raw feature uses a different unit/data type than the one without the Raw postfix. Please take care when changing your code!

Porting Existing Code Written With Versions Smaller Than 2.28.0

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.32.0

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.34.0

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.37.0

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Porting Existing Code Written With Versions Smaller Than 2.38.0

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

  • The property mvIMPACT::acquire::SystemSettings::workerPriority as well as the enumeration mvIMPACT::acquire::TThreadPriority have been removed from the public interface. Existing binaries will not be affected but if an application wants to continue to use this property the mvIMPACT::acquire::DeviceComponentLocator class must be used from now on to bind this property manually. This however is strongly discouraged! Modifying this property does not provide any benfits to an application.

Porting Existing Code Written With Versions Smaller Than 2.47.0

List of classes, functions and data types that have been removed and their replacement:

Changed Compile-time Behavior

Changed Run-time Behavior

As a consequence of the removal of the event related classes mentioned in the previous the underlying C-API serving these classes has been removed as well. If an application made use of this API it needs to be recompiled and linked before it can work with Impact Acquire 2.47.0 of higher. Otherwise the following symbols might be reported as unresolved:

  • DMR_EventWaitFor
  • DMR_EventGetData

Porting Existing Code Written With Versions Smaller Than 2.49.0

List of classes, functions and data types that have been moved to another namespace:

Changed Compile-time Behavior

  • mvIMPACT::acquire::labs::FirmwareUpdater
    The FirmwareUpdater class has moved from the mvIMPACT::acquire::labs namespace to mvIMPACT::acquire as it has been tested for a sufficient amount of time without any major issues. The API has been changed during that evaluation time and is supposed to be stable now. There is a suitable example as well now called FirmwareUpdate.cpp. Simply remove all occurrences of the labs namespace in connection with the updater class.

Porting Existing Code Written With Versions Smaller Than 3.0.0

The release of 3.0.0 of the Impact Acquire interface does no longer contain interface members, that have been declared as deprecated in previous versions. The following list can be used to port code to this release. These changes will NOT affect existing binaries, thus application compiled with code from this list, will continue to work, but can't be built with a new interface release.

Changed Compile-time Behavior

List of classes, functions and data types that have been removed and their replacement:

Deprecated Stuff

Frame Grabber Support

Note
Beginning with the release of 3.0.0 of Impact Acquire everything specifically related to frame grabber boards will be considered as deprecated and might be removed without further notice. No direct replacement will be provided for any of the classes, functions and data types!

List of frame grabber specific classes that have been declared deprecated:

List of frame grabber specific data types that have been declared deprecated:

Makefiles

Impact Acquire is shipped with CMake support for quite a while now (see Building And Linking Using CMake for details) and maintaining the traditional Makefiles that have been part of any Impact Acquire for a long time will soon come to an end. From this version onwards traditional Makefiles might be removed from example and GUI applications without further notice. Building using CMake is much easier and therefore should be preferred as soon as possible!