36#ifndef InstrumentChannel_h
37#define InstrumentChannel_h
68 const std::string&
color =
"#808080",
75 const std::string&
color =
"#808080",
112 enum PhysicalConnector
114 CONNECTOR_BANANA_DUAL,
123 virtual PhysicalConnector GetPhysicalConnector();
145 return Unit(Unit::UNIT_VOLTS);
172 return Stream::STREAM_TYPE_UNDEFINED;
305 virtual void Refresh(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue)
override;
Definition AcceleratorBuffer.h:204
Abstract base class for a node in the signal flow graph.
Definition FlowGraphNode.h:81
A single channel of an instrument.
Definition InstrumentChannel.h:63
virtual std::string GetDisplayName()
Gets the human-readable nickname for this channel, as displayed in the GUI.
Definition InstrumentChannel.cpp:102
std::string m_displaycolor
Display color (HTML hex notation with optional alpha channel: #RRGGBB or ##RRGGBBAA)
Definition InstrumentChannel.h:84
uint64_t GetDigitalWidth(size_t stream)
Gets the width of a digital data stream.
Definition InstrumentChannel.h:229
VisibilityMode
Selects how the channel should be displayed in e.g. the ngscopeclient filter graph editor.
Definition InstrumentChannel.h:273
std::string m_displayname
Display name (user defined, defaults to m_hwname).
Definition InstrumentChannel.h:329
WaveformBase * Detach(size_t stream)
Detach the capture data from this channel.
Definition InstrumentChannel.h:257
DownloadState
Enum values to be mapped to GetDownloadState() int result value for specific channel download states.
Definition InstrumentChannel.h:283
@ DOWNLOAD_WAITING
This channel is waiting to be downloaded (i.e. scope is triggered but previous channels are currently...
Definition InstrumentChannel.h:286
@ DOWNLOAD_IN_PROGRESS
Download has started.
Definition InstrumentChannel.h:287
@ DOWNLOAD_NONE
No download is pending (e.g. the scope is in stop mode)
Definition InstrumentChannel.h:285
@ DOWNLOAD_FINISHED
Download is finished.
Definition InstrumentChannel.h:288
virtual DownloadState GetDownloadState()
Returns the current download state of this channel.
Definition InstrumentChannel.cpp:163
uint64_t GetDigitalScalarValue(size_t stream)
Gets the value of a scalar data stream.
Definition InstrumentChannel.h:221
virtual float GetDownloadProgress()
returns the current completion of the download (on the range [0, 1]), if not DOWNLOAD_UNKNOWN
Definition InstrumentChannel.cpp:168
void SetData(WaveformBase *pNew, size_t stream)
Sets the waveform data for a given stream, replacing any previous waveform.
Definition InstrumentChannel.cpp:144
void ClearCachedDisplayName()
Sets the display name to an empty string, causing a fetch from hardware.
Definition InstrumentChannel.h:106
virtual bool ShouldPersistWaveform()
Determine whether the channel's waveform(s) should be persisted to a session file.
Definition InstrumentChannel.cpp:154
WaveformBase * GetData(size_t stream)
Get the contents of a data stream.
Definition InstrumentChannel.h:189
virtual Unit GetYAxisUnits(size_t stream)
Returns the Y axis unit for a specified stream.
Definition InstrumentChannel.h:140
void SetDigitalWidth(size_t stream, uint64_t width)
Set the width of a digital data stream.
Definition InstrumentChannel.h:237
virtual void SetDisplayName(std::string name)
Sets the human-readable nickname for this channel, as displayed in the GUI.
Definition InstrumentChannel.cpp:94
float GetScalarValue(size_t stream)
Gets the value of a scalar data stream.
Definition InstrumentChannel.h:205
std::string m_hwname
Hardware name of the channel.
Definition InstrumentChannel.h:321
Unit m_xAxisUnit
Unit of measurement for our horizontal axis (common to all streams)
Definition InstrumentChannel.h:339
virtual double GetDownloadStartTime()
returns the start time of a download, if we are DOWNLOAD_IN_PROGRESS; undefined, otherwise
Definition InstrumentChannel.cpp:173
std::string GetStreamName(size_t stream)
Gets the name of a stream (for display in the UI)
Definition InstrumentChannel.h:180
void SetScalarValue(size_t stream, float value)
Sets the value of a scalar data stream.
Definition InstrumentChannel.h:213
size_t m_index
Zero based index of the channel within the instrument.
Definition InstrumentChannel.h:334
Instrument * m_instrument
The instrument we're part of (may be null in the case of filters etc)
Definition InstrumentChannel.h:313
virtual Unit GetXAxisUnits()
Returns the X axis unit for this channel.
Definition InstrumentChannel.h:134
size_t GetIndex() const
Gets the (zero based) index of the channel.
Definition InstrumentChannel.h:94
std::vector< Stream > m_streams
Configuration data for each of our output streams.
Definition InstrumentChannel.h:344
const std::string & GetHwname() const
Gets the hardware name of the channel (m_hwname)
Definition InstrumentChannel.h:90
size_t GetStreamCount()
Get the number of data streams.
Definition InstrumentChannel.h:176
Stream::StreamType GetType(size_t stream)
Returns the type of a specified stream.
Definition InstrumentChannel.h:167
void SetDigitalScalarValue(size_t stream, uint64_t value)
Sets the value of a scalar data stream.
Definition InstrumentChannel.h:245
virtual size_t AddStream(Unit yunit, const std::string &name, Stream::StreamType stype, uint8_t flags=0)
Adds a new data stream to the channel.
Definition InstrumentChannel.cpp:125
virtual void ClearStreams()
Clears out any existing streams.
Definition InstrumentChannel.cpp:113
Instrument * GetInstrument() const
Gets the instrument this channel is part of (if any)
Definition InstrumentChannel.h:98
uint8_t GetStreamFlags(size_t stream)
Get the flags of a data stream.
Definition InstrumentChannel.h:197
virtual void SetXAxisUnits(const Unit &rhs)
Changes the X axis unit for this channel.
Definition InstrumentChannel.h:154
virtual void SetYAxisUnits(const Unit &rhs, size_t stream)
Changes the X axis unit for a specified stream.
Definition InstrumentChannel.h:163
An arbitrary lab instrument. Oscilloscope, LA, PSU, DMM, etc.
Definition Instrument.h:62
StreamType
General data type stored in a stream.
Definition Stream.h:57
A unit of measurement, plus conversion to pretty-printed output.
Definition Unit.h:59