Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9829b03db32b
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1af3ff878516
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Oct 31, 2020

  1. OscilloscopeChannel: if display name is not set by hardware in constr…

    …uctor, use hardware name
    azonenberg committed Oct 31, 2020
    Copy the full SHA
    1af3ff8 View commit details
Showing with 17 additions and 4 deletions.
  1. +16 −4 scopehal/OscilloscopeChannel.cpp
  2. +1 −0 scopehal/OscilloscopeChannel.h
20 changes: 16 additions & 4 deletions scopehal/OscilloscopeChannel.cpp
Original file line number Diff line number Diff line change
@@ -61,10 +61,7 @@ OscilloscopeChannel::OscilloscopeChannel(
, m_xAxisUnit(Unit::UNIT_PS)
, m_yAxisUnit(Unit::UNIT_VOLTS)
{
//Create a stream for our output.
//Normal channels only have one stream.
//Special instruments like SDRs with complex output, or filters/decodes, can have arbitrarily many.
AddStream("data");
SharedCtorInit();
}

OscilloscopeChannel::OscilloscopeChannel(
@@ -88,11 +85,26 @@ OscilloscopeChannel::OscilloscopeChannel(
, m_refcount(0)
, m_xAxisUnit(xunit)
, m_yAxisUnit(yunit)
{
SharedCtorInit();
}

void OscilloscopeChannel::SharedCtorInit()
{
//Create a stream for our output.
//Normal channels only have one stream.
//Special instruments like SDRs with complex output, or filters/decodes, can have arbitrarily many.
AddStream("data");

//If we have a scope, m_displayname is ignored.
//Start out by pulling the name from hardware.
//If it's not set, use our hardware name as the default.
if(m_scope)
{
auto name = m_scope->GetChannelDisplayName(m_index);
if(name == "")
m_scope->SetChannelDisplayName(m_index, m_hwname);
}
}

OscilloscopeChannel::~OscilloscopeChannel()
1 change: 1 addition & 0 deletions scopehal/OscilloscopeChannel.h
Original file line number Diff line number Diff line change
@@ -187,6 +187,7 @@ class OscilloscopeChannel
void SetCenterFrequency(int64_t freq);

protected:
void SharedCtorInit();

/**
@brief Clears out any existing streams