A default request factory.
Applications need to derive from this class and must re-implement the function mvIMPACT.acquire.RequestFactory.createRequest to work with custom objects derived from mvIMPACT.acquire.Request.
Deriving from mvIMPACT.acquire.Request can be useful when a certain device driver or device offers a custom feature that is returned as part of the request object that can not be accessed using the mvIMPACT.acquire.Request class offered by this interface.
This shows how a request factory could be used to create custom request objects from within a mvIMPACT::acquire::FunctionInterface instance.
MyRequest.java:
import mvIMPACT.acquire.*;
{
private void init()
{
}
protected MyRequest(
Device pDev,
int requestNr )
{
super( pDev, requestNr );
init();
}
public MyRequest( Request pRequest )
{
super( Request.getCPtr( pRequest ), false );
init();
}
public PropertyI getMyRequestResult()
{
return myRequestResult_;
}
}
boolean bindComponent(Component access, String name, int searchMode, int maxSearchDepth)
Binds an access object to an internal driver object.
Definition ComponentLocatorBase.java:114
A class to locate components within the driver.
Definition DeviceComponentLocator.java:139
This class and its functions represent an actual device detected by this interface in the current sys...
Definition Device.java:52
A template class to represent 32 bit integer properties and 32 bit enumerated integer properties.
Definition PropertyI.java:18
Contains information about a captured buffer.
Definition Request.java:32
MyRequestFactory.java:
import mvIMPACT.acquire.*;
{
@Override
{
return new MyRequest( pDev, requestNr );
}
}
A default request factory.
Definition RequestFactory.java:248
Now the request factory must be passed to the constructor of the function interface! This might happen in some other source file or class within the application.
{
MyRequestFactory mrf = new MyRequestFactory();
{
System.out.println( String.format( "%s: %s", ( ( MyRequest )pRequest ).getMyRequestResult().name(), ( ( MyRequest )pRequest ).getMyRequestResult().readS() );
}
}
The function interface to devices supported by this interface.
Definition FunctionInterface.java:34
Request getRequest(int nr)
Returns a pointer to the desired mvIMPACT.acquire.Request.
Definition FunctionInterface.java:473
boolean isOK()
Convenience function to check if a request has been processed successfully.
Definition Request.java:494
- Since
- 1.12.56