mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
an actuall cpu perf increase
This commit is contained in:
parent
49675dc672
commit
43e86c2ae8
@ -47,6 +47,7 @@ class CameraWidget:
|
||||
self.configl = main_config.left_eye
|
||||
self.configr = main_config.right_eye
|
||||
self.settings = main_config.settings
|
||||
self.update_wait_count = 100
|
||||
if self.eye_id == EyeId.RIGHT:
|
||||
self.config = main_config.right_eye
|
||||
elif self.eye_id == EyeId.LEFT:
|
||||
@ -311,6 +312,7 @@ class CameraWidget:
|
||||
|
||||
if event == self.gui_tracking_button:
|
||||
print("\033[94m[INFO] Moving to tracking mode\033[0m")
|
||||
self.update_wait_count = 100
|
||||
self.in_roi_mode = False
|
||||
self.camera.set_output_queue(self.capture_queue)
|
||||
window[self.gui_roi_layout].update(visible=False)
|
||||
@ -318,6 +320,7 @@ class CameraWidget:
|
||||
|
||||
if event == self.gui_roi_button:
|
||||
print("\033[94m[INFO] Move to roi mode\033[0m")
|
||||
self.update_wait_count = 100
|
||||
self.in_roi_mode = True
|
||||
self.camera.set_output_queue(self.roi_queue)
|
||||
window[self.gui_roi_layout].update(visible=True)
|
||||
@ -425,6 +428,8 @@ class CameraWidget:
|
||||
window[self.gui_output_graph].update(visible=False)
|
||||
return
|
||||
try:
|
||||
if self.update_wait_count >= 0:
|
||||
self.update_wait_count = self.update_wait_count - 1
|
||||
window[self.gui_roi_message].update(visible=False)
|
||||
window[self.gui_output_graph].update(visible=True)
|
||||
(maybe_image, eye_info) = self.image_queue.get(block=False)
|
||||
@ -478,5 +483,4 @@ class CameraWidget:
|
||||
if eye_info.info_type != EyeInfoOrigin.FAILURE:
|
||||
self.osc_queue.put((self.eye_id, eye_info))
|
||||
except Empty:
|
||||
time.sleep(0.01)
|
||||
pass
|
||||
|
||||
@ -192,7 +192,7 @@ def main():
|
||||
# GUI Render loop
|
||||
while True:
|
||||
# First off, check for any events from the GUI
|
||||
event, values = window.read(timeout=0.1)
|
||||
event, values = window.read(timeout=2)
|
||||
|
||||
# If we're in either mode and someone hits q, quit immediately
|
||||
if event == "Exit" or event == sg.WIN_CLOSED:
|
||||
@ -278,6 +278,7 @@ def main():
|
||||
config.save()
|
||||
|
||||
else:
|
||||
# print('size of queue: ', osc_queue.qsize())
|
||||
# Otherwise, render all
|
||||
for eye in eyes:
|
||||
if eye.started():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user