/// <summary>
        /// Creates a reader with a target command, interval, and threshhold to report average accuracry per interval
        /// </summary>
        /// <param name="device"></param>
        /// <param name="target"></param>
        /// <param name="intervalMs"></param>
        /// <param name="threshHold"></param>
        public EmotivAnalyticReader(IEmotivDevice device, EmotivCommandType target, long intervalMs, float threshHold) : this(device)
        {
            this.TargetCommand = target;

            this.Interval   = intervalMs;
            this.ThreshHold = threshHold;

            IntervalTimer           = new Timer(intervalMs);
            IntervalTimer.AutoReset = true;

            //reset list and enables  'ReadingState' to return a value
            IntervalTimer.Elapsed += (o, e) =>
            {
                //unlock loop in 'ReadingState'
                ShouldReturn = true;
            };

            //trigger the timer
            OnStart += () => { IntervalTimer.Enabled = true; };
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Updates Traget command after being selected from dropdown
 /// </summary>
 /// <param name="dd"></param>
 public void TargetCommandChange(Dropdown dd)
 {
     TargetCommand = (EmotivCommandType)dd.value;
 }
 /// <summary>
 /// Set command from dropdown
 /// </summary>
 /// <param name="dd"></param>
 public void SetTargetCommand(Dropdown dd)
 {
     TargetCommand = (EmotivCommandType)dd.value;
 }
 /// <summary>
 /// Creates an emotiv state
 /// </summary>
 /// <param name="cmd"></param>
 /// <param name="pwr"></param>
 /// <param name="time"></param>
 public EmotivState(EmotivCommandType cmd, float pwr, long time)
 {
     Command = cmd;
     Power   = pwr;
     Time    = time;
 }