Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("EEG LOGGER");
            Console.WriteLine("Please wear Headset with good signal!!!");

            // Delete Output file if existed
            if (File.Exists(OutFilePath))
            {
                File.Delete(OutFilePath);
            }
            OutFileStream = new FileStream(OutFilePath, FileMode.Append, FileAccess.Write);


            DataStreamExample dse = new DataStreamExample();

            dse.AddStreams("eeg");
            dse.OnSubscribed      += SubscribedOK;
            dse.OnEEGDataReceived += OnEEGDataReceived;
            dse.Start();

            Console.WriteLine("Press Esc to exit");
            while (Console.ReadKey().Key != ConsoleKey.Escape)
            {
            }

            // Unsubcribe stream
            dse.UnSubscribe();
            Thread.Sleep(5000);

            // Close Session
            dse.CloseSession();
            Thread.Sleep(5000);
            // Close Out Stream
            OutFileStream.Dispose();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Motion LOGGER");
            Console.WriteLine("Please wear Headset with good signal!!!");

            // Delete Output file if existed
            if (File.Exists(OutFilePath))
            {
                File.Delete(OutFilePath);
            }
            OutFileStream = new FileStream(OutFilePath, FileMode.Append, FileAccess.Write);
            rollingSums   = rollingSums = new RollingSums
            {
                x = 0,
                y = 0,
                z = 0
            };
            currentGyroType = GyrometerType.Unknown;

            DataStreamExample dse = new DataStreamExample();

            dse.AddStreams("mot");
            dse.OnSubscribed         += SubscribedOK;
            dse.OnMotionDataReceived += OnMotionDataReceived;
            dse.Start(licenseID);

            Console.WriteLine("Press Esc to flush data to file and exit");
            while (Console.ReadKey().Key != ConsoleKey.Escape)
            {
            }

            // Unsubcribe stream
            dse.UnSubscribe();
            Thread.Sleep(5000);

            // Close Session
            dse.CloseSession();
            Thread.Sleep(5000);
            // Close Out Stream
            OutFileStream.Dispose();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("PM LOGGER");
            Console.WriteLine("Please wear Headset with good signal!!!");

            // Delete Output file if existed
            if (File.Exists(OutFilePath))
            {
                File.Delete(OutFilePath);
            }
            OutFileStream = new FileStream(OutFilePath, FileMode.Append, FileAccess.Write);


            DataStreamExample dse = new DataStreamExample();

            dse.AddStreams("met");
            dse.OnSubscribed       += SubscribedOK;
            dse.OnPerfDataReceived += OnPMDataReceived;

            // Need a valid license key and activeSession when subscribe performance metric data
            dse.Start(licenseID, true);

            Console.WriteLine("Press Esc to flush data to file and exit");
            while (Console.ReadKey().Key != ConsoleKey.Escape)
            {
            }

            // Unsubcribe stream
            dse.UnSubscribe();
            Thread.Sleep(5000);

            // Close Session
            dse.CloseSession();
            Thread.Sleep(5000);
            // Close Out Stream
            OutFileStream.Dispose();
        }