User`s guide
4 Defining Your Adaptor Class
4-6
3
Add a C++ source file to the adaptor project. You can give the source file any name.
This example names the file mydeviceadaptor.cpp.
4
Copy the following stub implementations of all the adaptor virtual functions into the
C++ source file.
#include "MyDeviceAdaptor.h"
#include "mwadaptorimaq.h"
// Class constructor
MyDeviceAdaptor::MyDeviceAdaptor(imaqkit::IEngine* engine,
imaqkit::IDeviceInfo* deviceInfo,
const char* formatName):imaqkit::IAdaptor(engine){
}
// Class destructor
MyDeviceAdaptor::~MyDeviceAdaptor(){
}
// Device driver information functions
const char* MyDeviceAdaptor::getDriverDescription() const{
return "MyDevice_Driver";
}
const char* MyDeviceAdaptor::getDriverVersion() const {
return "1.0.0";
}
// Image data information functions
int MyDeviceAdaptor::getMaxWidth() const { return 640;}
int MyDeviceAdaptor::getMaxHeight() const { return 480;}
int MyDeviceAdaptor::getNumberOfBands() const { return 1;}
imaqkit::frametypes::FRAMETYPE MyDeviceAdaptor::getFrameType()
const {
return imaqkit::frametypes::MONO8;
}
// Image acquisition functions
bool MyDeviceAdaptor::openDevice() {return true;}
bool MyDeviceAdaptor::closeDevice(){return true;}
bool MyDeviceAdaptor::startCapture(){return true;}
bool MyDeviceAdaptor::stopCapture(){return true;}
5
Add a reference to your adaptor class header file to the file containing the exported
functions, mydevice_exported_fcns.cpp, that you created in “Using Adaptor