You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
1.7 KiB
77 lines
1.7 KiB
#pragma once
|
|
|
|
#include "sdk\components\dwin\dwin_screen.hpp"
|
|
|
|
namespace iflytop {
|
|
namespace dwin {
|
|
using namespace std;
|
|
|
|
#pragma pack(1)
|
|
typedef struct {
|
|
uint16_t m_VP = 0;
|
|
uint16_t m_PosX = 0;
|
|
uint16_t m_PosY = 0;
|
|
uint16_t m_VMin = 0;
|
|
uint16_t m_VMax = 0;
|
|
uint16_t m_IconMin = 0;
|
|
uint16_t m_IconMax = 0;
|
|
|
|
uint8_t m_Mode = 0;
|
|
uint8_t m_IconLib = 0;
|
|
|
|
uint8_t m_ICONGamma = 0;
|
|
uint8_t m_LayerMode = 0;
|
|
|
|
uint8_t m_FilterSet = 0;
|
|
uint8_t m_PICGamma = 0;
|
|
} VarIconDescript_t;
|
|
#pragma pack()
|
|
|
|
#define VARICON_VAL_HIDE 0xffff
|
|
|
|
class VarIcon {
|
|
DwinScreen *m_dwin_screen = nullptr;
|
|
|
|
uint16_t m_descript_add = 0;
|
|
VarIconDescript_t m_descript;
|
|
|
|
uint16_t m_val = 0xffff;
|
|
|
|
public:
|
|
bool init(DwinScreen *dwin_screen, uint16_t descript_add);
|
|
bool init(DwinScreen *dwin_screen);
|
|
void initcfg(uint16_t valpointerAdd, uint16_t initval, uint16_t posx, uint16_t posy, uint16_t iconlib, uint16_t iconmin, uint16_t iconmax);
|
|
|
|
void setpos(uint16_t posx, uint16_t posy);
|
|
|
|
/**
|
|
* @brief
|
|
*
|
|
* @param valpointerAdd 变量指针地址
|
|
* @param posx 图形的左上角x坐标
|
|
* @param posy 图形的左上角y坐标
|
|
* @param iconpath 图形的路径 47/1:1 iconlib/iconmin:iconmax
|
|
*/
|
|
// void initcfg(const char *pos, const char *iconpath, uint16_t initval);
|
|
void initcfg(int x, int y, const char *iconpath, uint16_t initval);
|
|
void initcfg(uint16_t valpointerAdd, uint16_t posx, uint16_t posy, const char *iconpath, uint16_t initval);
|
|
|
|
public:
|
|
bool flushcfg();
|
|
bool readcfg();
|
|
|
|
bool setVal(uint16_t val);
|
|
uint16_t getVal();
|
|
|
|
void hide();
|
|
void show();
|
|
|
|
VarIconDescript_t &getDescript();
|
|
|
|
void dumpinfo();
|
|
|
|
private:
|
|
bool _setVal(uint16_t val);
|
|
};
|
|
} // namespace dwin
|
|
} // namespace iflytop
|