public DetectionManager() { //eyestracker = new EyesTracker(); eyetracker = new Eyetracker(); pupilDetectionLeft = new PupilDetection(EyeEnum.Left); pupilDetectionRight = new PupilDetection(EyeEnum.Right); glintDetectionLeft = new GlintDetection(EyeEnum.Left); glintDetectionRight = new GlintDetection(EyeEnum.Right); }
public EyetrackerService(Microsoft.VisualStudio.OLE.Interop.IServiceProvider serviceProvider) { //TODO: this needs to be improved. Handle reconnection etc. try { _eyetracker = new Eyetracker(); } catch (Exception e) { Logger.Log("Could not connect to eye tracker (see exception below). All features are disabled."); Logger.Log(e); } }
public void EveryEyetracker_WhenCreated_UsesTheSameInstanceOfInnerEyetracker() { var expectedEyetracker = new EyetrackerStub(); EyetrackerFactory.Default = new EyetrackerFactoryStub() { CanCreateEyetracker = true, Eyetracker = expectedEyetracker }; var instances = EyetrackerStub.NumberOfCreatedInstances; var tracker1 = new Eyetracker(); var tracker2 = new Eyetracker(); Assert.That(EyetrackerStub.NumberOfCreatedInstances, Is.EqualTo(instances)); }
public void Eyetracker_WhenCreated_ShouldCreateEyetrackerFromDefaultFactory() { var expectedEyetracker = new EyetrackerStub() { X = .2f, Y = .23f, Z = .12f }; EyetrackerFactory.Default = new EyetrackerFactoryStub() { CanCreateEyetracker = true, Eyetracker = expectedEyetracker }; var eyetracker = new Eyetracker(); Assert.That(eyetracker.X, Is.EqualTo(expectedEyetracker.X), "X"); Assert.That(eyetracker.Y, Is.EqualTo(expectedEyetracker.Y), "Y"); }