49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <memory>
|
|
|
|
class MachineController;
|
|
class Machine;
|
|
class QLineEdit;
|
|
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
std::shared_ptr<Machine> machine() const { return m_machine; }
|
|
MachineController* controller() const { return m_controller.get(); }
|
|
|
|
void startExecution();
|
|
void stopExecution();
|
|
void stepExecution();
|
|
|
|
void setTestRegisterValues();
|
|
|
|
private slots:
|
|
void updateRegisterDisplays();
|
|
void onRegisterFieldChanged();
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
std::shared_ptr<Machine> m_machine;
|
|
std::unique_ptr<MachineController> m_controller;
|
|
|
|
void connectRegisterFields();
|
|
void updateSingleRegisterDisplay(const QString& fieldName, int value);
|
|
void updateAllFormatsForRegister(const QString& regPrefix, int value);
|
|
void updateFloatRegisterFormats(const QString& regPrefix, double value);
|
|
void handleFloatRegisterFieldChanged(QLineEdit* field, const QString& objectName);
|
|
void loadDemoProgram();
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|