Impact Acquire SDK Java
|
Grants access to devices that can be operated by this software interface. More...
Public Member Functions | |
long | changedCount () |
Returns the current changed counter for the device list. | |
void | close () |
synchronized void | delete () |
long | deviceCount () |
Returns the number of devices currently present in the system. | |
DeviceManager () | |
Constructs a new mvIMPACT.acquire.DeviceManager object. | |
DeviceManager (DeviceManager src) | |
Constructs a new mvIMPACT.acquire.DeviceManager object from an existing one. | |
Device | getDevice (long index) |
Returns a pointer to a mvIMPACT.acquire.Device object. | |
Device | getDeviceByFamily () |
Tries to locate a device via the family name. | |
Device | getDeviceByFamily (String family) |
Tries to locate a device via the family name. | |
Device | getDeviceByFamily (String family, long devNr) |
Tries to locate a device via the family name. | |
Device | getDeviceByFamily (String family, long devNr, char wildcard) |
Tries to locate a device via the family name. | |
Device | getDeviceByProduct () |
Tries to locate a device via the product name. | |
Device | getDeviceByProduct (String product) |
Tries to locate a device via the product name. | |
Device | getDeviceByProduct (String product, long devNr) |
Tries to locate a device via the product name. | |
Device | getDeviceByProduct (String product, long devNr, char wildcard) |
Tries to locate a device via the product name. | |
Device | getDeviceByProductAndID () |
Tries to locate a device via the product name and the device ID. | |
Device | getDeviceByProductAndID (String product) |
Tries to locate a device via the product name and the device ID. | |
Device | getDeviceByProductAndID (String product, long devID) |
Tries to locate a device via the product name and the device ID. | |
Device | getDeviceByProductAndID (String product, long devID, char wildcard) |
Tries to locate a device via the product name and the device ID. | |
Device | getDeviceByProductAndID (String product, String devID) |
Tries to locate a device via the product name and the device ID. | |
Device | getDeviceByProductAndID (String product, String devID, char wildcard) |
Tries to locate a device via the product name and the device ID. | |
Device | getDeviceBySerial () |
Tries to locate a device via the serial number. | |
Device | getDeviceBySerial (String serial) |
Tries to locate a device via the serial number. | |
Device | getDeviceBySerial (String serial, long devNr) |
Tries to locate a device via the serial number. | |
Device | getDeviceBySerial (String serial, long devNr, char wildcard) |
Tries to locate a device via the serial number. | |
int | getInternalHandle () |
Returns the internal handle to the device manager created via DMR_Init(). | |
void | updateDeviceList () |
Updates the internal device list. | |
Static Public Member Functions | |
static String | getVersionAsString (int libraryQuery) |
Returns a string containing the version number of the specified library. | |
Protected Member Functions | |
DeviceManager (long cPtr, boolean cMemoryOwn) | |
void | finalize () |
Static Protected Member Functions | |
static long | swigRelease (DeviceManager obj) |
Protected Attributes | |
transient boolean | swigCMemOwn |
Grants access to devices that can be operated by this software interface.
This class will grant access to any device installed on/in the current system. Whenever somewhere in the code a mvIMPACT.acquire.DeviceManager instance is created it can be used to access any device currently supported and available.
This is the only class which is allowed to create instances of the class mvIMPACT.acquire.Device, which are needed to access a certain device.
If a device is installed in the system but an appropriate driver has not been installed, this class will NOT list these devices.
As a result of this every program written by the use of this interface will create an instance of mvIMPACT.acquire.DeviceManager before performing any other operations which uses objects or functions from this interface.
During the construction of a mvIMPACT.acquire.DeviceManager object the system will be scanned for supported devices and once the instance has been created the object will provide an up to date list of devices whenever the user asks for it. Some devices when plugged into the system after the device manager has been created might require an explicit update of the device list. This can be triggered by an application by calling mvIMPACT.acquire.DeviceManager.updateDeviceList(). When there is currently no mvIMPACT.acquire.DeviceManager instance within the process creating the first one will result in all supported driver stacks to be loaded dynamically. See remarks below for consequences that result from this.
This class also provides various functions to find a particular device in the system. Devices can e.g. be found by family or by serial number.
DllMain
context and loading other libraries from within DllMain
is discouraged (see DllMain Best Practices
in MSDN for example). Instead either attach your instance of the device manager to a singleton, declare a global pointer that gets initialised/destroyed by custom library init/close functions or use any other approach that suits your needs.EXAMPLE CODE:
|
protected |
DeviceManager | ( | ) |
Constructs a new mvIMPACT.acquire.DeviceManager object.
If the construction of this object fails for some reason this constructor might throw an exception of type mvIMPACT.acquire.ImpactAcquireException or a type derived from this class.
DeviceManager | ( | DeviceManager | src | ) |
Constructs a new mvIMPACT.acquire.DeviceManager object from an existing one.
If the construction of this object fails for some reason this constructor might throw an exception of type mvIMPACT.acquire.ImpactAcquireException or a type derived from this class.
long changedCount | ( | ) |
Returns the current changed counter for the device list.
This is a useful function to find out if the device list has been changed in any way. Such a change might be the appearance of a new USB device or a state change of any other device (e.g. when a USB device has been unplugged). Thus this function can be called periodically in order to maintain lists in GUI application for example. To find out the actual number of devices call mvIMPACT.acquire.DeviceManager.deviceCount.
void close | ( | ) |
synchronized void delete | ( | ) |
long deviceCount | ( | ) |
Returns the number of devices currently present in the system.
This function returns the number of devices currently detected in the system. A device once connected to the system while the device manager was running will remain in its list even if it's unplugged (then only its state will change). To detect changes in the mvIMPACT.acquire.DeviceManager objects list call the function mvIMPACT.acquire.DeviceManager.changedCount.
|
protected |
Device getDevice | ( | long | index | ) |
Returns a pointer to a mvIMPACT.acquire.Device object.
Returns a pointer to a mvIMPACT.acquire.Device object specifying the device found at the given index in the device managers internal list.
index | [in] The index of the device to be returned. |
Device getDeviceByFamily | ( | ) |
Tries to locate a device via the family name.
This function tries to find a device by its family (or parts of this family name). The user can specify only parts of the family name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The family is the most general method of searching for a device apart from 'any device'. E.g. for a device the family name might be 'SampleDevice'
Device getDeviceByFamily | ( | String | family | ) |
Tries to locate a device via the family name.
This function tries to find a device by its family (or parts of this family name). The user can specify only parts of the family name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The family is the most general method of searching for a device apart from 'any device'. E.g. for a device the family name might be 'SampleDevice'
family | [in] The full family name of the requested device or known parts of it and wildcard characters. |
Device getDeviceByFamily | ( | String | family, |
long | devNr ) |
Tries to locate a device via the family name.
This function tries to find a device by its family (or parts of this family name). The user can specify only parts of the family name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The family is the most general method of searching for a device apart from 'any device'. E.g. for a device the family name might be 'SampleDevice'
family | [in] The full family name of the requested device or known parts of it and wildcard characters. |
devNr | [in] The number of the device to return (if there is more than one candidate). |
Device getDeviceByFamily | ( | String | family, |
long | devNr, | ||
char | wildcard ) |
Tries to locate a device via the family name.
This function tries to find a device by its family (or parts of this family name). The user can specify only parts of the family name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The family is the most general method of searching for a device apart from 'any device'. E.g. for a device the family name might be 'SampleDevice'
family | [in] The full family name of the requested device or known parts of it and wildcard characters. |
devNr | [in] The number of the device to return (if there is more than one candidate). |
wildcard | [in] The character to ignore in family. |
Device getDeviceByProduct | ( | ) |
Tries to locate a device via the product name.
This function tries to find a device by its product name (or parts of it). The user can specify only parts of the name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The product name is a bit more specific than the family name, but less specific than the serial. For the 'SampleDevice' for example there might be different product names for different device types. This might e.g. be 'SampleDevice-G' for a grey version of the sample device and 'SampleDevice-C' for the color version of the sample device.
DeviceManager devMgr = new DeviceManager(); // this will return a pointer to the second sample // device of type 'G' found or 0 if there aren't // two devices of this type in the system devMgr.getDeviceByProduct( "SampleDevice-G", 1 ); // will return a pointer to the first device whose // product string starts with 'SampleDev' or 0 if // no such device can be found. devMgr.getDeviceByProduct( "SampleDev*", 0, '*' ); // will return the first recognized device in the system devMgr.getDeviceByProduct( "*", 0, '*' );
Device getDeviceByProduct | ( | String | product | ) |
Tries to locate a device via the product name.
This function tries to find a device by its product name (or parts of it). The user can specify only parts of the name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The product name is a bit more specific than the family name, but less specific than the serial. For the 'SampleDevice' for example there might be different product names for different device types. This might e.g. be 'SampleDevice-G' for a grey version of the sample device and 'SampleDevice-C' for the color version of the sample device.
DeviceManager devMgr = new DeviceManager(); // this will return a pointer to the second sample // device of type 'G' found or 0 if there aren't // two devices of this type in the system devMgr.getDeviceByProduct( "SampleDevice-G", 1 ); // will return a pointer to the first device whose // product string starts with 'SampleDev' or 0 if // no such device can be found. devMgr.getDeviceByProduct( "SampleDev*", 0, '*' ); // will return the first recognized device in the system devMgr.getDeviceByProduct( "*", 0, '*' );
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
Device getDeviceByProduct | ( | String | product, |
long | devNr ) |
Tries to locate a device via the product name.
This function tries to find a device by its product name (or parts of it). The user can specify only parts of the name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The product name is a bit more specific than the family name, but less specific than the serial. For the 'SampleDevice' for example there might be different product names for different device types. This might e.g. be 'SampleDevice-G' for a grey version of the sample device and 'SampleDevice-C' for the color version of the sample device.
DeviceManager devMgr = new DeviceManager(); // this will return a pointer to the second sample // device of type 'G' found or 0 if there aren't // two devices of this type in the system devMgr.getDeviceByProduct( "SampleDevice-G", 1 ); // will return a pointer to the first device whose // product string starts with 'SampleDev' or 0 if // no such device can be found. devMgr.getDeviceByProduct( "SampleDev*", 0, '*' ); // will return the first recognized device in the system devMgr.getDeviceByProduct( "*", 0, '*' );
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
devNr | [in] The number of the device to return (if there is more than one candidate). |
Device getDeviceByProduct | ( | String | product, |
long | devNr, | ||
char | wildcard ) |
Tries to locate a device via the product name.
This function tries to find a device by its product name (or parts of it). The user can specify only parts of the name and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The product name is a bit more specific than the family name, but less specific than the serial. For the 'SampleDevice' for example there might be different product names for different device types. This might e.g. be 'SampleDevice-G' for a grey version of the sample device and 'SampleDevice-C' for the color version of the sample device.
DeviceManager devMgr = new DeviceManager(); // this will return a pointer to the second sample // device of type 'G' found or 0 if there aren't // two devices of this type in the system devMgr.getDeviceByProduct( "SampleDevice-G", 1 ); // will return a pointer to the first device whose // product string starts with 'SampleDev' or 0 if // no such device can be found. devMgr.getDeviceByProduct( "SampleDev*", 0, '*' ); // will return the first recognized device in the system devMgr.getDeviceByProduct( "*", 0, '*' );
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
devNr | [in] The number of the device to return (if there is more than one candidate). |
wildcard | [in] The character to ignore in product. |
Device getDeviceByProductAndID | ( | ) |
Tries to locate a device via the product name and the device ID.
This function behaves like mvIMPACT.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.
Device getDeviceByProductAndID | ( | String | product | ) |
Tries to locate a device via the product name and the device ID.
This function behaves like mvIMPACT.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
Device getDeviceByProductAndID | ( | String | product, |
long | devID ) |
Tries to locate a device via the product name and the device ID.
This function behaves like mvIMPACT.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
devID | [in] The ID associated with this device. |
Device getDeviceByProductAndID | ( | String | product, |
long | devID, | ||
char | wildcard ) |
Tries to locate a device via the product name and the device ID.
This function behaves like mvIMPACT.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
devID | [in] The ID associated with this device. |
wildcard | [in] The character to ignore in product. |
Device getDeviceByProductAndID | ( | String | product, |
String | devID ) |
Tries to locate a device via the product name and the device ID.
This function can be used to locate devices with a certain string identifier that has previously been written into a devices non-volatile memory. E.g. GenICam devices may support the DeviceUserID
feature to assign a certain user defined name. A user defined name might be useful e.g. to access a device with a certain function without the need to worry about which device is it. You could e.g. have a barcodeReadingDevice
and a monitorCamera
. This function behaves like mvIMPACT.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
devID | [in] The device ID associated with this device. |
Device getDeviceByProductAndID | ( | String | product, |
String | devID, | ||
char | wildcard ) |
Tries to locate a device via the product name and the device ID.
This function can be used to locate devices with a certain string identifier that has previously been written into a devices non-volatile memory. E.g. GenICam devices may support the DeviceUserID
feature to assign a certain user defined name. A user defined name might be useful e.g. to access a device with a certain function without the need to worry about which device is it. You could e.g. have a barcodeReadingDevice
and a monitorCamera
. This function behaves like mvIMPACT.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.
product | [in] The full product name of the requested device or known parts of it and wildcard characters. |
devID | [in] The device ID associated with this device. |
wildcard | [in] The character to ignore in product. |
Device getDeviceBySerial | ( | ) |
Tries to locate a device via the serial number.
This function tries to find a device by its serial number (or parts of this number). The user can specify only parts of the serial number and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find that matches these parameters in its current list.
Device getDeviceBySerial | ( | String | serial | ) |
Tries to locate a device via the serial number.
This function tries to find a device by its serial number (or parts of this number). The user can specify only parts of the serial number and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find that matches these parameters in its current list.
serial | [in] The full serial number or the known parts of the serial number and wildcard characters. |
Device getDeviceBySerial | ( | String | serial, |
long | devNr ) |
Tries to locate a device via the serial number.
This function tries to find a device by its serial number (or parts of this number). The user can specify only parts of the serial number and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find that matches these parameters in its current list.
serial | [in] The full serial number or the known parts of the serial number and wildcard characters. |
devNr | [in] The number of the device to return (if there is more than one candidate). |
Device getDeviceBySerial | ( | String | serial, |
long | devNr, | ||
char | wildcard ) |
Tries to locate a device via the serial number.
This function tries to find a device by its serial number (or parts of this number). The user can specify only parts of the serial number and a wildcard. The mvIMPACT.acquire.DeviceManager object will then try to find that matches these parameters in its current list.
serial | [in] The full serial number or the known parts of the serial number and wildcard characters. |
devNr | [in] The number of the device to return (if there is more than one candidate). |
wildcard | [in] The character to ignore in serial. |
int getInternalHandle | ( | ) |
Returns the internal handle to the device manager created via DMR_Init().
|
static |
Returns a string containing the version number of the specified library.
This function returns a string containing the version number of the specified library.
The format of the string will be MAJOR.MINOR.RELEASE.BUILD.
libraryQuery | [in] Specifies the library to query information from. |
|
staticprotected |
void updateDeviceList | ( | ) |
Updates the internal device list.
Most devices can't appear out of nowhere. For example a PCI device is either connected to the current system when the device manager is initialized or not but it will never appear at runtime after this instance of mvIMPACT.acquire.DeviceManager has been created.
However certain device classes (e.g. network devices) might be connected to the system AFTER the device manager has been initialized. Some will announce themselves like e.g. USB devices, which will send a message to every application interested while others like e.g. network devices wont. In order not to pollute the network or bus with constant rescan messages no polling is done inside the driver. the user should call this function instead when looking for new devices. This can either be done in reasonable intervals or after it is known that a new device has been connected to the system.
If new devices have been detected a subsequent call to mvIMPACT.acquire.DeviceManager.deviceCount will result in a higher value when compared to a previous call and mvIMPACT.acquire.DeviceManager.changedCount will contain a different value as well then (however this could also happen because a certain device related property did change its state).
|
protected |