Impact Acquire SDK Java
|
As already mentioned in the Quickstart chapter, settings contain all the parameters that are needed to prepare and program the device for the image capture. So for the user a setting is the one and only place where all the necessary modifications can be applied to achieve the desired form of data acquisition.
After a device has been initialized, the user will have access to a single setting named 'Base'. For most applications, this will be sufficient, as most applications just require the modification of a few parameters during start up and then at runtime these parameters stay constant.
This behavior can be achieved in two general ways:
The first approach has the advantage, that no additional files are needed by the application, but modifying the acquisition parameters might force you recompile your code.
The second method typically results in a XML file containing all the parameters that can be shipped together with the application. The application in that case just calls a function to load a setting after the device has been initialized. Here parameters can be modified without the need to rebuild the application itself, but at least one additional file is needed and this file might be corrupted by unauthorized users leading the application to malfunction.
The function needed to load such a setting is mvIMPACT.acquire.FunctionInterface.loadSetting. A setting can be stored either by using one of the provided interactive GUI tools or by calling the function mvIMPACT.acquire.FunctionInterface.saveSetting
Sometimes applications require the modification of parameters at runtime. This might become necessary e.g. when different regions of the image shall be captured at different times or when e.g. the exposure time must be adapted to the environment or for some other reason.
For the latter example, it's sufficient to acquire an image and use the image to determine the necessary exposure time for the next image from the acquired data and then set the expose time for the next acquisition and send a new image request to the device.
Modifying the AOI all the time might be tedious and sometimes it might be necessary to modify a large number of parameters back and forth. Here it would be more preferable to have two sets of parameters and tell the driver which setting to use for an acquisition when sending the request down to the driver.
To meet this requirement the Impact Acquire interface offers a method to create an arbitrary number of parameters.
A new setting can be created like this:
In order to allow the modification of certain parameters in an easy and natural way, settings are organized in a hierarchical structure. In default state (after a device has been initialized the first time or without stored new settings) every device offers just one setting called 'Base'.
Each new setting the user can create will be derived directly or indirectly from this setting. So after the user has created new settings like in the source sample from above these new parameter sets still depend on the 'Base' setting:
When now modifying a parameter in the setting 'Base' this will have direct impact on the new settings 'one' and 'two'. So this will provide a convenient way to change a parameter globally. Of course this is not always desired as then creating new settings wouldn't make any sense.
Modifying a parameter in one of the derived settings 'one' or 'two' will NOT influence the 'Base' or the other setting.
Furthermore modifying the same parameter in the 'Base' setting AFTER modifying the same parameter in one of the derived settings will NOT modify the derived setting anymore BUT will still modify in the setting that hasn't 'overwritten' the parameter:
However the original parent <-> child relationship can be restored by calling the corresponding restore to default method for the property in question:
Even the 'Base' setting has a default value for each property, that can be restored in the same way and affects all derived settings, that still refer to that original value :
When now the user has created all the parameter sets he needs for the application and has modified all the parameters to meet his requirements the only thing he needs to do afterwards to switch from one setting to another is to send the parameter set to use down to the device with the image request.
This can be done by modifying the property 'setting' in an image request control. An image request Control is an object that defines the behavior of the capture process. Each time an image is requested from the driver the user can pass the image request control to be used as a parameter of the request.