diff options
author | bd <bdunahu@operationnull.com> | 2025-04-19 12:18:14 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-19 12:18:14 -0400 |
commit | 5ad39ec769fa09b9ac4dcc8f66232ef51384a3c6 (patch) | |
tree | 76291c5284711f5e371134439dce2c4c48432528 /gui/gui.cc | |
parent | 24de6faf71c85e0281b32fb899fcbe4fe82380c4 (diff) |
Safely delete old controller object when re-initializing
Diffstat (limited to 'gui/gui.cc')
-rw-r--r-- | gui/gui.cc | 25 |
1 files changed, 8 insertions, 17 deletions
@@ -18,9 +18,6 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) worker = new Worker(); worker->moveToThread(&workerThread); - // Connect worker thread lifecycle - // connect(&workerThread, &QThread::started, worker, &Worker::doWork); - // display clock cycles and PC connect(worker, &Worker::clock_cycles, this, &GUI::onWorkerClockCycles); @@ -49,19 +46,6 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) this, &GUI::sendConfigure, worker, &Worker::configure, Qt::QueuedConnection); - // // Refresh DRAM from worker thread - // connect(this, &GUI::sendRefreshDram, worker, &Worker::refreshDram, - // Qt::QueuedConnection); - - // // Refresh Cache from worker thread - // connect(this, &GUI::sendRefreshCache, worker, &Worker::refreshCache, - // Qt::QueuedConnection); - - // Refresh Registers from worker thread - connect( - this, &GUI::sendRefreshRegisters, worker, &Worker::refreshRegisters, - Qt::QueuedConnection); - // Advance controller by some steps connect( this, &GUI::sendRunSteps, worker, &Worker::runSteps, @@ -303,10 +287,17 @@ void GUI::on_enable_pipeline_checkbox_checkStateChanged( void GUI::on_step_btn_clicked() { qDebug() << "Run step button clicked."; + // try to configure first + if (!this->ready) + this->on_config_clicked(); + // try again if (!this->ready) - return this->on_config_clicked(); + return; + + this->set_status(get_running); int steps = step_values[ui->step_slider->value()]; emit sendRunSteps(steps); + this->set_status(get_waiting); } void GUI::on_save_program_state_btn_clicked() |