36#ifndef InstrumentChannel_h
37#define InstrumentChannel_h
67 const std::string& hwname,
68 const std::string& color =
"#808080",
74 const std::string& hwname,
75 const std::string& color =
"#808080",
112 enum PhysicalConnector
114 CONNECTOR_BANANA_DUAL,
123 virtual PhysicalConnector GetPhysicalConnector();
141 {
return m_streams[stream].m_yAxisUnit; }
167 return Stream::STREAM_TYPE_UNDEFINED;
Abstract base class for a node in the signal flow graph.
Definition: FlowGraphNode.h:54
A single channel of an instrument.
Definition: InstrumentChannel.h:63
size_t GetIndex()
Gets the (zero based) index of the channel.
Definition: InstrumentChannel.h:94
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
VisibilityMode
Selects how the channel should be displayed in e.g. the ngscopeclient filter graph editor.
Definition: InstrumentChannel.h:236
std::string m_displayname
Display name (user defined, defaults to m_hwname).
Definition: InstrumentChannel.h:290
WaveformBase * Detach(size_t stream)
Detach the capture data from this channel.
Definition: InstrumentChannel.h:220
DownloadState
Enum values to be mapped to GetDownloadState() int result value for specific channel download states.
Definition: InstrumentChannel.h:246
@ DOWNLOAD_WAITING
This channel is waiting to be downloaded (i.e. scope is triggered but previous channels are currently...
Definition: InstrumentChannel.h:249
@ DOWNLOAD_IN_PROGRESS
Download has started.
Definition: InstrumentChannel.h:250
@ DOWNLOAD_NONE
No download is pending (e.g. the scope is in stop mode)
Definition: InstrumentChannel.h:248
@ DOWNLOAD_FINISHED
Download is finished.
Definition: InstrumentChannel.h:251
virtual DownloadState GetDownloadState()
Returns the current download state of this channel.
Definition: InstrumentChannel.cpp:158
virtual float GetDownloadProgress()
returns the current completion of the download (on the range [0, 1]), if not DOWNLOAD_UNKNOWN
Definition: InstrumentChannel.cpp:163
void SetData(WaveformBase *pNew, size_t stream)
Sets the waveform data for a given stream, replacing any previous waveform.
Definition: InstrumentChannel.cpp:139
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:149
WaveformBase * GetData(size_t stream)
Get the contents of a data stream.
Definition: InstrumentChannel.h:184
virtual Unit GetYAxisUnits(size_t stream)
Returns the Y axis unit for a specified stream.
Definition: InstrumentChannel.h:140
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:200
std::string m_hwname
Hardware name of the channel.
Definition: InstrumentChannel.h:282
Unit m_xAxisUnit
Unit of measurement for our horizontal axis (common to all streams)
Definition: InstrumentChannel.h:300
virtual double GetDownloadStartTime()
returns the start time of a download, if we are DOWNLOAD_IN_PROGRESS; undefined, otherwise
Definition: InstrumentChannel.cpp:168
std::string GetStreamName(size_t stream)
Gets the name of a stream (for display in the UI)
Definition: InstrumentChannel.h:175
void SetScalarValue(size_t stream, float value)
Sets the value of a scalar data stream.
Definition: InstrumentChannel.h:208
size_t m_index
Zero based index of the channel within the instrument.
Definition: InstrumentChannel.h:295
Instrument * m_instrument
The instrument we're part of (may be null in the case of filters etc)
Definition: InstrumentChannel.h:274
virtual Unit GetXAxisUnits()
Returns the X axis unit for this channel.
Definition: InstrumentChannel.h:134
std::vector< Stream > m_streams
Configuration data for each of our output streams.
Definition: InstrumentChannel.h:305
size_t GetStreamCount()
Get the number of data streams.
Definition: InstrumentChannel.h:171
Stream::StreamType GetType(size_t stream)
Returns the type of a specified stream.
Definition: InstrumentChannel.h:162
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()
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:192
virtual void SetXAxisUnits(const Unit &rhs)
Changes the X axis unit for this channel.
Definition: InstrumentChannel.h:149
virtual void SetYAxisUnits(const Unit &rhs, size_t stream)
Changes the X axis unit for a specified stream.
Definition: InstrumentChannel.h:158
std::string GetHwname()
Gets the hardware name of the channel (m_hwname)
Definition: InstrumentChannel.h:90
An arbitrary lab instrument. Oscilloscope, LA, PSU, DMM, etc.
Definition: Instrument.h:58
StreamType
General data type stored in a stream.
Definition: Stream.h:58
A unit of measurement, plus conversion to pretty-printed output.
Definition: Unit.h:57