2013-08-21 18:16:26 +00:00
|
|
|
#ifndef REGTAB_H
|
|
|
|
#define REGTAB_H
|
|
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QTreeWidget>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QSplitter>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QListWidget>
|
2014-02-10 22:10:55 +00:00
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QToolButton>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QCheckBox>
|
2013-08-21 18:16:26 +00:00
|
|
|
#include "backend.h"
|
|
|
|
#include "settings.h"
|
2014-04-07 09:28:04 +00:00
|
|
|
#include "mainwindow.h"
|
2013-08-21 18:16:26 +00:00
|
|
|
|
2014-04-07 09:28:04 +00:00
|
|
|
class RegTabPanel
|
2013-08-21 18:16:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-04-07 09:28:04 +00:00
|
|
|
RegTabPanel() {}
|
|
|
|
virtual ~RegTabPanel() {}
|
|
|
|
virtual void AllowWrite(bool en) = 0;
|
|
|
|
virtual QWidget *GetWidget() = 0;
|
2014-02-09 01:13:53 +00:00
|
|
|
};
|
|
|
|
|
2014-04-07 09:28:04 +00:00
|
|
|
class EmptyRegTabPanel : public QWidget, public RegTabPanel
|
2014-02-09 01:16:43 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-04-07 09:28:04 +00:00
|
|
|
EmptyRegTabPanel(QWidget *parent = 0);
|
2014-02-10 22:10:55 +00:00
|
|
|
void AllowWrite(bool en);
|
2014-04-07 09:28:04 +00:00
|
|
|
QWidget *GetWidget();
|
2013-08-21 18:16:26 +00:00
|
|
|
};
|
|
|
|
|
2014-04-07 09:28:04 +00:00
|
|
|
class RegTab : public QSplitter, public DocumentTab
|
2013-08-21 18:16:26 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-04-07 09:28:04 +00:00
|
|
|
RegTab(Backend *backend, QWidget *parent = 0);
|
2014-02-09 01:17:14 +00:00
|
|
|
~RegTab();
|
2014-04-07 09:28:04 +00:00
|
|
|
virtual bool Quit();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void OnModified(bool modified);
|
2013-08-21 18:16:26 +00:00
|
|
|
|
|
|
|
protected:
|
2014-02-10 22:10:55 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
DataSelNothing,
|
|
|
|
DataSelFile,
|
|
|
|
#ifdef HAVE_HWSTUB
|
|
|
|
DataSelDevice,
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2014-04-07 09:28:04 +00:00
|
|
|
void FillDevSubTree(QTreeWidgetItem *item);
|
2013-08-21 18:16:26 +00:00
|
|
|
void FillRegTree();
|
|
|
|
void FillAnalyserList();
|
|
|
|
void UpdateSocList();
|
2014-02-09 01:13:53 +00:00
|
|
|
void DisplayRegister(const SocRegRef& ref);
|
2014-04-07 09:28:04 +00:00
|
|
|
void DisplayDevice(const SocDevRef& ref);
|
2013-08-21 18:16:26 +00:00
|
|
|
void SetDataSocName(const QString& socname);
|
2014-04-07 09:28:04 +00:00
|
|
|
void SetPanel(RegTabPanel *panel);
|
|
|
|
void UpdateSocFilename();
|
|
|
|
|
2013-08-21 18:16:26 +00:00
|
|
|
QComboBox *m_soc_selector;
|
2014-02-03 23:18:51 +00:00
|
|
|
#ifdef HAVE_HWSTUB
|
|
|
|
QComboBox *m_dev_selector;
|
|
|
|
HWStubBackendHelper m_hwstub_helper;
|
|
|
|
#endif
|
2013-08-21 18:16:26 +00:00
|
|
|
Backend *m_backend;
|
|
|
|
QTreeWidget *m_reg_tree;
|
2014-02-09 01:13:53 +00:00
|
|
|
SocRef m_cur_soc;
|
2013-08-21 18:16:26 +00:00
|
|
|
QVBoxLayout *m_right_panel;
|
2014-04-07 09:28:04 +00:00
|
|
|
RegTabPanel *m_right_content;
|
2013-08-21 18:16:26 +00:00
|
|
|
QLineEdit *m_data_sel_edit;
|
2014-02-10 22:10:55 +00:00
|
|
|
QCheckBox *m_readonly_check;
|
2013-08-21 18:16:26 +00:00
|
|
|
QLabel *m_data_soc_label;
|
|
|
|
QPushButton *m_data_sel_reload;
|
2014-05-11 17:51:55 +00:00
|
|
|
QPushButton *m_dump;
|
2013-08-21 18:16:26 +00:00
|
|
|
QComboBox *m_data_selector;
|
|
|
|
IoBackend *m_io_backend;
|
|
|
|
QTabWidget *m_type_selector;
|
|
|
|
QListWidget *m_analysers_list;
|
|
|
|
|
|
|
|
private slots:
|
2014-02-03 23:18:51 +00:00
|
|
|
#ifdef HAVE_HWSTUB
|
|
|
|
void OnDevListChanged();
|
|
|
|
void OnDevChanged(int index);
|
2014-04-07 09:28:04 +00:00
|
|
|
void ClearDevList();
|
2014-02-03 23:18:51 +00:00
|
|
|
#endif
|
2014-02-09 01:16:43 +00:00
|
|
|
void SetReadOnlyIndicator();
|
2014-04-07 09:28:04 +00:00
|
|
|
void OnSocChanged(int index);
|
2013-08-21 18:16:26 +00:00
|
|
|
void OnSocListChanged();
|
|
|
|
void OnRegItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
|
|
|
void OnRegItemClicked(QTreeWidgetItem *clicked, int col);
|
|
|
|
void OnDataSelChanged(int index);
|
|
|
|
void OnDataChanged();
|
|
|
|
void OnDataSocActivated(const QString&);
|
|
|
|
void OnAnalyserChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
|
|
|
void OnAnalyserClicked(QListWidgetItem *clicked);
|
2014-02-10 22:10:55 +00:00
|
|
|
void OnReadOnlyClicked(bool);
|
2014-05-11 17:51:55 +00:00
|
|
|
void OnDumpRegs(bool);
|
2013-08-21 18:16:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* REGTAB_H */
|