#include <adapterBase.hpp>
Public Member Functions | |
| AdapterBase () | |
| virtual | ~AdapterBase () |
| virtual std::map< std::string, Parameter > | Connect ()=0 |
| virtual void | Disconnect ()=0 |
| virtual CheckResult | CheckConnection () const =0 |
| virtual bool | IsConnected () const =0 |
| virtual std::string | GetProtocol () const =0 |
| Get the protocol name used by this adapter. | |
| virtual BasicParams | GetBasicParams () const =0 |
| Get basic camera parameters in standardized units. Adapters read their native parameters and convert to common units. | |
| virtual void | Initialise (const ReceiveCfg &cfg) |
| virtual void | ReceiveFrame (bool &received_frame, uint64_t max_size, std::span< uint8_t > &data, FrameInfo &frame_info)=0 |
| virtual Parameter | Read (const std::string &name)=0 |
| Read a single parameter from the camera. | |
| virtual std::vector< Parameter > | Read (const std::vector< std::string > &names)=0 |
| Read multiple parameters from the camera. | |
| virtual void | Write (const Parameter ¶meter)=0 |
| Write a single parameter to the camera. | |
| virtual void | Write (const std::vector< Parameter > ¶meters)=0 |
| Write multiple parameters to the camera. | |
| virtual std::vector< Parameter > | Scan ()=0 |
| Scan all available parameters from the camera Re-scans the device parameter space, updates the namespace repository, and returns all discovered parameters. | |
| virtual NativeDocument | GetNativeParameterDocument () const |
| Get native parameter document from camera (protocol-specific) For GenICam cameras, returns the XML register description. Default implementation returns empty NativeDocument (not supported). | |
| virtual AcquisitionState | GetAcquisitionState () const =0 |
| Get the current acquisition state. | |
| virtual void | StartAcquisition (std::optional< int64_t > frame_count=std::nullopt)=0 |
| Start frame acquisition. | |
| virtual void | StopAcquisition ()=0 |
| Stop frame acquisition. | |
| void | SetAddress (const std::string &address) |
| Set the camera address/URI for connection. | |
| void | SetTimeout (double timeout_seconds) |
| Set the connection timeout. | |
Static Public Member Functions | |
| static std::string | ResolveAddress (const std::string &address, bool allow_device_id=false) |
Protected Attributes | |
| const std::chrono::duration< double_t > | m_connect_timeout {std::chrono::seconds(10)} |
| std::string | m_cam_address |
| std::chrono::duration< double_t > | m_timeout |
| bool | m_initialised {false} |
| std::chrono::time_point< std::chrono::system_clock > | m_time_last_stop {common::TimeNow()} |
| std::chrono::time_point< std::chrono::system_clock > | m_time_last_frame_recv {m_time_last_stop} |
| bool | m_waiting_for_frame {false} |
| camcom::common::AdapterBase::AdapterBase | ( | ) |
|
virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Get the current acquisition state.
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
pure virtual |
Get basic camera parameters in standardized units. Adapters read their native parameters and convert to common units.
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
inlinevirtual |
Get native parameter document from camera (protocol-specific) For GenICam cameras, returns the XML register description. Default implementation returns empty NativeDocument (not supported).
Reimplemented in camcom::genicam::GenICamAdapter.
|
pure virtual |
Get the protocol name used by this adapter.
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
virtual |
|
pure virtual |
|
pure virtual |
Read a single parameter from the camera.
| name | Name of the parameter to read |
| std::runtime_error | if parameter not found or read fails |
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
pure virtual |
Read multiple parameters from the camera.
| names | Vector of parameter names to read |
| std::runtime_error | if any parameter not found or read fails |
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
pure virtual |
|
static |
|
pure virtual |
Scan all available parameters from the camera Re-scans the device parameter space, updates the namespace repository, and returns all discovered parameters.
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
inline |
Set the camera address/URI for connection.
| address | Camera address (IP, serial number, URI, etc.) |
|
inline |
Set the connection timeout.
| timeout_seconds | Timeout in seconds |
|
pure virtual |
Start frame acquisition.
| frame_count | Number of frames to acquire, or std::nullopt for continuous
|
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
pure virtual |
Stop frame acquisition.
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
pure virtual |
Write a single parameter to the camera.
| parameter | Parameter object containing name, value, and type to write |
| std::runtime_error | if parameter not found or write fails |
Implemented in camcom::common::TestAdapter, camcom::genicam::GenICamAdapter, camcom::genicam::GenICamEmulator, camcom::server::MockAdapter, and camcom::sim::SimAdapter.
|
pure virtual |
Write multiple parameters to the camera.
| parameters | Vector of Parameter objects to write |
| std::runtime_error | if any parameter not found or write fails |
Implemented in camcom::common::TestAdapter.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |