31 lines
478 B
C++
31 lines
478 B
C++
#include "executor.h"
|
|
#include "machine.h"
|
|
#include<chrono>
|
|
#include<thread>
|
|
|
|
Executor::Executor() {}
|
|
|
|
Executor::Executor(Machine* m) {
|
|
machine = m;
|
|
}
|
|
|
|
void Executor::start() {
|
|
running = true;
|
|
while (running) {
|
|
machine->execute();
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
}
|
|
}
|
|
|
|
|
|
void Executor::stop() {
|
|
running = false;
|
|
}
|
|
|
|
bool Executor::isRunning() {
|
|
return running;
|
|
}
|
|
|
|
void Executor::step() {
|
|
machine->execute();
|
|
}
|