コード例 #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;
        }
コード例 #2
0
ファイル: DataStream.cs プロジェクト: jettblu/brainStorm
        // 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;
        }