Ejemplo n.º 1
0
 public void HandleSensorData(SensorData sd)
 {
     State origState = state;
     dataSinceStateStart = dataSinceStateStart.EnqueueRight(sd);
     ChangeState(sd.FingerCount(), sd.Distance());
     if (origState != state)
     {
         // state changed! Send off the vanish event for the previous gesture, and a appear event for the current gesture
         gestures.Enqueue(new Gesture(origState, EventType.VANISH, stateEntryTime, dataSinceStateStart));
         stateEntryTime = DateTime.Now;
         dataSinceStateStart = Deque<SensorData>.Empty;
         dataSinceStateStart = dataSinceStateStart.EnqueueRight(sd);
         gestures.Enqueue(new Gesture(state, EventType.APPEAR, stateEntryTime, dataSinceStateStart));
     }
     else
     {
         // continuation of the existing gesture
         gestures.Enqueue(new Gesture(state, EventType.MOVE, stateEntryTime, dataSinceStateStart));
     }
 }
Ejemplo n.º 2
0
 public void HandleSensorData(SensorData sd)
 {
     ChangeState(sd.FingerCount(), sd.Distance());
 }
Ejemplo n.º 3
0
 public void HandleSensorData(SensorData sd)
 {
     ChangeState(sd.FingerCount(), sd.Distance());
 }