Code cleanup and minor adjustments

This commit is contained in:
Prohurtz 2022-01-14 14:07:37 -08:00 committed by GitHub
parent 15dd61805d
commit 8710f14c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()