Skip to content

Commit

Permalink
update: dwell time edittext has been connected the system
Browse files Browse the repository at this point in the history
  • Loading branch information
Yejining committed Feb 13, 2020
1 parent dbe83cf commit 0e7f2e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/input/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def get_time(self, status):
elif status == Status.GAME:
return 2000 * 1000

def get_dwell_rgb(self):
dwell = self.dwell_time()
return int((dwell / 30) - 20)

def get_card_size(self):
width = self.width()
height = self.height()
Expand Down
6 changes: 4 additions & 2 deletions src/tobii/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def in_process(self):
self.proportion))

red, green, blue = self.get_rgb()
if self.list.count(True) / len(self.list) >= 0.5:
if self.list.count(True) / len(self.list) >= 0.4:
red, green, blue = self.rgb_to_black(red, green, blue)
self.set_rgb(red, green, blue)
if self.is_black():
Expand All @@ -54,6 +54,7 @@ def __init__(self, label, parser, screen_size, i, j, proportion):
self.proportion = proportion
self.list = []
self.is_finished = False
self.set_rgb(self.parser.get_dwell_rgb(), self.parser.get_dwell_rgb(), self.parser.get_dwell_rgb())

def run(self):
self.timer.start(30)
Expand Down Expand Up @@ -84,4 +85,5 @@ def is_black(self):

def is_initial_color(self):
red, green, blue = self.get_rgb()
return True if red == 160 and green == 160 and blue == 160 else False
color = self.parser.get_dwell_rgb()
return True if red == color and green == color and blue == color else False
2 changes: 0 additions & 2 deletions src/tobii/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def set_point(self, element):
x = element.average_point.x
y = element.average_point.y

# self.window.card_thread.x = x
# self.window.card_thread.y = y
for thread in self.window.card_threads:
thread.x = x
thread.y = y
Expand Down

0 comments on commit 0e7f2e7

Please sign in to comment.