fix flip right axis, fix http add

This commit is contained in:
Prohurtz 2023-03-19 17:07:05 -05:00
parent 5c0b1b45fd
commit 137f3004f7
2 changed files with 12 additions and 7 deletions

View File

@ -59,10 +59,8 @@ class Camera:
if (
self.config.capture_source != None and self.config.capture_source != ""
):
# if len(self.current_capture_source) > 2 and "http" not in self.current_capture_source:
# self.current_capture_source = f"http://{self.current_capture_source}/"
# print(self.current_capture_source)
if (self.current_capture_source[:3] == "COM"):
if (self.config.capture_source[:3] == "COM"):
if (
self.serial_connection is None
or self.camera_status == CameraState.DISCONNECTED

View File

@ -1,9 +1,16 @@
import sys
from utils.misc_utils import PlaySound, SND_FILENAME, SND_ASYNC
import numpy as np
from enum import IntEnum
class EyeId(IntEnum):
RIGHT = 0
LEFT = 1
BOTH = 2
SETTINGS = 3
def cal_osc(self, cx, cy):
if self.eye_id == "EyeId.RIGHT":
if self.eye_id == EyeId.RIGHT:
flipx = self.settings.gui_flip_x_axis_right
else:
flipx = self.settings.gui_flip_x_axis_left
@ -61,7 +68,7 @@ def cal_osc(self, cx, cy):
if yu > 0:
out_y = max(0.0, min(1.0, yu))
if flipx: #TODO Check for working function
if flipx:
if xr >= 0:
out_x = -abs(max(0.0, min(1.0, xr)))
if xl > 0:
@ -72,7 +79,7 @@ def cal_osc(self, cx, cy):
if xl > 0:
out_x = -abs(max(0.0, min(1.0, xl)))
except:
print("[ERROR] Eye Calibration Invalid!")
print("\033[91m[ERROR] Eye Calibration Invalid!\033[0m")
out_x = 0.5
out_y = 0.5
try: