2020-05-31 23:39:08 -04:00
|
|
|
#ifndef TIMER_H
|
|
|
|
#define TIMER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2020-06-03 00:21:37 -04:00
|
|
|
#include "../../Machines/Utility/MachineForTarget.hpp"
|
|
|
|
|
2020-05-31 23:39:08 -04:00
|
|
|
class Timer : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Timer(QObject *parent = nullptr);
|
2020-06-03 00:21:37 -04:00
|
|
|
void setMachine(MachineTypes::TimedMachine *machine);
|
2020-05-31 23:39:08 -04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void tick();
|
2020-06-03 00:21:37 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
MachineTypes::TimedMachine *machine = nullptr;
|
|
|
|
int64_t lastTickNanos = 0;
|
2020-05-31 23:39:08 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TIMER_H
|