diff options
author | Karel Kočí <cynerd@email.cz> | 2017-12-17 13:31:25 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-12-17 13:31:25 +0100 |
commit | e0c757926743ee21f1a60b4b6948ca3eb895c373 (patch) | |
tree | d2acad9475849d5abed15cdd4b6bf3b8d9030f06 /qtmips_gui | |
parent | 7fa050ddefca5373b09bdbcbb3aa0902eacd5d2f (diff) | |
download | qtmips-e0c757926743ee21f1a60b4b6948ca3eb895c373.tar.gz qtmips-e0c757926743ee21f1a60b4b6948ca3eb895c373.tar.bz2 qtmips-e0c757926743ee21f1a60b4b6948ca3eb895c373.zip |
Put qtmips_machine to machine namespace
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/coreview.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview.h | 4 | ||||
-rw-r--r-- | qtmips_gui/coreview/latch.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview/latch.h | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview/programcounter.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/coreview/programcounter.h | 2 | ||||
-rw-r--r-- | qtmips_gui/mainwindow.cpp | 4 | ||||
-rw-r--r-- | qtmips_gui/mainwindow.h | 4 | ||||
-rw-r--r-- | qtmips_gui/newdialog.cpp | 4 | ||||
-rw-r--r-- | qtmips_gui/registersdock.cpp | 2 | ||||
-rw-r--r-- | qtmips_gui/registersdock.h | 4 |
11 files changed, 16 insertions, 16 deletions
diff --git a/qtmips_gui/coreview.cpp b/qtmips_gui/coreview.cpp index 660f78d..6630ad1 100644 --- a/qtmips_gui/coreview.cpp +++ b/qtmips_gui/coreview.cpp @@ -1,6 +1,6 @@ #include "coreview.h" -CoreView::CoreView(QWidget *parent, QtMipsMachine *machine) : QGraphicsView(parent) { +CoreView::CoreView(QWidget *parent, machine::QtMipsMachine *machine) : QGraphicsView(parent) { setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); diff --git a/qtmips_gui/coreview.h b/qtmips_gui/coreview.h index fc69861..7e9081a 100644 --- a/qtmips_gui/coreview.h +++ b/qtmips_gui/coreview.h @@ -12,13 +12,13 @@ class CoreView : public QGraphicsView { Q_OBJECT public: - CoreView(QWidget *parent, QtMipsMachine *machine); + CoreView(QWidget *parent, machine::QtMipsMachine *machine); private: void resizeEvent(QResizeEvent *event); QGraphicsScene scene; - QtMipsMachine *machine; + machine::QtMipsMachine *machine; coreview::ProgramCounter *pc; coreview::Multiplexer *pc_multiplexer; diff --git a/qtmips_gui/coreview/latch.cpp b/qtmips_gui/coreview/latch.cpp index 77bb317..52f6eb3 100644 --- a/qtmips_gui/coreview/latch.cpp +++ b/qtmips_gui/coreview/latch.cpp @@ -7,7 +7,7 @@ using namespace coreview; #define PENW 1 ////////////////////// -Latch::Latch(QtMipsMachine *machine, qreal height) { +Latch::Latch(machine::QtMipsMachine *machine, qreal height) { this->height = height; connect(machine, SIGNAL(tick()), this, SLOT(tick())); } diff --git a/qtmips_gui/coreview/latch.h b/qtmips_gui/coreview/latch.h index a8738b3..0148b67 100644 --- a/qtmips_gui/coreview/latch.h +++ b/qtmips_gui/coreview/latch.h @@ -13,7 +13,7 @@ namespace coreview { class Latch : public QGraphicsObject { Q_OBJECT public: - Latch(QtMipsMachine *machine, qreal height); + Latch(machine::QtMipsMachine *machine, qreal height); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/qtmips_gui/coreview/programcounter.cpp b/qtmips_gui/coreview/programcounter.cpp index 32c907c..b25cbbe 100644 --- a/qtmips_gui/coreview/programcounter.cpp +++ b/qtmips_gui/coreview/programcounter.cpp @@ -8,7 +8,7 @@ using namespace coreview; #define PENW 1 ////////////////////// -ProgramCounter::ProgramCounter(QtMipsMachine *machine) : QGraphicsObject(nullptr), value(this), name(this) { +ProgramCounter::ProgramCounter(machine::QtMipsMachine *machine) : QGraphicsObject(nullptr), value(this), name(this) { value.setText(QString("0x") + QString::number(machine->registers()->read_pc(), 16)); value.setPos(0, HEIGHT/2 - value.boundingRect().height()/2); name.setText(QString("PC")); diff --git a/qtmips_gui/coreview/programcounter.h b/qtmips_gui/coreview/programcounter.h index 98b161d..91d1da3 100644 --- a/qtmips_gui/coreview/programcounter.h +++ b/qtmips_gui/coreview/programcounter.h @@ -12,7 +12,7 @@ namespace coreview { class ProgramCounter : public QGraphicsObject { Q_OBJECT public: - ProgramCounter(QtMipsMachine *machine); + ProgramCounter(machine::QtMipsMachine *machine); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index 157baf4..6a507fa 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -48,9 +48,9 @@ void MainWindow::start() { ndialog->show(); } -void MainWindow::create_core(MachineConfig *config) { +void MainWindow::create_core(machine::MachineConfig *config) { // Create machine - machine = new QtMipsMachine(config); + machine = new machine::QtMipsMachine(config); // Create machine view coreview = new CoreView(this, machine); this->setCentralWidget(coreview); diff --git a/qtmips_gui/mainwindow.h b/qtmips_gui/mainwindow.h index bba1cb7..8b9e3e7 100644 --- a/qtmips_gui/mainwindow.h +++ b/qtmips_gui/mainwindow.h @@ -21,7 +21,7 @@ public: ~MainWindow(); void start(); - void create_core(MachineConfig *config); + void create_core(machine::MachineConfig *config); public slots: void new_machine(); @@ -48,7 +48,7 @@ private: QSettings *settings; - QtMipsMachine *machine; // Current simulated machine + machine::QtMipsMachine *machine; // Current simulated machine void show_dockwidget(QDockWidget *w); }; diff --git a/qtmips_gui/newdialog.cpp b/qtmips_gui/newdialog.cpp index 31f4bb8..bbaa73a 100644 --- a/qtmips_gui/newdialog.cpp +++ b/qtmips_gui/newdialog.cpp @@ -46,14 +46,14 @@ void NewDialog::cancel() { void NewDialog::create() { MainWindow *prnt = (MainWindow*)parent(); - MachineConfig *mc = new MachineConfig(); + machine::MachineConfig *mc = new machine::MachineConfig(); mc->set_elf(ui->elf_file->text()); mc->set_pipelined(ui->pipelined->isChecked()); // TODO other settings try { prnt->create_core(mc); - } catch (const QtMipsExceptionInput &e) { + } catch (const machine::QtMipsExceptionInput &e) { QMessageBox msg(this); msg.setText(e.msg(false)); msg.setIcon(QMessageBox::Critical); diff --git a/qtmips_gui/registersdock.cpp b/qtmips_gui/registersdock.cpp index d038462..20eb9e4 100644 --- a/qtmips_gui/registersdock.cpp +++ b/qtmips_gui/registersdock.cpp @@ -30,7 +30,7 @@ RegistersDock::~RegistersDock() { delete gp[i]; } -void RegistersDock::setup(QtMipsMachine *machine) { +void RegistersDock::setup(machine::QtMipsMachine *machine) { regs = machine->registers(); connect(regs, SIGNAL(pc_update(std::uint32_t)), this, SLOT(pc_changed(std::uint32_t))); connect(regs, SIGNAL(gp_update(std::uint8_t,std::uint32_t)), this, SLOT(gp_changed(std::uint8_t,std::uint32_t))); diff --git a/qtmips_gui/registersdock.h b/qtmips_gui/registersdock.h index 90be659..654983e 100644 --- a/qtmips_gui/registersdock.h +++ b/qtmips_gui/registersdock.h @@ -14,7 +14,7 @@ public: RegistersDock(QWidget *parent); ~RegistersDock(); - void setup(QtMipsMachine *machine); + void setup(machine::QtMipsMachine *machine); private slots: void pc_changed(std::uint32_t val); @@ -22,7 +22,7 @@ private slots: void hi_lo_changed(bool hi, std::uint32_t val); private: - const Registers *regs; + const machine::Registers *regs; QScrollArea *widg; QFormLayout *layout; |