Ejemplo n.º 1
0
        /// <summary>
        /// Keeps reading from device for duration.
        /// </summary>
        /// <param name="reader">reader to read from</param>
        /// <param name="second">duration to read</param>
        public TimedEmotivReader(IConnectomeReader <IEmotivState> reader, int second)
        {
            this.reader = reader;
            timer       = new Timer(1000 * second);

            timer.Elapsed += (o, e) => reader.StopReading();
        }
 /// <summary>
 /// Insures reader is disabled
 /// </summary>
 void OnApplicationQuit()
 {
     if (Reader != null && Reader.IsReading)
     {
         Reader.StopReading();
     }
 }
Ejemplo n.º 3
0
 public void StopReading()
 {
     reader.StopReading();
     timer.Stop();
 }