forked from EyeTrackVR/EyeTrackVR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdjustmentGUI.py
143 lines (111 loc) · 4.66 KB
/
AdjustmentGUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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 = (700, 200)
class WidgetContainer(GridLayout):
def __init__(self, **kwargs):
super(WidgetContainer, self).__init__(**kwargs)
############################################################################### 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.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,
value_track_color =[1, 1, 1, 1])
self.add_widget(Label(text ='Search Size X L'))
self.add_widget(self.xlc)
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,
value_track_color =[1, 1, 1, 1])
self.add_widget(Label(text ='Search Size Y L'))
self.add_widget(self.ylc)
self.ylValue = Label(text ='1')
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(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])
self.add_widget(Label(text ='Camera input'))
self.add_widget(self.cam)
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+")
fx.write(self.xValue.text)
fx.close
def on_value1(self, instance, brightness,):
self.YV.text = "% d"% brightness
fy= open("valueY.txt","w+")
fy.write(self.YV.text)
fy.close
def on_value2(self, instance, brightness):
self.xlValue.text = "% d"% brightness
fxl= open("valueXl.txt","w+")
fxl.write(self.xlValue.text)
fxl.close
def on_value3(self, instance, brightness,):
self.ylValue.text = "% d"% brightness
fyl= open("valueYl.txt","w+")
fyl.write(self.ylValue.text)
fyl.close
def on_value4(self, instance, brightness,):
self.dethv.text = "% d"% brightness
fyl= open("thresh.txt","w+")
fyl.write(self.dethv.text)
fyl.close
def on_value5(self, instance, brightness,):
self.camv.text = "% d"% brightness
fyl= open("camport.txt","w+")
fyl.write(self.camv.text)
fyl.close
class EyetrackGUI(App):
def build(self):
widgetContainer = WidgetContainer()
print()
return widgetContainer
rootGUI = EyetrackGUI()
rootGUI.run()