aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/mainwindow.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-05 17:08:04 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-05 17:08:04 +0100
commit8025ccc2091228f9d089532852a2380f5f5a80b1 (patch)
tree21e9b0d9c0d45300ee3143d57c79a9e1e8d4e68d /qtmips_gui/mainwindow.cpp
parent85110f7880e32d298ee2853b4c055c7aaa22662f (diff)
downloadqtmips-8025ccc2091228f9d089532852a2380f5f5a80b1.tar.gz
qtmips-8025ccc2091228f9d089532852a2380f5f5a80b1.tar.bz2
qtmips-8025ccc2091228f9d089532852a2380f5f5a80b1.zip
Add template for Memory dock
For now a memory view is missing so there is no content.
Diffstat (limited to 'qtmips_gui/mainwindow.cpp')
-rw-r--r--qtmips_gui/mainwindow.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp
index 6b8d19b..a286f0d 100644
--- a/qtmips_gui/mainwindow.cpp
+++ b/qtmips_gui/mainwindow.cpp
@@ -18,6 +18,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
registers->hide();
program = new ProgramDock(this);
program->hide();
+ memory = new MemoryDock(this);
+ memory->hide();
cache_content = new CacheContentDock(this);
cache_content->hide();
cache_statictics = new CacheStatisticsDock(this);
@@ -36,6 +38,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
connect(ui->actionNew, SIGNAL(triggered(bool)), this, SLOT(new_machine()));
connect(ui->actionRegisters, SIGNAL(triggered(bool)), this, SLOT(show_registers()));
connect(ui->actionProgram_memory, SIGNAL(triggered(bool)), this, SLOT(show_program()));
+ connect(ui->actionMemory, SIGNAL(triggered(bool)), this, SLOT(show_memory()));
connect(ui->actionCache, SIGNAL(triggered(bool)), this, SLOT(show_cache_content()));
connect(ui->actionCache_statistics, SIGNAL(triggered(bool)), this, SLOT(show_cache_statictics()));
connect(ui->ips1, SIGNAL(toggled(bool)), this, SLOT(set_speed()));
@@ -59,6 +62,8 @@ MainWindow::~MainWindow() {
delete cache_content;
delete cache_statictics;
delete registers;
+ delete program;
+ delete memory;
delete ui;
if (machine != nullptr)
delete machine;
@@ -104,21 +109,16 @@ void MainWindow::new_machine() {
ndialog->show();
}
-void MainWindow::show_cache_content() {
- show_dockwidget(cache_content);
-}
-
-void MainWindow::show_cache_statictics() {
- show_dockwidget(cache_statictics);
-}
+#define SHOW_HANDLER(NAME) void MainWindow::show_##NAME() { \
+ show_dockwidget(NAME); \
+ } \
-void MainWindow::show_registers() {
- show_dockwidget(registers);
-}
-
-void MainWindow::show_program() {
- show_dockwidget(program);
-}
+SHOW_HANDLER(registers)
+SHOW_HANDLER(program)
+SHOW_HANDLER(memory)
+SHOW_HANDLER(cache_content)
+SHOW_HANDLER(cache_statictics)
+#undef SHOW_HANDLER
void MainWindow::set_speed() {
if (machine == nullptr)