コード例 #1
0
ファイル: ETCalibrate.cs プロジェクト: shalse/HARE_ET
        //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;
            }
        }
コード例 #2
0
ファイル: ETEyeImageMonitor.cs プロジェクト: shalse/HARE_ET
 public ETEyeImageMonitor(ETController ETDevice, PictureBox inPicBox)
 {
     Console.WriteLine("Test1");
     EyeImageCallback = new GetEyeImageCallback(GetEyeImageCallbackFunction);
     ETDevice.iV_SetEyeImageCallback(EyeImageCallback);
     pictureBoxReference = inPicBox;
 }
コード例 #3
0
 public ETEyeImageMonitor(ETController ETDevice, PictureBox inPicBox)
 {
     Console.WriteLine("Test1");
     EyeImageCallback = new GetEyeImageCallback(GetEyeImageCallbackFunction);
     ETDevice.iV_SetEyeImageCallback(EyeImageCallback);
     pictureBoxReference = inPicBox;
 }
コード例 #4
0
ファイル: ETValidate.cs プロジェクト: shalse/HARE_ET
 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);
 }
コード例 #5
0
        //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);
            }
        }
コード例 #6
0
ファイル: ETConnection.cs プロジェクト: shalse/HARE_ET
        //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);
            }
        }
コード例 #7
0
ファイル: ETConnection.cs プロジェクト: shalse/HARE_ET
 //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;
     }
 }
コード例 #8
0
ファイル: ETEyeImageMonitor.cs プロジェクト: shalse/HARE_ET
 private void GetEyeImageCallbackFunction(ETController.ImageStruct image)
 {
     Bitmap eyeImageBmp;
     eyeImageBmp = new Bitmap(image.imageWidth, image.imageHeight, image.imageWidth * 3, PixelFormat.Format24bppRgb, image.imageBuffer);
     UpdateTrackingMonitor(eyeImageBmp);
 }
コード例 #9
0
ファイル: ETTrackingMonitor.cs プロジェクト: shalse/HARE_ET
 public ETTrackingMonitor(ETController ETDevice, PictureBox inPicBox)
 {
     m_TrackingMonitorCallback = new GetTrackingMonitorCallback(GetTrackingMonitorCallbackFunction);
     ETDevice.iV_SetTrackingMonitorCallback(m_TrackingMonitorCallback);
     pictureBoxReference = inPicBox;
 }
コード例 #10
0
ファイル: ETValidate.cs プロジェクト: shalse/HARE_ET
 public ETValidate(ETController inETDevice, PictureBox inPicBox)
 {
     ETDevice = inETDevice;
     pictureBoxReference = inPicBox;
 }
コード例 #11
0
ファイル: ETValidate.cs プロジェクト: shalse/HARE_ET
 public ETValidate(ETController inETDevice, PictureBox inPicBox)
 {
     ETDevice            = inETDevice;
     pictureBoxReference = inPicBox;
 }
コード例 #12
0
ファイル: ETTrackingMonitor.cs プロジェクト: shalse/HARE_ET
 public ETTrackingMonitor(ETController ETDevice, PictureBox inPicBox)
 {
     m_TrackingMonitorCallback = new GetTrackingMonitorCallback(GetTrackingMonitorCallbackFunction);
     ETDevice.iV_SetTrackingMonitorCallback(m_TrackingMonitorCallback);
     pictureBoxReference = inPicBox;
 }