status light fixed and stop btn fixed

This commit is contained in:
aljazbrodar. 2025-12-11 07:38:13 +01:00
parent 87b9c1dc62
commit 55a126dcca
10 changed files with 197 additions and 129 deletions

View file

@ -1,67 +1,55 @@
# ninja log v6
2309 2585 1765391447352614831 simulator 53725ab159343a13
2366 2590 1765433802185918596 simulator 53725ab159343a13
17 296 1765301640842310980 CMakeFiles/simulator.dir/device.cpp.o 36fc5c8cf014f45b
3 15 1765391445045619892 simulator_autogen/timestamp c193a23cfe79571d
13 775 1765391004094460465 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
206 1341 1765388632939713585 CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o 5301f473905a545f
3 15 1765391445045619892 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
206 1793 1765388632939713585 CMakeFiles/simulator.dir/main.cpp.o 9ebba9b7abc4cbf1
3 207 1765433800022921911 simulator_autogen/timestamp c193a23cfe79571d
208 1368 1765433800027921904 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
207 1462 1765433800026921905 CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o 5301f473905a545f
3 207 1765433800022921911 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
3 207 1765433800022921911 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
12 22 1765010490368890036 CMakeFiles/simulator.dir/opcode.cpp.o da65f589ec5e1f76
3 15 1765391445045619892 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
207 1357 1765433800026921905 CMakeFiles/simulator.dir/main.cpp.o 9ebba9b7abc4cbf1
3 207 1765433800022921911 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
208 2366 1765433800027921904 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
298 641 1765351736928284389 CMakeFiles/simulator.dir/loader.cpp.o 8371bb969cd708a5
14 290 1765388413560525375 CMakeFiles/simulator.dir/machine.cpp.o 7030a03f8cbf1ad0
15 2309 1765391445058619863 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
3 15 1765391445045619892 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
3 244 1765391661065278121 simulator_autogen/timestamp c193a23cfe79571d
3 244 1765391661065278121 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
3 244 1765391661065278121 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
3 244 1765391661065278121 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
244 1878 1765391661070278116 CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o 5301f473905a545f
244 2352 1765391661070278116 CMakeFiles/simulator.dir/main.cpp.o 9ebba9b7abc4cbf1
244 2999 1765391661070278116 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
2999 3246 1765391663825275257 simulator 53725ab159343a13
2 13 1765391675220263773 simulator_autogen/timestamp c193a23cfe79571d
2 13 1765391675220263773 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
2 13 1765391675220263773 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
2 13 1765391675220263773 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
13 1850 1765391675231263762 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1850 2084 1765391677068261961 simulator 53725ab159343a13
2 13 1765391743406206014 simulator_autogen/timestamp c193a23cfe79571d
2 13 1765391743406206014 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
2 13 1765391743406206014 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
2 13 1765391743406206014 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
13 1956 1765391743417206006 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1956 2190 1765391745360204622 simulator 53725ab159343a13
3 19 1765391803656169255 simulator_autogen/timestamp c193a23cfe79571d
3 19 1765391803656169255 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
3 19 1765391803656169255 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
3 19 1765391803656169255 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
19 1599 1765391803672169247 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1599 1838 1765391805252168448 simulator 53725ab159343a13
3 14 1765392232130182156 simulator_autogen/timestamp c193a23cfe79571d
3 14 1765392232130182156 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
3 14 1765392232130182156 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
3 14 1765392232130182156 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
14 1687 1765392232141182161 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1687 1928 1765392233814182895 simulator 53725ab159343a13
2 12 1765392380808261413 simulator_autogen/timestamp c193a23cfe79571d
2 12 1765392380808261413 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
2 12 1765392380808261413 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
2 12 1765392380808261413 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
12 801 1765392380818261419 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
12 1711 1765392380818261419 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1711 1966 1765392382517262473 simulator 53725ab159343a13
3 13 1765392399220272998 simulator_autogen/timestamp c193a23cfe79571d
3 13 1765392399220272998 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
3 13 1765392399220272998 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
3 13 1765392399220272998 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
14 843 1765392399231273005 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
13 1798 1765392399230273005 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1798 2041 1765392401015274146 simulator 53725ab159343a13
5 17 1765432887804460877 simulator_autogen/timestamp c193a23cfe79571d
5 17 1765432887804460877 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
5 17 1765432887804460877 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
5 17 1765432887804460877 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
18 822 1765432887817460840 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
18 1676 1765432887817460840 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1676 1990 1765432889475456127 simulator 53725ab159343a13
2 204 1765434024529529022 simulator_autogen/timestamp c193a23cfe79571d
2 204 1765434024529529022 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
2 204 1765434024529529022 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
2 204 1765434024529529022 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
205 1222 1765434024534529013 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
205 1499 1765434024534529013 CMakeFiles/simulator.dir/main.cpp.o 9ebba9b7abc4cbf1
205 1912 1765434024533529015 CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o 5301f473905a545f
205 2133 1765434024534529013 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
2133 2368 1765434026462525270 simulator 53725ab159343a13
3 208 1765434093411392111 simulator_autogen/timestamp c193a23cfe79571d
3 208 1765434093411392111 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
3 208 1765434093411392111 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
3 208 1765434093411392111 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
208 1418 1765434093415392103 CMakeFiles/simulator.dir/main.cpp.o 9ebba9b7abc4cbf1
208 1509 1765434093415392103 CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o 5301f473905a545f
209 1575 1765434093416392101 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
209 2359 1765434093416392101 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
2359 2599 1765434095566387726 simulator 53725ab159343a13
2 206 1765434253865051082 simulator_autogen/timestamp c193a23cfe79571d
2 206 1765434253865051082 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
2 206 1765434253865051082 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
2 206 1765434253865051082 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
207 1098 1765434253870051071 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
207 1624 1765434253870051071 CMakeFiles/simulator.dir/main.cpp.o 9ebba9b7abc4cbf1
206 1987 1765434253869051073 CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o 5301f473905a545f
207 2168 1765434253870051071 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
2168 2417 1765434255831046739 simulator 53725ab159343a13
3 13 1765434790221769863 simulator_autogen/timestamp c193a23cfe79571d
3 13 1765434790221769863 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
3 13 1765434790221769863 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
3 13 1765434790221769863 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
13 852 1765434790231769838 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
13 1671 1765434790231769838 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1671 1909 1765434791889765665 simulator 53725ab159343a13
1 14 1765434930303414438 simulator_autogen/timestamp c193a23cfe79571d
1 14 1765434930303414438 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
1 14 1765434930303414438 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
1 14 1765434930303414438 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
14 841 1765434930316414405 CMakeFiles/simulator.dir/executor.cpp.o 8cd2a28f3c211eaa
14 1672 1765434930316414405 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
1672 1908 1765434931974410166 simulator 53725ab159343a13

