Impact Acquire SDK .NET
CameraDescriptionBase Class Referenceabstract

A base class to describe a camera(Device specific interface layout only) connected to a frame grabber. More...

Inheritance diagram for CameraDescriptionBase:
[legend]

Public Member Functions

TDMR_ERROR copyDescription (String newName)
 Creates a new camera description list as a copy of the current one.
 
TDMR_ERROR exportDescription ()
 Stores the current camera description on disk.
 
IEnumerable< T > getEnumerable< T > ()
 Returns an enumerator of a certain type that iterates through the collection.
 
IEnumerator< int > GetEnumerator ()
 Returns an enumerator that iterates through the collection.
 
TDMR_ERROR importDescription ()
 Updates a camera description with the data stored in a previous session or with the original default data.
 
void restoreDefault ()
 Restores the default for every component of this collection.
 

Public Attributes

readonly PropertyI aoiHeight = new PropertyI()
 An integer property defining the number of active lines to capture from the camera.
 
readonly PropertyI aoiStartX = new PropertyI()
 An integer property defining the X-offset in pixels to the first active pixel to capture.
 
readonly PropertyI aoiStartY = new PropertyI()
 An integer property defining the Y-offset in lines to the first active line to capture.
 
readonly PropertyI aoiWidth = new PropertyI()
 An integer property defining the number of active pixels to capture per line.
 
readonly EnumPropertyI< TCameraInterlacedTypeinterlacedType = new EnumPropertyI<TCameraInterlacedType>()
 An enumerated integer property defining how the camera transmits image data.
 
readonly PropertyS name = new PropertyS()
 A string property (read-only) containing the name of this camera description list.
 
readonly EnumPropertyI< TCameraOutputvideoOutput = new EnumPropertyI<TCameraOutput>()
 An enumerated integer property defining the type of video outputs this camera offers.
 

Properties

String className [get]
 Returns the class this description is belonging to.
 
IEnumerable< ComponentcomponentEnumerable [get]
 Returns an enumerator that iterates through the collection.
 
IEnumerable< ComponentListcomponentListEnumerable [get]
 Returns an enumerator that iterates through all the mv.impact.acquire.ComponentList elements in the collection.
 
int hObj [get]
 Returns a unique identifier for the component collection referenced by this object.
 

Detailed Description

A base class to describe a camera(Device specific interface layout only) connected to a frame grabber.

A camera description object provides an abstract way to prepare the capture device (e.g. a frame grabber) for the connected imaging device (e.g. a camera).

By selecting one of the available camera descriptions the underlying hardware will use the information provided in the camera description to prepare the image capture. Therefore it is crucial to select a camera description that matches the connected video signal as close as possible. If no description for the camera connected to a frame grabber is available a new description should be generated from one of the existing ones. This can be achieved by calling the function mv.impact.acquire.CameraDescriptionBase.copyDescription. A new camera description with the name that is passed to the function will be created.

Note
The name must be unique. There can't be two descriptions with the same name belonging to the same generic class (i.e. 'Standard' or 'CameraLink'®). However it's perfectly legal to have a camera description for standard analogue video signals and one for e.g. CameraLink® signals with the same name.

This new description will be an exact copy of the one the copy function has been executed for. After creation this description can be selected e.g. by setting the property mv.impact.acquire.CameraSettingsFrameGrabber.type to the name of the new description.

Note
Please note that the name passed to the property mv.impact.acquire.CameraSettingsFrameGrabber.type does NOT exactly correspond to the name assigned to the new camera description. It is a combination of the class the camera is belonging to (e.g. 'Standard') and the actual name. So to select a camera description the name must be build from the return value of a call to mv.impact.acquire.CameraDescriptionBase.className, an underscore ('_') and the actual name of the description: <class name>_<desc. name>

Example: For a standard description with the name 'MyCam' the full name would be 'Standard_MyCam'.

Example

