SeekDAS S100M4X C++ SDK 0.2.0
seekdas.hpp: C++17 interface over the Rust SDK
Loading...
Searching...
No Matches
seekdas::Device Class Reference

#include <seekdas.hpp>

Public Member Functions

 Device (const std::string &ip="192.168.1.128", std::uint16_t host_port=5000)
 connect to the device (checks the ID); the device then sends its data to this host
 Device (const DeviceOptions &o)
DeviceInfo info ()
 -— identification and status
double sample_rate_hz ()
 sample clock measured on the board (nominal 100e6); converts time stamps (T/64) to seconds
BoardStatus board_status ()
NetStatus net_status ()
AcqStatus acq_status ()
std::uint32_t read_reg (std::uint16_t addr)
 -— registers (byte addresses, 32-bit words)
std::vector< std::uint32_t > read_regs (std::uint16_t addr, std::size_t count)
std::uint32_t write_reg (std::uint16_t addr, std::uint32_t value)
 returns the value read back after the write
WindowStats read_window (Window w, Channel input)
 -— monitoring outside the CONV path
RawCapture raw_capture (int decimation_log2=0)
void start_trigger (const Trigger &t)
 -— trigger: target + CONV inputs, start, state, data
TriggerState trigger_state ()
 state of the trigger; may be called at any time, also while a run is active
bool trigger_running ()
std::optional< Capture > poll_trigger (std::chrono::milliseconds timeout)
 receive the data of the started trigger for up to timeout: the complete capture once the whole run has arrived, otherwise nothing (call again; what arrived is kept).
Capture wait_trigger (std::chrono::milliseconds idle_timeout=std::chrono::seconds(10))
 wait for the whole run; throws TimeoutError if no point arrives for idle_timeout (no CONV edges?).
Capture run_trigger (const Trigger &t, std::chrono::milliseconds idle_timeout=std::chrono::seconds(10))
 start, then wait for the whole run
void stop ()
 stop the run now (always allowed); the points produced so far are still delivered
void configure (const Config &cfg)
 -— full control: configuration, one-call runs, packet by packet all of these throw BusyError while a run is active
Capture acquire (const Config &cfg)
Capture acquire_for (const Config &cfg, std::chrono::milliseconds duration)
void start ()
 start with the configuration written by configure(); then recv() until stream_finished(), then finish()
std::optional< Packet > recv (std::chrono::milliseconds timeout)
bool stream_finished ()
RunSummary finish ()
template<class F>
RunSummary stream (const Config &cfg, F &&on_packet)
 configure, start, call on_packet(const Packet &) for every packet in sequence, finish
seekdas_device * native () noexcept

Detailed Description

Definition at line 519 of file seekdas.hpp.

Constructor & Destructor Documentation

◆ Device() [1/2]

seekdas::Device::Device ( const std::string & ip = "192.168.1.128",
std::uint16_t host_port = 5000 )
inlineexplicit

connect to the device (checks the ID); the device then sends its data to this host

Definition at line 522 of file seekdas.hpp.

◆ Device() [2/2]

seekdas::Device::Device ( const DeviceOptions & o)
inlineexplicit

Definition at line 527 of file seekdas.hpp.

Member Function Documentation

◆ info()

DeviceInfo seekdas::Device::info ( )
inline

-— identification and status

Definition at line 534 of file seekdas.hpp.

◆ sample_rate_hz()

double seekdas::Device::sample_rate_hz ( )
inline

sample clock measured on the board (nominal 100e6); converts time stamps (T/64) to seconds

Definition at line 545 of file seekdas.hpp.

◆ board_status()

BoardStatus seekdas::Device::board_status ( )
inline

Definition at line 546 of file seekdas.hpp.

◆ net_status()

NetStatus seekdas::Device::net_status ( )
inline

Definition at line 557 of file seekdas.hpp.

◆ acq_status()

AcqStatus seekdas::Device::acq_status ( )
inline

Definition at line 566 of file seekdas.hpp.

◆ read_reg()

std::uint32_t seekdas::Device::read_reg ( std::uint16_t addr)
inline

-— registers (byte addresses, 32-bit words)

Definition at line 569 of file seekdas.hpp.

