Class PvGenFile
Allows reading/writing to files hosted on the device.
Implements
Inherited Members
Namespace: eBUSDotNet
Assembly: eBUSDotNet.dll
Syntax
public class PvGenFile : IDisposable
Remarks
These files could be debug information, look-up tables, new firmware, configuration files, persistent configurations or just about anything.
Constructors
View SourcePvGenFile()
Constructor.
Declaration
public PvGenFile()
Fields
View SourceswigCMemOwn
Determines who is responsible for deleting the underlying C++ object.
Declaration
protected bool swigCMemOwn
Field Value
| Type | Description |
|---|---|
| bool |
Properties
View SourceIsOpened
Gets whether the file object is opened or not. True if it is opened and attached to a PvGenParameterArray, false if not.
Declaration
public bool IsOpened { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LastErrorMessage
Used to retrieve string-based operation of the last operation on a PvGenFile.
Declaration
public string LastErrorMessage { get; }
Property Value
| Type | Description |
|---|---|
| string | Error message associated with the last PvException operation on a PvGenFile. |
Remarks
Use this method to retrieve detailed information about the last failed operation that throws GENERIC_ERROR exception.
EOFs and other status are not considered errors and are monitored through the GetStatus method.
Methods
View SourceClose()
Closes the PvGenFile.
Declaration
public PvResult Close()
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Dispose()
Dispose.
Declaration
public void Dispose()
Dispose(bool)
Dispose
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
~PvGenFile()
Destructor.
Declaration
protected ~PvGenFile()
GetFiles(ref PvGenParameterArray, ref PvStringList)
Returns all files currently supported by a GenICam interface.
Declaration
public static void GetFiles(ref PvGenParameterArray aArray, ref PvStringList aFiles)
Parameters
| Type | Name | Description |
|---|---|---|
| PvGenParameterArray | aArray | The GenICam parameter array. |
| PvStringList | aFiles | A string array that is filled with all available files. |
GetProgress(out long, out long)
Returns progress about the current read or write operation.
Declaration
public PvResult GetProgress(out long aCompleted, out long aTotal)
Parameters
| Type | Name | Description |
|---|---|---|
| long | aCompleted | How many bytes have been read or written. |
| long | aTotal | Total byte count for the read or write operation. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
GetStatus(out string)
Returns the status of the last operation on a PvGenFile.
Declaration
public PvResult GetStatus(out string aStatus)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aStatus | Last status from a read or write operation. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
IsReadable(ref PvGenParameterArray, string)
Returns true if a file defined by the GenICam interface can be read.
Declaration
public static bool IsReadable(ref PvGenParameterArray aArray, string aFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| PvGenParameterArray | aArray | The GenICam parameter array. |
| string | aFilename | The file we are testing readability on. |
Returns
| Type | Description |
|---|---|
| bool | True if the file exist and is readable. |
IsSupported(ref PvGenParameterArray)
Static method used to query if a #PvGenParameterArray supports file access
Declaration
public static bool IsSupported(ref PvGenParameterArray aArray)
Parameters
| Type | Name | Description |
|---|---|---|
| PvGenParameterArray | aArray | The eBUS SDK GenApi parameter array to test. |
Returns
| Type | Description |
|---|---|
| bool | True if supported, false if not. |
IsWritable(ref PvGenParameterArray, string)
Returns true if a file defined by the GenICam interface can be written.
Declaration
public static bool IsWritable(ref PvGenParameterArray aArray, string aFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| PvGenParameterArray | aArray | The eBUS SDK GenApi parameter array. |
| string | aFilename | The file we are testing writability on. |
Returns
| Type | Description |
|---|---|
| bool | True if the file exist and is writable. |
Open(ref PvGenParameterArray, string, PvGenOpenMode)
Opens a file through the GenICam interface.
Declaration
public PvResult Open(ref PvGenParameterArray aArray, string aFilename, PvGenOpenMode aMode)
Parameters
| Type | Name | Description |
|---|---|---|
| PvGenParameterArray | aArray | The eBUS SDK GenApi parameter array to use. |
| string | aFilename | The filename of the file to open on the device. Must match one of the pre-defined enumeration entry of the FileSelector feature. The filename is case sensitive. |
| PvGenOpenMode | aMode | Mode used to access the file. Read or write. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Read(byte[], long, out long)
Reads data from the opened device file.
Declaration
public PvResult Read(byte[] aBuffer, long aLength, out long aBytesRead)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | aBuffer | Pointer to the buffer where to write the data read from the device file. |
| long | aLength | Number of bytes to read to the device file. |
| long | aBytesRead | Number of bytes successfully read from the device file. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
ReadTo(string)
Reads a complete device file and writes it to a local file.
Declaration
public PvResult ReadTo(string aLocalFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aLocalFilename | The full path of the local file where data read from the device file is written to. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Write(byte[], long, out long)
Writes data to the opened device file.
Declaration
public PvResult Write(byte[] aBuffer, long aLength, out long aBytesWritten)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | aBuffer | Pointer to the data to write to the device file. |
| long | aLength | Number of bytes to write to the device file. |
| long | aBytesWritten | Number of bytes successfully written to the device file. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
WriteFrom(string)
Writes a complete local file to the opened device file.
Declaration
public PvResult WriteFrom(string aLocalFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aLocalFilename | The full path of the local file to write to the device file. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|