Beispiel #1
0
        // helper
        private void DisconnectEyetracker(bool DoRescan)
        {
            if (FEyetracker != null)
            {
                FEyetracker.ConnectionError -= HandleConnectionError;
                FEyetracker.Dispose();
                FEyetracker     = null;
                FConnectionName = string.Empty;

                FSyncManager.Dispose();

                UpdateDeviceStatus(FTrackerInfo.Status);
                if (!FEyetrackerBrowser.IsStarted)
                {
                    if (DoRescan)
                    {
                        FEyetrackerBrowser.Start();
                    }
                }
                if (FEyetrackerBrowser.IsStarted)
                {
                    FEyetrackerBrowser.Stop();
                }
            }
        }
Beispiel #2
0
        // called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            if (FLibraryInitialized)
            {
                if (FEnable.IsChanged && FEnable[0] == true)
                {
                    FEyetrackerBrowser.Start();
                }
                else if (FEnable.IsChanged && FEnable[0] == false)
                {
                    FEyetrackerBrowser.Stop();
                }

                if (FUpdate || FUpdateIn.IsChanged)
                {
                    FModel.SliceCount = FName.SliceCount = FID.SliceCount = FGerneration.SliceCount = FVersion.SliceCount = FStatus.SliceCount = FEyetrackerInfoOut.SliceCount = FEyetrackerInfo.Count;
                    FEyetrackerInfoOut.AssignFrom(FEyetrackerInfo);

                    for (int i = 0; i < FEyetrackerInfo.Count; i++)
                    {
                        FModel[i]       = FEyetrackerInfo[i].Model;
                        FName[i]        = FEyetrackerInfo[i].GivenName;
                        FID[i]          = FEyetrackerInfo[i].ProductId;
                        FGerneration[i] = FEyetrackerInfo[i].Generation;
                        FVersion[i]     = FEyetrackerInfo[i].Version;
                        FStatus[i]      = FEyetrackerInfo[i].Status;
                    }
                    FUpdate = false;
                }
            }
            else
            {
                if (FEnable[0] == true)
                {
                    Initialize();
                }
            }
            FInitialized[0] = FLibraryInitialized;
        }