◆ read_regs()

std::vector< std::uint32_t > seekdas::Device::read_regs ( std::uint16_t addr,
std::size_t count )
inline

Definition at line 570 of file seekdas.hpp.

◆ write_reg()

std::uint32_t seekdas::Device::write_reg ( std::uint16_t addr,
std::uint32_t value )
inline

returns the value read back after the write

Definition at line 576 of file seekdas.hpp.

◆ read_window()

WindowStats seekdas::Device::read_window ( Window w,
Channel input )
inline

-— monitoring outside the CONV path

Definition at line 583 of file seekdas.hpp.

◆ raw_capture()

RawCapture seekdas::Device::raw_capture ( int decimation_log2 = 0)
inline

Definition at line 588 of file seekdas.hpp.

◆ start_trigger()

void seekdas::Device::start_trigger ( const Trigger & t)
inline

-— trigger: target + CONV inputs, start, state, data

start_trigger writes the set-up and starts the run. It throws BusyError if a run is active (started from this or any other host, or the data of this object's previous trigger has not all been received); the running acquisition is not touched then.

Definition at line 600 of file seekdas.hpp.

◆ trigger_state()

TriggerState seekdas::Device::trigger_state ( )
inline

state of the trigger; may be called at any time, also while a run is active

Definition at line 602 of file seekdas.hpp.

◆ trigger_running()

bool seekdas::Device::trigger_running ( )
inline

Definition at line 614 of file seekdas.hpp.

◆ poll_trigger()

std::optional< Capture > seekdas::Device::poll_trigger ( std::chrono::milliseconds timeout)
inline

receive the data of the started trigger for up to timeout: the complete capture once the whole run has arrived, otherwise nothing (call again; what arrived is kept).

Keep calling while the run is active: the data flows only during these calls (the device buffers 128 MB meanwhile).

Definition at line 618 of file seekdas.hpp.

◆ wait_trigger()

Capture seekdas::Device::wait_trigger ( std::chrono::milliseconds idle_timeout = std::chrono::seconds(10))
inline

wait for the whole run; throws TimeoutError if no point arrives for idle_timeout (no CONV edges?).

The run then stays active: wait again, or stop().

Definition at line 625 of file seekdas.hpp.

◆ run_trigger()

Capture seekdas::Device::run_trigger ( const Trigger & t,
std::chrono::milliseconds idle_timeout = std::chrono::seconds(10) )
inline

start, then wait for the whole run

Definition at line 639 of file seekdas.hpp.

◆ stop()

void seekdas::Device::stop ( )
inline

stop the run now (always allowed); the points produced so far are still delivered

Definition at line 645 of file seekdas.hpp.

◆ configure()

void seekdas::Device::configure ( const Config & cfg)
inline

-— full control: configuration, one-call runs, packet by packet all of these throw BusyError while a run is active

Definition at line 649 of file seekdas.hpp.

◆ acquire()

Capture seekdas::Device::acquire ( const Config & cfg)
inline

Definition at line 650 of file seekdas.hpp.

◆ acquire_for()

Capture seekdas::Device::acquire_for ( const Config & cfg,
std::chrono::milliseconds duration )
inline

Definition at line 651 of file seekdas.hpp.

◆ start()

void seekdas::Device::start ( )
inline

start with the configuration written by configure(); then recv() until stream_finished(), then finish()

Definition at line 657 of file seekdas.hpp.

◆ recv()

std::optional< Packet > seekdas::Device::recv ( std::chrono::milliseconds timeout)
inline

Definition at line 658 of file seekdas.hpp.

◆ stream_finished()

bool seekdas::Device::stream_finished ( )
inline

Definition at line 670 of file seekdas.hpp.

◆ finish()

RunSummary seekdas::Device::finish ( )
inline

Definition at line 671 of file seekdas.hpp.

◆ stream()

template<class F>
RunSummary seekdas::Device::stream ( const Config & cfg,
F && on_packet )
inline

configure, start, call on_packet(const Packet &) for every packet in sequence, finish

Definition at line 673 of file seekdas.hpp.

◆ native()

seekdas_device * seekdas::Device::native ( )
inlinenoexcept

Definition at line 681 of file seekdas.hpp.


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