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: 52605666b1c8
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c71d2dd7fcb1
Choose a head ref
  • 5 commits
  • 5 files changed
  • 1 contributor

Commits on Nov 24, 2020

  1. Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    66d3d56 View commit details
  2. Copy the full SHA
    6eca3ea View commit details
  3. Copy the full SHA
    b9454ec View commit details
  4. Copy the full SHA
    1f5cdef View commit details
  5. Copy the full SHA
    c71d2dd View commit details
Showing with 22 additions and 10 deletions.
  1. +8 −1 scopehal/Filter.h
  2. +1 −1 scopehal/FlowGraphNode.h
  3. +10 −3 scopehal/MockOscilloscope.cpp
  4. +1 −1 scopeprotocols/USB2PCSDecoder.cpp
  5. +2 −4 scopeprotocols/USB2PacketDecoder.cpp
9 changes: 8 additions & 1 deletion scopehal/Filter.h
Original file line number Diff line number Diff line change
@@ -90,6 +90,13 @@ class Filter : public OscilloscopeChannel
static std::set<Filter*> GetAllInstances()
{ return m_filters; }

//Set all currently existing filters to the dirty state
static void SetAllFiltersDirty()
{
for(auto f : m_filters)
f->SetDirty();
}

/**
@brief Clears any integrated data from past triggers (e.g. eye patterns).
@@ -231,7 +238,7 @@ class Filter : public OscilloscopeChannel
static void DoAddDecoderClass(const std::string& name, CreateProcType proc);

static void EnumProtocols(std::vector<std::string>& names);
static Filter* CreateFilter(const std::string& protocol, const std::string& color);
static Filter* CreateFilter(const std::string& protocol, const std::string& color = "#ffffff");

protected:
//Class enumeration
2 changes: 1 addition & 1 deletion scopehal/FlowGraphNode.h
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ class StreamDescriptor
, m_stream(0)
{}

StreamDescriptor(OscilloscopeChannel* channel, size_t stream)
StreamDescriptor(OscilloscopeChannel* channel, size_t stream = 0)
: m_channel(channel)
, m_stream(stream)
{}
13 changes: 10 additions & 3 deletions scopehal/MockOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -356,7 +356,7 @@ bool MockOscilloscope::LoadCSV(const string& path)
return false;
}

map<int, AnalogWaveform*> waveforms;
vector<AnalogWaveform*> waveforms;

char line[1024];
size_t nrow = 0;
@@ -461,15 +461,22 @@ bool MockOscilloscope::LoadCSV(const string& path)
true);
AddChannel(chan);
chan->SetDefaultDisplayName();
}
}

//Create waveforms if needed
if(waveforms.empty())
{
for(size_t i=0; i<ncols; i++)
{
//Create the waveform for the channel
auto wfm = new AnalogWaveform;
wfm->m_timescale = 1;
wfm->m_startTimestamp = 0;
wfm->m_startPicoseconds = 0;
wfm->m_triggerPhase = 0;
waveforms[i] = wfm;
chan->SetData(wfm, 0);
waveforms.push_back(wfm);
GetChannel(i)->SetData(wfm, 0);
}
}

2 changes: 1 addition & 1 deletion scopeprotocols/USB2PCSDecoder.cpp
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ bool USB2PCSDecoder::ValidateChannel(size_t i, StreamDescriptor stream)
if(stream.m_channel == NULL)
return false;

if( (i == 0) && (dynamic_cast<USB2PMAWaveform*>(stream.m_channel->GetData(0)) != NULL) )
if( (i == 0) && (dynamic_cast<USB2PMADecoder*>(stream.m_channel) != NULL) )
return true;

return false;
6 changes: 2 additions & 4 deletions scopeprotocols/USB2PacketDecoder.cpp
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ bool USB2PacketDecoder::ValidateChannel(size_t i, StreamDescriptor stream)
if(stream.m_channel == NULL)
return false;

if( (i == 0) && (dynamic_cast<USB2PCSWaveform*>(stream.m_channel->GetData(0)) != NULL) )
if( (i == 0) && (dynamic_cast<USB2PCSDecoder*>(stream.m_channel) != NULL) )
return true;

return false;
@@ -338,10 +338,8 @@ void USB2PacketDecoder::Refresh()
packet_data.pop_back();
packet_data.pop_back();

//Calculate the CRC
//Verify the CRC
uint16_t crc16_calculated = CalculateCRC16(packet_data);
LogDebug("Calculated CRC16: %04x, got: %04x\n", crc16_calculated, crc16);

cap->m_durations[firstoff] += cap->m_durations[secondoff];
if(crc16 == crc16_calculated)
cap->m_samples[firstoff] = USB2PacketSymbol(USB2PacketSymbol::TYPE_CRC16_GOOD, crc16);