Remove unused class RunDialog
DELETE
src/tmp_unused/rundialog.cpp
-#include "rundialog.h"
-#include "ui_rundialog.h"
-
-#include "processortab.h"
-
-#include <QPushButton>
-#include <QtConcurrent/QtConcurrent>
-
-RunDialog::RunDialog(QWidget* parent) : QDialog(parent), ui(new Ui::RunDialog) {
- ui->setupUi(this);
- ui->buttonBox->button(QDialogButtonBox::Ok)->setVisible(false);
- ui->buttonBox->button(QDialogButtonBox::Cancel)->setText("Abort");
-
- m_processorTab = static_cast<ProcessorTab*>(parent);
-
- setWindowTitle("Running...");
-
- ui->label->setText(QString("Running for 0 seconds"));
- m_timer.setInterval(1000);
- connect(&m_timer, &QTimer::timeout, this, &RunDialog::updateText);
- m_timer.start();
-}
-
-void RunDialog::updateText() {
- runtime++;
- ui->label->setText(QString("Running for %1 seconds").arg(runtime));
- if (runtime > 15) {
- ui->extra->setText(QString("Your program may contain an infinite loop"));
- }
-}
-QFuture<int> RunDialog::startSimulation() {
- // Ensure that abort flag of pipeline is cleared before running again
- Pipeline::getPipeline()->clearAbort();
- QFuture<int> future = QtConcurrent::run(Pipeline::getPipeline(), &Pipeline::run);
- return future;
-}
-
-int RunDialog::exec() {
- connect(&m_runWatcher, &QFutureWatcher<int>::finished, this, &RunDialog::finished);
-
- m_runWatcher.setFuture(startSimulation());
- return QDialog::exec();
-}
-
-RunDialog::~RunDialog() {
- delete ui;
-}
-
-void RunDialog::finished() {
- if (m_runWatcher.future().result() == 0) {
- m_timer.stop();
- accept();
- } else {
- // Check if there was an ecall
- const auto ecall_val = Pipeline::getPipeline()->checkEcall(true);
- if (ecall_val.first != Pipeline::ECALL::none) {
- // An ECALL has been invoked during continuous running. Handle ecall and continue to run
- m_processorTab->handleEcall(ecall_val);
- // Check whether to stop the pipeline given an ecall::exit instruction
- if (!(Pipeline::getPipeline()->isFinished() || ecall_val.first == Pipeline::ECALL::exit)) {
- m_runWatcher.setFuture(startSimulation());
- } else {
- accept();
- }
- }
- }
-}
-
-void RunDialog::on_buttonBox_clicked(QAbstractButton* button) {
- if (button == ui->buttonBox->button(QDialogButtonBox::Cancel)) {
- // Disable the futureWatcher as to not call stateChanged twice
- Pipeline::getPipeline()->abort();
- }
-}

DELETE
src/tmp_unused/rundialog.h
-#ifndef RUNDIALOG_H
-#define RUNDIALOG_H
-
-#include <QAbstractButton>
-#include <QDialog>
-#include <QTimer>
-
-#include <QFutureWatcher>
-
-namespace Ui {
-class RunDialog;
-}
-class ProcessorTab;
-
-class RunDialog : public QDialog {
- Q_OBJECT
-
-public:
- explicit RunDialog(QWidget* parent = nullptr);
- ~RunDialog() override;
-
-public slots:
- int exec() override;
-
-private slots:
- void on_buttonBox_clicked(QAbstractButton* button);
- void finished();
- void updateText();
-
-private:
- int runtime = 0;
- QFuture<int> startSimulation();
-
- Ui::RunDialog* ui;
-
- ProcessorTab* m_processorTab;
-
- QFutureWatcher<int> m_runWatcher;
- QTimer m_timer;
-};
-
-#endif // RUNDIALOG_H

DELETE
src/tmp_unused/rundialog.ui
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>RunDialog</class>
- <widget class="QDialog" name="RunDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>184</width>
- <height>80</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Running...</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="extra">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>RunDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>RunDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>

Remove unused class RunDialog