示例#1
0
 def __init__(self, **kwargs):
     super(MatchScreen, self).__init__(**kwargs)
     self.score_objects = [self.ids.labelHome, self.ids.labelAway]
     self.set_title('Spiel')
     self.score_touch = None
     self.start_time = 0.0
     self.stop_time = 0.0
     self.timer_event = None
     self.submit_success = None
     self.thread = None
     self.__reset()
     NetworkInfo.register(self.__callback_check_failed_submission)
示例#2
0
    def __init__(self, **kwargs):
        super(BackgroundScreenManager, self).__init__(**kwargs)
        #self.transition = FadeTransition(duration=0.2)
        self.transition = NoTransition()

        # setup hardware listener
        self.hwlistener = HardwareListener()
        Clock.schedule_interval(self.callback, 1/30.0)

        # setup network status
        NetworkInfo.start_polling()

        # setup screens
        self.add_widget(MenuScreen(name='menu'))
        self.add_widget(RfidSetupScreen(name='rfid-setup'))
        self.add_widget(SettingsScreen(name='settings'))
        self.add_widget(LineupScreen(name='lineup'))
        self.add_widget(MatchScreen(name='match'))
示例#3
0
def refresh():
    diskspace = humanize.naturalsize(disk_usage('/').free, binary=True)
    battery_pct = int(sensors_battery().percent)
    battery_status = "charging" if sensors_battery(
    ).power_plugged else "discharging"
    date = datetime.now().strftime('%d/%m %H:%M:%S')
    network_info = NetworkInfo.update()
    content = f"\N{globe with meridians} {network_info.summary} | \U0001F50B {battery_pct}% {battery_status} | \N{floppy disk} {diskspace} avail. | \U0001F55E {date}"
    stdout.write(f"{content}\n")
    stdout.flush()
示例#4
0
    def __init__(self, **kwargs):
        super(BackgroundScreenManager, self).__init__(**kwargs)
        self.transition = FadeTransition(duration=0.2)

        # setup hardware listener
        self.hwlistener = HardwareListener()
        self.hwlistener.register(self.receive_msg)

        # setup network status
        NetworkInfo.start_polling()

        # setup screens
        self.add_widget(MenuScreen(name='menu'))
        self.add_widget(RfidSetupScreen(name='rfid-setup'))
        self.add_widget(SettingsScreen(name='settings'))
        self.add_widget(LoungeScreen(name='lounge'))
        self.add_widget(MatchScreen(name='match'))

        SoundManager.play(Trigger.INTRO)
示例#5
0
 def network_info_pressed(self):
     NetworkInfo.say_connection_status()
示例#6
0
 def __init__(self, **kwargs):
     super(MenuScreen, self).__init__(**kwargs)
     # initial fade in
     self.fadeopacity = 0.0
     NetworkInfo.register(self.__update_network_info)
示例#7
0
 def __init__(self, **kwargs):
     super(BaseScreen, self).__init__(**kwargs)
     NetworkInfo.register(self.__update_network_info)
示例#8
0
 def __network_btn_long_press(self, dt):
     self.network_btn_long_press = True
     NetworkInfo.reconnect()
示例#9
0
 def __init__(self, **kwargs):
     super(MenuScreen, self).__init__(**kwargs)
     # initial fade in
     self.fadeopacity = 0.0
     NetworkInfo.register(self.__update_network_info)
     SoundManager.play(Trigger.INTRO)
示例#10
0
 def network_btn_pressed(self):
     if not self.network_btn_long_press:
         NetworkInfo.say_connection_status()
     else:
         self.network_btn_long_press = False