View file

@ -1,6 +1,7 @@
# Generated by CMake. Changes will be overwritten.
/home/aljaz/Desktop/spo/ass2/simulator/opcode.h
/home/aljaz/Desktop/spo/ass2/simulator/machine.cpp
/home/aljaz/Desktop/spo/ass2/simulator/device.h
/home/aljaz/Desktop/spo/ass2/simulator/loader.cpp
/home/aljaz/Desktop/spo/ass2/simulator/machine.h
/home/aljaz/Desktop/spo/ass2/simulator/mainwindow.h
mmc:Q_OBJECT
mdp:/home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/moc_predefs.h
@ -474,12 +475,13 @@
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stdarg.h
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stdbool.h
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h
/home/aljaz/Desktop/spo/ass2/simulator/machine.h
/home/aljaz/Desktop/spo/ass2/simulator/loader.cpp
/home/aljaz/Desktop/spo/ass2/simulator/device.h
/home/aljaz/Desktop/spo/ass2/simulator/opcode.h
/home/aljaz/Desktop/spo/ass2/simulator/machine.cpp
/home/aljaz/Desktop/spo/ass2/simulator/main.cpp
/home/aljaz/Desktop/spo/ass2/simulator/executor.cpp
/home/aljaz/Desktop/spo/ass2/simulator/loader.h
/home/aljaz/Desktop/spo/ass2/simulator/opcode.cpp
/home/aljaz/Desktop/spo/ass2/simulator/device.cpp
/home/aljaz/Desktop/spo/ass2/simulator/mainwindow.cpp
uic:ui_mainwindow.h
/home/aljaz/Desktop/spo/ass2/simulator/executor.h
mmc:Q_OBJECT
mdp:/home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/moc_predefs.h
@ -843,7 +845,5 @@
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stdarg.h
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stdbool.h
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h
/home/aljaz/Desktop/spo/ass2/simulator/mainwindow.cpp
uic:ui_mainwindow.h
/home/aljaz/Desktop/spo/ass2/simulator/device.cpp
/home/aljaz/Desktop/spo/ass2/simulator/opcode.cpp
/home/aljaz/Desktop/spo/ass2/simulator/loader.h
/home/aljaz/Desktop/spo/ass2/simulator/executor.cpp

