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

Commits on Oct 7, 2020

  1. Copy the full SHA
    4b60d54 View commit details

Commits on Oct 8, 2020

  1. Copy the full SHA
    0e26669 View commit details
  2. Copy the full SHA
    012598d View commit details
  3. Copy the full SHA
    201cc51 View commit details
14 changes: 9 additions & 5 deletions scopehal/PacketDecoder.cpp
Original file line number Diff line number Diff line change
@@ -88,26 +88,30 @@ bool PacketDecoder::GetShowImageColumn()
}

/**
@brief Checks if two packets can be merged under a single heading in the protocol analyzer view.
@brief Checks if multiple packets can be merged under a single heading in the protocol analyzer view.
This can be used to collapse polling loops, acknowledgements, etc in order to minimize clutter in the view.
The default implementation in PacketDecoder always returns false so packets are not merged.
@param a Packet 1
@param b Packet 2
@param first The first packet in the merge group
@param cur The most recently merged packet
@param next The candidate packet to be merged
@return true if packets can be merged, false otherwise
*/
bool PacketDecoder::CanMerge(Packet* /*a*/, Packet* /*b*/)
bool PacketDecoder::CanMerge(Packet* /*first*/, Packet* /*cur*/, Packet* /*next*/)
{
return false;
}

/**
@brief Creates a summary packet for one or more merged packets
@param pack The first packet in the merge string
@param i Index of pack within m_packets
*/
Packet* PacketDecoder::CreateMergedHeader(Packet* /*pack*/)
Packet* PacketDecoder::CreateMergedHeader(Packet* /*pack*/, size_t /*i*/)
{
return NULL;
}
4 changes: 2 additions & 2 deletions scopehal/PacketDecoder.h
Original file line number Diff line number Diff line change
@@ -79,8 +79,8 @@ class PacketDecoder : public Filter
virtual bool GetShowDataColumn();
virtual bool GetShowImageColumn();

virtual Packet* CreateMergedHeader(Packet* pack);
virtual bool CanMerge(Packet* a, Packet* b);
virtual Packet* CreateMergedHeader(Packet* pack, size_t i);
virtual bool CanMerge(Packet* first, Packet* cur, Packet* next);

/**
@brief Standard colors for protocol analyzer lines.
1 change: 1 addition & 0 deletions scopeprotocols/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ set(SCOPEPROTOCOLS_SOURCES
QuadratureDecoder.cpp
QSPIDecoder.cpp
RiseMeasurement.cpp
SDCmdDecoder.cpp
SPIDecoder.cpp
SPIFlashDecoder.cpp
SubtractFilter.cpp
6 changes: 3 additions & 3 deletions scopeprotocols/I2CEepromDecoder.cpp
Original file line number Diff line number Diff line change
@@ -599,16 +599,16 @@ string I2CEepromDecoder::GetText(int i)
return string(tmp);
}

bool I2CEepromDecoder::CanMerge(Packet* a, Packet* b)
bool I2CEepromDecoder::CanMerge(Packet* first, Packet* /*cur*/, Packet* next)
{
//Merge polling packets
if( (a->m_headers["Type"].find("Poll") == 0) && (b->m_headers["Type"].find("Poll") == 0 ) )
if( (first->m_headers["Type"].find("Poll") == 0) && (next->m_headers["Type"].find("Poll") == 0 ) )
return true;

return false;
}

Packet* I2CEepromDecoder::CreateMergedHeader(Packet* pack)
Packet* I2CEepromDecoder::CreateMergedHeader(Packet* pack, size_t /*i*/)
{
if(pack->m_headers["Type"].find("Poll") == 0)
{
4 changes: 2 additions & 2 deletions scopeprotocols/I2CEepromDecoder.h
Original file line number Diff line number Diff line change
@@ -91,8 +91,8 @@ class I2CEepromDecoder : public PacketDecoder
virtual double GetVoltageRange();
virtual bool ValidateChannel(size_t i, StreamDescriptor stream);

bool CanMerge(Packet* a, Packet* b);
Packet* CreateMergedHeader(Packet* pack);
bool CanMerge(Packet* first, Packet* cur, Packet* next);
Packet* CreateMergedHeader(Packet* pack, size_t i);

PROTOCOL_DECODER_INITPROC(I2CEepromDecoder)

Loading