protected override IEmotivState ReadingState(IConnectomeDevice <IEmotivState> device, long time) { IEmotivState currentState = device.Read(time); if (ShouldReadNull == false) { while (currentState.Command == Enum.EmotivCommandType.NULL) { InsureMillisecondPassed(); currentState = device.Read(time); } } return(currentState); }
/// <summary> /// Returns n average state after every intervals /// </summary> /// <param name="device"></param> /// <returns>State with target command average power</returns> protected override IEmotivState ReadingState(IConnectomeDevice <IEmotivState> device, long time) { IntervalStatesList = new LinkedList <IEmotivState>(); while (!ShouldReturn) { IntervalStatesList.AddFirst(device.Read(time)); } ShouldReturn = false; return(ComputeState(IntervalStatesList)); }