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: 1af3ff878516
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cac6294c8e35
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Oct 31, 2020

  1. Copy the full SHA
    cac6294 View commit details
Showing with 19 additions and 10 deletions.
  1. +5 −3 scopehal/AgilentOscilloscope.cpp
  2. +3 −0 scopehal/OscilloscopeChannel.cpp
  3. +1 −0 scopehal/OscilloscopeChannel.h
  4. +5 −4 scopehal/RigolOscilloscope.cpp
  5. +5 −3 scopehal/RohdeSchwarzOscilloscope.cpp
8 changes: 5 additions & 3 deletions scopehal/AgilentOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -81,15 +81,16 @@ AgilentOscilloscope::AgilentOscilloscope(SCPITransport* transport)
}

//Create the channel
m_channels.push_back(
new OscilloscopeChannel(
auto chan = new OscilloscopeChannel(
this,
chname,
OscilloscopeChannel::CHANNEL_TYPE_ANALOG,
color,
1,
i,
true));
true);
m_channels.push_back(chan);
chan->SetDefaultDisplayName();

//Configure transport format to raw 8-bit int
m_transport->SendCommand(":WAV:SOUR " + chname);
@@ -110,6 +111,7 @@ AgilentOscilloscope::AgilentOscilloscope(SCPITransport* transport)
m_channels.size(),
true);
m_channels.push_back(m_extTrigChannel);
m_extTrigChannel->SetDefaultDisplayName();

//See what options we have
m_transport->SendCommand("*OPT?");
3 changes: 3 additions & 0 deletions scopehal/OscilloscopeChannel.cpp
Original file line number Diff line number Diff line change
@@ -95,7 +95,10 @@ void OscilloscopeChannel::SharedCtorInit()
//Normal channels only have one stream.
//Special instruments like SDRs with complex output, or filters/decodes, can have arbitrarily many.
AddStream("data");
}

void OscilloscopeChannel::SetDefaultDisplayName()
{
//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.
1 change: 1 addition & 0 deletions scopehal/OscilloscopeChannel.h
Original file line number Diff line number Diff line change
@@ -186,6 +186,7 @@ class OscilloscopeChannel

void SetCenterFrequency(int64_t freq);

void SetDefaultDisplayName();
protected:
void SharedCtorInit();

9 changes: 5 additions & 4 deletions scopehal/RigolOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -76,8 +76,7 @@ RigolOscilloscope::RigolOscilloscope(SCPITransport* transport)
for(int i = 0; i < nchans; i++)
{
//Hardware name of the channel
string chname = string("CHAN1");
chname[4] += i;
string chname = string("CHAN") + to_string(i+1);

//Color the channels based on Rigol's standard color sequence (yellow-cyan-red-blue)
string color = "#ffffff";
@@ -101,15 +100,17 @@ RigolOscilloscope::RigolOscilloscope(SCPITransport* transport)
}

//Create the channel
m_channels.push_back(
new OscilloscopeChannel(this, chname, OscilloscopeChannel::CHANNEL_TYPE_ANALOG, color, 1, i, true));
auto chan = new OscilloscopeChannel(this, chname, OscilloscopeChannel::CHANNEL_TYPE_ANALOG, color, 1, i, true);
m_channels.push_back(chan);
chan->SetDefaultDisplayName();
}
m_analogChannelCount = nchans;

//Add the external trigger input
m_extTrigChannel =
new OscilloscopeChannel(this, "EX", OscilloscopeChannel::CHANNEL_TYPE_TRIGGER, "", 1, m_channels.size(), true);
m_channels.push_back(m_extTrigChannel);
m_extTrigChannel->SetDefaultDisplayName();

//Configure acquisition modes
if(m_protocol == DS_OLD)
8 changes: 5 additions & 3 deletions scopehal/RohdeSchwarzOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -73,15 +73,16 @@ RohdeSchwarzOscilloscope::RohdeSchwarzOscilloscope(SCPITransport* transport)
}

//Create the channel
m_channels.push_back(
new OscilloscopeChannel(
auto chan = new OscilloscopeChannel(
this,
chname,
OscilloscopeChannel::CHANNEL_TYPE_ANALOG,
color,
1,
i,
true));
true);
m_channels.push_back(chan);
chan->SetDefaultDisplayName();

//Request all points when we download
m_transport->SendCommand(chname + ":DATA:POIN MAX");
@@ -98,6 +99,7 @@ RohdeSchwarzOscilloscope::RohdeSchwarzOscilloscope(SCPITransport* transport)
m_channels.size(),
true);
m_channels.push_back(m_extTrigChannel);
m_extTrigChannel->SetDefaultDisplayName();

//Configure transport format to raw IEEE754 float, little endian
//TODO: if instrument internal is big endian, skipping the bswap might improve download performance?