def __init__(self, visitor, darea, obj=None, config=None, key=None): Generic.__init__(self, self.visitor, obj, config, TYPE_GRAPHIC) section = self.cfg_fetch_raw(config, key, None) Graphic.__init__(self, section, rows=64, cols=256) self.dots = {'x': 6, 'y':8} self.pixels = {'x':4, 'y':4} # Resolution in crt pixels - scaled self.border = 5 self.darea = darea self.darea.connect('expose-event', self.lcd_expose_event, self) self.bg_color = gtk.gdk.color_parse("#78a878") self.fg_color = gtk.gdk.color_parse("#113311") self.config = config self.rows = 8 self.cols = 256/6 self.lcd_gc = None if obj == None: self.name = 'noname' self.connected = False self.framebuffer = resizeList([], 256 * 64, list) self.clear_display() else: self.name = obj.name self.connected = obj.connected self.framebuffer = obj.framebuffer self.app = visitor
def __init__ ( self, visitor, obj=None, config=None, key=None): Generic.__init__(self, visitor, obj, config, TYPE_GRAPHIC) section = self.cfg_fetch_raw(config, key, None) Graphic.__init__(self, section, rows=SCREEN_H, cols=SCREEN_W) self.rows = SCREEN_H / 8 self.cols = SCREEN_W / 6 self.CHARS = self.rows * self.cols self.CHAR0 = 0 self.chars = [] if obj == None: self.contrast = 127 self.backlight = 100 self.command_queue = Queue.Queue() self.command_rate = 1 self.layout_timeout = 0 self.name = 'noname' self.connected = False else: self.contrast = obj.contrast self.backlight = obj.backlight self.command_queue = obj.command_queue0 self.layout_timeout = obj.layout_timeout self.command_rate = obj.command_rate self.name = obj.name self.connected = obj.connected self.app = visitor self.debug = visitor.debug self.AddFunction("LCD::contrast", 1, self.my_contrast) self.AddFunction("LCD::backlight", 1, self.my_backlight) self.AddFunction("LCD::gpo", 2, self.my_gpo) self.command_id = None #self.device_poll_thread = threading.Thread(target=self.device_poll) self.framebuffer = resizeList([], 256 * 64, bool) self.inverted = 0 self.command_time = time.time() self.graphic_real_blit = self.drv_blit #self.graphic_clear = self.drv_clear self.drv_locked = False self.libhandle = OPENUSB_HANDLE() self.usbhandle = OPENUSB_DEV_HANDLE() self.request_handle = (OPENUSB_REQUEST_HANDLE * 1)() self.rq_handle_references = []
def __init__ ( self, visitor, obj=None, config=None, key=None): Generic.__init__(self, visitor, obj, config, DRV_GRAPHIC) section = self.cfg_fetch_raw(config, key, None) Graphic.__init__(self, section, rows=SCREEN_H, cols=SCREEN_W) self.rows = SCREEN_H / 8 self.cols = SCREEN_W / 6 self.CHARS = self.rows * self.cols self.CHAR0 = 0 self.chars = [] if obj == None: self.contrast = 127 self.backlight = 100 self.command_queue = Queue.Queue() self.command_rate = 1 self.layout_timeout = 0 self.name = 'noname' self.connected = False else: self.contrast = obj.contrast self.backlight = obj.backlight self.command_queue = obj.command_queue0 self.layout_timeout = obj.layout_timeout self.command_rate = obj.command_rate self.name = obj.name self.connected = obj.connected self.app = visitor self.debug = visitor.debug self.AddFunction("LCD::contrast", 1, self.my_contrast) self.AddFunction("LCD::backlight", 1, self.my_backlight) self.AddFunction("LCD::gpo", 2, self.my_gpo) self.command_id = None self.device_poll_thread = threading.Thread(target=self.device_poll) self.framebuffer = resizeList([], 256 * 64, bool) lib.libusb_init(None) self.transfer = lib.libusb_alloc_transfer(0) self.handle = lib.libusb_open_device_with_vid_pid(None, VENDOR_ID, PRODUCT_ID) self.inverted = 0 self.command_time = time.time() self.graphic_real_blit = self.drv_blit #self.graphic_clear = self.drv_clear self.drv_locked = False