Browse Source

update

master
zhaohe 2 years ago
parent
commit
90b7dd71a7
  1. 15
      components/dwin/var_icon.cpp
  2. 2
      components/dwin/var_icon.hpp

15
components/dwin/var_icon.cpp

@ -88,16 +88,27 @@ void VarIcon::dumpinfo() {
bool VarIcon::setVal(uint16_t val) {
m_val = val;
if (m_hide) return true;
return _setVal(val);
}
uint16_t VarIcon::getVal() {
uint16_t val = 0xffff;
if(m_hide) return m_val;
m_dwin_screen->read_varspace16(m_descript.m_VP, val, 100);
return val;
}
void VarIcon::hide() { _setVal(VARICON_VAL_HIDE); };
void VarIcon::show() { _setVal(m_val); }
void VarIcon::hide() { //
_setVal(VARICON_VAL_HIDE);
/**
* @brief
*/
m_hide = true;
};
void VarIcon::show() {
m_hide = false;
_setVal(m_val);
}
VarIconDescript_t &VarIcon::getDescript() { return m_descript; }

2
components/dwin/var_icon.hpp

@ -37,6 +37,8 @@ class VarIcon {
uint16_t m_val = 0xffff;
bool m_hide = false;
public:
bool init(DwinScreen *dwin_screen, uint16_t descript_add);
bool init(DwinScreen *dwin_screen);

Loading…
Cancel
Save