The device class encapsulates a Genicam device.
More...
#include <device.h>
The device class encapsulates a Genicam device.
NOTE: A GenTLException is thrown in case of a severe error.
Definition at line 56 of file device.h.
◆ ACCESS
Enumerator |
---|
READONLY | |
CONTROL | |
EXCLUSIVE | |
Definition at line 60 of file device.h.
◆ Device() [1/2]
rcg::Device::Device |
( |
const std::shared_ptr< Interface > & |
parent, |
|
|
const std::shared_ptr< const GenTLWrapper > & |
gentl, |
|
|
const char * |
id |
|
) |
| |
Constructs a device class.
Devices must only be created by the interface class.
Definition at line 49 of file device.cc.
◆ ~Device()
◆ Device() [2/2]
rcg::Device::Device |
( |
class Device & |
| ) |
|
|
private |
◆ abortWaitingForModuleEvents()
void rcg::Device::abortWaitingForModuleEvents |
( |
| ) |
|
Aborts waiting for module events.
Definition at line 378 of file device.cc.
◆ close()
void rcg::Device::close |
( |
| ) |
|
Closes the device.
Each call of open() must be followed by a call to close() at some point in time.
Definition at line 142 of file device.cc.
◆ enableModuleEvents()
void rcg::Device::enableModuleEvents |
( |
| ) |
|
Enable module events for the local device.
Does nothing if they are already enabled.
Definition at line 175 of file device.cc.
◆ getAccessStatus()
std::string rcg::Device::getAccessStatus |
( |
| ) |
|
Returns the access status of the device.
NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.
- Returns
- Access status.
Definition at line 506 of file device.cc.
◆ getAvailableModuleEvents()
int rcg::Device::getAvailableModuleEvents |
( |
| ) |
|
Returns the number of module events that are currently in the queue.
This returns 0 if modules events have not been enabled.
- Returns
- Module event count.
Definition at line 188 of file device.cc.
◆ getDisplayName()
std::string rcg::Device::getDisplayName |
( |
| ) |
|
Returns the display name of the device.
NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.
- Returns
- Display name.
Definition at line 489 of file device.cc.
◆ getHandle()
void * rcg::Device::getHandle |
( |
| ) |
const |
Get internal interface handle.
- Returns
- Internal handle.
Definition at line 684 of file device.cc.
◆ getID()
const std::string & rcg::Device::getID |
( |
| ) |
const |
Get the internal ID of this device.
- Returns
- ID.
Definition at line 82 of file device.cc.
◆ getModel()
std::string rcg::Device::getModel |
( |
| ) |
|
◆ getModuleEvent()
Gets the next module event for the device and attaches it to the local device nodemap.
NOTE: This can be called from a different thread to wait for the event.
- Parameters
-
timeout | Timeout in ms. A value < 0 sets waiting time to infinite. |
- Returns
- Event ID or -1 if the method returned due to timeout, -2 if waiting was interrupted due to calling abortWaitingForModuleEvents(), -3 if module events have not been enabled.
Definition at line 243 of file device.cc.
◆ getNodeMap()
Returns the node map of this object.
NOTE: open() must be called before calling this method. The returned pointer remains valid until close() of this object is called.
- Parameters
-
xml | Path and name for storing the received XML file. An empty string for using the filename on the device or 0 if xml file should not be stored. |
- Returns
- Node map of this object.
Definition at line 639 of file device.cc.
◆ getParent()
std::shared_ptr< Interface > rcg::Device::getParent |
( |
| ) |
const |
Returns the pointer to the parent interface object.
- Returns
- Pointer to parent interface object.
Definition at line 77 of file device.cc.
◆ getRemoteNodeMap()
Returns the node map of the remote device.
NOTE: open() must be called before calling this method. The returned pointer remains valid until close() of this object is called.
- Parameters
-
xml | Path and name for storing the received XML file. An empty string for using the filename on the device or 0 if xml file should not be stored. |
- Returns
- Node map of this object.
Definition at line 652 of file device.cc.
◆ getRemotePort()
std::shared_ptr< CPort > rcg::Device::getRemotePort |
( |
| ) |
|
Returns the remote port that is used by the remote node map to read and write registers.
- Returns
- Remote port.
Definition at line 668 of file device.cc.
◆ getSerialNumber()
std::string rcg::Device::getSerialNumber |
( |
| ) |
|
Returns the serial number of the device.
NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.
- Returns
- Serial number.
Definition at line 607 of file device.cc.
◆ getStreams()
std::vector< std::shared_ptr< Stream > > rcg::Device::getStreams |
( |
| ) |
|
Returns the currently available streams of this device.
NOTE: The device must have been opened with the open() call before calling this method.
- Returns
- List of streams.
Definition at line 406 of file device.cc.
◆ getTimestampFrequency()
uint64_t rcg::Device::getTimestampFrequency |
( |
| ) |
|
Returns the timestamp frequency of the device.
NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.
- Returns
- Tick-frequency of the time stamp clock.
Definition at line 619 of file device.cc.
◆ getTLType()
std::string rcg::Device::getTLType |
( |
| ) |
|
Returns the transport layer type of the device.
NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.
- Returns
- Transport layer type.
Definition at line 483 of file device.cc.
◆ getUserDefinedName()
std::string rcg::Device::getUserDefinedName |
( |
| ) |
|
Returns the user defined name of the device.
NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.
- Returns
- User defined name.
Definition at line 566 of file device.cc.
◆ getVendor()
std::string rcg::Device::getVendor |
( |
| ) |
|
◆ getVersion()
std::string rcg::Device::getVersion |
( |
| ) |
|
◆ open()
void rcg::Device::open |
( |
ACCESS |
access | ) |
|
Opens the device for working with it.
The interface may be opened multiple times. However, for each open(), the close() method must be called as well.
- Parameters
-
Definition at line 87 of file device.cc.
◆ operator=()
◆ cport
std::shared_ptr<CPort> rcg::Device::cport |
|
private |
◆ dev
◆ event
◆ event_buffer
std::vector<uint8_t> rcg::Device::event_buffer |
|
private |
◆ event_value
std::vector<uint8_t> rcg::Device::event_value |
|
private |
◆ eventadapter
◆ gentl
◆ id
std::string rcg::Device::id |
|
private |
◆ mtx
std::mutex rcg::Device::mtx |
|
private |
◆ n_open
◆ nodemap
◆ parent
std::shared_ptr<Interface> rcg::Device::parent |
|
private |
◆ rnodemap
◆ rp
◆ rport
std::shared_ptr<CPort> rcg::Device::rport |
|
private |
◆ slist
std::vector<std::weak_ptr<Stream> > rcg::Device::slist |
|
private |
The documentation for this class was generated from the following files: