1. 花了几天时间基于lvgl8.3封装了lvgl_cpp,写了一些基本需要的控件,支持链式调用
还存在一点点bug,不难fix 2. 增加了中文字库,支持中文显示 3. 修复和优化了一些地方
This commit is contained in:
@@ -3,12 +3,25 @@
|
||||
//
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
/**
|
||||
* 本模块提供各种杂项工具类,基本都来源于对底层驱动的封装
|
||||
*
|
||||
*
|
||||
*/
|
||||
class ToolsClass {
|
||||
public:
|
||||
static ToolsClass* getInstance();
|
||||
|
||||
private:
|
||||
ToolsClass();
|
||||
~ToolsClass() = default;
|
||||
|
||||
|
||||
private:
|
||||
static ToolsClass* instance;
|
||||
static std::mutex instance_mutex;
|
||||
|
||||
public:
|
||||
/**
|
||||
* 获取当前时间
|
||||
@@ -37,6 +50,25 @@ public:
|
||||
*/
|
||||
static std::string GenerateSN(const std::string& mac, const std::string& chipID);
|
||||
|
||||
/**
|
||||
* 获取电池电压
|
||||
* @return 电池电压
|
||||
*/
|
||||
float getBatteryVolts();
|
||||
|
||||
/**
|
||||
* 获取电池电量
|
||||
* @return 电池电量百分比(0 ~ 100)
|
||||
*/
|
||||
int32_t getBatteryPer();
|
||||
|
||||
/**
|
||||
* 拼接文件路径(for sd card)
|
||||
* @param filename 文件名
|
||||
* @return 拼接后的文件路径
|
||||
*/
|
||||
static std::string makeFullPath(const std::string& filename);
|
||||
|
||||
/**
|
||||
* 获取设备版本
|
||||
* @return 设备版本
|
||||
|
||||
Reference in New Issue
Block a user