View file

@ -43,7 +43,11 @@ template <> constexpr inline auto Executor::qt_create_metaobjectdata<qt_meta_tag
"",
"signalEnded",
"signalStarted",
"signalStopped"
"signalStopped",
"start",
"stop",
"step",
"runStep"
};
QtMocHelpers::UintData qt_methods {
@ -55,6 +59,14 @@ template <> constexpr inline auto Executor::qt_create_metaobjectdata<qt_meta_tag
QtMocHelpers::SignalData<void()>(4, 2, QMC::AccessPublic, QMetaType::Void),
// Signal 'signalStopped'
QtMocHelpers::SignalData<void()>(5, 2, QMC::AccessPublic, QMetaType::Void),
// Slot 'start'
QtMocHelpers::SlotData<void()>(6, 2, QMC::AccessPublic, QMetaType::Void),
// Slot 'stop'
QtMocHelpers::SlotData<void()>(7, 2, QMC::AccessPublic, QMetaType::Void),
// Slot 'step'
QtMocHelpers::SlotData<void()>(8, 2, QMC::AccessPublic, QMetaType::Void),
// Slot 'runStep'
QtMocHelpers::SlotData<void()>(9, 2, QMC::AccessPrivate, QMetaType::Void),
};
QtMocHelpers::UintData qt_properties {
};
@ -82,6 +94,10 @@ void Executor::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, vo
case 1: _t->signalEnded(); break;
case 2: _t->signalStarted(); break;
case 3: _t->signalStopped(); break;
case 4: _t->start(); break;
case 5: _t->stop(); break;
case 6: _t->step(); break;
case 7: _t->runStep(); break;
default: ;
}
}
@ -116,14 +132,14 @@ int Executor::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
if (_id < 8)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
_id -= 8;
}
if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
if (_id < 8)
*reinterpret_cast<QMetaType *>(_a[0]) = QMetaType();
_id -= 4;
_id -= 8;
}
return _id;
}

View file

