itom 2.2.0
|
base class for all dataIO plugin classes More...
#include <addInInterface.h>
Public Slots | |
virtual ito::RetVal | startDevice (ItomSharedSemaphore *waitCond) |
method to start the device - i.e. get ready to record data | |
virtual ito::RetVal | stopDevice (ItomSharedSemaphore *waitCond) |
method to stop the device, it is no longer possible to acquire data | |
virtual ito::RetVal | acquire (const int trigger, ItomSharedSemaphore *waitCond=NULL) |
freeze the current data and prepare it for retrieval | |
virtual ito::RetVal | getVal (void *data, ItomSharedSemaphore *waitCond=NULL) |
read data from the device into a dataObject (which is passed as void pointer actually). Output is a shallow-copy to the grabber internal buffer-object. | |
virtual ito::RetVal | getVal (QSharedPointer< char > data, QSharedPointer< int > length, ItomSharedSemaphore *waitCond=NULL) |
read data from the device into a "raw data pointer" (in this case a char * is passed, pointing to the start of the preallocated memory) | |
virtual ito::RetVal | copyVal (void *dObj, ItomSharedSemaphore *waitCond) |
read data from the device into a dataObject (which is passed as void pointer actually). Output is a deep-copy to the grabber internal object. | |
virtual ito::RetVal | setVal (const char *data, const int length, ItomSharedSemaphore *waitCond=NULL) |
write data, e.g. to the DA part of an ADDA card | |
ito::RetVal | enableAutoGrabbing (ItomSharedSemaphore *waitCond=NULL) |
enables the timer for auto grabbing (live image), if any live image has signed on (usually this method must not be overwritten) | |
ito::RetVal | disableAutoGrabbing (ItomSharedSemaphore *waitCond=NULL) |
disables the timer for auto grabbing (live image) (usually this method must not be overwritten) | |
ito::RetVal | setAutoGrabbingInterval (QSharedPointer< int > interval, ItomSharedSemaphore *waitCond=NULL) |
sets a new interval for the auto-grabbing timer (in ms). If interval <= 0 is passed, nothing is changed, but the current interval is returned. This method does not enable or disable the timer. | |
ito::RetVal | startDeviceAndRegisterListener (QObject *obj, ItomSharedSemaphore *waitCond=NULL) |
starts device and registers obj as listener (live image). This listener must have a slot void dataAvailable(DataObject image). | |
ito::RetVal | stopDeviceAndUnregisterListener (QObject *obj, ItomSharedSemaphore *waitCond=NULL) |
stops device and unregisters obj (live image). | |
Public Member Functions | |
int | getAutoGrabbing () |
Protected Member Functions | |
void | runStatusChanged (bool deviceStarted) |
Protected Attributes | |
QSet< QObject * > | m_autoGrabbingListeners |
int | m_timerID |
int | m_timerIntervalMS |
bool | m_autoGrabbingEnabled |
base class for all dataIO plugin classes
This class is one step further down the line from AddInBase. DataIO plugins must be derived from this class which is derived from AddInBase. In this class only the methods specific to dataIO plugins are declared. A dataIO device (e.g. a framegrabber / camera) should use this sequence to operate: 1. startDevice - device is now ready to acquire data 2. acquire - now a data set is freezed and prepared for retrieval 3. getVal - method to retrieve the previously freezed data (shallow copy, if you want to work with this data, make a deep copy) 4. stopDevice - acquisition is stopped, device is no longer ready to record data
the steps 2. and 3. can be repeated until the desired number of "frames" has been read. The device should be only started once before the first acquisition of a sequence and stop only at their end. The device itself MUST NOT allocate memory for the data to be stored. This HAS TO BE DONE in the main programm or in the calling method!
If a live image is listening this device, its source node calls startDeviceAndRegisterListener. If the autoGrabbing-flag is enabled, a timer will be started, which triggers the method 'timerEvent' (should be implemented by any camera). If this flag is disabled, the live image is registered, but no images will be regularily aquired. In this case, only manually taken images will be passed to any registered source node. If the flag is enabled again, the timer is restarted and every live image will automatically get new images. This is done by invoking the slot 'dataAvailable' of every registered source node.
Every camera will only return shallow copies of its internal image both to the live image and to the user. This image can be read by everybody. If the user wants to change values in this image, he should make a deep copy first.
int ito::AddInDataIO::getAutoGrabbing | ( | ) | [inline] |
returns the state of m_autoGrabbingEnabled; consider this method as final
bool ito::AddInDataIO::m_autoGrabbingEnabled [protected] |
defines, whether the auto-grabbing timer for any live image can be activated. If this variable becomes false and any timer is activated, this timer is killed.
QSet<QObject*> ito::AddInDataIO::m_autoGrabbingListeners [protected] |
list of listeners (live image source nodes), which want to have updates from this camera
int ito::AddInDataIO::m_timerID [protected] |
internal ID of the timer, which acquires images for any live view (if allowed)
int ito::AddInDataIO::m_timerIntervalMS [protected] |
timer interval (in ms)