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.

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