def staticDrill(self,appname): from guizero import Box appname = appname # second_message.value = "Static Passing Selected" self.drillType = "Static" self.window1 = Window(app, bg="#424242",height=280, width=480, layout="grid") # logo = Picture(self.window1, image="include/logo.gif", align="left", grid=[0, 0]) # logo.resize(40, 40) Heading = Text(self.window1, "Basic Tracking", size=18, font="Calibri Bold", color="white",grid=[1,0,3,1]) Slide1 = Text(self.window1, "Ball Speed:", size=14, font="Calibri Bold", color="white", grid=[1, 1]) # , 2, 1]) speed = Slider(self.window1, command=self.ball_speed_slider, start=1, end=5, grid=[1, 2]) speed.width = 150 speed.text_color = "black" speed.bg = "white" speed.text_size=14 Slide2 = Text(self.window1, "Pass Difficulty:", size=14, font="Calibri Bold", color="white", grid=[3, 1]) difficulty = Slider(self.window1, command=self.difficulty_slider, start=1, end=5, grid=[3, 2]) difficulty.width = 150 difficulty.text_color = "black" difficulty.bg = "white" difficulty.text_size=14 start = PushButton(self.window1, command=self.start_command, args=[self.ballSpeed, self.difficulty, self.drillType, appname], image="include/images/startbut.png", grid=[1, 5]) start.bg = "#37f100" start.text_color = "white" stop = PushButton(self.window1, command=self.pause_command, args=[self.window1], image="include/images/pausebut.png", grid=[3, 5]) stop.bg = "#ffb000" stop.text_color = "white" exit_win = PushButton(self.window1, command=self.exit_command, args=[appname, self.window1], image="include/images/stopbut.png", grid=[1, 6]) exit_win.bg = "#e9002a" exit_win.text_color = "white" camera = PushButton(self.window1, command=self.show_cam, args=[], image="include/images/camerabut.png", grid=[3, 6]) camera.bg = "#002ff5" camera.text_color = "white" Center = Box(self.window1, width=50, height=165, grid=[2, 1, 1, 7]) Left = Box(self.window1, width=60, height=200, grid=[0, 0, 1, 7]) Right = Box(self.window1, width=20, height=200, grid=[4, 0, 1, 7]) VC = PushButton(Center, command=self.enable_voice, args=[], image="include/images/micbut.png", align="bottom")
def manualDrill(self,appname): # if self.player != "None": from guizero import Box appname = appname # second_message.value = "Entering Manual Mode" self.drillType = "Manual" self.window3 = Window(app, bg="#424242",height=280, width=480, layout="grid") # logo = Picture(self.window3, image="include/logo.gif", align="left", grid=[0, 0]) # logo.resize(75, 75) Heading = Text(self.window3, "Voice Activated Launch", size=18, font="Calibri Bold", color="white",grid=[1,0,3,1]) Slide1 = Text(self.window3, "Ball Speed:", size=14, font="Calibri Bold", color="white", grid=[1, 1]) # , 2, 1]) speed = Slider(self.window3, command=self.ball_speed_slider, start=1, end=5, grid=[1, 2]) speed.width = 150 speed.text_color = "black" speed.bg = "white" speed.text_size=14 Slide2 = Text(self.window3, "Pass Difficulty:", size=14, font="Calibri Bold", color="white", grid=[3, 1]) difficulty = Slider(self.window3, command=self.difficulty_slider, start=1, end=5, grid=[3, 2]) # , 2, 1]) difficulty.width = 150 difficulty.text_color = "black" difficulty.bg = "white" difficulty.text_size=14 start = PushButton(self.window3, command=self.start_command, args=[self.ballSpeed, self.difficulty, self.drillType, appname], image="include/images/startbut.png", grid=[1, 5]) start.bg = "#37f100" start.text_color = "white" stop = PushButton(self.window3, command=self.pause_command, args=[self.window3], image="include/images/pausebut.png", grid=[3, 5]) stop.bg = "#ffb000" stop.text_color = "white" exit_win = PushButton(self.window3, command=self.exit_command, args=[appname, self.window3], image="include/images/stopbut.png", grid=[1, 6]) exit_win.bg = "#e9002a" exit_win.text_color = "white" camera = PushButton(self.window3, command=self.show_cam, args=[], image="include/images/camerabut.png", grid=[3, 6]) camera.bg = "#002ff5" camera.text_color = "white" Center = Box(self.window3, width=50, height=200, grid=[2, 1, 1, 7]) Left = Box(self.window3, width=60, height=200, grid=[0, 0, 1, 7]) Right = Box(self.window3, width=20, height=200, grid=[4, 0, 1, 7])
def gui_main(): """ The main function for GUI mode. This function sets up the GUI elements and launches the GUI event loop. """ app = App(title="Nikola", bg="black") text = Text(app, color="light sky blue") text.text_size = 36 keybox = Box(app, layout="grid", border=3) keybox.text_color = "white" keybox.bg = "gray" for row in range(4): keys.append([]) for col in range(4): key = Text(keybox, grid=[col, row], text=keypad.names[row][col], size=24) keys[row].append(key) slider = Slider(app, height=36, width="fill", end=100) slider.bg = "blue" slider.text_color = "white" app.repeat(100, gui_loop, args=[text, slider]) keypad.init() rotary_encoder.init() app.set_full_screen() app.display()
global g #global brightness # print('colour is ' + str(colour.value)) #r=r*int(brightness) #g=g*int(brightness) #b=b*int(brightness) set_motes() app = App(title="Ozzy's TimeLapse Booth", height=500, width=700, layout="grid") messager = Text(app, text="Brightness =", grid=[0, 1]) slider = Slider(app, grid=[1, 2], start="1", end="90", command=space) slider.width = 150 slider.text_color = "red" choice = ButtonGroup(app, options=[["seconds", 1], ["minutes", 60], ["hours", 3600]], selected=1, grid=[0, 2]) brightnessslider = Slider(app, grid=[1, 1], end="255", command=bright) brightnessslider.width = 150 button = PushButton(app, command=thread_starting, text="Start", grid=[1, 3]) button.bg = 'green' endbutton = PushButton(app, command=finishtimelapse, text="End", grid=[3, 3]) endbutton.bg = 'red'