-
Notifications
You must be signed in to change notification settings - Fork 1
/
elevatorsystem.h
68 lines (52 loc) · 1.2 KB
/
elevatorsystem.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef ELEVATORSYSTEM_H
#define ELEVATORSYSTEM_H
#include <QObject>
#include <QTime>
#include <QThread>
#include <QDebug>
#include <QSignalMapper>
extern "C"
{
#include "modules/data.h"
#include "modules/request.h"
#include "modules/requestor.h"
#include "modules/actioner.h"
#include "modules/responder.h"
// include C library here
}
class ElevatorSystem : public QObject
{
Q_OBJECT
public:
explicit ElevatorSystem(QObject *parent = 0);
void start();
private:
int update(int elapsedTime);
void draw();
// Nested class
class ElevatorSystemThread : public QThread
{
public:
ElevatorSystem *elevatorSystem;
protected:
void run();
};
// Variable
QTime time;
ElevatorSystemThread *thread;
int currentElevatorPosition;
double currentDoorPosition;
QString currentMessage;
int currentWeight;
QString currentLog;
signals:
void elevatorPositionChanged(int position);
void doorPositionChanged(double position);
void currentMessageChanged(QString message);
void currentWeightChanged(int weight);
void currentLogChanged(QString log);
public slots:
protected:
int tick();
};
#endif // ELEVATORSYSTEM_H