35#ifndef PacketManager_h
36#define PacketManager_h
38#include "../../lib/scopehal/PacketDecoder.h"
100 bool Validate(std::vector<std::string> headers);
102 std::string Evaluate(
const Packet* pack);
104 static std::string
EatSpaces(std::string str);
117 std::string m_identifier;
118 std::string m_string;
133 static void EatSpaces(std::string str,
size_t& i);
135 bool Validate(std::vector<std::string> headers,
bool nakedLiteralOK =
false);
137 bool Match(
const Packet* pack);
138 std::string Evaluate(
const Packet* pack);
141 std::vector<ProtocolDisplayFilterClause*> m_clauses;
142 std::vector<std::string> m_operators;
157 std::recursive_mutex& GetMutex()
160 const std::map<TimePoint, std::vector<Packet*> >& GetPackets()
163 const std::vector<Packet*>& GetChildPackets(
Packet* pack)
166 const std::map<TimePoint, std::vector<Packet*> >& GetFilteredPackets()
169 const std::vector<Packet*>& GetFilteredChildPackets(
Packet* pack)
183 bool IsChildOpen(
Packet* pack)
186 void SetChildOpen(
Packet* pack,
bool open)
189 std::vector<RowData>& GetRows()
192 void OnMarkerChanged();
195 void RemoveChildHistoryFrom(
Packet* pack);
Data for a marker.
Definition: Marker.h:84
Definition: PacketDecoder.h:85
Keeps track of packetized data history from a single protocol analyzer filter.
Definition: PacketManager.h:149
PacketDecoder * m_filter
The filter we're managing.
Definition: PacketManager.h:204
std::map< Packet *, bool > m_lastChildOpen
Map of packets to child-open flags from last frame.
Definition: PacketManager.h:231
void RefreshRows()
Update the list of rows being displayed.
Definition: PacketManager.cpp:68
void Update()
Handle newly arrived waveform data (may be a change to parameters or a freshly arrived waveform)
Definition: PacketManager.cpp:169
void FilterPackets()
Run the filter expression against the packets.
Definition: PacketManager.cpp:253
Session & m_session
Parent session object.
Definition: PacketManager.h:198
void SetDisplayFilter(std::shared_ptr< ProtocolDisplayFilter > filter)
Sets the current filter expression.
Definition: PacketManager.h:175
std::map< Packet *, std::vector< Packet * > > m_childPackets
Merged child packets.
Definition: PacketManager.h:210
std::recursive_mutex m_mutex
Mutex controlling access to m_packets.
Definition: PacketManager.h:201
std::map< TimePoint, std::vector< Packet * > > m_packets
Our saved packet data.
Definition: PacketManager.h:207
std::shared_ptr< ProtocolDisplayFilter > m_filterExpression
Current filter expression.
Definition: PacketManager.h:222
void RemoveHistoryFrom(TimePoint timestamp)
Removes all history from the specified timestamp.
Definition: PacketManager.cpp:311
std::map< Packet *, std::vector< Packet * > > m_filteredChildPackets
Subset of m_filteredChildPackets that passed the current filter expression.
Definition: PacketManager.h:216
std::map< TimePoint, std::vector< Packet * > > m_filteredPackets
Subset of m_packets that passed the current filter expression.
Definition: PacketManager.h:213
std::vector< RowData > m_rows
The set of rows that are to be displayed, based on current tree expansion and filter state.
Definition: PacketManager.h:228
WaveformCacheKey m_cachekey
Cache key for the current waveform.
Definition: PacketManager.h:219
Definition: PacketDecoder.h:40
Definition: PacketManager.h:92
static std::string EatSpaces(std::string str)
Returns a copy of the input string with spaces removed.
Definition: PacketManager.cpp:621
Definition: PacketManager.h:126
Context data for a single row (used for culling)
Definition: PacketManager.h:47
Marker m_marker
The marker in this row (ignored if m_packet is valid)
Definition: PacketManager.h:86
TimePoint m_stamp
Timestamp of the waveform this packet came from.
Definition: PacketManager.h:80
double m_height
Height of this row.
Definition: PacketManager.h:74
Packet * m_packet
The packet in this row (null if m_marker is valid)
Definition: PacketManager.h:83
double m_totalHeight
Total height of the entire list up to this point.
Definition: PacketManager.h:77
A Session stores all of the instrument configuration and other state the user has open.
Definition: Session.h:95
A timestamp, measured in seconds + femtoseconds.
Definition: Marker.h:42