Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support SDS2000+ scope #402

Merged
merged 5 commits into from Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
466 changes: 209 additions & 257 deletions scopehal/LeCroyOscilloscope.cpp

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions scopehal/LeCroyOscilloscope.h
Expand Up @@ -56,8 +56,8 @@ class LeCroyOscilloscope
virtual ~LeCroyOscilloscope();

//not copyable or assignable
LeCroyOscilloscope(const LeCroyOscilloscope& rhs) =delete;
LeCroyOscilloscope& operator=(const LeCroyOscilloscope& rhs) =delete;
LeCroyOscilloscope(const LeCroyOscilloscope& rhs) = delete;
LeCroyOscilloscope& operator=(const LeCroyOscilloscope& rhs) = delete;

protected:
void IdentifyHardware();
Expand Down Expand Up @@ -174,13 +174,10 @@ class LeCroyOscilloscope

MODEL_WAVESURFER_3K,

MODEL_SIGLENT_SDS2000X,

MODEL_UNKNOWN
};

Model GetModelID()
{ return m_modelid; }
Model GetModelID() { return m_modelid; }

//Timebase
virtual std::vector<uint64_t> GetSampleRatesNonInterleaved();
Expand Down Expand Up @@ -256,21 +253,16 @@ class LeCroyOscilloscope

bool ReadWaveformBlock(std::string& data);
bool ReadWavedescs(
std::vector<std::string>& wavedescs,
bool* enabled,
unsigned int& firstEnabledChannel,
bool& any_enabled);
std::vector<std::string>& wavedescs, bool* enabled, unsigned int& firstEnabledChannel, bool& any_enabled);
void RequestWaveforms(bool* enabled, uint32_t num_sequences, bool denabled);
time_t ExtractTimestamp(unsigned char* wavedesc, double& basetime);
std::vector<WaveformBase*> ProcessAnalogWaveform(
const char* data,
std::vector<WaveformBase*> ProcessAnalogWaveform(const char* data,
size_t datalen,
std::string& wavedesc,
uint32_t num_sequences,
time_t ttime,
double basetime,
double* wavetime
);
double* wavetime);
std::map<int, DigitalWaveform*> ProcessDigitalWaveform(std::string& data);

void Convert8BitSamples(
Expand All @@ -289,8 +281,8 @@ class LeCroyOscilloscope
bool m_hasLA;
bool m_hasDVM;
bool m_hasFunctionGen;
bool m_hasFastSampleRate; //-M models
int m_memoryDepthOption; //0 = base, after that number is max sample count in millions
bool m_hasFastSampleRate; //-M models
int m_memoryDepthOption; //0 = base, after that number is max sample count in millions
bool m_hasI2cTrigger;
bool m_hasSpiTrigger;
bool m_hasUartTrigger;
Expand Down
1 change: 1 addition & 0 deletions scopehal/OscilloscopeChannel.h
Expand Up @@ -150,6 +150,7 @@ class OscilloscopeChannel
COUPLE_DC_1M, //1M ohm, DC coupled
COUPLE_AC_1M, //1M ohm, AC coupled
COUPLE_DC_50, //50 ohm, DC coupled
COUPLE_AC_50, //50 ohm, AC coupled
COUPLE_GND, //tie to ground
COUPLE_SYNTHETIC //channel is math, digital, or otherwise not a direct voltage measurement
};
Expand Down
6 changes: 6 additions & 0 deletions scopehal/SCPISocketTransport.cpp
Expand Up @@ -145,6 +145,12 @@ string SCPISocketTransport::ReadReply(bool endOnSemicolon)
return ret;
}

void SCPISocketTransport::FlushRXBuffer(void)

{
m_socket.FlushRxBuffer();
}

void SCPISocketTransport::SendRawData(size_t len, const unsigned char* buf)
{
m_socket.SendLooped(buf, len);
Expand Down
1 change: 1 addition & 0 deletions scopehal/SCPISocketTransport.h
Expand Up @@ -51,6 +51,7 @@ class SCPISocketTransport : public SCPITransport
virtual std::string GetConnectionString();
static std::string GetTransportName();

virtual void FlushRXBuffer(void);
virtual bool SendCommand(const std::string& cmd);
virtual std::string ReadReply(bool endOnSemicolon = true);
virtual size_t ReadRawData(size_t len, unsigned char* buf);
Expand Down
6 changes: 6 additions & 0 deletions scopehal/SCPITransport.cpp
Expand Up @@ -162,3 +162,9 @@ void* SCPITransport::SendCommandImmediateWithRawBlockReply(string cmd, size_t& l
len = ReadRawData(len, buf);
return buf;
}

void SCPITransport::FlushRXBuffer(void)

{
LogError("SCPITransport::FlushRXBuffer is unimplemented");
}
1 change: 1 addition & 0 deletions scopehal/SCPITransport.h
Expand Up @@ -61,6 +61,7 @@ class SCPITransport
{ return m_netMutex; }

//Immediate command API
virtual void FlushRXBuffer(void);
virtual bool SendCommand(const std::string& cmd) =0;
virtual std::string ReadReply(bool endOnSemicolon = true) =0;
virtual size_t ReadRawData(size_t len, unsigned char* buf) =0;
Expand Down