27 lines
481 B
C++
27 lines
481 B
C++
#ifndef MACHINECONTROLLER_H
|
|
#define MACHINECONTROLLER_H
|
|
|
|
#include <QObject>
|
|
#include <atomic>
|
|
#include <thread>
|
|
|
|
class MachineController : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
explicit MachineController(QObject *parent = nullptr);
|
|
~MachineController() override;
|
|
|
|
void start();
|
|
void stop();
|
|
void step();
|
|
|
|
signals:
|
|
void tick();
|
|
|
|
private:
|
|
void runLoop();
|
|
std::atomic<bool> m_running{false};
|
|
std::thread m_thread;
|
|
};
|
|
|
|
#endif // MACHINECONTROLLER_H
|