Skip to content

Commit

Permalink
Merge pull request #95 from BoysTownOrg/eyetracking-updates-for-kaylah
Browse files Browse the repository at this point in the history
Eyetracking updates for kaylah
  • Loading branch information
sbashford authored Jan 4, 2023
2 parents a2398e5 + 53e34c8 commit 3b1045f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
9 changes: 6 additions & 3 deletions macos/main/with-tobii.mm
Original file line number Diff line number Diff line change
Expand Up @@ -196,33 +196,36 @@ void attach(SubjectView::Observer *a) override {
}

void moveDotTo(WindowPoint point) override {
dot.hidden = YES;
animate(dot,
NSMakeRect(point.x * dot.superview.frame.size.width -
dot.frame.size.width / 2,
point.y * dot.superview.frame.size.height -
dot.frame.size.height / 2,
dot.frame.size.width, dot.frame.size.height),
1.5, animationDelegate);
0.5, animationDelegate);
}

void shrinkDot() override {
dot.hidden = NO;
animate(dot,
NSMakeRect(dot.frame.origin.x +
(dot.frame.size.width - shrunkenDotDiameterPoints) / 2,
dot.frame.origin.y +
(dot.frame.size.height - shrunkenDotDiameterPoints) / 2,
shrunkenDotDiameterPoints, shrunkenDotDiameterPoints),
0.5, animationDelegate);
2.0, animationDelegate);
}

void growDot() override {
dot.hidden = NO;
animate(dot,
NSMakeRect(dot.frame.origin.x +
(dot.frame.size.width - normalDotDiameterPoints) / 2,
dot.frame.origin.y +
(dot.frame.size.height - normalDotDiameterPoints) / 2,
normalDotDiameterPoints, normalDotDiameterPoints),
0.5, animationDelegate);
2.0, animationDelegate);
}

void show() override { [dot setHidden:NO]; }
Expand Down
25 changes: 14 additions & 11 deletions macos/main/with-tobii.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,25 @@ struct CalibrationValidationTesterSwiftView: View {
if showing.value {
HStack {
List {
Section(header: Text("accuracy (degrees)")) {
TextField("left", text: $leftEyeAccuracyDegrees.string).disabled(true)
TextField("right", text: $rightEyeAccuracyDegrees.string).disabled(true)
Form {
Section(header: Text("accuracy (degrees)")) {
TextField("left", text: $leftEyeAccuracyDegrees.string).disabled(true)
TextField("right", text: $rightEyeAccuracyDegrees.string).disabled(true)
}
}
}
List {
Section(header: Text("precision (degrees)")) {
TextField("left", text: $leftEyePrecisionDegrees.string).disabled(true)
TextField("right", text: $rightEyePrecisionDegrees.string).disabled(true)
Form {
Section(header: Text("precision (degrees)")) {
TextField("left", text: $leftEyePrecisionDegrees.string).disabled(true)
TextField("right", text: $rightEyePrecisionDegrees.string).disabled(true)
}
}
}
Button("Close") {
observableObserver.observer?.notifyThatCloseButtonHasBeenClicked()
}
}.padding()
}.frame(height: 200)
}
}
}
Expand Down Expand Up @@ -148,15 +152,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
let alert = NSAlert()
alert.messageText = ""
alert.informativeText = "This software will store your eye tracking data.\n\nWe do so only for the purpose of the current study (17-13-XP). We never sell, distribute, or make profit on the collected data. Only staff and research personnel on the existing IRB will have access to the data. Any data used for publication or collaborative and/or learning purposes will be deidentified.\n\nThere is no direct benefit to you for doing this study. What we learn from this study may help doctors treat children who have a hard time hearing when it is noisy."
alert.addButton(withTitle: "No, I do not accept")
alert.informativeText = "This software will store your eye tracking data.\n\nWe do so only for the purpose of the current study (11-24-XP). We never sell, distribute, or make profit on the collected data. Only staff and research personnel on the existing IRB will have access to the data. Any data used for publication or collaborative and/or learning purposes will be deidentified.\n\nThere is no direct benefit to you for doing this study. What we learn from this study may help doctors treat children who have a hard time hearing when it is noisy."
alert.addButton(withTitle: "Yes, I accept")
alertWindow.makeKeyAndOrderFront(nil)
alert.addButton(withTitle: "No, I do not accept")
alert.beginSheetModal(for: alertWindow, completionHandler: { (response: NSApplication.ModalResponse) in
alertWindow.orderOut(nil)
NSApp.stopModal(withCode: response)
})
if NSApp.runModal(for: alertWindow) == NSApplication.ModalResponse.alertFirstButtonReturn {
if NSApp.runModal(for: alertWindow) == NSApplication.ModalResponse.alertSecondButtonReturn {
let terminatingAlert = NSAlert()
terminatingAlert.messageText = ""
terminatingAlert.informativeText = "User does not accept eye tracking terms. Terminating."
Expand Down

0 comments on commit 3b1045f

Please sign in to comment.