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.
|
|
#pragma once
#include "sdk\components\dwin\dwin_screen.hpp"
namespace iflytop { namespace dwin {
using namespace std; /**
* @brief * * 0x00 *VP * */
/**
* * 0x00: *VP 2 �ı�ָ�롣 * 0x01: (X,Y) 4 ��ʼ��ʾλ�ã���ʾ�ַ������Ͻ����ꡣ * 0x03: Color 2 ��ʾ�ı���ɫ�� * 0x04: (xs,Ys)(xe,Ye) 8 �ı����� * 0x08: Text_Length 2 ��ʾ�ֽ�������������0xFFFF��0x0000������ʾ���ı���β��������ʾ�� * 0x09: Font0_ID(H) 1 ���뷽ʽΪ0x01-0x04ʱ��ASII�ַ�ʹ�õ��ֿ�λ�á� * 0x09: Font1_ID(L) 1 ���뷽ʽΪ0x00��0x05���Լ�0x01-0x04ʱ�ķ�ASCII�ַ�ʹ�õ��ֿ�λ�á� * 0x0A: Font_x_Dots(H) 1 ����x������������0x01-0x04ģʽ��ASCII�ַ���x��������������x/2���㣩�� * 0x0A: Font_Y_Dots(L) 1 ����Y������������ * 0x0B: Encode_Mode(H) 1 .7�������ı���ʾ���ַ������Ƿ��Զ������� * .7=0 �ַ������Զ������� * .7=1�ַ�����Զ��������ַ����ȹ̶�Ϊ�趨�ĵ������� * .6-.0�������ı����뷽ʽ��0=8bit����1=GB2312����2=GBK 3=BIG5 4=SJIS 5=UNICODE * 0x0B: HOR_Dis(L 1 �ַ�ˮƽ������ * 0x0C: VER_Dis(H) 1 �ַ���ֱ������ * 0x0C: δ����(L) 1 д0x00 * */ #pragma pack(1)
typedef struct { uint16_t VP; uint16_t PosX; uint16_t PosY; uint16_t Color; uint16_t Xs; uint16_t Ys; uint16_t Xe; uint16_t Ye; uint16_t TextLength;
uint8_t Font1ID; uint8_t Font0ID;
uint8_t FontYDots; uint8_t FontXDots;
uint8_t LHORDis; uint8_t EncodeMode; // [7:7] 0�ַ������Զ�����,1�ַ�����Զ����� [6:0] 0=8bit����1=GB2312����2=GBK 3=BIG5 4=SJIS 5=UNICODE
uint8_t mark; uint8_t LVERDis; } TextDisplayerDescript_t; #pragma pack()
typedef enum { kcolor_red = 0xF800, kcolor_black = 0x0000, kcolor_white = 0xFFFF, kcolor_grey = 0xc618, } dwincolor_t;
class TextDisplayer { DwinScreen *m_dwin_screen = nullptr;
uint16_t m_descript_add = 0; TextDisplayerDescript_t m_descript; bool m_hide = false;
public: bool init(DwinScreen *dwin_screen, uint16_t valsize); bool init(DwinScreen *dwin_screen, uint16_t descript_add, uint16_t val_add); /**
* @brief Set the Font object * * @param EncodeMode [7:7] 0�ַ������Զ�����,1�ַ�����Զ����� [6:0] 0=8bit����1=GB2312����2=GBK 3=BIG5 4=SJIS 5=UNICODE * @param font0id * @param font1id */ void setFont(uint16_t EncodeMode, uint8_t font0id, uint8_t font1id, uint16_t frontxsize, uint16_t frontysize); /**
* @brief Set the Pos object * * @param x * @param y * @param width �ı������� * @param hight �ı����߶� */ void setPos(uint16_t x, uint16_t y, uint16_t width, uint16_t hight); /**
* @brief �����ı� * * @param */ bool setVal(const char *val); void setColor(uint16_t color);
bool setTextLengthDirect(uint16_t len);
bool show(); bool hide();
bool isHide() { return m_hide; }
public: bool flushcfg(); bool readcfg(); void dumpinfo(); }; } // namespace dwin
} // namespace iflytop
|