Work on horizon watchface
This commit is contained in:
parent
a01abc89be
commit
89fc951cd6
@ -15,6 +15,7 @@
|
|||||||
#include "displayapp/screens/WatchFaceInfineat.h"
|
#include "displayapp/screens/WatchFaceInfineat.h"
|
||||||
#include "displayapp/screens/WatchFacePineTimeStyle.h"
|
#include "displayapp/screens/WatchFacePineTimeStyle.h"
|
||||||
#include "displayapp/screens/WatchFaceTerminal.h"
|
#include "displayapp/screens/WatchFaceTerminal.h"
|
||||||
|
#include "displayapp/screens/WatchFaceHorizon.h"
|
||||||
|
|
||||||
namespace Pinetime {
|
namespace Pinetime {
|
||||||
namespace Applications {
|
namespace Applications {
|
||||||
|
@ -57,6 +57,7 @@ namespace Pinetime {
|
|||||||
Terminal,
|
Terminal,
|
||||||
Infineat,
|
Infineat,
|
||||||
CasioStyleG7710,
|
CasioStyleG7710,
|
||||||
|
Horizon
|
||||||
};
|
};
|
||||||
|
|
||||||
template <Apps>
|
template <Apps>
|
||||||
|
@ -30,6 +30,7 @@ else()
|
|||||||
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Terminal")
|
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Terminal")
|
||||||
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Infineat")
|
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Infineat")
|
||||||
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710")
|
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710")
|
||||||
|
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Horizon")
|
||||||
set(WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}" CACHE STRING "List of watch faces to build into the firmware")
|
set(WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}" CACHE STRING "List of watch faces to build into the firmware")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
#include "displayapp/screens/WatchFaceHorizon.h"
|
#include "displayapp/screens/WatchFaceHorizon.h"
|
||||||
|
|
||||||
#include <date/date.h>
|
|
||||||
#include <lvgl/lvgl.h>
|
#include <lvgl/lvgl.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include "components/settings/Settings.h"
|
#include "components/settings/Settings.h"
|
||||||
#include "components/battery/BatteryController.h"
|
#include "components/battery/BatteryController.h"
|
||||||
#include "components/motion/MotionController.h"
|
#include "components/motion/MotionController.h"
|
||||||
|
#include "utility/DirtyValue.h"
|
||||||
|
|
||||||
using namespace Pinetime::Applications::Screens;
|
using namespace Pinetime::Applications::Screens;
|
||||||
|
|
||||||
WatchFaceHorizon::WatchFaceHorizon(DisplayApp* app,
|
WatchFaceHorizon::WatchFaceHorizon(Controllers::DateTime& dateTimeController,
|
||||||
Controllers::DateTime& dateTimeController,
|
|
||||||
Controllers::Battery& batteryController,
|
Controllers::Battery& batteryController,
|
||||||
Controllers::Settings& settingsController,
|
Controllers::Settings& settingsController,
|
||||||
Controllers::MotionController& motionController,
|
Controllers::MotionController& motionController,
|
||||||
Controllers::FS& filesystem)
|
Controllers::FS& filesystem)
|
||||||
: Screen(app),
|
|
||||||
currentDateTime {{}},
|
currentDateTime {{}},
|
||||||
dateTimeController {dateTimeController},
|
dateTimeController {dateTimeController},
|
||||||
batteryController {batteryController},
|
batteryController {batteryController},
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include "displayapp/screens/Screen.h"
|
#include "displayapp/screens/Screen.h"
|
||||||
#include "components/datetime/DateTimeController.h"
|
#include "components/datetime/DateTimeController.h"
|
||||||
|
#include "components/ble/BleController.h"
|
||||||
|
#include "utility/DirtyValue.h"
|
||||||
|
#include "displayapp/apps/Apps.h"
|
||||||
|
|
||||||
namespace Pinetime {
|
namespace Pinetime {
|
||||||
namespace Controllers {
|
namespace Controllers {
|
||||||
@ -19,8 +22,7 @@ namespace Pinetime {
|
|||||||
|
|
||||||
class WatchFaceHorizon : public Screen {
|
class WatchFaceHorizon : public Screen {
|
||||||
public:
|
public:
|
||||||
WatchFaceHorizon(DisplayApp* app,
|
WatchFaceHorizon(Controllers::DateTime& dateTimeController,
|
||||||
Controllers::DateTime& dateTimeController,
|
|
||||||
Controllers::Battery& batteryController,
|
Controllers::Battery& batteryController,
|
||||||
Controllers::Settings& settingsController,
|
Controllers::Settings& settingsController,
|
||||||
Controllers::MotionController& motionController,
|
Controllers::MotionController& motionController,
|
||||||
@ -39,11 +41,11 @@ namespace Pinetime {
|
|||||||
Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown;
|
Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown;
|
||||||
Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
|
Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
|
||||||
uint8_t currentDay = 0;
|
uint8_t currentDay = 0;
|
||||||
|
|
||||||
DirtyValue<uint8_t> batteryPercentRemaining {};
|
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
|
||||||
DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {};
|
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {};
|
||||||
DirtyValue<bool> motionSensorOk {};
|
Utility::DirtyValue<bool> motionSensorOk {};
|
||||||
DirtyValue<uint32_t> stepCount {};
|
Utility::DirtyValue<uint32_t> stepCount {};
|
||||||
|
|
||||||
lv_obj_t* background;
|
lv_obj_t* background;
|
||||||
|
|
||||||
@ -84,5 +86,23 @@ namespace Pinetime {
|
|||||||
0xbd815b, 0xa86f60, 0x935d64, 0x7e4b68, 0x6d4467, 0x4b3766, 0x3a3066, 0x292965};
|
0xbd815b, 0xa86f60, 0x935d64, 0x7e4b68, 0x6d4467, 0x4b3766, 0x3a3066, 0x292965};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct WatchFaceTraits<WatchFace::Horizon> {
|
||||||
|
static constexpr WatchFace watchFace = WatchFace::Horizon;
|
||||||
|
static constexpr const char* name = "Horizon";
|
||||||
|
|
||||||
|
static Screens::Screen* Create(AppControllers& controllers) {
|
||||||
|
return new Screens::WatchFaceHorizon(controllers.dateTimeController,
|
||||||
|
controllers.batteryController,
|
||||||
|
controllers.settingsController,
|
||||||
|
controllers.motionController,
|
||||||
|
controllers.filesystem);
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool IsAvailable(Pinetime::Controllers::FS& filesystem) {
|
||||||
|
return Screens::WatchFaceInfineat::IsAvailable(filesystem);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user