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.

76 lines
1.7 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
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. bool init(DwinScreen *dwin_screen);
  32. void initcfg(uint16_t valpointerAdd, uint16_t initval, uint16_t posx, uint16_t posy, uint16_t iconlib, uint16_t iconmin, uint16_t iconmax);
  33. void setpos(uint16_t posx, uint16_t posy);
  34. /**
  35. * @brief
  36. *
  37. * @param valpointerAdd ַָ
  38. * @param posx ͼεϽx
  39. * @param posy ͼεϽy
  40. * @param iconpath ͼε· 47/1:1 iconlib/iconmin:iconmax
  41. */
  42. // void initcfg(const char *pos, const char *iconpath, uint16_t initval);
  43. void initcfg(int x, int y, const char *iconpath, uint16_t initval);
  44. void initcfg(uint16_t valpointerAdd, uint16_t posx, uint16_t posy, const char *iconpath, uint16_t initval);
  45. public:
  46. bool flushcfg();
  47. bool readcfg();
  48. bool setVal(uint16_t val);
  49. uint16_t getVal();
  50. void hide();
  51. void show();
  52. VarIconDescript_t &getDescript();
  53. void dumpinfo();
  54. private:
  55. bool _setVal(uint16_t val);
  56. };
  57. } // namespace dwin
  58. } // namespace iflytop