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

Commits on Feb 26, 2020

  1. Copy the full SHA
    c1dc4a9 View commit details
Showing with 48 additions and 6 deletions.
  1. +45 −0 scopehal/LeCroyOscilloscope.cpp
  2. +3 −6 scopehal/SiglentSCPIOscilloscope.cpp
45 changes: 45 additions & 0 deletions scopehal/LeCroyOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -205,6 +205,51 @@ void LeCroyOscilloscope::DetectOptions()
LogDebug("* %s (not yet implemented)\n", o.c_str());
}
}

//Desired format for waveform data
//Only use increased bit depth if the scope actually puts content there!
if(m_highDefinition)
SendCommand("COMM_FORMAT DEF9,WORD,BIN");
else
SendCommand("COMM_FORMAT DEF9,BYTE,BIN");

//Clear the state-change register to we get rid of any history we don't care about
PollTrigger();
}

void LeCroyOscilloscope::IdentifyHardware()
{
//Turn off headers (complicate parsing and add fluff to the packets)
SendCommand("CHDR OFF", true);

//Ask for the ID
SendCommand("*IDN?", true);
string reply = ReadSingleBlockString();
char vendor[128] = "";
char model[128] = "";
char serial[128] = "";
char version[128] = "";
if(4 != sscanf(reply.c_str(), "%127[^,],%127[^,],%127[^,],%127s", vendor, model, serial, version))
{
LogError("Bad IDN response %s\n", reply.c_str());
return;
}
m_vendor = vendor;
m_model = model;
m_serial = serial;
m_fwVersion = version;

//Look up model info
if(m_model.find("WS3") == 0)
m_modelid = MODEL_WAVESURFER_3K;
else if(m_model.find("WAVERUNNER8") == 0)
m_modelid = MODEL_WAVERUNNER_8K;
else
m_modelid = MODEL_UNKNOWN;

//TODO: better way of doing this?
if(m_model.find("HD") != string::npos)
m_highDefinition = true;
}

void LeCroyOscilloscope::DetectAnalogChannels()
9 changes: 3 additions & 6 deletions scopehal/SiglentSCPIOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ void SiglentSCPIOscilloscope::DetectAnalogChannels()
{
//Siglent likes variably long model names (x, x-e, etc)
int nchans = m_model[strlen("sds120")] - '0';
//nchans = 1;
nchans = 1;
for(int i=0; i<nchans; i++)
{
//Hardware name of the channel
@@ -225,7 +225,7 @@ void SiglentSCPIOscilloscope::ReadWaveDescriptorBlock(SiglentWaveformDesc_t *des

bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)
{
m_mutex.lock();
lock_guard<recursive_mutex> lock(m_mutex);

LogDebug("Acquire data\n");

@@ -246,9 +246,7 @@ bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)
wavedescs.push_back(new struct SiglentWaveformDesc_t);
if(enabled[i])
{
snprintf(tmp, sizeof(tmp), "C%d:WF? DESC", i+1);
cmd = tmp;
SendCommand(cmd);
SendCommand(m_channels[i]->GetHwname() + ":WF? DESC");
ReadWaveDescriptorBlock(wavedescs[i], i);
LogDebug("name %s, number: %u\n",wavedescs[i]->InstrumentName,
wavedescs[i]->InstrumentNumber);
@@ -383,7 +381,6 @@ bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)

double dt = GetTime() - start;
LogTrace("Waveform download took %.3f ms\n", dt * 1000);
m_mutex.unlock();
//Refresh protocol decoders
for(size_t i=0; i<m_channels.size(); i++)
{