Esempio n. 1
0
        //Constructor
        public Training()
        {
            _authorizer      = new Authorizer();
            _headsetFinder   = new HeadsetFinder();
            _sessionCreator  = new SessionCreator();
            _cortexToken     = "";
            _sessionId       = "";
            _isProfileLoaded = false;
            _availActions    = new List <string>();
            _profileLists    = new List <string>();

            // Event register
            _ctxClient = CortexClient.Instance;
            _ctxClient.OnErrorMsgReceived   += MessageErrorRecieved;
            _ctxClient.OnGetDetectionInfo   += GetDetectionOk;
            _ctxClient.OnStreamDataReceived += StreamDataReceived;
            _ctxClient.OnSubscribeData      += SubscribeDataOK;
            _ctxClient.OnCreateProfile      += ProfileCreatedOK;
            _ctxClient.OnLoadProfile        += ProfileLoadedOK;
            _ctxClient.OnSaveProfile        += ProfileSavedOK;
            _ctxClient.OnUnloadProfile      += ProfileUnloadedOK;
            _ctxClient.OnTraining           += TrainingOK;
            _ctxClient.OnQueryProfile       += QueryProfileOK;

            _authorizer.OnAuthorized          += AuthorizedOK;
            _headsetFinder.OnHeadsetConnected += HeadsetConnectedOK;
            _sessionCreator.OnSessionCreated  += SessionCreatedOk;
            _sessionCreator.OnSessionClosed   += SessionClosedOK;
        }
Esempio n. 2
0
 public HeadsetFinder()
 {
     _ctxClient                        = CortexClient.Instance;
     _headsetId                        = "";
     _isFoundHeadset                   = false;
     _ctxClient.OnQueryHeadset        += QueryHeadsetOK;
     _ctxClient.OnHeadsetConnected    += HeadsetConnectedOK;
     _ctxClient.OnHeadsetDisConnected += HeadsetDisconnectedOK;
 }
Esempio n. 3
0
        //Constructor
        public SessionCreator()
        {
            _sessionId     = "";
            _applicationId = "";
            _cortexToken   = "";

            _ctxClient = CortexClient.Instance;

            _ctxClient.OnCreateSession += CreateSessionOk;
            _ctxClient.OnUpdateSession += UpdateSessionOk;
        }
Esempio n. 4
0
        // Constructor
        public Authorizer()
        {
            _ctxClient      = CortexClient.Instance;
            _cortexToken    = "";
            _emotivId       = "";
            _isEulaAccepted = false;
            _hasAccessRight = false;

            _ctxClient.OnConnected          += ConnectedOK;
            _ctxClient.OnGetUserLogin       += GetUserLoginOK;
            _ctxClient.OnUserLogin          += UserLoginOK;  // inform user loggin
            _ctxClient.OnUserLogout         += UserLogoutOK; // inform user log out
            _ctxClient.OnHasAccessRight     += HasAccessRightOK;
            _ctxClient.OnRequestAccessDone  += RequestAccessDone;
            _ctxClient.OnAccessRightGranted += AccessRightGrantedOK; // inform user have granted or rejected access right for the App
            _ctxClient.OnAuthorize          += AuthorizedOK;
            _ctxClient.OnEULAAccepted       += EULAAcceptedOK;
        }
Esempio n. 5
0
        // Constructor
        public DataStream()
        {
            _authorizer      = new Authorizer();
            _headsetFinder   = new HeadsetFinder();
            _sessionCreator  = new SessionCreator();
            _cortexToken     = "";
            _sessionId       = "";
            _isActiveSession = false;

            _streams = new List <string>();
            // Event register
            _ctxClient = CortexClient.Instance;
            _ctxClient.OnErrorMsgReceived   += MessageErrorRecieved;
            _ctxClient.OnStreamDataReceived += StreamDataReceived;
            _ctxClient.OnSubscribeData      += SubscribeDataOK;
            _ctxClient.OnUnSubscribeData    += UnSubscribeDataOK;

            _authorizer.OnAuthorized          += AuthorizedOK;
            _headsetFinder.OnHeadsetConnected += HeadsetConnectedOK;
            _sessionCreator.OnSessionCreated  += SessionCreatedOk;
            _sessionCreator.OnSessionClosed   += SessionClosedOK;
        }