diff options
-rw-r--r-- | gui/gui.cc | 5 | ||||
-rw-r--r-- | gui/gui.h | 2 | ||||
-rw-r--r-- | gui/worker.cc | 1 | ||||
-rw-r--r-- | gui/worker.h | 1 |
4 files changed, 8 insertions, 1 deletions
@@ -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); @@ -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: |