Exemplo n.º 1
0
        public void processSkeleton(Skeleton skeleton)
        {
            Boolean rightHandOnFace = _rightHandOnFaceIndicator.isPositionDetected(skeleton);

            ResumeState state;
            if (rightHandOnFace)
            {
                double xPos = skeleton.Joints[JointType.HandRight].Position.X;
                double yPos = skeleton.Joints[JointType.HandRight].Position.Y;
                state = new ResumeState(ResumeState.ResumePosition.HAND_BACK, DateTime.Now, DateTime.Now);
                this._rightHandHistory.addState(state);
            }
            else
            {
                state = new ResumeState(ResumeState.ResumePosition.HAND_FRONT, DateTime.Now, DateTime.Now);
                this._rightHandHistory.addState(state);
            }
        }
Exemplo n.º 2
0
        public void processSkeleton(Skeleton skeleton)
        {
            Boolean rightHandBack = this._righthandResumeIndicator.rightHandBack(skeleton);
            Boolean rightHandFront = this._righthandResumeIndicator.rightHandFront(skeleton);

            Boolean leftHandLeft = this._lefthandResumeIndicator.leftHandBack(skeleton);
            Boolean leftHandRight = this._lefthandResumeIndicator.leftHandFront(skeleton);

            ResumeState state;
            if (rightHandBack)
            {
                state = new ResumeState(ResumeState.ResumePosition.HAND_BACK, DateTime.Now, DateTime.Now);
                this._rightHandHistory.addState(state);
            }
            else if (rightHandFront)
            {
                state = new ResumeState(ResumeState.ResumePosition.HAND_FRONT, DateTime.Now, DateTime.Now);
                this._rightHandHistory.addState(state);
            }
            else
            {
                state = new ResumeState(ResumeState.ResumePosition.HAND_AWAY, DateTime.Now, DateTime.Now);
                this._rightHandHistory.addState(state);
            }

            if (leftHandLeft)
            {
                state = new ResumeState(ResumeState.ResumePosition.HAND_BACK, DateTime.Now, DateTime.Now);
                this._leftHandHistory.addState(state);
            }
            else if (leftHandRight)
            {
                state = new ResumeState(ResumeState.ResumePosition.HAND_FRONT, DateTime.Now, DateTime.Now);
                this._leftHandHistory.addState(state);
            }
            else
            {
                state = new ResumeState(ResumeState.ResumePosition.HAND_AWAY, DateTime.Now, DateTime.Now);
                this._leftHandHistory.addState(state);
            }
        }
Exemplo n.º 3
0
        public ScenarioState finishState(ScenarioState next)
        {
            ResumeState gualState = new ResumeState(this);
            // make sure this is same state
            if (!this.isSameState(next))
            {
                if (next.GetType().Equals(this.GetType()))
                {
                    ResumeState nextState = (ResumeState)next;

                    // make gualState's start be the earlier of the two
                    if (nextState._start.CompareTo(gualState._start) < 0)
                    {
                        gualState._start = nextState._start;
                    }
                    // make gualState's start be the later of the two
                    if (nextState._end.CompareTo(gualState._end) > 0)
                    {
                        gualState._end = nextState._end;
                    }
                }
            }
            return gualState;
        }
Exemplo n.º 4
0
 public ResumeState(ResumeState goalState)
 {
     this._start = goalState._start;
     this._end = goalState._end;
     this._pos = goalState._pos;
 }