-
Notifications
You must be signed in to change notification settings - Fork 1
/
Event.cpp
57 lines (48 loc) · 1.06 KB
/
Event.cpp
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
/**************************************************************************
** Code written by Hesam Gholami.
**
** Email: [email protected]
** Website: http://hesam.org
**
** This file created in 12.
**************************************************************************/
#include "DataProvider.hpp"
#include "Event.hpp"
Event::Event(Type eventType, unsigned int time, DumpTruck *truck, QObject *parent) : QObject(parent), eventType(eventType), time(time), truck(truck)
{
}
Event::Type Event::getEventType() const
{
return this->eventType;
}
QString Event::getTypeString() const
{
QString type;
switch (this->eventType) {
case ALQ:
type = "ALQ";
break;
case EL:
type = "EL";
break;
case EW:
type = "EW";
break;
default:
type = "None";
break;
}
return type;
}
QString Event::getTimeString() const
{
return QString::number(this->getTime());
}
DumpTruck *Event::getTruck()
{
return this->truck;
}
unsigned int Event::getTime() const
{
return this->time;
}