-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInitialize.cpp
More file actions
41 lines (33 loc) · 1.06 KB
/
Initialize.cpp
File metadata and controls
41 lines (33 loc) · 1.06 KB
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
/*
* Initialize.cpp
*
* Created on: Feb 5, 2013
* Author: dam7633
*/
#include "Initialize.h"
#include "SetUnits.h"
#include "CyclometerController.h"
Initialize::Initialize(StateParent* parent, StateContext* context) :
State(parent, context) {}
void Initialize::accept(Event event) {
// We won't actually accept any events because
// of our anonymous transition. Implemented because
// accept is pure virtual.
}
void Initialize::entryAction() {
// Clear the full reset done flag.
((CyclometerController*)context)->setFullResetDone(false);
// Perform the actual reset action.
((CyclometerController*)context)->getPulseScanner()->scannerReset();
// Perform an anonymous transition to the next config state.
parent->doTransition(new SetUnits(parent, context), NULL);
}
DisplayInfo Initialize::getData() {
DisplayInfo info;
// Numbers should all be blank, decimal points should be lit.
for (int i = 0; i < NUM_DIGITS; i++) {
info.val[i] = BLANK_DIGIT;
info.dp[i] = true;
}
return info;
}