-
Notifications
You must be signed in to change notification settings - Fork 1
/
simulationthread.h
50 lines (42 loc) · 1022 Bytes
/
simulationthread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*!
* \file simulationthread.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for the simulation thread
*/
#ifndef SIMULATIONTHREAD_H_
#define SIMULATIONTHREAD_H_
#include <QThread>
#include <QMutex>
#include "./machinemodel.h"
#include "./memorymodel.h"
#include "./arrow.h"
#include "./machine.h"
#include "./state.h"
#include "./transition.h"
class SimulationThread : public QThread {
Q_OBJECT
public:
explicit SimulationThread(QObject *parent = 0);
~SimulationThread();
void setMachine(Machine * m) { machine = m; }
signals:
void updateScene();
void selectTransition(QString n);
void selectState(QString n);
public slots:
void stopSim();
void pauseSim();
void startSim();
protected:
void run();
private:
int m_abort;
QMutex mutex;
Machine * machine;
QGraphicsItem * item;
State * currentState;
Transition * currentTransition;
};
#endif // SIMULATIONTHREAD_H_