general: trying to capture correct deeplink
This commit is contained in:
@@ -35,7 +35,8 @@ protocol ScreenCapturePermissionManaging: AnyObject {
|
|||||||
final class ScreenCapturePermissionManager: ObservableObject, ScreenCapturePermissionManaging {
|
final class ScreenCapturePermissionManager: ObservableObject, ScreenCapturePermissionManaging {
|
||||||
static let shared = ScreenCapturePermissionManager()
|
static let shared = ScreenCapturePermissionManager()
|
||||||
|
|
||||||
@Published private(set) var authorizationStatus: ScreenCaptureAuthorizationStatus = .notDetermined
|
@Published private(set) var authorizationStatus: ScreenCaptureAuthorizationStatus =
|
||||||
|
.notDetermined
|
||||||
|
|
||||||
var authorizationStatusPublisher: AnyPublisher<ScreenCaptureAuthorizationStatus, Never> {
|
var authorizationStatusPublisher: AnyPublisher<ScreenCaptureAuthorizationStatus, Never> {
|
||||||
$authorizationStatus.eraseToAnyPublisher()
|
$authorizationStatus.eraseToAnyPublisher()
|
||||||
@@ -70,11 +71,24 @@ final class ScreenCapturePermissionManager: ObservableObject, ScreenCapturePermi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func openSystemSettings() {
|
func openSystemSettings() {
|
||||||
guard let url = URL(
|
// Try different variations
|
||||||
string: "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenRecording"
|
let possibleUrls = [
|
||||||
) else {
|
"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenRecording",
|
||||||
|
"x-apple.systempreferences:Privacy?ScreenRecording",
|
||||||
|
"x-apple.systempreferences:com.apple.preference.security",
|
||||||
|
"x-apple.systempreferences:Privacy",
|
||||||
|
"x-apple.systempreferences:com.apple.preferences.security",
|
||||||
|
]
|
||||||
|
|
||||||
|
for urlString in possibleUrls {
|
||||||
|
if let url = URL(string: urlString),
|
||||||
|
NSWorkspace.shared.open(url)
|
||||||
|
{
|
||||||
|
print("Successfully opened: \(urlString)")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
NSWorkspace.shared.open(url)
|
}
|
||||||
|
|
||||||
|
print("All attempts failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,9 @@ struct SettingsWindowView: View {
|
|||||||
}
|
}
|
||||||
.listStyle(.sidebar)
|
.listStyle(.sidebar)
|
||||||
} detail: {
|
} detail: {
|
||||||
|
ScrollView {
|
||||||
detailView(for: selectedSection)
|
detailView(for: selectedSection)
|
||||||
|
}
|
||||||
}.onReceive(
|
}.onReceive(
|
||||||
NotificationCenter.default.publisher(
|
NotificationCenter.default.publisher(
|
||||||
for: Notification.Name("SwitchToSettingsTab"))
|
for: Notification.Name("SwitchToSettingsTab"))
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import Foundation
|
||||||
|
|
||||||
struct EnforceModeSetupView: View {
|
struct EnforceModeSetupView: View {
|
||||||
@ObservedObject var settingsManager: SettingsManager
|
@ObservedObject var settingsManager: SettingsManager
|
||||||
@@ -24,7 +25,6 @@ struct EnforceModeSetupView: View {
|
|||||||
@ObservedObject var calibrationManager = CalibrationManager.shared
|
@ObservedObject var calibrationManager = CalibrationManager.shared
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
VStack(spacing: 16) {
|
VStack(spacing: 16) {
|
||||||
Image(systemName: "video.fill")
|
Image(systemName: "video.fill")
|
||||||
@@ -86,14 +86,14 @@ struct EnforceModeSetupView: View {
|
|||||||
|
|
||||||
if isTestModeActive && enforceModeService.isCameraActive {
|
if isTestModeActive && enforceModeService.isCameraActive {
|
||||||
testModePreviewView
|
testModePreviewView
|
||||||
/*trackingConstantsView*/
|
trackingConstantsView
|
||||||
} else {
|
} else {
|
||||||
if enforceModeService.isCameraActive && !isTestModeActive {
|
if enforceModeService.isCameraActive && !isTestModeActive {
|
||||||
/*trackingConstantsView*/
|
trackingConstantsView
|
||||||
eyeTrackingStatusView
|
eyeTrackingStatusView
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if showDebugView {
|
if showDebugView {
|
||||||
/*debugEyeTrackingView*/
|
debugEyeTrackingView
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else if enforceModeService.isEnforceModeEnabled {
|
} else if enforceModeService.isEnforceModeEnabled {
|
||||||
@@ -107,7 +107,6 @@ struct EnforceModeSetupView: View {
|
|||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
.padding()
|
.padding()
|
||||||
.background(.clear)
|
.background(.clear)
|
||||||
@@ -424,327 +423,225 @@ struct EnforceModeSetupView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private var trackingConstantsView: some View {*/
|
private var trackingConstantsView: some View {
|
||||||
/*VStack(alignment: .leading, spacing: 16) {*/
|
VStack(alignment: .leading, spacing: 16) {
|
||||||
/*HStack {*/
|
HStack {
|
||||||
/*Text("Tracking Sensitivity")*/
|
Text("Tracking Sensitivity")
|
||||||
/*.font(.headline)*/
|
.font(.headline)
|
||||||
/*Spacer()*/
|
Spacer()
|
||||||
/*Button(action: {*/
|
Button(action: {
|
||||||
/*eyeTrackingService.enableDebugLogging.toggle()*/
|
eyeTrackingService.enableDebugLogging.toggle()
|
||||||
/*}) {*/
|
}) {
|
||||||
/*Image(*/
|
Image(
|
||||||
/*systemName: eyeTrackingService.enableDebugLogging*/
|
systemName: eyeTrackingService.enableDebugLogging
|
||||||
/*? "ant.circle.fill" : "ant.circle"*/
|
? "ant.circle.fill" : "ant.circle"
|
||||||
/*)*/
|
)
|
||||||
/*.foregroundColor(eyeTrackingService.enableDebugLogging ? .orange : .secondary)*/
|
.foregroundColor(eyeTrackingService.enableDebugLogging ? .orange : .secondary)
|
||||||
/*}*/
|
}
|
||||||
/*.buttonStyle(.plain)*/
|
.buttonStyle(.plain)
|
||||||
/*.help("Toggle console debug logging")*/
|
.help("Toggle console debug logging")
|
||||||
|
|
||||||
/*Button(showAdvancedSettings ? "Hide Settings" : "Show Settings") {*/
|
Button(showAdvancedSettings ? "Hide Settings" : "Show Settings") {
|
||||||
/*withAnimation {*/
|
withAnimation {
|
||||||
/*showAdvancedSettings.toggle()*/
|
showAdvancedSettings.toggle()
|
||||||
/*}*/
|
}
|
||||||
/*}*/
|
}
|
||||||
/*.buttonStyle(.bordered)*/
|
.buttonStyle(.bordered)
|
||||||
/*.controlSize(.small)*/
|
.controlSize(.small)
|
||||||
/*}*/
|
}
|
||||||
|
|
||||||
/*// Debug info always visible when tracking*/
|
// Debug info always visible when tracking
|
||||||
/*VStack(alignment: .leading, spacing: 8) {*/
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
/*Text("Live Values:")*/
|
Text("Live Values:")
|
||||||
/*.font(.caption)*/
|
.font(.caption)
|
||||||
/*.fontWeight(.semibold)*/
|
.fontWeight(.semibold)
|
||||||
/*.foregroundColor(.secondary)*/
|
.foregroundColor(.secondary)
|
||||||
|
|
||||||
/*if let leftRatio = eyeTrackingService.debugLeftPupilRatio,*/
|
if let leftRatio = eyeTrackingService.debugLeftPupilRatio,
|
||||||
/*let rightRatio = eyeTrackingService.debugRightPupilRatio*/
|
let rightRatio = eyeTrackingService.debugRightPupilRatio
|
||||||
/*{*/
|
{
|
||||||
/*HStack(spacing: 16) {*/
|
HStack(spacing: 16) {
|
||||||
/*VStack(alignment: .leading, spacing: 2) {*/
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
/*Text("Left Pupil: \(String(format: "%.3f", leftRatio))")*/
|
Text("Left Pupil: \(String(format: "%.3f", leftRatio))")
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(*/
|
.foregroundColor(
|
||||||
/*!trackingConstants.minPupilEnabled*/
|
!EyeTrackingConstants.minPupilEnabled
|
||||||
/*&& !trackingConstants.maxPupilEnabled*/
|
&& !EyeTrackingConstants.maxPupilEnabled
|
||||||
/*? .secondary*/
|
? .secondary
|
||||||
/*: (leftRatio < trackingConstants.minPupilRatio*/
|
: (leftRatio < EyeTrackingConstants.minPupilRatio
|
||||||
/*|| leftRatio > trackingConstants.maxPupilRatio)*/
|
|| leftRatio > EyeTrackingConstants.maxPupilRatio)
|
||||||
/*? .orange : .green*/
|
? .orange : .green
|
||||||
/*)*/
|
)
|
||||||
/*Text("Right Pupil: \(String(format: "%.3f", rightRatio))")*/
|
Text("Right Pupil: \(String(format: "%.3f", rightRatio))")
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(*/
|
.foregroundColor(
|
||||||
/*!trackingConstants.minPupilEnabled*/
|
!EyeTrackingConstants.minPupilEnabled
|
||||||
/*&& !trackingConstants.maxPupilEnabled*/
|
&& !EyeTrackingConstants.maxPupilEnabled
|
||||||
/*? .secondary*/
|
? .secondary
|
||||||
/*: (rightRatio < trackingConstants.minPupilRatio*/
|
: (rightRatio < EyeTrackingConstants.minPupilRatio
|
||||||
/*|| rightRatio > trackingConstants.maxPupilRatio)*/
|
|| rightRatio > EyeTrackingConstants.maxPupilRatio)
|
||||||
/*? .orange : .green*/
|
? .orange : .green
|
||||||
/*)*/
|
)
|
||||||
/*}*/
|
}
|
||||||
|
|
||||||
/*Spacer()*/
|
Spacer()
|
||||||
|
|
||||||
/*VStack(alignment: .trailing, spacing: 2) {*/
|
VStack(alignment: .trailing, spacing: 2) {
|
||||||
/*Text(*/
|
Text(
|
||||||
/*"Range: \(String(format: "%.2f", trackingConstants.minPupilRatio)) - \(String(format: "%.2f", trackingConstants.maxPupilRatio))"*/
|
"Range: \(String(format: "%.2f", EyeTrackingConstants.minPupilRatio)) - \(String(format: "%.2f", EyeTrackingConstants.maxPupilRatio))"
|
||||||
/*)*/
|
)
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(.secondary)*/
|
.foregroundColor(.secondary)
|
||||||
/*let bothEyesOut =*/
|
let bothEyesOut =
|
||||||
/*(leftRatio < trackingConstants.minPupilRatio*/
|
(leftRatio < EyeTrackingConstants.minPupilRatio
|
||||||
/*|| leftRatio > trackingConstants.maxPupilRatio)*/
|
|| leftRatio > EyeTrackingConstants.maxPupilRatio)
|
||||||
/*&& (rightRatio < trackingConstants.minPupilRatio*/
|
&& (rightRatio < EyeTrackingConstants.minPupilRatio
|
||||||
/*|| rightRatio > trackingConstants.maxPupilRatio)*/
|
|| rightRatio > EyeTrackingConstants.maxPupilRatio)
|
||||||
/*Text(bothEyesOut ? "Both Out ⚠️" : "In Range ✓")*/
|
Text(bothEyesOut ? "Both Out ⚠️" : "In Range ✓")
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(bothEyesOut ? .orange : .green)*/
|
.foregroundColor(bothEyesOut ? .orange : .green)
|
||||||
/*}*/
|
}
|
||||||
/*}*/
|
}
|
||||||
/*} else {*/
|
} else {
|
||||||
/*Text("Pupil data unavailable")*/
|
Text("Pupil data unavailable")
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(.secondary)*/
|
.foregroundColor(.secondary)
|
||||||
/*}*/
|
}
|
||||||
|
|
||||||
/*if let yaw = eyeTrackingService.debugYaw,*/
|
if let yaw = eyeTrackingService.debugYaw,
|
||||||
/*let pitch = eyeTrackingService.debugPitch*/
|
let pitch = eyeTrackingService.debugPitch
|
||||||
/*{*/
|
{
|
||||||
/*HStack(spacing: 16) {*/
|
HStack(spacing: 16) {
|
||||||
/*VStack(alignment: .leading, spacing: 2) {*/
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
/*Text("Yaw: \(String(format: "%.3f", yaw))")*/
|
Text("Yaw: \(String(format: "%.3f", yaw))")
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(*/
|
.foregroundColor(
|
||||||
/*!trackingConstants.yawEnabled*/
|
!EyeTrackingConstants.yawEnabled
|
||||||
/*? .secondary*/
|
? .secondary
|
||||||
/*: abs(yaw) > trackingConstants.yawThreshold*/
|
: abs(yaw) > EyeTrackingConstants.yawThreshold
|
||||||
/*? .orange : .green*/
|
? .orange : .green
|
||||||
/*)*/
|
)
|
||||||
/*Text("Pitch: \(String(format: "%.3f", pitch))")*/
|
Text("Pitch: \(String(format: "%.3f", pitch))")
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(*/
|
.foregroundColor(
|
||||||
/*!trackingConstants.pitchUpEnabled*/
|
!EyeTrackingConstants.pitchUpEnabled
|
||||||
/*&& !trackingConstants.pitchDownEnabled*/
|
&& !EyeTrackingConstants.pitchDownEnabled
|
||||||
/*? .secondary*/
|
? .secondary
|
||||||
/*: (pitch > trackingConstants.pitchUpThreshold*/
|
: (pitch > EyeTrackingConstants.pitchUpThreshold
|
||||||
/*|| pitch < trackingConstants.pitchDownThreshold)*/
|
|| pitch < EyeTrackingConstants.pitchDownThreshold)
|
||||||
/*? .orange : .green*/
|
? .orange : .green
|
||||||
/*)*/
|
)
|
||||||
/*}*/
|
}
|
||||||
|
|
||||||
/*Spacer()*/
|
Spacer()
|
||||||
|
|
||||||
/*VStack(alignment: .trailing, spacing: 2) {*/
|
VStack(alignment: .trailing, spacing: 2) {
|
||||||
/*Text(*/
|
Text(
|
||||||
/*"Yaw Max: \(String(format: "%.2f", trackingConstants.yawThreshold))"*/
|
"Yaw Max: \(String(format: "%.2f", EyeTrackingConstants.yawThreshold))"
|
||||||
/*)*/
|
)
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(.secondary)*/
|
.foregroundColor(.secondary)
|
||||||
/*Text(*/
|
Text(
|
||||||
/*"Pitch: \(String(format: "%.2f", trackingConstants.pitchDownThreshold)) to \(String(format: "%.2f", trackingConstants.pitchUpThreshold))"*/
|
"Pitch: \(String(format: "%.2f", EyeTrackingConstants.pitchDownThreshold)) to \(String(format: "%.2f", EyeTrackingConstants.pitchUpThreshold))"
|
||||||
/*)*/
|
)
|
||||||
/*.font(.caption2)*/
|
.font(.caption2)
|
||||||
/*.foregroundColor(.secondary)*/
|
.foregroundColor(.secondary)
|
||||||
/*}*/
|
}
|
||||||
/*}*/
|
}
|
||||||
/*}*/
|
}
|
||||||
/*}*/
|
}
|
||||||
/*.padding(.top, 4)*/
|
.padding(.top, 4)
|
||||||
|
|
||||||
/*if showAdvancedSettings {*/
|
if showAdvancedSettings {
|
||||||
/*VStack(spacing: 16) {*/
|
VStack(spacing: 16) {
|
||||||
/*// Yaw Threshold*/
|
// Display the current constant values
|
||||||
/*VStack(alignment: .leading, spacing: 4) {*/
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
/*HStack {*/
|
Text("Current Threshold Values:")
|
||||||
/*Toggle("", isOn: $trackingConstants.yawEnabled)*/
|
.font(.caption)
|
||||||
/*.labelsHidden()*/
|
.fontWeight(.semibold)
|
||||||
/*Text("Yaw Threshold (Head Turn)")*/
|
.foregroundColor(.secondary)
|
||||||
/*.foregroundColor(*/
|
|
||||||
/*trackingConstants.yawEnabled ? .primary : .secondary)*/
|
|
||||||
/*Spacer()*/
|
|
||||||
/*Text(String(format: "%.2f rad", trackingConstants.yawThreshold))*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
/*}*/
|
|
||||||
/*Slider(value: $trackingConstants.yawThreshold, in: 0.1...0.8, step: 0.05)*/
|
|
||||||
/*.disabled(!trackingConstants.yawEnabled)*/
|
|
||||||
/*Text("Lower = more sensitive to head turning")*/
|
|
||||||
/*.font(.caption2)*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*Divider()*/
|
HStack {
|
||||||
|
Text("Yaw Threshold:")
|
||||||
|
Spacer()
|
||||||
|
Text("\(String(format: "%.2f", EyeTrackingConstants.yawThreshold)) rad")
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
|
|
||||||
/*// Pitch Up Threshold*/
|
HStack {
|
||||||
/*VStack(alignment: .leading, spacing: 4) {*/
|
Text("Pitch Up Threshold:")
|
||||||
/*HStack {*/
|
Spacer()
|
||||||
/*Toggle("", isOn: $trackingConstants.pitchUpEnabled)*/
|
Text("\(String(format: "%.2f", EyeTrackingConstants.pitchUpThreshold)) rad")
|
||||||
/*.labelsHidden()*/
|
.foregroundColor(.secondary)
|
||||||
/*Text("Pitch Up Threshold (Looking Up)")*/
|
}
|
||||||
/*.foregroundColor(*/
|
|
||||||
/*trackingConstants.pitchUpEnabled ? .primary : .secondary)*/
|
|
||||||
/*Spacer()*/
|
|
||||||
/*Text(String(format: "%.2f rad", trackingConstants.pitchUpThreshold))*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
/*}*/
|
|
||||||
/*Slider(*/
|
|
||||||
/*value: $trackingConstants.pitchUpThreshold, in: -0.2...0.5, step: 0.05*/
|
|
||||||
/*)*/
|
|
||||||
/*.disabled(!trackingConstants.pitchUpEnabled)*/
|
|
||||||
/*Text("Lower = more sensitive to looking up")*/
|
|
||||||
/*.font(.caption2)*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*Divider()*/
|
HStack {
|
||||||
|
Text("Pitch Down Threshold:")
|
||||||
|
Spacer()
|
||||||
|
Text("\(String(format: "%.2f", EyeTrackingConstants.pitchDownThreshold)) rad")
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
|
|
||||||
/*// Pitch Down Threshold*/
|
HStack {
|
||||||
/*VStack(alignment: .leading, spacing: 4) {*/
|
Text("Min Pupil Ratio:")
|
||||||
/*HStack {*/
|
Spacer()
|
||||||
/*Toggle("", isOn: $trackingConstants.pitchDownEnabled)*/
|
Text("\(String(format: "%.2f", EyeTrackingConstants.minPupilRatio))")
|
||||||
/*.labelsHidden()*/
|
.foregroundColor(.secondary)
|
||||||
/*Text("Pitch Down Threshold (Looking Down)")*/
|
}
|
||||||
/*.foregroundColor(*/
|
|
||||||
/*trackingConstants.pitchDownEnabled ? .primary : .secondary)*/
|
|
||||||
/*Spacer()*/
|
|
||||||
/*Text(String(format: "%.2f rad", trackingConstants.pitchDownThreshold))*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
/*}*/
|
|
||||||
/*Slider(*/
|
|
||||||
/*value: $trackingConstants.pitchDownThreshold, in: -0.8...0.0, step: 0.05*/
|
|
||||||
/*)*/
|
|
||||||
/*.disabled(!trackingConstants.pitchDownEnabled)*/
|
|
||||||
/*Text("Higher = more sensitive to looking down")*/
|
|
||||||
/*.font(.caption2)*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*Divider()*/
|
HStack {
|
||||||
|
Text("Max Pupil Ratio:")
|
||||||
|
Spacer()
|
||||||
|
Text("\(String(format: "%.2f", EyeTrackingConstants.maxPupilRatio))")
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
|
|
||||||
/*// Min Pupil Ratio*/
|
HStack {
|
||||||
/*VStack(alignment: .leading, spacing: 4) {*/
|
Text("Eye Closed Threshold:")
|
||||||
/*HStack {*/
|
Spacer()
|
||||||
/*Toggle("", isOn: $trackingConstants.minPupilEnabled)*/
|
Text("\(String(format: "%.3f", EyeTrackingConstants.eyeClosedThreshold))")
|
||||||
/*.labelsHidden()*/
|
.foregroundColor(.secondary)
|
||||||
/*Text("Min Pupil Ratio (Looking Right)")*/
|
}
|
||||||
/*.foregroundColor(*/
|
}
|
||||||
/*trackingConstants.minPupilEnabled ? .primary : .secondary)*/
|
.padding(.top, 8)
|
||||||
/*Spacer()*/
|
}
|
||||||
/*Text(String(format: "%.2f", trackingConstants.minPupilRatio))*/
|
.padding(.top, 8)
|
||||||
/*.foregroundColor(.secondary)*/
|
}
|
||||||
/*.font(.caption)*/
|
}
|
||||||
/*}*/
|
.padding()
|
||||||
/*Slider(value: $trackingConstants.minPupilRatio, in: 0.2...0.5, step: 0.01)*/
|
.glassEffectIfAvailable(GlassStyle.regular, in: .rect(cornerRadius: 12))
|
||||||
/*.disabled(!trackingConstants.minPupilEnabled)*/
|
}
|
||||||
/*Text("Higher = more sensitive to looking right")*/
|
|
||||||
/*.font(.caption2)*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*Divider()*/
|
private var debugEyeTrackingView: some View {
|
||||||
|
VStack(alignment: .leading, spacing: 12) {
|
||||||
|
Text("Debug Eye Tracking Data")
|
||||||
|
.font(.headline)
|
||||||
|
.foregroundColor(.blue)
|
||||||
|
|
||||||
/*// Max Pupil Ratio*/
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
/*VStack(alignment: .leading, spacing: 4) {*/
|
Text("Face Detected: \(eyeTrackingService.faceDetected ? "Yes" : "No")")
|
||||||
/*HStack {*/
|
.font(.caption)
|
||||||
/*Toggle("", isOn: $trackingConstants.maxPupilEnabled)*/
|
|
||||||
/*.labelsHidden()*/
|
|
||||||
/*Text("Max Pupil Ratio (Looking Left)")*/
|
|
||||||
/*.foregroundColor(*/
|
|
||||||
/*trackingConstants.maxPupilEnabled ? .primary : .secondary)*/
|
|
||||||
/*Spacer()*/
|
|
||||||
/*Text(String(format: "%.2f", trackingConstants.maxPupilRatio))*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
/*}*/
|
|
||||||
/*Slider(value: $trackingConstants.maxPupilRatio, in: 0.5...0.8, step: 0.01)*/
|
|
||||||
/*.disabled(!trackingConstants.maxPupilEnabled)*/
|
|
||||||
/*Text("Lower = more sensitive to looking left")*/
|
|
||||||
/*.font(.caption2)*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*Divider()*/
|
Text("Looking at Screen: \(eyeTrackingService.userLookingAtScreen ? "Yes" : "No")")
|
||||||
|
.font(.caption)
|
||||||
|
|
||||||
/*// Eye Closed Threshold*/
|
Text("Eyes Closed: \(eyeTrackingService.isEyesClosed ? "Yes" : "No")")
|
||||||
/*VStack(alignment: .leading, spacing: 4) {*/
|
.font(.caption)
|
||||||
/*HStack {*/
|
|
||||||
/*Toggle("", isOn: $trackingConstants.eyeClosedEnabled)*/
|
|
||||||
/*.labelsHidden()*/
|
|
||||||
/*Text("Eye Closed Threshold")*/
|
|
||||||
/*.foregroundColor(*/
|
|
||||||
/*trackingConstants.eyeClosedEnabled ? .primary : .secondary)*/
|
|
||||||
/*Spacer()*/
|
|
||||||
/*Text(String(format: "%.3f", trackingConstants.eyeClosedThreshold))*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
/*}*/
|
|
||||||
/*Slider(*/
|
|
||||||
/*value: Binding(*/
|
|
||||||
/*get: { Double(trackingConstants.eyeClosedThreshold) },*/
|
|
||||||
/*set: { trackingConstants.eyeClosedThreshold = CGFloat($0) }*/
|
|
||||||
/*), in: 0.01...0.1, step: 0.005*/
|
|
||||||
/*)*/
|
|
||||||
/*.disabled(!trackingConstants.eyeClosedEnabled)*/
|
|
||||||
/*Text("Lower = more sensitive to eye closure")*/
|
|
||||||
/*.font(.caption2)*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*// Reset button*/
|
if eyeTrackingService.faceDetected {
|
||||||
/*Button(action: {*/
|
Text("Yaw: 0.0")
|
||||||
/*trackingConstants.resetToDefaults()*/
|
.font(.caption)
|
||||||
/*}) {*/
|
|
||||||
/*HStack {*/
|
|
||||||
/*Image(systemName: "arrow.counterclockwise")*/
|
|
||||||
/*Text("Reset to Defaults")*/
|
|
||||||
/*}*/
|
|
||||||
/*.frame(maxWidth: .infinity)*/
|
|
||||||
/*}*/
|
|
||||||
/*.buttonStyle(.bordered)*/
|
|
||||||
/*.controlSize(.small)*/
|
|
||||||
/*.padding(.top, 8)*/
|
|
||||||
/*}*/
|
|
||||||
/*.padding(.top, 8)*/
|
|
||||||
/*}*/
|
|
||||||
/*}*/
|
|
||||||
/*.padding()*/
|
|
||||||
/*.glassEffectIfAvailable(GlassStyle.regular, in: .rect(cornerRadius: 12))*/
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
/*private var debugEyeTrackingView: some View {*/
|
Text("Roll: 0.0")
|
||||||
/*VStack(alignment: .leading, spacing: 12) {*/
|
.font(.caption)
|
||||||
/*Text("Debug Eye Tracking Data")*/
|
}
|
||||||
/*.font(.headline)*/
|
}
|
||||||
/*.foregroundColor(.blue)*/
|
.font(.caption)
|
||||||
|
.foregroundColor(.secondary)
|
||||||
/*VStack(alignment: .leading, spacing: 8) {*/
|
}
|
||||||
/*Text("Face Detected: \(eyeTrackingService.faceDetected ? "Yes" : "No")")*/
|
.padding()
|
||||||
/*.font(.caption)*/
|
.glassEffectIfAvailable(GlassStyle.regular, in: .rect(cornerRadius: 12))
|
||||||
|
}
|
||||||
/*Text("Looking at Screen: \(eyeTrackingService.userLookingAtScreen ? "Yes" : "No")")*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
|
|
||||||
/*Text("Eyes Closed: \(eyeTrackingService.isEyesClosed ? "Yes" : "No")")*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
|
|
||||||
/*if eyeTrackingService.faceDetected {*/
|
|
||||||
/*Text("Yaw: 0.0")*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
|
|
||||||
/*Text("Roll: 0.0")*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
/*}*/
|
|
||||||
/*}*/
|
|
||||||
/*.font(.caption)*/
|
|
||||||
/*.foregroundColor(.secondary)*/
|
|
||||||
/*}*/
|
|
||||||
/*.padding()*/
|
|
||||||
/*.glassEffectIfAvailable(GlassStyle.regular, in: .rect(cornerRadius: 12))*/
|
|
||||||
/*}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
|
|||||||
Reference in New Issue
Block a user