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

Commits on Mar 11, 2020

  1. Copy the full SHA
    66ed64f View commit details
1 change: 0 additions & 1 deletion scopehal/LeCroyOscilloscope.h
Original file line number Diff line number Diff line change
@@ -165,7 +165,6 @@ class LeCroyOscilloscope

virtual bool SendCommand(std::string cmd, bool eoi=true) = 0;
virtual std::string ReadData() =0;
virtual std::string ReadMultiBlockString() =0;
virtual std::string ReadSingleBlockString(bool trimNewline = false) =0;

bool ReadWaveformBlock(std::string& data);
16 changes: 0 additions & 16 deletions scopehal/LeCroyVICPOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -94,19 +94,3 @@ string LeCroyVICPOscilloscope::ReadSingleBlockString(bool trimNewline)
return payload;
}
}

string LeCroyVICPOscilloscope::ReadMultiBlockString()
{
//Read until we get the closing quote
string data;
bool first = true;
while(true)
{
string payload = ReadSingleBlockString();
data += payload;
if(!first && payload.find("\"") != string::npos)
break;
first = false;
}
return data;
}
1 change: 0 additions & 1 deletion scopehal/LeCroyVICPOscilloscope.h
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@ class LeCroyVICPOscilloscope
protected:
virtual bool SendCommand(std::string cmd, bool eoi=true);
virtual std::string ReadData();
virtual std::string ReadMultiBlockString();
virtual std::string ReadSingleBlockString(bool trimNewline = false);

VICPSocketTransport* m_transport;
16 changes: 5 additions & 11 deletions scopehal/SiglentSCPIOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -169,12 +169,6 @@ string SiglentSCPIOscilloscope::ReadSingleBlockString(bool trimNewline)
}
}

string SiglentSCPIOscilloscope::ReadMultiBlockString()
{
return ReadData();
}


// parses out length, does no other validation. requires 17 bytes at header.
uint32_t SiglentSCPIOscilloscope::ReadWaveHeader(char *header)
{
@@ -188,7 +182,7 @@ uint32_t SiglentSCPIOscilloscope::ReadWaveHeader(char *header)
return 0;
}

if (strlen(header) != 16)
if (strlen(header) != 16)
{
LogError("Unexpected descriptor header %s\n", header);
return 0;
@@ -197,15 +191,15 @@ uint32_t SiglentSCPIOscilloscope::ReadWaveHeader(char *header)
return atoi(&header[8]);
}

void SiglentSCPIOscilloscope::ReadWaveDescriptorBlock(SiglentWaveformDesc_t *descriptor, unsigned int channel)
void SiglentSCPIOscilloscope::ReadWaveDescriptorBlock(SiglentWaveformDesc_t *descriptor, unsigned int channel)
{
char header[17] = {0};
ssize_t r = 0;
uint32_t headerLength = 0;

headerLength = ReadWaveHeader(header);

if(headerLength != sizeof(struct SiglentWaveformDesc_t))
if(headerLength != sizeof(struct SiglentWaveformDesc_t))
{
LogError("Unexpected header length: %u\n", headerLength);
}
@@ -248,7 +242,7 @@ bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)
{
SendCommand(m_channels[i]->GetHwname() + ":WF? DESC");
ReadWaveDescriptorBlock(wavedescs[i], i);
LogDebug("name %s, number: %u\n",wavedescs[i]->InstrumentName,
LogDebug("name %s, number: %u\n",wavedescs[i]->InstrumentName,
wavedescs[i]->InstrumentNumber);

}
@@ -389,4 +383,4 @@ bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)
decoder->Refresh();
}
return true;
}
}
8 changes: 4 additions & 4 deletions scopehal/SiglentSCPIOscilloscope.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2019 Andrew D. Zonenberg *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -40,7 +40,8 @@ struct SiglentWaveformDesc_t;
/**
@brief A Siglent SCPI (SCPI/TCP) oscilloscope
Protocol layer is based on Siglent's reference manual, implementation here modeled off of the LeCroy support in LeCroyVICPOscilloscope.cpp
Protocol layer is based on Siglent's reference manual
Implementation here modeled off of the LeCroy support in LeCroyVICPOscilloscope.cpp
*/
class SiglentSCPIOscilloscope
: public LeCroyOscilloscope
@@ -55,7 +56,6 @@ class SiglentSCPIOscilloscope
virtual void DetectAnalogChannels();
virtual bool SendCommand(std::string cmd, bool eoi=true);
virtual std::string ReadData();
virtual std::string ReadMultiBlockString();
virtual std::string ReadSingleBlockString(bool trimNewline = false);

void ReadWaveDescriptorBlock(SiglentWaveformDesc_t *descriptor, unsigned int channel);
@@ -64,7 +64,7 @@ class SiglentSCPIOscilloscope

#pragma pack(1)

struct SignalWaveformTimestamp_t
struct SignalWaveformTimestamp_t
{
double Seconds;
uint8_t Minutes;
3 changes: 3 additions & 0 deletions scopehal/VICPSocketTransport.cpp
Original file line number Diff line number Diff line change
@@ -115,6 +115,9 @@ string VICPSocketTransport::ReadReply()
unsigned char header[8];
ReadRawData(8, header);

uint8_t op = header[0];
//OP_EOI terminates a block

//Sanity check
if(header[1] != 1)
{