|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
A connection to a stand-in T7, for tests and for running the bridge with no hardware (t7_bridge --fake). More...
#include <T7Stream.hpp>
Classes | |
| struct | Options |
Public Member Functions | |
| FakeT7Device () | |
| FakeT7Device (Options o) | |
| void | open (const std::string &ip) override |
| int64_t | serial_number () override |
| void | write_names (const std::vector< std::string > &names, const std::vector< double > &values) override |
| std::vector< double > | read_names (const std::vector< std::string > &names) override |
| Command-response reads; only valid while no stream is running. | |
| double | stream_start (const std::vector< std::string > &scan_names, int scans_per_read, double scan_rate_hz) override |
| Starts the stream; returns the scan rate the device will actually run at. | |
| Backlog | stream_read (std::vector< double > &data) override |
| Fills data with scans_per_read scans, channels interleaved. | |
| void | stream_stop () override |
| void | close () override |
| FakeT7Unit & | unit () |
| double | volts (int ain, double t) const |
| Volts on ain at t: Options::signal, else the default described above. | |
| Public Member Functions inherited from fsw::t7::T7Device | |
| virtual | ~T7Device ()=default |
Public Attributes | |
| std::string | opened_ip |
| std::vector< std::pair< std::string, double > > | writes |
| std::vector< std::string > | scan_names |
| std::vector< std::string > | reads |
| every name read_names() was asked for | |
| bool | streaming = false |
| this handle's own stream is running | |
| bool | closed = false |
| int | stop_calls = 0 |
Private Member Functions | |
| bool | owns_stream () const |
Private Attributes | |
| Options | opt_ |
| int | scans_per_read_ = 0 |
| double | rate_ = 0.0 |
| uint64_t | scan_ = 0 |
| int | reads_ = 0 |
| uint64_t | my_stream_ = 0 |
| unit stream_id this handle started; 0 = none | |
A connection to a stand-in T7, for tests and for running the bridge with no hardware (t7_bridge --fake).
By default each AIN reads a slow sine offset by its AIN number, so the GUI shows distinct lines; Options::signal replaces that. AIN14 (the internal temperature sensor) reads 25 C and TEMPERATURE_DEVICE_K agrees with it. Every call is recorded so a test can check what the session asked of the device. Device state (stream, registers) is the shared FakeT7Unit's.
Modelled on LJM and the T7 firmware: a stream start, a configuration write or a command-response read while the unit streams fails with STREAM_IS_ACTIVE (2605); a stop with no stream answers STREAM_NOT_RUNNING (1303); writing STREAM_ENABLE = 0 stops the stream from any handle; reading a stream another handle stopped times out (1306).
Definition at line 249 of file T7Stream.hpp.
|
inline |
Definition at line 270 of file T7Stream.hpp.
|
explicit |
Definition at line 318 of file T7Stream.cpp.
|
overridevirtual |
Implements fsw::t7::T7Device.
Definition at line 455 of file T7Stream.cpp.
|
overridevirtual |
Implements fsw::t7::T7Device.
Definition at line 323 of file T7Stream.cpp.
|
inlineprivate |
Definition at line 308 of file T7Stream.hpp.
|
overridevirtual |
Command-response reads; only valid while no stream is running.
Implements fsw::t7::T7Device.
Definition at line 360 of file T7Stream.cpp.
|
overridevirtual |
Implements fsw::t7::T7Device.
Definition at line 329 of file T7Stream.cpp.
|
overridevirtual |
Fills data with scans_per_read scans, channels interleaved.
Blocks until they arrive.
Implements fsw::t7::T7Device.
Definition at line 407 of file T7Stream.cpp.
|
overridevirtual |
Starts the stream; returns the scan rate the device will actually run at.
Implements fsw::t7::T7Device.
Definition at line 386 of file T7Stream.cpp.
|
overridevirtual |
Implements fsw::t7::T7Device.
Definition at line 436 of file T7Stream.cpp.
|
inline |
Definition at line 294 of file T7Stream.hpp.
| double fsw::t7::FakeT7Device::volts | ( | int | ain, |
| double | t ) const |
Volts on ain at t: Options::signal, else the default described above.
Definition at line 378 of file T7Stream.cpp.
|
overridevirtual |
Implements fsw::t7::T7Device.
Definition at line 333 of file T7Stream.cpp.
| bool fsw::t7::FakeT7Device::closed = false |
Definition at line 291 of file T7Stream.hpp.
|
private |
unit stream_id this handle started; 0 = none
Definition at line 307 of file T7Stream.hpp.
| std::string fsw::t7::FakeT7Device::opened_ip |
Definition at line 286 of file T7Stream.hpp.
|
private |
Definition at line 302 of file T7Stream.hpp.
|
private |
Definition at line 304 of file T7Stream.hpp.
| std::vector<std::string> fsw::t7::FakeT7Device::reads |
every name read_names() was asked for
Definition at line 289 of file T7Stream.hpp.
|
private |
Definition at line 306 of file T7Stream.hpp.
|
private |
Definition at line 305 of file T7Stream.hpp.
| std::vector<std::string> fsw::t7::FakeT7Device::scan_names |
Definition at line 288 of file T7Stream.hpp.
|
private |
Definition at line 303 of file T7Stream.hpp.
Definition at line 292 of file T7Stream.hpp.
| bool fsw::t7::FakeT7Device::streaming = false |
this handle's own stream is running
Definition at line 290 of file T7Stream.hpp.
| std::vector<std::pair<std::string, double> > fsw::t7::FakeT7Device::writes |
Definition at line 287 of file T7Stream.hpp.