|
@ -32,7 +32,10 @@ bool VarIcon::init(DwinScreen *dwin_screen, uint16_t descript_add) { |
|
|
// sscanf(pos, "(%d,%d)", &posx, &posy);
|
|
|
// sscanf(pos, "(%d,%d)", &posx, &posy);
|
|
|
// initcfg(m_dwin_screen->alloc_one_var_icon(), posx, posy, iconpath, initval);
|
|
|
// initcfg(m_dwin_screen->alloc_one_var_icon(), posx, posy, iconpath, initval);
|
|
|
// }
|
|
|
// }
|
|
|
void VarIcon::initcfg(int x, int y, const char *iconpath, uint16_t initval) { initcfg(m_dwin_screen->alloc_free_ram(1), x, y, iconpath, initval); } |
|
|
|
|
|
|
|
|
void VarIcon::initcfg(int x, int y, const char *iconpath, uint16_t initval) { |
|
|
|
|
|
if (m_varAdd == -1) m_varAdd = m_dwin_screen->alloc_free_ram(1); |
|
|
|
|
|
initcfg(m_varAdd, x, y, iconpath, initval); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void VarIcon::initcfg(uint16_t valpointerAdd, uint16_t posx, uint16_t posy, const char *iconpath, uint16_t initval) { |
|
|
void VarIcon::initcfg(uint16_t valpointerAdd, uint16_t posx, uint16_t posy, const char *iconpath, uint16_t initval) { |
|
|
// printf("initcfg %04x %d %d %s %d\n", valpointerAdd, posx, posy, iconpath, initval);
|
|
|
// printf("initcfg %04x %d %d %s %d\n", valpointerAdd, posx, posy, iconpath, initval);
|
|
@ -58,7 +61,10 @@ void VarIcon::initcfg(uint16_t valpointerAdd, uint16_t initval, uint16_t posx, u |
|
|
m_descript.m_ICONGamma = 0; |
|
|
m_descript.m_ICONGamma = 0; |
|
|
m_descript.m_PICGamma = 0; |
|
|
m_descript.m_PICGamma = 0; |
|
|
m_descript.m_FilterSet = 0x3F; |
|
|
m_descript.m_FilterSet = 0x3F; |
|
|
|
|
|
m_hide = false; |
|
|
|
|
|
m_varAdd = valpointerAdd; |
|
|
|
|
|
|
|
|
|
|
|
// printf("initcfg %04x %d %d %d %d %d %d\n", valpointerAdd, posx, posy, iconlib, iconmin, iconmax, initval);
|
|
|
flushcfg(); |
|
|
flushcfg(); |
|
|
setVal(initval); |
|
|
setVal(initval); |
|
|
} |
|
|
} |
|
@ -116,4 +122,7 @@ void VarIcon::show(bool showval) { |
|
|
|
|
|
|
|
|
VarIconDescript_t &VarIcon::getDescript() { return m_descript; } |
|
|
VarIconDescript_t &VarIcon::getDescript() { return m_descript; } |
|
|
|
|
|
|
|
|
bool VarIcon::_setVal(uint16_t val) { return m_dwin_screen->write_varspace16(m_descript.m_VP, val, 100); } |
|
|
|
|
|
|
|
|
bool VarIcon::_setVal(uint16_t val) { |
|
|
|
|
|
if (m_varAdd == -1) return false; |
|
|
|
|
|
return m_dwin_screen->write_varspace16(m_descript.m_VP, val, 100); |
|
|
|
|
|
} |