2021-10-15 16:39:43 +01:00
|
|
|
#pragma once
|
|
|
|
#include <qwidget.h>
|
|
|
|
#include "../../QSbieAPI/SbieAPI.h"
|
|
|
|
#include "../../MiscHelpers/Common/TreeItemModel.h"
|
|
|
|
|
|
|
|
class CTraceModel : public CTreeItemModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
CTraceModel(QObject* parent = 0);
|
|
|
|
~CTraceModel();
|
|
|
|
|
2022-09-29 17:28:48 +01:00
|
|
|
void SetTree(bool bTree) { m_bTree = bTree; }
|
|
|
|
bool IsTree() const { return m_bTree; }
|
|
|
|
void SetObjTree(bool bObjTree) { m_bObjTree = bObjTree; }
|
|
|
|
bool IsObjTree() const { return m_bObjTree; }
|
|
|
|
|
2021-10-15 16:39:43 +01:00
|
|
|
QList<QVariant> Sync(const QVector<CTraceEntryPtr>& EntryList, int (*Filter)(const CTraceEntryPtr&, void*), void* params);
|
|
|
|
|
|
|
|
CTraceEntryPtr GetEntry(const QModelIndex& index) const;
|
|
|
|
|
|
|
|
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
enum EColumns
|
|
|
|
{
|
|
|
|
eProcess = 0,
|
|
|
|
//eTimeStamp,
|
|
|
|
eType,
|
|
|
|
eStatus,
|
|
|
|
eValue,
|
|
|
|
eCount
|
|
|
|
};
|
|
|
|
|
2022-03-26 09:09:24 +00:00
|
|
|
/*struct SProgInfo
|
2021-10-15 16:39:43 +01:00
|
|
|
{
|
|
|
|
SProgInfo() { Dirty = true; }
|
|
|
|
QString Name;
|
|
|
|
bool Dirty;
|
|
|
|
QSet<quint32> Threads;
|
|
|
|
};
|
|
|
|
QMap<quint32, SProgInfo>GetPids() { return m_PidMap; }
|
|
|
|
|
|
|
|
signals:
|
2022-03-26 09:09:24 +00:00
|
|
|
void NewBranche();*/
|
2021-10-15 16:39:43 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
struct STraceNode : STreeNode
|
|
|
|
{
|
|
|
|
STraceNode(const QVariant& Id) : STreeNode(Id) { bHighLight = false; }
|
|
|
|
|
|
|
|
CTraceEntryPtr pEntry;
|
|
|
|
bool bHighLight;
|
|
|
|
};
|
|
|
|
|
2022-09-29 17:28:48 +01:00
|
|
|
bool m_bTree;
|
|
|
|
bool m_bObjTree;
|
2021-10-15 16:39:43 +01:00
|
|
|
QVariant m_LastID;
|
|
|
|
int m_LastCount;
|
|
|
|
|
|
|
|
virtual STreeNode* MkNode(const QVariant& Id) { return new STraceNode(Id); }
|
|
|
|
virtual STreeNode* MkVirtualNode(const QVariant& Id, STreeNode* pParent);
|
|
|
|
|
|
|
|
/*QList<QVariant> MakePath(const CTraceEntryPtr& pEntry, const QList<CTraceEntryPtr>& EntryList);
|
|
|
|
bool TestPath(const QList<QVariant>& Path, const CTraceEntryPtr& pEntry, const QList<CTraceEntryPtr>& EntryList, int Index = 0);*/
|
|
|
|
|
2022-03-26 09:09:24 +00:00
|
|
|
/*void SetProcessName(const QString& Name, quint32 pid, quint32 tid);
|
2021-10-15 16:39:43 +01:00
|
|
|
QString GetProcessName(quint32 pid);
|
|
|
|
void LogThreadId(quint32 pid, quint32 tid);
|
2022-03-26 09:09:24 +00:00
|
|
|
QMap<quint32, SProgInfo>m_PidMap;*/
|
2021-10-15 16:39:43 +01:00
|
|
|
};
|