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

Commits on Jan 28, 2021

  1. Copy the full SHA
    6b96287 View commit details
Showing with 27 additions and 74 deletions.
  1. +26 −73 scopehal/PicoOscilloscope.cpp
  2. +1 −1 scopehal/PicoOscilloscope.h
99 changes: 26 additions & 73 deletions scopehal/PicoOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -108,8 +108,9 @@ PicoOscilloscope::PicoOscilloscope(SCPITransport* transport)
SetChannelVoltageRange(i, 5);
}

//Set initial sample rate
//Set initial memory configuration
SetSampleRate(1250000000L);
SetSampleDepth(1000000);

//Add the external trigger input
m_extTrigChannel =
@@ -436,17 +437,29 @@ set<Oscilloscope::InterleaveConflict> PicoOscilloscope::GetInterleaveConflicts()

vector<uint64_t> PicoOscilloscope::GetSampleDepthsNonInterleaved()
{
//FIXME
vector<uint64_t> ret;
/* if(m_protocol == MSO5)
ret = {
1000,
10 * 1000,
100 * 1000,
1000 * 1000,
10 * 1000 * 1000,
25 * 1000 * 1000,
};*/

string depths;
{
lock_guard<recursive_mutex> lock(m_mutex);
m_transport->SendCommand("DEPTHS?");
depths = m_transport->ReadReply();
}

size_t i=0;
while(true)
{
size_t istart = i;
i = depths.find(',', i+1);
if(i == string::npos)
break;

ret.push_back(stol(depths.substr(istart, i-istart)));

//skip the comma
i++;
}

return ret;
}

@@ -464,74 +477,14 @@ uint64_t PicoOscilloscope::GetSampleRate()

uint64_t PicoOscilloscope::GetSampleDepth()
{
/*
if(m_mdepthValid)
return m_mdepth;
lock_guard<recursive_mutex> lock(m_mutex);
m_transport->SendCommand(":ACQ:MDEP?");
string ret = m_transport->ReadReply();
double depth;
sscanf(ret.c_str(), "%lf", &depth);
m_mdepth = (uint64_t)depth;
m_mdepthValid = true;
return m_mdepth;
*/
return 1;
}

void PicoOscilloscope::SetSampleDepth(uint64_t depth)
{
/*
lock_guard<recursive_mutex> lock(m_mutex);
if(m_protocol == MSO5)
{
switch(depth)
{
case 1000:
m_transport->SendCommand("ACQ:MDEP 1k");
break;
case 10000:
m_transport->SendCommand("ACQ:MDEP 10k");
break;
case 100000:
m_transport->SendCommand("ACQ:MDEP 100k");
break;
case 1000000:
m_transport->SendCommand("ACQ:MDEP 1M");
break;
case 10000000:
m_transport->SendCommand("ACQ:MDEP 10M");
break;
case 25000000:
m_transport->SendCommand("ACQ:MDEP 25M");
break;
case 50000000:
if(m_opt200M)
m_transport->SendCommand("ACQ:MDEP 50M");
else
LogError("Invalid memory depth for channel: %lu\n", depth);
break;
case 100000000:
//m_transport->SendCommand("ACQ:MDEP 100M");
LogError("Invalid memory depth for channel: %lu\n", depth);
break;
case 200000000:
//m_transport->SendCommand("ACQ:MDEP 200M");
LogError("Invalid memory depth for channel: %lu\n", depth);
break;
default:
LogError("Invalid memory depth for channel: %lu\n", depth);
}
}
else
{
LogError("Memory depth setting not implemented for this series");
}
m_mdepthValid = false;
*/
m_transport->SendCommand(string("DEPTH ") + to_string(depth));
m_mdepth = depth;
}

void PicoOscilloscope::SetSampleRate(uint64_t rate)
2 changes: 1 addition & 1 deletion scopehal/PicoOscilloscope.h
Original file line number Diff line number Diff line change
@@ -112,6 +112,7 @@ class PicoOscilloscope : public SCPIOscilloscope
bool m_triggerArmed;
bool m_triggerOneShot;
uint64_t m_srate;
uint64_t m_mdepth;

/*
@@ -121,7 +122,6 @@ class PicoOscilloscope : public SCPIOscilloscope
std::map<size_t, unsigned int> m_channelBandwidthLimits;
std::map<int, bool> m_channelsEnabled;
bool m_mdepthValid;
uint64_t m_mdepth;
int64_t m_triggerOffset;
bool m_triggerOffsetValid;