示例#1
0
 def __init__(
     self,
     parent,
     pnglib,
     Normal,
     Hoover = []):
     # call parent class __init__()
     Display.__init__(
         self,
         parent = parent,
         pnglib = pnglib,
         names  = Normal + Hoover)
     # LOCALS
     self.rotation = +1 # direction
     self.reset = None # cancel operation
     # "hoover length" should be zero or
     # the same as "Normal length"
     self.l = len(Normal), len(Hoover)
     self.radio = None # radio group handle
     self.ctr   = None # 
     self.evt   = None
     self.overflow = 0
     # BINDINGS
     self.Bind(wx.EVT_ENTER_WINDOW, self._onMouseEnter)
     self.Bind(wx.EVT_LEAVE_WINDOW, self._onMouseLeave)
     self.Bind(wx.EVT_MOUSEWHEEL,   self._onMouseWheel)
     return
示例#2
0
 def __init__(self, isHeadless):
     Display.__init__(self, isHeadless)
     self.__display_found = (
         self.__DISPLAY
         in os.popen(
             'cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done '
         ).read()
     )
     if self.__display_found:
         os.environ["DISPLAY"] = self.__DISPLAY
     else:
         print(f"Display {self.__DISPLAY} not found.")
示例#3
0
    def __init__(self, gpio, gpio_DC, gpio_RST, port=0, device=0):
        Display.__init__(self)

        self.port = port
        self.device = device
        self.spi = spi(gpio=gpio,
                       port=self.port,
                       device=self.device,
                       gpio_DC=gpio_DC,
                       gpio_RST=gpio_RST)

        self.device = self.get_device()
示例#4
0
 def __init__(
     self,
     parent,
     pnglib,
     names):
     # call parent __init__()
     Display.__init__(
         self,
         parent = parent,
         pnglib = pnglib,
         names  = names)
     # LOCALS
     self.radio = None
     self.ctr   = None
     self.evt   = None
     # BINDINGS
     self.Bind(wx.EVT_LEFT_DOWN,   self._onMouseDown)
     self.Bind(wx.EVT_LEFT_DCLICK, self._onMouseDown)
     # capture double clicks events as secondary single clicks
     # call child start up method
     self._start()
     # done
     return
示例#5
0
 def __init__(self, isHeadless) -> None:
     Display.__init__(self, isHeadless)
	def __init__(self):
		Display.__init__(self)
		self._brightness = 7 # default brightness
		self._special_index = 0
 def __init__(self, i, j, name, floor):
     Display.__init__(self, i, j, name, floor)
示例#8
0
GPIO.setmode(GPIO.BCM)

GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)

while True:
    # will keep running until the button is pressed
    input_state = GPIO.input(18)
    # when the button is pressed:
    if input_state == False:
        time.sleep(0.2)
        lcd = Display()
        chkAPI = CheckoutApi()

        # clear lcd and then show text asking for user's tag
        lcd.clear_lcd()
        lcd.show_msg_firstLine("Please Scan your")
        lcd.show_msg_secondLine("tag: ")
        # prompt on command line
        user_tag_id=raw_input("Please Scan your tag to Start : ")
        # clear lcd and then show text asking for device's tag
        lcd.clear_lcd()
        lcd.show_msg_firstLine("Please Scan the")
        lcd.show_msg_secondLine("device's tag: ")
        # prompt on command line
        device_tag_id=raw_input("Please, Scan the device you are checking out. : ")

        # clean up,# prompt on command line
        lcd.clear_lcd()
        chkAPI.checkout_device(device_tag_id, user_tag_id)
        lcd.__init__()
示例#9
0
 def __init__(self):
     Display.__init__(self)
     self._brightness = 7
示例#10
0
    def __init__(self, width=16, height=16):
        Display.__init__(self)

        self.width = width
        self.height = height
        self.pixelCount = width * height
示例#11
0
    def __init__(self, gamestate, view):

        Display.__init__(self, DISPLAYW, DISPLAYH, (0, 0))

        self.GS = gamestate
        self.view = view