Example #1
0
 void _kioskInteractionService_KioskStateChanged(object sender, KioskStateEventArgs e)
 {
     if (e.KioskState == "Touch")
         OnActivated();
     else
         OnDeactivated();
 }
Example #2
0
        void _itemInteractionService_ItemStateChanged(object sender, KioskStateEventArgs e)
        {
            if (e.ItemState != ManipulationStates.NoTrack && e.ItemState != ItemState)
            {
                    Debug.Print("@@@ITEM STATE: " + e.ItemState.ToString());
                    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);
                            //SelectContentBasedOnItem(e.ItemSelected, ManipulationStates.Released);
                            break;
                    }

                    OnActivated();
            }
        }
Example #3
0
        void _interactionService_KioskStateChanged(object sender, KioskStateEventArgs e)
        {
            if (e.KioskState == "Tracking")
            {
                Debug.Print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Media Content Kiosk State Change " + e.CurrentZone);
                if (_currentZone != e.CurrentZone)
                {
                    if (_currentZone == NOTRACK) IsVideoPlaying = false;
                    _currentZone = e.CurrentZone;
                    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();
        }
Example #4
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;
     }
 }
Example #5
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.
                    _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();
        }
Example #6
0
 void _itemInteractionService_ItemInteraction(object sender, KioskStateEventArgs e)
 {
     ItemState = e.ItemSelected;
 }
Example #7
0
 private void OnItemInteraction(TrackedItem item, ManipulationStates st)
 {
     var handler = this.ItemInteraction;
     if (handler != null)
     {
         var kioskEvent = new KioskStateEventArgs();
         kioskEvent.ItemSelected = item.ObjectID;
         kioskEvent.ItemState = st;
         kioskEvent.TrackingID = this.CorrelationPlayerId;
         handler(this, kioskEvent);
     }
 }
Example #8
0
 void _itemInteractionService_ItemInteraction(object sender, KioskStateEventArgs e)
 {
     if (e.ItemState != ManipulationStates.NoTrack)
     {
         Debug.Print("Sending Object Interaction Event: " + e.ItemSelected);
         var kioskEvent = new KioskStateEventArgs() { TrackingID = _bodyTrackingService.ActiveBodyId, KioskState = CurrentState.ToString(), CurrentZone = CurrentZone };
         kioskEvent.ItemState = e.ItemState;
         kioskEvent.ItemSelected = e.ItemSelected;
         _interactionProcessingQueue.Add(kioskEvent);
     }
 }
Example #9
0
        private void SendIteraction(KioskStateEventArgs args)
        {
            //  Debug.Print("Send Interactions........");
              //  return;

            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;
                System.Diagnostics.Debug.Print("**** SendInteraction ****, TrackingId{0}, Zone{1}, SelectionState{2}, Timestamp{3}", contentInteraction.TrackingId, contentInteraction.InteractionZone, contentInteraction.DeviceSelectionState, contentInteraction.TimeStamp);
                _eventHub.SendMessageToEventHub(contentInteraction);
            }
        }
Example #10
0
        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);
        }
Example #11
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();
            }
        }