summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Motion.h
blob: ad1341a8295e7b5fb482bf9182a533b41fdfb654 (plain)
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
#pragma once

#include <cstdint>
#include <chrono>
#include "Screen.h"
#include <bits/unique_ptr.h>
#include <libs/lvgl/src/lv_core/lv_style.h>
#include <libs/lvgl/src/lv_core/lv_obj.h>
#include <components/motion/MotionController.h>

namespace Pinetime {
  namespace Applications {
    namespace Screens {

      class Motion : public Screen{
      public:
        Motion(DisplayApp* app, Controllers::MotionController& motionController);
        ~Motion() override;

        bool Refresh() override;
        bool OnButtonPushed() override;

      private:
        Controllers::MotionController& motionController;
        lv_obj_t * chart;
        lv_chart_series_t * ser1;
        lv_chart_series_t * ser2;
        lv_chart_series_t * ser3;

        lv_obj_t* labelStep;
        lv_obj_t* labelStepValue;
        static constexpr uint8_t nbStepsBufferSize = 9;
        char nbStepsBuffer[nbStepsBufferSize+1];
        bool running = true;

      };
    }
  }
}