//-----------------------------------------------------------------------------
static void Main(string[] args)
//-----------------------------------------------------------------------------
{
LibraryPath.init(); // this will add the folders containing unmanaged libraries to the PATH variable.
if(pDev == null)
{
Console.WriteLine("Unable to continue! Press any key to end the program.");
Console.Read();
Environment.Exit(1);
}
try
{
// the next line will raise an exception if this device does not
// support camera descriptions (e.g. if it is a USB camera rather than a frame grabber)
pCam.copyDescription( "MyCam" );
// Get access to the newly created description
// Modify something
pMyCam.videoStandard.write( TVideoStandard.vsRS170 );
pMyCam.scanStandard.write( TScanStandard.ssITU601 );
// now save the description to make it available in all future sessions
// select the newly created description
// the name for this property is always a combination of the class the camera
// description is belonging to and the actual name:
cs.type.writeS( pMyCam.className + "_" + pMyCam.name.read() );
}
{
Console.WriteLine("An error occurred while opening the device " + device.serial + "(error code: " + e.Message + "). Press any key to end the application...");
Environment.Exit(1);
}
}
TDMR_ERROR copyDescription(String newName)
Creates a new camera description list as a copy of the current one.
Definition CameraDescriptionBase.cs:154
readonly PropertyS name
A string property (read-only) containing the name of this camera description list.
Definition CameraDescriptionBase.cs:247
TDMR_ERROR exportDescription()
Stores the current camera description on disk.
Definition CameraDescriptionBase.cs:182
String className
Returns the class this description is belonging to.
Definition CameraDescriptionBase.cs:235
Grants access to camera description objects (Device specific interface layout only).
Definition CameraDescriptionManager.cs:83
CameraDescriptionStandard cameraDescriptionStandard(int index)
Returns a pointer to a mv.impact.acquire.CameraDescriptionStandard object specifying the camera descr...
Definition CameraDescriptionManager.cs:310
A class describing analogue standard compliant video cameras (Device specific interface layout only).
Definition CameraDescriptionStandard.cs:13
readonly EnumPropertyI< TScanStandard > scanStandard
An enumerated integer property defining the scan standard this camera is compliant with.
Definition CameraDescriptionStandard.cs:40
readonly EnumPropertyI< TVideoStandard > videoStandard
An enumerated integer property for defining the video standard this camera is compliant with.
Definition CameraDescriptionStandard.cs:35
A class to access frame grabber related camera settings (Device specific interface layout only).
Definition CameraSettingsFrameGrabber.cs:24
readonly PropertyI type
An enumerated integer property defining the camera description used for the image acquisition.
Definition CameraSettingsFrameGrabber.cs:131
Grants access to devices that can be operated by this software interface.
Definition DeviceManager.cs:157
static Device getDevice(int index)
Returns a pointer to a mv.impact.acquire.Device object.
Definition DeviceManager.cs:438
This class and its functions represent an actual device detected by this interface in the current sys...
Definition Device.cs:91
EnumPropertyI< T > write(T value)
Writes one value to the property.
Definition EnumPropertyI.cs:449
An base class for exceptions generated by Impact Acquire.
Definition Exceptions.cs:9
A small helper class to administer various library search path related variables and paths.
Definition LibraryPath.cs:14
static void init()
Calling this method will add the folders containing unmanaged libraries to the systems library search...
Definition LibraryPath.cs:251
String read()
Reads a value from a property.
Definition PropertyS.cs:144
TVideoStandard
Defines valid video standards that might be supported by a video capture device.
Definition mvDriverBaseEnums.cs:4622
TScanStandard
Defines valid scan modes for standard cameras (deprecated.
Definition mvDriverBaseEnums.cs:4502
This namespace contains classes and functions belonging to the image acquisition module of this SDK.
Definition Enumerations.cs:2
Note
This class will only be available if mv.impact.acquire.Device.interfaceLayout is set to mv.impact.acquire.TDeviceInterfaceLayout.dilDeviceSpecific before the device is opened.

Member Function Documentation

◆ copyDescription()

TDMR_ERROR copyDescription ( String newName)
inline

Creates a new camera description list as a copy of the current one.

This function can be used to create a new camera description list. It will create a deep copy of the properties referenced by this camera description and will append the new description to the list of camera descriptions.

Note
This will NOT store the new description permanently. After the driver has been closed, this data will be lost. To store the new list in a way, that it will be available the next time the driver/device is opened again mv.impact.acquire.CameraDescriptionBase.exportDescription must be called with the handle of the newly created description after this function.
See also
mv.impact.acquire.CameraDescriptionBase.exportDescription,
mv.impact.acquire.CameraDescriptionBase.importDescription
Returns
Parameters
[in]newNameThe name for the newly created camera description. This name MUST NOT match a description already existing.

◆ exportDescription()

TDMR_ERROR exportDescription ( )
inline

Stores the current camera description on disk.

This function can be used to store the current settings of a camera description permanently so that the next time the driver is initialised these settings are restored.

When exporting a camera description a file in XML format will be written to disk.

  • On Windows® camera descriptions will be stored under PUBLIC%/Documents/Balluff/ImpactAcquire/CameraFiles (or MVIMPACT_ACQUIRE_DATA_DIR%/CameraFiles, which will point to the same folder)
  • On Unix based systems this directory will be /opt/ImpactAcquire/data/camerafiles
  • On other platforms these files will end up in the current working directory.

This behaviour can be modified by writing the the property mv.impact.acquire.Device.customDataDirectory before initialising the device.

See also
mv.impact.acquire.CameraDescriptionBase.copyDescription,
mv.impact.acquire.CameraDescriptionBase.importDescription
Returns

◆ getEnumerable< T >()

IEnumerable< T > getEnumerable< T > ( )
inlineinherited

Returns an enumerator of a certain type that iterates through the collection.

This interface will allow to e.g. write code like this:

Info info = new Info(pDev);
foreach (Property c in info.getEnumerable<Property>())
{
validateProperty(c);
}
A class to query various general information about the device, its driver and other information.
Definition Info.cs:10
A base class for properties.
Definition Property.cs:109

See the framework's documentation about the System.Collections.IEnumerable interface for more information.

Returns
An enumerator that iterates through the collection

◆ GetEnumerator()

IEnumerator< int > GetEnumerator ( )
inlineinherited

Returns an enumerator that iterates through the collection.

See the framework's documentation about the System.Collections.IEnumerable interface for more information.

Returns
An enumerator that iterates through the collection

◆ importDescription()

TDMR_ERROR importDescription ( )
inline

Updates a camera description with the data stored in a previous session or with the original default data.

When importing a camera description the device driver will try to retrieve the parameters needed from a XML file.

  • On Windows® camera descriptions MUST be stored under PUBLIC%/Documents/Balluff/ImpactAcquire/CameraFiles (or MVIMPACT_ACQUIRE_DATA_DIR%/CameraFiles, which will point to the same folder)
  • n Unix based systems this directory will be /opt/ImpactAcquire/data/camerafiles
  • On other platforms these files MUST be located in the current working directory.

This behaviour can be modified by writing the the property mv.impact.acquire.Device.customDataDirectory before initialising the device. To get access to a XML description file within the application, these file must be copied to this directory BEFORE the device is initialised. During the init process the device driver will process every file located under this location and will add them to the internal list of descriptions. Every camera located during this process and also descriptions created later on during the program operation can be selected via the property mv.impact.acquire.CameraSettingsFrameGrabber.type.

Note
In order not to bloat the device driver with redundant data it's wise only to store the descriptions needed for the application to run under this location.
Only camera descriptions supported by the capture device will be added to the device drivers internal list and will therefore be accessible via the mv.impact.acquire.CameraDescriptionManager.

To restore the default values valid during the driver was initialised the function mv.impact.acquire.ComponentCollection.restoreDefault can be used as well.

See also
mv.impact.acquire.CameraDescriptionBase.exportDescription,
mv.impact.acquire.CameraDescriptionBase.copyDescription
Returns

◆ restoreDefault()

void restoreDefault ( )
inlineinherited

Restores the default for every component of this collection.

Calling this function will restore the default value for every component belonging to this collection.

Note
The caller must have the right to modify the component. Otherwise an exception will be thrown.

Member Data Documentation

◆ aoiHeight

readonly PropertyI aoiHeight = new PropertyI()

An integer property defining the number of active lines to capture from the camera.

◆ aoiStartX

readonly PropertyI aoiStartX = new PropertyI()

An integer property defining the X-offset in pixels to the first active pixel to capture.

◆ aoiStartY

readonly PropertyI aoiStartY = new PropertyI()

An integer property defining the Y-offset in lines to the first active line to capture.

◆ aoiWidth

readonly PropertyI aoiWidth = new PropertyI()

An integer property defining the number of active pixels to capture per line.

◆ interlacedType

An enumerated integer property defining how the camera transmits image data.

Valid values for this property are defined by the enumeration mv.impact.acquire.TCameraInterlacedType.

◆ name

readonly PropertyS name = new PropertyS()

A string property (read-only) containing the name of this camera description list.

◆ videoOutput

readonly EnumPropertyI<TCameraOutput> videoOutput = new EnumPropertyI<TCameraOutput>()

An enumerated integer property defining the type of video outputs this camera offers.

Valid values for this property are defined by the enumeration mv.impact.acquire.TCameraOutput.

Note
This property will be read-only for camera descriptions of type mv.impact.acquire.CameraDescriptionCameraLink and mv.impact.acquire.CameraDescriptionSDI as for these camera types the video output depends on certain other parameters according to the corresponding standard.

Property Documentation

◆ className

String className
get

Returns the class this description is belonging to.

Returns
The class this description is belonging to.

◆ componentEnumerable

IEnumerable<Component> componentEnumerable
getinherited

Returns an enumerator that iterates through the collection.

This interface will allow to e.g. write code like this:

Info info = new Info(pDev);
foreach (Component c in info.componentEnumerable)
{
Console.WriteLine("{0}", c.name);
}
String name
Returns the name of the component referenced by this object.
Definition ComponentAccess.cs:167
IEnumerable< Component > componentEnumerable
Returns an enumerator that iterates through the collection.
Definition ComponentCollection.cs:202
A base class to implement access to internal driver components.
Definition Component.cs:133

See the framework's documentation about the System.Collections.IEnumerable interface for more information.

Returns
An enumerator that iterates through the collection

◆ componentListEnumerable

IEnumerable<ComponentList> componentListEnumerable
getinherited

Returns an enumerator that iterates through all the mv.impact.acquire.ComponentList elements in the collection.

This interface will allow to e.g. write code like this:

Info info = new Info(pDev);
{
Console.WriteLine("{0}", cl.name);
}
IEnumerable< ComponentList > componentListEnumerable
Returns an enumerator that iterates through all the mv.impact.acquire.ComponentList elements in the c...
Definition ComponentCollection.cs:229
A class to provide access to component lists.
Definition ComponentList.cs:14

See the framework's documentation about the System.Collections.IEnumerable interface for more information.

Returns
An enumerator that iterates through the collection

◆ hObj

int hObj
getinherited

Returns a unique identifier for the component collection referenced by this object.

This handle will always reference an object of type mv.impact.acquire.ComponentList.

Returns
A unique identifier for the component referenced by this object.