2021-03-31 19:47:27 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <chrono>
|
2021-10-13 22:08:35 +02:00
|
|
|
#include "displayapp/screens/Screen.h"
|
2021-11-03 23:08:57 +01:00
|
|
|
#include <lvgl/src/lv_core/lv_style.h>
|
|
|
|
#include <lvgl/src/lv_core/lv_obj.h>
|
2021-03-31 19:47:27 +02:00
|
|
|
#include <components/motion/MotionController.h>
|
2023-10-23 20:12:34 +02:00
|
|
|
#include "displayapp/Controllers.h"
|
2023-12-19 17:53:48 +01:00
|
|
|
#include "displayapp/apps/Apps.h"
|
2021-03-31 19:47:27 +02:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
|
2021-04-18 20:28:14 +03:00
|
|
|
class Motion : public Screen {
|
2021-03-31 19:47:27 +02:00
|
|
|
public:
|
2023-02-22 22:36:38 +02:00
|
|
|
Motion(Controllers::MotionController& motionController);
|
2021-03-31 19:47:27 +02:00
|
|
|
~Motion() override;
|
|
|
|
|
2021-07-19 16:26:12 +03:00
|
|
|
void Refresh() override;
|
2021-03-31 19:47:27 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Controllers::MotionController& motionController;
|
2021-04-18 20:28:14 +03:00
|
|
|
lv_obj_t* chart;
|
|
|
|
lv_chart_series_t* ser1;
|
|
|
|
lv_chart_series_t* ser2;
|
|
|
|
lv_chart_series_t* ser3;
|
2021-04-26 21:29:48 +01:00
|
|
|
lv_obj_t* label;
|
2021-03-31 19:47:27 +02:00
|
|
|
|
|
|
|
lv_obj_t* labelStep;
|
2021-07-19 16:26:12 +03:00
|
|
|
lv_task_t* taskRefresh;
|
2021-03-31 19:47:27 +02:00
|
|
|
};
|
|
|
|
}
|
2023-11-01 21:06:26 +01:00
|
|
|
|
2023-10-23 20:12:34 +02:00
|
|
|
template <>
|
|
|
|
struct AppTraits<Apps::Motion> {
|
|
|
|
static constexpr Apps app = Apps::Motion;
|
|
|
|
static constexpr const char* icon = "M";
|
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::Motion(controllers.motionController);
|
|
|
|
};
|
|
|
|
};
|
2021-03-31 19:47:27 +02:00
|
|
|
}
|
2021-07-19 16:26:12 +03:00
|
|
|
}
|