first gui
This commit is contained in:
parent
42737c0a66
commit
c918993060
6 changed files with 1027 additions and 33 deletions
|
|
@ -2,6 +2,11 @@
|
|||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <memory>
|
||||
|
||||
class MachineController;
|
||||
class Machine;
|
||||
class QLineEdit;
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
|
|
@ -14,9 +19,31 @@ class MainWindow : public QMainWindow
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue