-
Notifications
You must be signed in to change notification settings - Fork 0
/
Screen1View.cpp
47 lines (39 loc) · 1013 Bytes
/
Screen1View.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
#include <gui/screen1_screen/Screen1View.hpp>
Screen1View::Screen1View()
{
gauge1modifier = 25;
EngTempmodifier = 1;
}
void Screen1View::setupScreen()
{
Screen1ViewBase::setupScreen();
}
void Screen1View::tearDownScreen()
{
Screen1ViewBase::tearDownScreen();
}
void Screen1View::handleTickEvent()
{
int gauge1minValue;
int gauge1maxValue;
gauge1.getRange(gauge1minValue, gauge1maxValue);
/*
if (gauge1.getValue()== gauge1minValue || gauge1.getValue()== gauge1maxValue)
{
gauge1modifier *= -1;
}
*/
gauge1.updateValue(gauge1.getValue() + gauge1modifier, 0);
if (gauge1.getValue() >= gauge1maxValue*0.8)
{
upShiftArrow_Warning.setVisible(true);
upShiftArrow_Warning.invalidate();
} else {
upShiftArrow_Warning.setVisible(false);
upShiftArrow_Warning.invalidate();
}
Unicode::snprintf(textArea1Buffer, TEXTAREA1_SIZE, "%d", gauge1.getValue() / 20);
textArea1.invalidate();
Unicode::snprintf(RPM_TextBuffer, RPM_TEXT_SIZE, "%d", gauge1.getValue());
RPM_Text.invalidate();
}