CVB.Net 14.0
ReaderConfig Class Reference

Barcode reader object. More...

Inherits INativeHandle, and IDictionary< Symbology, Base >.

Public Member Functions

void Dispose ()
 IDisposable implementation.
 
bool ContainsKey (Symbology key)
 Determines whether the dictionary contains a configuration for the given symbology. More...
 
bool TryGetValue (Symbology key, out Base value)
 Tries to get the configuration associated with the given symbology. More...
 
void Add (KeyValuePair< Symbology, Base > item)
 Adds a configuration to the dictionary. More...
 
void Clear ()
 Removes all configurations.
 
bool Contains (KeyValuePair< Symbology, Base > item)
 Check if a given configuration is part of the dictionary. More...
 
void CopyTo (KeyValuePair< Symbology, Base >[] array, int arrayIndex)
 Copy the current dictionary into an array. More...
 
bool Remove (KeyValuePair< Symbology, Base > item)
 Remove a configuration. More...
 
IEnumerator< KeyValuePair< Symbology, Base > > GetEnumerator ()
 Get dictionary enumerator. More...
 
 ReaderConfig (ReaderInitialization initMode)
 Barcode reader initialization. More...
 
 ReaderConfig (string fileName)
 Load a reader configuration from disk. More...
 
void Save (string fileName)
 Write the reader configuration to a file. More...
 
TConfig Configuration< TConfig > ()
 Access one of the current configurations of the barcode reader. Trying to access a configuration that is not available will result in a return value of null. More...
 
void Add (Symbology sym, Base config)
 Set a new barcode configuration for a given symbology. Set configuration to null to delete it. More...
 
void Add (Symbology sym)
 Add default configuration for a Symbology. More...
 
void Add< TConfig > (TConfig config)
 Set a new barcode configuration. Effect is the same as if calling More...
 
bool Remove (Symbology sym)
 Remove the configuration for the given symbology. More...
 
bool Remove< TConfig > ()
 Remove the configuration for symbology. Effect is the same as if calling More...
 

Static Public Attributes

static readonly TimeSpan MaxTimeLimit = TimeSpan.FromMilliseconds(short.MaxValue)
 Maximum time limit that may be specified.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 IDisposable helper function. More...
 

Properties

IntPtr Handle [get]
 Native Color filter handle. More...
 
bool IsDisposed [get]
 Tests if the native handle has already been disposed.
 
Readout ReadoutMode [get, set]
 Readout and search mode for barcodes in the image.
 
short ReadoutStripeDistance [get, set]
 Readout definition for the readout modes Ladder, Fence and FenceOrLadder.
 
short OmniDirectionalReadoutStripeCount [get, set]
 Number of readout stripes (only used in omni directional readout mode).
 
short OmniDirectionalReadoutAngleCount [get, set]
 Number of readout angles (only used in omni directional readout mode).
 
bool CheckCodePosition [get, set]
 Activates or deactivates the code position checks.
 
TimeSpan TimeLimit [get, set]
 upper limit for the amount of time the tool may take for a single run.
 
string FileName [get]
 Name of the file from which this reader was loaded (string.Empty if this reader was neither loaded nor saved since its construction). More...
 
ICollection< SymbologyKeys [get]
 Collection of keys in the configuration.
 
ICollection< BaseValues [get]
 Collection of values in the configuration.
 
int Count [get]
 Number of currently active configurations.
 
bool IsReadOnly [get]
 Read only flag
 
Base this[Symbology sym] [get, set]
 Access the currently configured symbologies. More...
 
- Properties inherited from INativeHandle
IntPtr Handle [get]
 The native handle of the object.
 
bool IsDisposed [get]
 Possibility to check whether the object has already been disposed of.
 

Events

NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Barcode reader object.

Constructor & Destructor Documentation

◆ ReaderConfig() [1/2]

Barcode reader initialization.

Parameters
initModeInitialization to read all or none.
Exceptions
OutOfMemoryExceptionif the process ran out of available reader configurations (currently a process may use no more than 1000 configurations); if your application runs out of configurations, dispose unused Reader objects

◆ ReaderConfig() [2/2]

ReaderConfig ( string  fileName)

Load a reader configuration from disk.

Parameters
fileNameFile to load the configuration from.
Exceptions
FileNotFoundExceptionIf the classifier file does not exist
FileLoadExceptionIf loading an existing classifier file failed
ArgumentNullExceptionIf fileName is null

