remove unused Meter.cpp and Meter.h (#1171)
This commit is contained in:
parent
8a71f2b9e0
commit
91a3e98276
|
@ -376,7 +376,6 @@ list(APPEND SOURCE_FILES
|
|||
displayapp/screens/Screen.cpp
|
||||
displayapp/screens/Clock.cpp
|
||||
displayapp/screens/Tile.cpp
|
||||
displayapp/screens/Meter.cpp
|
||||
displayapp/screens/InfiniPaint.cpp
|
||||
displayapp/screens/Paddle.cpp
|
||||
displayapp/screens/StopWatch.cpp
|
||||
|
@ -590,7 +589,6 @@ set(INCLUDE_FILES
|
|||
displayapp/screens/Screen.h
|
||||
displayapp/screens/Clock.h
|
||||
displayapp/screens/Tile.h
|
||||
displayapp/screens/Meter.h
|
||||
displayapp/screens/InfiniPaint.h
|
||||
displayapp/screens/StopWatch.h
|
||||
displayapp/screens/Paddle.h
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "displayapp/screens/InfiniPaint.h"
|
||||
#include "displayapp/screens/Paddle.h"
|
||||
#include "displayapp/screens/StopWatch.h"
|
||||
#include "displayapp/screens/Meter.h"
|
||||
#include "displayapp/screens/Metronome.h"
|
||||
#include "displayapp/screens/Music.h"
|
||||
#include "displayapp/screens/Navigation.h"
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
#include "displayapp/screens/Meter.h"
|
||||
#include <lvgl/lvgl.h>
|
||||
#include "displayapp/DisplayApp.h"
|
||||
|
||||
using namespace Pinetime::Applications::Screens;
|
||||
|
||||
Meter::Meter(Pinetime::Applications::DisplayApp* app) : Screen(app) {
|
||||
|
||||
/*Create a line meter */
|
||||
lmeter = lv_linemeter_create(lv_scr_act(), nullptr);
|
||||
lv_linemeter_set_range(lmeter, 0, 60); /*Set the range*/
|
||||
lv_linemeter_set_value(lmeter, value); /*Set the current value*/
|
||||
lv_linemeter_set_angle_offset(lmeter, 180);
|
||||
lv_linemeter_set_scale(lmeter, 360, 60); /*Set the angle and number of lines*/
|
||||
|
||||
lv_obj_set_style_local_scale_end_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(255, 0, 0));
|
||||
lv_obj_set_style_local_scale_grad_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(160, 0, 0));
|
||||
lv_obj_set_style_local_line_width(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, 2);
|
||||
lv_obj_set_style_local_line_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
|
||||
|
||||
lv_obj_set_size(lmeter, 200, 200);
|
||||
lv_obj_align(lmeter, nullptr, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
|
||||
}
|
||||
|
||||
Meter::~Meter() {
|
||||
lv_task_del(taskRefresh);
|
||||
lv_obj_clean(lv_scr_act());
|
||||
}
|
||||
|
||||
void Meter::Refresh() {
|
||||
lv_linemeter_set_value(lmeter, value++); /*Set the current value*/
|
||||
if (value >= 60)
|
||||
value = 0;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include "displayapp/screens/Screen.h"
|
||||
#include <lvgl/src/lv_core/lv_style.h>
|
||||
#include <lvgl/src/lv_core/lv_obj.h>
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Applications {
|
||||
namespace Screens {
|
||||
|
||||
class Meter : public Screen {
|
||||
public:
|
||||
Meter(DisplayApp* app);
|
||||
~Meter() override;
|
||||
|
||||
void Refresh() override;
|
||||
|
||||
private:
|
||||
lv_style_t style_lmeter;
|
||||
lv_obj_t* lmeter;
|
||||
|
||||
uint32_t value = 0;
|
||||
|
||||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue