mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
49 lines
1.5 KiB
C++
49 lines
1.5 KiB
C++
#ifndef HARDWARE_TEST_LED_TEST_CONTROLLER_H
|
|
#define HARDWARE_TEST_LED_TEST_CONTROLLER_H
|
|
|
|
#include <escher.h>
|
|
#include "battery_test_controller.h"
|
|
|
|
namespace HardwareTest {
|
|
|
|
class LEDTestController : public ViewController {
|
|
public:
|
|
LEDTestController(Responder * parentResponder);
|
|
View * view() override;
|
|
bool handleEvent(Ion::Events::Event event) override;
|
|
void viewWillAppear() override;
|
|
private:
|
|
class ContentView : public View {
|
|
public:
|
|
ContentView();
|
|
SolidColorView * LEDColorIndicatorView();
|
|
void drawRect(KDContext * ctx, KDRect rect) const override;
|
|
private:
|
|
void layoutSubviews() override;
|
|
int numberOfSubviews() const override;
|
|
View * subviewAtIndex(int index) override;
|
|
SolidColorView m_ledColorIndicatorView;
|
|
SolidColorView m_ledColorOutlineView;
|
|
BufferTextView m_ledView;
|
|
};
|
|
void setLEDColor(KDColor color);
|
|
constexpr static KDCoordinate k_arrowThickness = 3;
|
|
constexpr static KDCoordinate k_arrowLength = 100;
|
|
constexpr static KDCoordinate k_arrowMargin = 20;
|
|
constexpr static KDCoordinate k_indicatorSize = 20;
|
|
constexpr static KDCoordinate k_indicatorMargin = 8;
|
|
constexpr static KDCoordinate k_arrowHeight = 10;
|
|
constexpr static KDCoordinate k_arrowWidth = 9;
|
|
constexpr static int k_numberOfColors = 5;
|
|
constexpr static KDColor k_LEDColors[k_numberOfColors] = {KDColorWhite, KDColorRed, KDColorBlue, KDColorGreen, KDColorBlack};
|
|
static KDColor LEDColorAtIndex(int i);
|
|
ContentView m_view;
|
|
int m_LEDColorIndex;
|
|
BatteryTestController m_batteryTestController;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
|
|