Member Function Documentation

◆ Add() [1/3]

void Add ( KeyValuePair< Symbology, Base item)

Adds a configuration to the dictionary.

Parameters
itemConfiguration to be added.

◆ Add() [2/3]

void Add ( Symbology  sym)

Add default configuration for a Symbology.

Parameters
symSymbology to be added.

◆ Add() [3/3]

void Add ( Symbology  sym,
Base  config 
)

Set a new barcode configuration for a given symbology. Set configuration to null to delete it.

Parameters
symSymbology to set the configuration for.
configConfiguration to set.
Exceptions
InvalidOperationExceptionwhen trying to set a configuration for the symbology "None" or when trying to set a configuration that does not match the selected symbology

◆ Add< TConfig >()

void Add< TConfig > ( TConfig  config)

Set a new barcode configuration. Effect is the same as if calling

Set(Symbology sym, Configuration.Base config) with the corresponding symbology enumeration value.

Template Parameters
TConfigtype of configuration to set
Parameters
configconfiguration
Type Constraints
TConfig :Configuration.Base 

◆ Configuration< TConfig >()

TConfig Configuration< TConfig > ( )

Access one of the current configurations of the barcode reader. Trying to access a configuration that is not available will result in a return value of null.

Template Parameters
TConfigConfiguration type to access
Returns
currently set configuration or null
Type Constraints
TConfig :Configuration.Base 

◆ Contains()

bool Contains ( KeyValuePair< Symbology, Base item)

Check if a given configuration is part of the dictionary.

Parameters
itemconfiguration to check for
Returns
true if the configuration was found, false otherwise

◆ ContainsKey()

bool ContainsKey ( Symbology  key)

Determines whether the dictionary contains a configuration for the given symbology.

Parameters
keysymbology to check for
Returns
true if the dictionary contains a configuration for the given symbology, false otherwise

◆ CopyTo()

void CopyTo ( KeyValuePair< Symbology, Base >[]  array,
int  arrayIndex 
)

Copy the current dictionary into an array.

Parameters
arrayarray to copy to
arrayIndexstart index in the array

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDisposable helper function.

Parameters
disposing

◆ GetEnumerator()

IEnumerator< KeyValuePair< Symbology, Base > > GetEnumerator ( )

Get dictionary enumerator.

Returns
IEnumerator<T> for this object.

◆ Remove() [1/2]

bool Remove ( KeyValuePair< Symbology, Base item)

Remove a configuration.

Parameters
itemconfiguration to remove
Returns
true if the configuration was removes, false otherwise

◆ Remove() [2/2]

bool Remove ( Symbology  sym)

Remove the configuration for the given symbology.

Parameters
symSymbology to remove from the current set of configurations.
Returns
true if the symbology was previously set and is now removed; false if the symbology wasn't configured previously.

◆ Remove< TConfig >()

bool Remove< TConfig > ( )

Remove the configuration for symbology. Effect is the same as if calling

Remove(Symbology sym) with the corresponding symbology enum.

Template Parameters
TConfigconfiguration type to remove
Returns
true if the symbology was previously set and is now removed; false if the symbology wasn't configured previously.
Type Constraints
TConfig :Configuration.Base 

◆ Save()

void Save ( string  fileName)

Write the reader configuration to a file.

Parameters
fileName
Exceptions
ObjectDisposedExceptionIf the reader has already been disposed
ArgumentNullExceptionwhen fileName is null


◆ TryGetValue()

bool TryGetValue ( Symbology  key,
out Base  value 
)

Tries to get the configuration associated with the given symbology.

Parameters
keysymbology for which to query
valueconfiguration
Returns
true if a configuration for the given symbology was found, false otherwise

Property Documentation

◆ FileName

string FileName
get

Name of the file from which this reader was loaded (string.Empty if this reader was neither loaded nor saved since its construction).

Exceptions
ObjectDisposedExceptionIf the reader has already been disposed

◆ Handle

IntPtr Handle
get

Native Color filter handle.

It is normally not necessary to work with this handle in CVB.Net. Note that using this handle in connection with the legacy CVB managed wrappers may actually be disruptive to your application.

Implements INativeHandle.

◆ this[Symbology sym]

Base this[Symbology sym]
getset

Access the currently configured symbologies.

Parameters
symsymbology to access
Returns
current configuration for the given symbology
Exceptions
KeyNotFoundExceptionif no configuration for the queried symbology has been defined

Event Documentation

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.