//calibrate given eyetracker public int Calibrate(ETController etController) { int ret = 0; ret = etController.iV_SetupCalibration(ref m_CalibrationData); if (ret == 1) Console.WriteLine("iV_SetupCalibration: Calibration set up successfully"); if (ret == 101) Console.WriteLine("iV_SetupCalibration: no connection established"); if (ret == 111) Console.WriteLine("iV_SetupCalibration: eye tracking device required for this function is not connected"); if (ret == 112) Console.WriteLine("iV_SetupCalibration: parameter out of range"); if (ret == 113) Console.WriteLine("iV_SetupCalibration: eye tracking device required for this calibration method is not connected"); if (ret == 1) { ret = etController.iV_Calibrate(); if (ret == 1) Console.WriteLine("iV_Calibrate: Calibration started successfully"); if (ret == 3) Console.WriteLine("iV_Calibrate: Calibration was aborted"); if (ret == 101) Console.WriteLine("iV_Calibrate: no connection established"); if (ret == 111) Console.WriteLine("iV_Calibrate: eye tracking device required for this function is not connected"); if (ret == 113) Console.WriteLine("iV_Calibrate: eye tracking device required for this calibration method is not connected"); return ret; } else { return ret; } }
public ETEyeImageMonitor(ETController ETDevice, PictureBox inPicBox) { Console.WriteLine("Test1"); EyeImageCallback = new GetEyeImageCallback(GetEyeImageCallbackFunction); ETDevice.iV_SetEyeImageCallback(EyeImageCallback); pictureBoxReference = inPicBox; }
private void ShowAccuracyImage(ETController.ImageStruct image) { Bitmap AccuracyImagebmp; Console.WriteLine("Showing picture: Width: " + m_AccuracyImageData.imageWidth + "Height: " + image.imageHeight); AccuracyImagebmp = new Bitmap(image.imageWidth, image.imageHeight, image.imageWidth * 3, PixelFormat.Format24bppRgb, image.imageBuffer); UpdateAccuracyImage(AccuracyImagebmp); }
//calibrate given eyetracker public int Calibrate(ETController etController) { int ret = 0; ret = etController.iV_SetupCalibration(ref m_CalibrationData); if (ret == 1) { Console.WriteLine("iV_SetupCalibration: Calibration set up successfully"); } if (ret == 101) { Console.WriteLine("iV_SetupCalibration: no connection established"); } if (ret == 111) { Console.WriteLine("iV_SetupCalibration: eye tracking device required for this function is not connected"); } if (ret == 112) { Console.WriteLine("iV_SetupCalibration: parameter out of range"); } if (ret == 113) { Console.WriteLine("iV_SetupCalibration: eye tracking device required for this calibration method is not connected"); } if (ret == 1) { ret = etController.iV_Calibrate(); if (ret == 1) { Console.WriteLine("iV_Calibrate: Calibration started successfully"); } if (ret == 3) { Console.WriteLine("iV_Calibrate: Calibration was aborted"); } if (ret == 101) { Console.WriteLine("iV_Calibrate: no connection established"); } if (ret == 111) { Console.WriteLine("iV_Calibrate: eye tracking device required for this function is not connected"); } if (ret == 113) { Console.WriteLine("iV_Calibrate: eye tracking device required for this calibration method is not connected"); } return(ret); } else { return(ret); } }
//connect to the eye tracker public int connect(ETController etController) { int ret = 0; try { ret = etController.iV_Connect(new StringBuilder(_sendIP), _sendPort, new StringBuilder(_receiveIP), _receivePort); if (ret == 1) { Console.WriteLine("iV_Connect: connection established"); } if (ret == 100) { Console.WriteLine("iV_Connect: failed to establish connection"); } if (ret == 112) { Console.WriteLine("iV_Connect error: wrong parameter"); } if (ret == 123) { Console.WriteLine("iV_Connect error: failed to bind sockets"); } return(ret); } catch (Exception ex) { DialogResult messagebox = MessageBox.Show("Could not connect to SMI Eye Tracker\n\n" + ex.Message, "Error Connecting to Eye Tracker Server", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (messagebox == DialogResult.Retry) { connect(etController); } Console.WriteLine("Exception during iV_Connect: " + ex.Message); return(0); } }
//connect to the eye tracker public int connect(ETController etController) { int ret = 0; try { ret = etController.iV_Connect(new StringBuilder(_sendIP), _sendPort, new StringBuilder(_receiveIP), _receivePort); if (ret == 1) Console.WriteLine("iV_Connect: connection established"); if (ret == 100) Console.WriteLine("iV_Connect: failed to establish connection"); if (ret == 112) Console.WriteLine("iV_Connect error: wrong parameter"); if (ret == 123) Console.WriteLine("iV_Connect error: failed to bind sockets"); return ret; } catch (Exception ex) { DialogResult messagebox = MessageBox.Show("Could not connect to SMI Eye Tracker\n\n"+ex.Message, "Error Connecting to Eye Tracker Server", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (messagebox == DialogResult.Retry) { connect(etController); } Console.WriteLine("Exception during iV_Connect: " + ex.Message); return 0; } }
private void GetEyeImageCallbackFunction(ETController.ImageStruct image) { Bitmap eyeImageBmp; eyeImageBmp = new Bitmap(image.imageWidth, image.imageHeight, image.imageWidth * 3, PixelFormat.Format24bppRgb, image.imageBuffer); UpdateTrackingMonitor(eyeImageBmp); }
public ETTrackingMonitor(ETController ETDevice, PictureBox inPicBox) { m_TrackingMonitorCallback = new GetTrackingMonitorCallback(GetTrackingMonitorCallbackFunction); ETDevice.iV_SetTrackingMonitorCallback(m_TrackingMonitorCallback); pictureBoxReference = inPicBox; }
public ETValidate(ETController inETDevice, PictureBox inPicBox) { ETDevice = inETDevice; pictureBoxReference = inPicBox; }