IDS peak genericC++ v1.15.0
Loading...
Searching...
No Matches
peak::core::Device Class Reference

Represents a GenTL Device module, i.e. a local virtual Device proxy for the actual hardware RemoteDevice. More...

#include <peak/device/peak_device.hpp>

Inheritance diagram for peak::core::Device:
peak::core::EventSupportingModule peak::core::Module

Public Member Functions

 Device ()=delete
 ~Device () override
 Device (const Device &other)=delete
Device & operator= (const Device &other)=delete
 Device (Device &&other)=delete
Device & operator= (Device &&other)=delete
std::string Key () const
 Returns the unique key.
RawInformation Info (int32_t infoCommand) const
 Delivers information based on the given GenTL info command.
std::string ID () const
 Returns the ID.
std::string DisplayName () const
 Returns the display name.
std::string VendorName () const
 Returns the vendor name.
std::string ModelName () const
 Returns the model name.
std::string Version () const
 Returns the version.
std::string TLType () const
 Returns the TL (transport layer) type.
std::string UserDefinedName () const
 Returns the user defined name.
std::string SerialNumber () const
 Returns the serial number.
DeviceAccessStatus AccessStatus () const
 Returns the access status.
uint64_t TimestampTickFrequency () const
 Returns the timestamp tick frequency.
std::shared_ptr< class RemoteDevice > RemoteDevice () const
 Returns the remote device of the device.
std::vector< std::shared_ptr< DataStreamDescriptor > > DataStreams () const
 Returns the data stream list of the device.
std::shared_ptr< Interface > ParentInterface () const
 Returns the parent interface.
PEAK_DEVICE_HANDLE Handle () const
 Get the backend handle.
Public Member Functions inherited from peak::core::EventSupportingModule
 EventSupportingModule ()=default
 ~EventSupportingModule () override=default
 EventSupportingModule (const EventSupportingModule &other)=delete
EventSupportingModule & operator= (const EventSupportingModule &other)=delete
 EventSupportingModule (EventSupportingModule &&other)=delete
EventSupportingModule & operator= (EventSupportingModule &&other)=delete
std::unique_ptr< EventController > EnableEvents (EventType type)
 Enables events of the given event type.
Public Member Functions inherited from peak::core::Module
 Module ()=default
virtual ~Module ()=default
 Module (const Module &other)=delete
Module & operator= (const Module &other)=delete
 Module (Module &&other)=delete
Module & operator= (Module &&other)=delete
std::vector< std::shared_ptr< NodeMap > > NodeMaps () const
 Returns the module's node maps.
std::shared_ptr< class Port > Port () const
 Returns the module's port.

Detailed Description

Represents a GenTL Device module, i.e. a local virtual Device proxy for the actual hardware RemoteDevice.

This class allows to query information about a GenTL Device module and to enumerate its DataStreamDescriptors, which allows to open the corresponding DataStream.

Additionally, it allows access to its RemoteDevice, i.e. the actual hardware device. To change hardware settings, you typically need to work with the NodeMap of the RemoteDevice. E.g. to change the exposure time:

// get the (first) node map of the remote device
auto remoteNodeMap = device->RemoteDevice()->NodeMaps().at(0);
// change exposure time
remoteNodeMap->FindNode<peak::core::nodes::FloatNode>("ExposureTime")->SetValue(1.5);
Represents a GenAPI float node.
Definition peak_float_node.hpp:48

Constructor & Destructor Documentation

◆ Device() [1/3]

peak::core::Device::Device ( )
delete

◆ ~Device()

peak::core::Device::~Device ( )
inlineoverride

◆ Device() [2/3]

peak::core::Device::Device ( const Device & other)
delete

◆ Device() [3/3]

peak::core::Device::Device ( Device && other)
delete

Member Function Documentation

◆ AccessStatus()

DeviceAccessStatus peak::core::Device::AccessStatus ( ) const
inline

Returns the access status.

Returns
Access status
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ DataStreams()

std::vector< std::shared_ptr< DataStreamDescriptor > > peak::core::Device::DataStreams ( ) const
inline

Returns the data stream list of the device.

Returns
Data stream list
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ DisplayName()

std::string peak::core::Device::DisplayName ( ) const
inline

Returns the display name.

Returns
Display name
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ Handle()

PEAK_DEVICE_HANDLE peak::core::Device::Handle ( ) const
inline

Get the backend handle.

Use this to use the c interface directly (not recommended)

Returns
The PEAK_DEVICE_HANDLE
Since
1.5

◆ ID()

std::string peak::core::Device::ID ( ) const
inline

Returns the ID.

Returns
ID
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Info()

RawInformation peak::core::Device::Info ( int32_t infoCommand) const
inline

Delivers information based on the given GenTL info command.

Parameters
[in]infoCommandThe GenTL info command.

This function can be used to query information going beyond the predefined info functions, based on the GenTL info commands of the corresponding module.

Example (error handling is omitted):

auto info = object->Info(GenTL::XX_INFO_XX);
// Cast depending on the delivered data type
if (info.dataType == GenTL::INFO_DATATYPE_UINT64)
{
uint64_t uint64Var = *reinterpret_cast<const uint64_t*>(info.data.data());
// Do something with the information
}
else if (infoDataTypeVar == GenTL::INFO_DATATYPE_INT64)
{
...
}
...
Returns
Raw information according to the passed info command
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Key()

std::string peak::core::Device::Key ( ) const
inline

Returns the unique key.

The returned key is unique even across different producer libraries.

Returns
Unique key
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ ModelName()

std::string peak::core::Device::ModelName ( ) const
inline

Returns the model name.

Returns
Model name
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ operator=() [1/2]

Device & peak::core::Device::operator= ( const Device & other)
delete

◆ operator=() [2/2]

Device & peak::core::Device::operator= ( Device && other)
delete

◆ ParentInterface()

std::shared_ptr< Interface > peak::core::Device::ParentInterface ( ) const
inline

Returns the parent interface.

Returns
Parent interface
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ RemoteDevice()

std::shared_ptr< class RemoteDevice > peak::core::Device::RemoteDevice ( ) const
inline

Returns the remote device of the device.

This function returns the remote device which provides the access to the physical device. In contrast, this class acts only as a proxy for the physical device.

Returns
Remote device
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ SerialNumber()

std::string peak::core::Device::SerialNumber ( ) const
inline

Returns the serial number.

Returns
Serial number
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ TimestampTickFrequency()

uint64_t peak::core::Device::TimestampTickFrequency ( ) const
inline

Returns the timestamp tick frequency.

Returns
Timestamp tick frequency in Hz
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ TLType()

std::string peak::core::Device::TLType ( ) const
inline

Returns the TL (transport layer) type.

Returns
TL type
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ UserDefinedName()

std::string peak::core::Device::UserDefinedName ( ) const
inline

Returns the user defined name.

Returns
User defined name
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ VendorName()

std::string peak::core::Device::VendorName ( ) const
inline

Returns the vendor name.

Returns
Vendor name
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

◆ Version()

std::string peak::core::Device::Version ( ) const
inline

Returns the version.

Returns
Version
Since
1.0
Exceptions
NotFoundExceptionDevice could not be found.
InternalErrorExceptionAn internal error has occurred.

The documentation for this class was generated from the following file: