memset(raw, 0, 64*64);
for (y=0; y<64; y++)
{
+ int pix=0;
for (x=0; x<128 / 2; x++)
- raw[y*64+x] = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4);
+ {
+ pix = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4);
+ if (inverted)
+ pix = 0xFF - pix;
+ raw[y*64+x] = pix;
+ }
}
if (lcdfd >= 0)
write(lcdfd, raw, 64*64);
ilcd = LCD()
- config.lcd.bright = ConfigSlider(default=10, limits=(0, 10))
+ config.lcd.standby = ConfigSlider(default=0, limits=(0, 10))
+ config.lcd.standby.addNotifier(setLCDbright);
+ config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby)
+
+ config.lcd.bright = ConfigSlider(default=5, limits=(0, 10))
config.lcd.bright.addNotifier(setLCDbright);
config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright)
+ config.lcd.bright.callNotifiersOnSaveAndCancel = True
if not ilcd.isOled():
config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
else:
config.lcd.contrast = ConfigNothing()
- config.lcd.standby = ConfigSlider(default=0, limits=(0, 10))
- config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby)
-
config.lcd.invert = ConfigYesNo(default=False)
config.lcd.invert.addNotifier(setLCDinverted);
else:
self.save_disabled = False
self.notifiers = []
self.enabled = True
+ self.callNotifiersOnSaveAndCancel = False
# you need to override this to do input validation
def setValue(self, value):
self.saved_value = None
else:
self.saved_value = self.tostring(self.value)
+ if self.callNotifiersOnSaveAndCancel:
+ self.changed()
def cancel(self):
self.load()
+ if self.callNotifiersOnSaveAndCancel:
+ self.changed()
def isChanged(self):
sv = self.saved_value