-
Notifications
You must be signed in to change notification settings - Fork 0
/
CyclometerController.cpp
44 lines (35 loc) · 1.05 KB
/
CyclometerController.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
/*
* CyclometerController.cpp
*
* Created on: Feb 3, 2013
* Author: dam7633
*/
#include "CyclometerController.h"
#include "Initialize.h"
#include "PulseScanner.h"
CyclometerController::CyclometerController(PulseScanner* scanner) :
StateContext(), isFullResetDone(false), pulseScanner(scanner) {
childState = new Initialize(this, this);
childState->entryAction();
pulseScanner->start();
}
void CyclometerController::handle(Event event) {
// Super hacky hack to handle the start stop button.
if (event == evStartStopDepressed) {
pulseScanner->toggleCalculate();
}
// Handle events normally.
StateContext::handle(event);
}
bool CyclometerController::getIsFullResetDone() {
return isFullResetDone;
}
void CyclometerController::setFullResetDone(bool _isFullResetDone) {
isFullResetDone = _isFullResetDone;
}
PulseScanner* CyclometerController::getPulseScanner() {
return pulseScanner;
}
DisplayInfo CyclometerController::getData() {
return ((DataProvider*)childState)->getData();
}