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

Commits on Oct 1, 2020

  1. Copy the full SHA
    9a27ea7 View commit details
Showing with 30 additions and 2 deletions.
  1. +6 −0 scopehal/OscilloscopeChannel.cpp
  2. +2 −0 scopehal/OscilloscopeChannel.h
  3. +22 −2 scopehal/TektronixOscilloscope.cpp
6 changes: 6 additions & 0 deletions scopehal/OscilloscopeChannel.cpp
Original file line number Diff line number Diff line change
@@ -235,6 +235,12 @@ void OscilloscopeChannel::SetDigitalThreshold(float level)
m_scope->SetDigitalThreshold(m_index, level);
}

void OscilloscopeChannel::SetCenterFrequency(int64_t freq)
{
if(m_scope)
m_scope->SetCenterFrequency(m_index, freq);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Accessors

2 changes: 2 additions & 0 deletions scopehal/OscilloscopeChannel.h
Original file line number Diff line number Diff line change
@@ -183,6 +183,8 @@ class OscilloscopeChannel
void SetDigitalHysteresis(float level);
void SetDigitalThreshold(float level);

void SetCenterFrequency(int64_t freq);

protected:

/**
24 changes: 22 additions & 2 deletions scopehal/TektronixOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -2158,14 +2158,34 @@ void TektronixOscilloscope::SetCenterFrequency(size_t channel, int64_t freq)
{
lock_guard<recursive_mutex> lock(m_mutex);

//CH1:SV:CENTERFREQUENCY 100.0000E+6;
switch(m_family)
{
case FAMILY_MSO5:
case FAMILY_MSO6:
m_transport->SendCommand(
string("CH") + to_string(channel-m_spectrumChannelBase+1) + ":SV:CENTERFREQUENCY " + to_string(freq));
break;

default:
break;
}
}

int64_t TektronixOscilloscope::GetCenterFrequency(size_t channel)
{
lock_guard<recursive_mutex> lock(m_mutex);

return 1;
switch(m_family)
{
case FAMILY_MSO5:
case FAMILY_MSO6:
m_transport->SendCommand(
string("CH") + to_string(channel-m_spectrumChannelBase+1) + ":SV:CENTERFREQUENCY?");
return round(stof(m_transport->ReadReply()));

default:
return 0;
}
}

void TektronixOscilloscope::SetResolutionBandwidth(int64_t rbw)