Numworks Epsilon  1.4.1
Graphing Calculator Operating System
screen_test_controller.cpp
Go to the documentation of this file.
2 extern "C" {
3 #include <assert.h>
4 }
5 
6 namespace HardwareTest {
7 
9  ViewController(parentResponder),
10  m_patternIndex(0),
11  m_view(),
12  m_ledTestController(this)
13 {
14 }
15 
17  return &m_view;
18 }
19 
21  if (event != Ion::Events::OK) {
22  return true;
23  }
24  if (m_patternIndex == Pattern::numberOfPatterns()) {
26  modal->displayModalViewController(&m_ledTestController, 0.0f, 0.0f);
27  } else {
28  showNextPattern();
29  }
30  return true;
31 }
32 
34  m_patternIndex = 0;
35  showNextPattern();
36 }
37 
38 void ScreenTestController::showNextPattern() {
39  m_view.setPattern(Pattern::patternAtIndex(m_patternIndex++));
40 }
41 
42 }
43 
Responder * parentResponder() const
Definition: responder.cpp:12
static Pattern patternAtIndex(int i)
Definition: pattern.cpp:12
static int numberOfPatterns()
Definition: pattern.cpp:8
bool handleEvent(Ion::Events::Event event) override
void setPattern(Pattern p)
void displayModalViewController(ViewController *vc, float verticalAlignment, float horizontalAlignment, KDCoordinate topMargin=0, KDCoordinate leftMargin=0, KDCoordinate bottomMargin=0, KDCoordinate rightMargin=0)
Definition: view.h:23
ScreenTestController(Responder *parentResponder)
constexpr Event OK
Definition: events.h:65