summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-27 13:06:44 -0400
committerbd <bdunahu@operationnull.com>2025-04-27 13:06:44 -0400
commitc00703033380d68eeff47c40a9c7dc5f8cd7fb1f (patch)
tree78e088fd451a5fbe80406c4506223f27a8755514 /gui
parenta4dd1f00a5d0108058fb3bfbd5f399a507792859 (diff)
Report status correctly when steps have finished running
Diffstat (limited to 'gui')
-rw-r--r--gui/gui.cc5
-rw-r--r--gui/gui.h2
-rw-r--r--gui/worker.cc1
-rw-r--r--gui/worker.h1
4 files changed, 8 insertions, 1 deletions
diff --git a/gui/gui.cc b/gui/gui.cc
index b4feda6..28876ba 100644
--- a/gui/gui.cc
+++ b/gui/gui.cc
@@ -72,6 +72,8 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI)
connect(worker, &Worker::wb_info, this, &GUI::onWorkerWriteBackInfo);
+ connect(worker, &Worker::steps_done, this, &GUI::onWorkerStepsDone);
+
// Display cache
connect(worker, &Worker::storage, this, &GUI::onWorkerShowStorage);
@@ -139,7 +141,6 @@ void GUI::on_worker_refresh_gui(int cycles, int pc)
{
ui->p_counter->set_value(pc);
ui->cycle_counter->set_value(cycles);
- this->set_status(get_waiting, "idle");
}
void GUI::onWorkerFetchInfo(const InstrDTO *i)
@@ -215,6 +216,8 @@ void GUI::onWorkerWriteBackInfo(const InstrDTO *i)
}
}
+void GUI::onWorkerStepsDone() { this->set_status(get_waiting, "idle"); }
+
void GUI::onWorkerShowStorage(const QVector<QVector<int>> &data, int i)
{
this->tab_boxes.at(i)->set_data(data);
diff --git a/gui/gui.h b/gui/gui.h
index 830d852..8e0b5b4 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -68,6 +68,8 @@ class GUI : public QMainWindow
void onWorkerWriteBackInfo(const InstrDTO *);
+ void onWorkerStepsDone();
+
void onWorkerShowStorage(const QVector<QVector<int>> &data, int i);
void onWorkerShowRegisters(const std::array<int, GPR_NUM> &data);
diff --git a/gui/worker.cc b/gui/worker.cc
index 0ba364b..dd7b637 100644
--- a/gui/worker.cc
+++ b/gui/worker.cc
@@ -72,6 +72,7 @@ void Worker::runSteps(int steps)
{
this->ct->run_for(steps);
this->update();
+ emit steps_done();
}
void Worker::update()
diff --git a/gui/worker.h b/gui/worker.h
index c62f4ed..5ffb6ef 100644
--- a/gui/worker.h
+++ b/gui/worker.h
@@ -72,6 +72,7 @@ class Worker : public QObject
void ex_info(const InstrDTO *);
void mm_info(const InstrDTO *);
void wb_info(const InstrDTO *);
+ void steps_done();
void finished();
private: