def run(): UserInterface().run()
from screens.authorize import ScreenAuthorize from ui.ui import UserInterface # global config UI_PLACEMENT_MODE = True RESOLUTION = (800, 480) FPS = 60 DEV_MODE = False if __name__ == "__main__": firstScreen = ScreenAuthorize() ui = UserInterface(firstScreen, RESOLUTION, UI_PLACEMENT_MODE, FPS, DEV_MODE) while (True): ui.tick()
import subprocess as sub from ui import screenPWM from ui.ui import UserInterface from screens.main import ScreenMain # global config UI_PLACEMENT_MODE = True RESOLUTION = (480, 320) FPS = 25 DEV_MODE = True if __name__ == "__main__": # Set the screen brightness to midrange to start with try: screenPWM.screenPWM(1.0, pin=18) screenPWM.screenPWM(0.5, pin=18) # sub.call(['gpio', '-g', 'pwm', '18', '800']) except OSError: pass firstScreen = ScreenMain() ui = UserInterface(firstScreen, RESOLUTION, UI_PLACEMENT_MODE, FPS, DEV_MODE) while (True): ui.tick()
from screens.main import ScreenMain from screens.authorize import ScreenAuthorize from screens.screensaver import ScreenSaver from ui.ui import UserInterface import config if __name__ == "__main__": if config.PIN == '': UserInterface.Authorised = True firstScreen = ScreenMain() authorizeScreen = ScreenAuthorize() screenSaver = ScreenSaver() audio_params = (22050, -8, 1, 1024) ui = UserInterface(firstScreen, config.RESOLUTION, config.UI_PLACEMENT_MODE, config.FPS, config.DEV_MODE, config.SOUND, audio_params, authorizeScreen, screenSaver) while (True): ui.tick()
from screens.authorize import ScreenAuthorize from ui.ui import UserInterface import config if __name__ == "__main__": firstScreen = ScreenAuthorize() ui = UserInterface(firstScreen, config.RESOLUTION, config.UI_PLACEMENT_MODE, config.FPS, config.DEV_MODE, config.SOUND) while (True): ui.tick()
''' Created on Jun 11, 2015 @author: nex ''' from tools.crawler import Crawler from ui.ui import UserInterface if __name__ == '__main__': crawler = Crawler() UI = UserInterface(crawler) UI.run()
from models.board import Board from models.game import Game from ui.gameSettings import Settings from ui.ui import UserInterface from validators import boardValidator ''' getting the board dimensions ''' settings = Settings() boardDimensions = settings.getDimensions() ''' initalizing the board ''' board = Board(boardDimensions.boardX, boardDimensions.boardY) ''' initializing the game ''' BoardValidator = boardValidator() game = Game(board, BoardValidator) ''' starting the game ''' ui = UserInterface(game) ui.start()
from modules.camera import Camera from screens.mainscreen import MainScreen from ui.ui import UserInterface def read_config(filepath): # read configuration file config = {} with codecs.open('config.yml', 'r', encoding='utf8') as f: yml_dict = yaml.safe_load(f) for k in yml_dict: config[k] = yml_dict[k] return config if __name__ == "__main__": config = read_config('config.yml') cam = Camera(rpiCam=config['rpi_camera'], cameraNum=config['camera_number'], width=config['camera_width'], height=config['camera_height'], fps=config['camera_fps']) screen = MainScreen(config, cam) ui = UserInterface(screen, (800, 480), True, 60, True) while True: image = cam.grabFrame() if (image != None): screen.setImage(image) ui.tick() cam.cleanup()
from ui.ui import UserInterface from kivy.garden.iconfonts import iconfonts from kivy import resources from kivy.config import Config Config.set('graphics', 'width', '800') Config.set('graphics', 'height', '480') resources.resource_add_path( '/home/zandemax/coding/pcms/img/defaulttheme-0.png') resources.resource_remove_path( '/usr/lib/python3.6/site-packages/kivy/data/images/defaulttheme-0.png') print(resources.resource_find('defaulttheme-0')) iconfonts.register('weather', 'img/weathericons-regular-webfont.ttf', 'img/weather_icons.fontd') UserInterface().run()