-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtft_plottable.cpp
70 lines (59 loc) · 919 Bytes
/
tft_plottable.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
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "tft_plottable.h"
Plottable::Plottable() :
_visible(false),
_size_x(0),
_size_y(0),
_callback(NULL)
{
//do nothing
}
Plottable::Plottable(void (*callback)()) :
_visible(false),
_size_x(0),
_size_y(0),
_callback(callback)
{
//do nothing
}
Plottable::Plottable(void (*callback)(), uint16_t size_x, uint16_t size_y) :
_visible(false),
_size_x(size_x),
_size_y(size_y),
_callback(callback)
{
//do nothing
}
void Plottable::callback()
{
if(_callback != NULL){
_callback();
}
}
bool Plottable::getVisible()
{
return _visible;
}
void Plottable::setVisible(bool visible)
{
_visible = visible;
}
void Plottable::setInvisible()
{
_visible = false;
}
uint16_t Plottable::getSizeX()
{
return _size_x;
}
uint16_t Plottable::getSizeY()
{
return _size_y;
}
void Plottable::setSizeX(uint16_t size_x)
{
_size_x = size_x;
}
void Plottable::setSizeY(uint16_t size_y)
{
_size_y = size_y;
}