2018-05-14 20:01:23 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-05-14 20:01:23 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2021-02-19 22:02:59 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
2018-05-14 20:01:23 +00:00
|
|
|
class QGroupBox;
|
|
|
|
class QLabel;
|
|
|
|
class QLineEdit;
|
|
|
|
class QListWidget;
|
|
|
|
class QPushButton;
|
|
|
|
class QSplitter;
|
|
|
|
class QTextBrowser;
|
|
|
|
class QTreeWidget;
|
|
|
|
|
|
|
|
class FIFOAnalyzer final : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit FIFOAnalyzer();
|
|
|
|
~FIFOAnalyzer();
|
|
|
|
|
|
|
|
void Update();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
|
|
|
|
void BeginSearch();
|
|
|
|
void FindNext();
|
|
|
|
void FindPrevious();
|
|
|
|
|
|
|
|
void ShowSearchResult(size_t index);
|
|
|
|
|
|
|
|
void UpdateTree();
|
|
|
|
void UpdateDetails();
|
|
|
|
void UpdateDescription();
|
|
|
|
|
|
|
|
QTreeWidget* m_tree_widget;
|
|
|
|
QListWidget* m_detail_list;
|
|
|
|
QTextBrowser* m_entry_detail_browser;
|
|
|
|
QSplitter* m_object_splitter;
|
|
|
|
|
|
|
|
// Search
|
|
|
|
QGroupBox* m_search_box;
|
|
|
|
QLineEdit* m_search_edit;
|
|
|
|
QPushButton* m_search_new;
|
|
|
|
QPushButton* m_search_next;
|
|
|
|
QPushButton* m_search_previous;
|
|
|
|
QLabel* m_search_label;
|
|
|
|
QSplitter* m_search_splitter;
|
|
|
|
|
|
|
|
struct SearchResult
|
|
|
|
{
|
2021-04-22 01:06:33 +00:00
|
|
|
constexpr SearchResult(u32 frame, u32 object_idx, u32 cmd)
|
|
|
|
: m_frame(frame), m_object_idx(object_idx), m_cmd(cmd)
|
2021-02-19 22:02:59 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
const u32 m_frame;
|
2021-04-22 01:06:33 +00:00
|
|
|
// Index in tree view. Does not correspond with object numbers or part numbers.
|
|
|
|
const u32 m_object_idx;
|
2021-02-19 22:02:59 +00:00
|
|
|
const u32 m_cmd;
|
2018-05-14 20:01:23 +00:00
|
|
|
};
|
|
|
|
|
2021-04-22 01:06:33 +00:00
|
|
|
// Offsets from the start of the first part in an object for each command within the currently
|
|
|
|
// selected object.
|
2018-05-14 20:01:23 +00:00
|
|
|
std::vector<int> m_object_data_offsets;
|
2021-04-22 01:06:33 +00:00
|
|
|
|
2018-05-14 20:01:23 +00:00
|
|
|
std::vector<SearchResult> m_search_results;
|
|
|
|
};
|