void _itemInteractionService_ItemStateChanged(object sender, KioskStateEventArgs e)
        {
            if (e.ItemState != ManipulationStates.NoTrack && e.ItemState != ItemState)
            {
                DisplayZoneName = _currentZone + ", " + e.ItemState.ToString();
                ItemState       = e.ItemState;

                switch (e.ItemState)
                {
                case ManipulationStates.NoTrack:
                    break;

                case ManipulationStates.Touched:
                    IsVideoPlaying = false;             // when an item is touched, change to the item content immediately
                    SelectContentBasedOnItem(e.ItemSelected, ManipulationStates.Touched);
                    break;

                case ManipulationStates.Removed:
                // Show something different
                //break;

                default:                    // released/replaced
                    SelectContentBasedOnDemographics(_demographics);
                    break;
                }

                OnActivated();
            }
        }
        private void SendIteraction(KioskStateEventArgs args)
        {
            var contentInteraction = new ContentInteraction();

            if (args.ContentAction == ContentAction.Exit)
            {
                var duration = contentInteraction.TimeStamp - _lastStateChange;
                contentInteraction.Duration = duration;
            }
            contentInteraction.Action     = args.ContentAction;
            contentInteraction.KioskState = args.KioskState;
            contentInteraction.TrackingId = args.TrackingID;

            contentInteraction.CorrelatedTrackingID = args.TrackingID;

            contentInteraction.DeviceSelection = args.ItemSelected ?? string.Empty;
            contentInteraction.InteractionZone = CurrentZone ?? string.Empty;
            contentInteraction.KinectDeviceId  = this._sensorService.Sensor.UniqueKinectId;
            contentInteraction.Location        = new LocationCoordinates
            {
                Latitude  = float.Parse(ConfigurationManager.AppSettings["LocationLatitude"]),
                Longitude = float.Parse(ConfigurationManager.AppSettings["LocationLongitutde"])
            };


            switch (args.ItemState)
            {
            case ManipulationStates.NoTrack:
                contentInteraction.DeviceSelectionState = DeviceSelectionState.NoTrack;
                break;

            case ManipulationStates.Released:
                contentInteraction.DeviceSelectionState = DeviceSelectionState.Released;
                break;

            case ManipulationStates.Removed:
                contentInteraction.DeviceSelectionState = DeviceSelectionState.DeviceRemoved;
                break;

            case ManipulationStates.Replaced:
                contentInteraction.DeviceSelectionState = DeviceSelectionState.DeviceReplaced;
                break;

            case ManipulationStates.Touched:
                contentInteraction.DeviceSelectionState = DeviceSelectionState.Touched;
                break;
            }

            contentInteraction.TimeStamp = DateTime.Now;

            if (_lastContentInteraction.InteractionZone != contentInteraction.InteractionZone || _lastContentInteraction.DeviceSelectionState != contentInteraction.DeviceSelectionState)
            {
                _lastContentInteraction = contentInteraction;

                _InteractionEventHub.SendMessageToEventHub(contentInteraction);
            }
        }
