-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.h
116 lines (89 loc) · 3.07 KB
/
model.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
// Created by tberg on 4/13/18.
//
#ifndef CTA_CLOCK_PROVIDER_H
#define CTA_CLOCK_PROVIDER_H
#include <vector>
#include "matrix/include/graphics.h"
using std::vector;
using rgb_matrix::Color;
namespace itr {
namespace cta_clock {
namespace model {
struct TimeOptions {
bool IsDelayed : 1;
bool IsApproaching: 1;
bool IsScheduled : 1;
bool IsFaulty : 1;
};
class Time {
public:
time_t ArrivalTime;
int Run;
TimeOptions Options;
};
class Direction {
public:
explicit Direction(const char *destination);
~Direction();
/**
* The current set of times
*/
vector<Time> Times;
/**
* The destination
*/
const char *Destination;
};
class Line {
public:
/**
* @param identifier A short identifier for the line (2-3 chars)
* @param name A longer name for the line
* @param directions A list of all directions for this line from this stop
*/
Line(const char *identifier, const char *name, vector<Direction> directions);
/**
* @param color A color that identifies the line
* @param name A longer name for the line
* @param directions A list of all directions for the line from this stop
*/
Line(const Color *color, const char *name, vector<Direction> directions);
/**
* @param identifier A short identifier for the line (2-3 chars)
* @param color A color that identifies the line
* @param name A longer name for the line
* @param directions A list of all directions for the line from this stop
*/
Line(const char *identifier, const Color *color, const char *name, vector<Direction> directions);
~Line();
/**
* A list of directions with service times
*/
vector<Direction> Directions;
/**7
* Time when this Line last got fresh data
*/
time_t LastUpdate;
/**
* A short identifier for the line (2-3 chars)
*/
const char *Identifier;
/**
* A longer name for the line
*/
const char *Name;
/**
* An identifying color for the line
*/
const Color *LineColor;
};
class Provider {
public:
vector<Line> Lines;
virtual bool Update() =0;
};
}
}
}
#endif //CTA_CLOCK_PROVIDER_H