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.

71 lines
1.5 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include "sdk\components\dwin\dwin_screen.hpp"
  3. namespace iflytop {
  4. namespace dwin {
  5. using namespace std;
  6. #pragma pack(1)
  7. typedef struct {
  8. uint16_t m_VP = 0;
  9. uint16_t m_PosX = 0;
  10. uint16_t m_PosY = 0;
  11. uint16_t m_VMin = 0;
  12. uint16_t m_VMax = 0;
  13. uint16_t m_IconMin = 0;
  14. uint16_t m_IconMax = 0;
  15. uint8_t m_Mode = 0;
  16. uint8_t m_IconLib = 0;
  17. uint8_t m_ICONGamma = 0;
  18. uint8_t m_LayerMode = 0;
  19. uint8_t m_FilterSet = 0;
  20. uint8_t m_PICGamma = 0;
  21. } VarIconDescript_t;
  22. #pragma pack()
  23. #define VARICON_VAL_HIDE 0xffff
  24. class VarIcon {
  25. DwinScreen *m_dwin_screen = nullptr;
  26. uint16_t m_descript_add = 0;
  27. VarIconDescript_t m_descript;
  28. uint16_t m_val = 0xffff;
  29. public:
  30. bool init(DwinScreen *dwin_screen, uint16_t descript_add);
  31. void initcfg(uint16_t valpointerAdd, uint16_t initval, uint16_t posx, uint16_t posy, uint16_t iconlib, uint16_t iconmin, uint16_t iconmax);
  32. /**
  33. * @brief
  34. *
  35. * @param valpointerAdd ַָ
  36. * @param posx ͼεϽx
  37. * @param posy ͼεϽy
  38. * @param iconpath ͼε· 47/1:1 iconlib/iconmin:iconmax
  39. */
  40. void initcfg(uint16_t valpointerAdd, uint16_t posx, uint16_t posy, const char *iconpath, uint16_t initval);
  41. public:
  42. bool flushcfg();
  43. bool readcfg();
  44. bool setVal(uint16_t val);
  45. uint16_t getVal();
  46. void hide();
  47. void show();
  48. VarIconDescript_t &getDescript();
  49. void dumpinfo();
  50. private:
  51. bool _setVal(uint16_t val);
  52. };
  53. } // namespace dwin
  54. } // namespace iflytop