@ -1,76 +1,132 @@
#include "executor.h"
#include "machine.h"
#include<chrono>
#include<thread>
#include <QCoreApplication>
Executor::Executor() {}
#include <QTimer>
#include <QThread>
Executor::Executor(Machine* m) {
machine = m;
Executor::Executor(Machine* m)
: QObject(nullptr), machine(m), timer(nullptr)
{
}
void Executor::start() {
if (ended) {
emit signalEnded();
return;
}
running = true;
emit signalStarted();
while (running && !ended) {
int pc_before = machine->getPC();
machine->execute();
int pc_after = machine->getPC();
emit updateRequested(); // signal za posodobitev UI
if (pc_before == pc_after) {
ended = true;
emit signalEnded();
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));
QCoreApplication::processEvents();
Executor::~Executor()
{
if (timer) {
timer->stop();
delete timer;
timer = nullptr;
}
}
void Executor::stop() {
running = false;
emit signalStopped();
emit updateRequested();
}
bool Executor::isRunning() {
return running;
}
bool Executor::hasEnded() {
bool Executor::hasEnded() const {
return ended;
}
void Executor::resetProgram() {
// resetiraj stanje, poruši izvajanje in spravi lučko v stopped
ended = false;
running = false;
stepping = false;
if (timer) timer->stop();
emit signalStopped();
emit updateRequested();
}
// START: pripravimo timer (v threadu, kjer je ta objekt) in ga zaženemo
void Executor::start() {
// če je končano, pošljemo ended in ne začnemo
if (ended) {
emit signalEnded();
return;
}
// če že tečemo, nič
if (running) return;
running = true;
emit signalStarted();
// timer naj bo kreiran v končni niti (start() bo klican v executorThread preko queued connection)
if (!timer) {
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &Executor::runStep, Qt::DirectConnection);
}
// zaženi timer z intervalom
timer->start(intervalMs);
}
// STOP: takoj ustavimo timer in sporočimo stopped
void Executor::stop() {
if (!running && !timer) {
emit signalStopped();
return;
}
running = false;
stepping = false;
if (timer && timer->isActive()) timer->stop();
emit signalStopped();
emit updateRequested();
}
// runStep: izvede en ukaz — klican iz timer timeout
void Executor::runStep() {
if (!running || ended) {
if (timer && timer->isActive()) timer->stop();
return;
}
// izvedemo en ukaz
int pc_before = machine->getPC();
machine->execute();
int pc_after = machine->getPC();
// obvestimo UI
emit updateRequested();
// preverimo halt / ended
if (pc_before == pc_after) {
ended = true;
// ustavimo timer in pošljemo samo ended (ne stopped)
if (timer && timer->isActive()) timer->stop();
emit signalEnded();
return;
}
// Če je uporabnik pritisnil stop med izvajanjem, ustavimo timer
if (!running) {
if (timer && timer->isActive()) timer->stop();
emit signalStopped();
}
}
// step: en sam korak, le če ne tečemo že v avtomatskem načinu
void Executor::step() {
if (ended) {
emit signalEnded();
return;
}
emit signalStarted();
// če je avtomatsko izvajanje v teku, ignoriramo manualni step
if (running) return;
// preprečimo reentrance
if (stepping) return;
stepping = true;
int pc_before = machine->getPC();
machine->execute();
int pc_after = machine->getPC();
emit updateRequested();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
emit signalStopped();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
if (pc_after == pc_before) {
ended = true;
emit signalEnded();
} else {
emit signalStopped();
}
}
stepping = false;
}

View file

@ -4,28 +4,25 @@
#include <QObject>
class Machine;
class QTimer;
class Executor : public QObject
{
Q_OBJECT
private:
bool running = false;
bool ended = false;
Machine* machine;
public:
Executor();
Executor(Machine* m);
bool hasEnded();
explicit Executor(Machine* m = nullptr);
~Executor() override;
bool hasEnded() const;
void resetProgram();
public slots:
// Zažene oz. nadaljuje samodejno izvajanje.
void start();
// Zaustavi samodejno izvajanje.
void stop();
// Pove, ali je samodejno izvajanje trenutno v teku.
bool isRunning();
// Izvede en ukaz.
void step();
@ -34,6 +31,17 @@ signals:
void signalEnded();
void signalStarted();
void signalStopped();
private slots:
void runStep(); // povezan s QTimer::timeout
private:
Machine* machine = nullptr;
QTimer* timer = nullptr;
bool running = false;
bool ended = false;
bool stepping = false; // prepreči reentrant step
int intervalMs = 500; // privzeta frekvenca izvajanja v ms
};
#endif // EXECUTOR_H