From 8710f14c4af7a6fc0a33b6c91282f59a122333d1 Mon Sep 17 00:00:00 2001 From: Prohurtz <48768484+RedHawk989@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:07:37 -0800 Subject: [PATCH] Code cleanup and minor adjustments --- AdjustmentGUI.py | 67 +++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 41 deletions(-) diff --git a/AdjustmentGUI.py b/AdjustmentGUI.py index f126e41..ff64948 100644 --- a/AdjustmentGUI.py +++ b/AdjustmentGUI.py @@ -1,71 +1,53 @@ import kivy from multiprocessing import Process,Queue,Pipe kivy.require("1.9.1") - from kivy.app import App - from kivy.uix.gridlayout import GridLayout - from kivy.uix.slider import Slider - from kivy.uix.label import Label - from kivy.uix.floatlayout import FloatLayout - from kivy.properties import NumericProperty - from kivy.uix.scatter import Scatter - from kivy.uix.textinput import TextInput - from kivy.uix.boxlayout import BoxLayout - from kivy.core.window import Window -Window.size = (600, 200) +############################################################################### + +Window.size = (700, 200) class WidgetContainer(GridLayout): def __init__(self, **kwargs): - super(WidgetContainer, self).__init__(**kwargs) - - - self.cols = 3 - + + + +############################################################################### right + + self.cols = 3 self.xcc = Slider(min = 1, max = 800, value_track = True, value_track_color =[1, 1, 1, 1]) - - self.add_widget(Label(text ='Search Size X R')) - self.add_widget(self.xcc) - - - - self.xValue = Label(text ='1') - + self.add_widget(self.xcc) + self.xValue = Label(text ='1') self.add_widget(self.xValue) - - self.xcc.bind(value = self.on_value) - ################################### - +############################################################################### bottom self.Y = Slider(min = 1, max = 2000, value_track = True, value_track_color =[1, 1, 1, 1]) - - self.add_widget(Label(text ='Search Size Y R')) self.add_widget(self.Y) - self.YV = Label(text ='1') self.add_widget(self.YV) self.Y.bind(value = self.on_value1) - ############################################### + +############################################################################### left self.xlc = Slider(min = 1, max = 800, value_track = True, @@ -75,7 +57,8 @@ class WidgetContainer(GridLayout): self.xlValue = Label(text ='1') self.add_widget(self.xlValue) self.xlc.bind(value = self.on_value2) - #################################################### + +############################################################################### top self.ylc = Slider(min = 1, max = 800, value_track = True, @@ -86,19 +69,19 @@ class WidgetContainer(GridLayout): self.add_widget(self.ylValue) self.ylc.bind(value = self.on_value3) - - ############################### +############################################################################### detection self.deth = Slider(min = 1, max = 40, value_track = True, value_track_color =[1, 1, 1, 1]) - self.add_widget(Label(text ='Detection thresh default (18)')) + self.add_widget(Label(text ='Detection thresh DEFAULT:18')) self.add_widget(self.deth) self.dethv= Label(text ='1') self.add_widget(self.dethv) self.deth.bind(value = self.on_value4) -##################################################### +############################################################################### camera input + self.cam = Slider(min = 0, max = 5, value_track = True, value_track_color =[1, 1, 1, 1]) @@ -107,7 +90,9 @@ class WidgetContainer(GridLayout): self.camv= Label(text ='Select') self.add_widget(self.camv) self.cam.bind(value = self.on_value5) - ################################################ + +############################################################################### + def on_value(self, instance, brightness): self.xValue.text = "% d"% brightness fx= open("valueX.txt","w+") @@ -144,7 +129,7 @@ class WidgetContainer(GridLayout): fyl.write(self.camv.text) fyl.close -class Eyetrack(App): +class EyetrackGUI(App): def build(self): widgetContainer = WidgetContainer() print() @@ -152,7 +137,7 @@ class Eyetrack(App): return widgetContainer -root = Eyetrack() +rootGUI = EyetrackGUI() -root.run() +rootGUI.run()