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

Commits on Jun 1, 2019

  1. Copy the full SHA
    69f9939 View commit details
Showing with 29 additions and 3 deletions.
  1. +29 −3 scopehal/RigolOscilloscope.cpp
32 changes: 29 additions & 3 deletions scopehal/RigolOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -203,13 +203,39 @@ void RigolOscilloscope::DisableChannel(size_t i)

OscilloscopeChannel::CouplingType RigolOscilloscope::GetChannelCoupling(size_t i)
{
//FIXME
return OscilloscopeChannel::COUPLE_DC_1M;
lock_guard<recursive_mutex> lock(m_mutex);

SendCommand(m_channels[i]->GetHwname() + ":COUP?");
string reply = ReadReply();

if(reply == "AC")
return OscilloscopeChannel::COUPLE_AC_1M;
else if(reply == "DC")
return OscilloscopeChannel::COUPLE_DC_1M;
else /* if(reply == "GND") */
return OscilloscopeChannel::COUPLE_GND;
}

void RigolOscilloscope::SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type)
{
//FIXME
lock_guard<recursive_mutex> lock(m_mutex);
switch(type)
{
case OscilloscopeChannel::COUPLE_AC_1M:
SendCommand(m_channels[i]->GetHwname() + ":COUP AC");
break;

case OscilloscopeChannel::COUPLE_DC_1M:
SendCommand(m_channels[i]->GetHwname() + ":COUP DC");
break;

case OscilloscopeChannel::COUPLE_GND:
SendCommand(m_channels[i]->GetHwname() + ":COUP GND");
break;

default:
LogError("Invalid coupling for channel\n");
}
}

double RigolOscilloscope::GetChannelAttenuation(size_t i)