2021-04-19 15:28:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <lvgl/lvgl.h>
|
2021-10-13 22:08:35 +02:00
|
|
|
#include "displayapp/screens/Screen.h"
|
2021-04-19 15:28:38 +01:00
|
|
|
#include <components/motion/MotionController.h>
|
2023-10-23 20:12:34 +02:00
|
|
|
#include "displayapp/Apps.h"
|
|
|
|
#include "displayapp/Controllers.h"
|
|
|
|
#include "Symbols.h"
|
2021-04-19 15:28:38 +01:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
|
|
|
|
namespace Controllers {
|
|
|
|
class Settings;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
|
|
|
|
class Steps : public Screen {
|
2021-07-19 16:26:12 +03:00
|
|
|
public:
|
2023-02-22 22:36:38 +02:00
|
|
|
Steps(Controllers::MotionController& motionController, Controllers::Settings& settingsController);
|
2021-07-19 16:26:12 +03:00
|
|
|
~Steps() override;
|
2021-04-19 15:28:38 +01:00
|
|
|
|
2021-07-19 16:26:12 +03:00
|
|
|
void Refresh() override;
|
2021-10-19 23:42:48 -04:00
|
|
|
void lapBtnEventHandler(lv_event_t event);
|
2021-04-19 15:28:38 +01:00
|
|
|
|
2021-07-19 16:26:12 +03:00
|
|
|
private:
|
|
|
|
Controllers::MotionController& motionController;
|
|
|
|
Controllers::Settings& settingsController;
|
2021-04-19 15:28:38 +01:00
|
|
|
|
2021-10-20 14:29:10 -04:00
|
|
|
uint32_t currentTripSteps = 0;
|
2021-10-19 23:42:48 -04:00
|
|
|
|
2021-07-19 16:26:12 +03:00
|
|
|
lv_obj_t* lSteps;
|
|
|
|
lv_obj_t* stepsArc;
|
2021-10-23 13:41:10 -04:00
|
|
|
lv_obj_t* resetBtn;
|
|
|
|
lv_obj_t* resetButtonLabel;
|
|
|
|
lv_obj_t* tripLabel;
|
2021-04-19 15:28:38 +01:00
|
|
|
|
2021-07-19 16:26:12 +03:00
|
|
|
uint32_t stepsCount;
|
2021-04-19 15:28:38 +01:00
|
|
|
|
2021-07-19 16:26:12 +03:00
|
|
|
lv_task_t* taskRefresh;
|
2021-04-19 15:28:38 +01:00
|
|
|
};
|
|
|
|
}
|
2023-11-01 21:06:26 +01:00
|
|
|
|
2023-10-23 20:12:34 +02:00
|
|
|
template <>
|
|
|
|
struct AppTraits<Apps::Steps> {
|
|
|
|
static constexpr Apps app = Apps::Steps;
|
|
|
|
static constexpr const char* icon = Screens::Symbols::shoe;
|
2023-11-01 21:06:26 +01:00
|
|
|
|
2023-10-23 20:12:34 +02:00
|
|
|
static Screens::Screen* Create(AppControllers& controllers) {
|
|
|
|
return new Screens::Steps(controllers.motionController, controllers.settingsController);
|
|
|
|
};
|
|
|
|
};
|
2021-04-19 15:28:38 +01:00
|
|
|
}
|
|
|
|
}
|