Exemple #3
0
        void _itemInteractionService_ItemStateChanged(object sender, KioskStateEventArgs e)
        {
            if (e.ItemState != ManipulationStates.NoTrack /*&& e.ItemState != ItemState*/)
            {
                Debug.Print(e.ItemSelected + " " + e.ItemState + " " + _activeItems.ToString());
                DisplayZoneName = _currentZone + ", " + e.ItemState.ToString();
                ItemState       = e.ItemState;

                switch (e.ItemState)
                {
                case ManipulationStates.NoTrack:
                    break;

                case ManipulationStates.Touched:
                    _activeItems++;
                    if (_activeItems == 1)
                    {
                        IsVideoPlaying = false;         // when an item is touched, change to the item content immediately
                        SelectContentBasedOnItem(e.ItemSelected, ManipulationStates.Touched);
                        lastItemSelected = e.ItemSelected;
                    }
                    else if (_activeItems == 2)
                    {
                        //Display comparisons
                        SelectContentForComarison(lastItemSelected, e.ItemSelected);
                    }

                    break;

                case ManipulationStates.Removed:
                // Show something different
                //break;

                default:                    // released/replaced
                    if (_activeItems == 2)  //If we are coming back to just one item selected from a compare we need to force the system to reload the content and not auto cycle as the content may still be for the comparison
                    {
                        IsVideoPlaying = false;
                    }

                    _activeItems--;

                    if (MediaContentState == "Compare")
                    {
                        SelectContentBasedOnItem(lastItemSelected, ManipulationStates.Touched);
                    }



                    MediaContentState = "Normal";
                    break;
                }

                OnActivated();
            }
        }
 void _kioskInteractionService_KioskStateChanged(object sender, KioskStateEventArgs e)
 {
     if (e.KioskState == "Touch")
     {
         OnActivated();
     }
     else
     {
         OnDeactivated();
     }
 }
 void _itemInteractionService_ItemInteraction(object sender, KioskStateEventArgs e)
 {
     if (e.ItemState != ManipulationStates.NoTrack)
     {
         var kioskEvent = new KioskStateEventArgs()
         {
             TrackingID = _bodyTrackingService.ActiveBodyId, KioskState = CurrentState.ToString(), CurrentZone = CurrentZone
         };
         kioskEvent.ItemState    = e.ItemState;
         kioskEvent.ItemSelected = e.ItemSelected;
         _interactionProcessingQueue.Add(kioskEvent);
     }
 }
Exemple #6
0
        void _interactionService_KioskStateChanged(object sender, KioskStateEventArgs e)
        {
            if (e.KioskState == "Tracking")
            {
                if (_currentZone != e.CurrentZone || _currentUserTrackingID != e.TrackingID)
                {
                    //remember the last state we had before selecting content.
                    MediaContentState      = "Normal";
                    _currentZone           = e.CurrentZone;
                    _currentUserTrackingID = e.TrackingID;

                    DisplayZoneName = _currentZone;
                    if (e.Demographics == null)
                    {
                        _missingDemographicData = true;
                        _missingUsersTrackingID = e.TrackingID;
                    }
                    else
                    {
                        _missingDemographicData = false;
                    }

                    if (e.Demographics != null)
                    {
                        Debug.Print("Demographics during Kiosk State Change " + e.Demographics.Gender.ToString());
                    }

                    _demographics = e.Demographics;
                    SelectContentBasedOnDemographics(e.Demographics);
                    OnActivated();
                }
            }
            else if (e.KioskState == NOTRACK)
            {
                _currentZone    = NOTRACK;
                DisplayZoneName = _currentZone;
                SelectContentBasedOnDemographics(null);
                OnActivated();
            }
            else
            {
                OnDeactivated();
            }
        }
Exemple #7
0
        void _kioskInteractionService_KioskStateChanged(object sender, KioskStateEventArgs e)
        {
            Debug.WriteLine("MainViewModel kiosk state changed: " + e.KioskState);
            switch (e.KioskState)
            {
            case "Special":
                Messenger.Default.Send <string>("SPECIALSTART");
                this.KioskState = "Special";
                break;

            case "Ready":
                this.KioskState = "SensorReady";
                break;

            default:
                this.KioskState = e.KioskState;
                break;
            }
        }
        private void OnKioskStateChanged(KioskStates newKioskState)
        {
            Debug.WriteLine("NewKioskState: " + newKioskState.ToString());
            var kioskEvent = new KioskStateEventArgs()
            {
                TrackingID = _bodyTrackingService.ActiveBodyId, KioskState = CurrentState.ToString(), CurrentZone = CurrentZone
            };

            //make sure pass the correct demographics for this player
            var activeUserDemographics = (from user in _demographicService.UserExperiences where user.TrackingId == _bodyTrackingService.ActiveBodyId select user).FirstOrDefault();

            kioskEvent.Demographics  = activeUserDemographics;
            kioskEvent.ContentAction = ContentAction.Enter;

            _interactionProcessingQueue.Add(kioskEvent);

            var handler = this.KioskStateChanged;

            if (handler != null)
            {
                handler(this, kioskEvent);
            }
        }
Exemple #9
0
 void _itemInteractionService_ItemInteraction(object sender, KioskStateEventArgs e)
 {
     ItemState = e.ItemSelected;
 }