Constant variables that hold messages to be read via the SpeechHelper class
Example #1
0
        /// <summary>
        /// Unlocks door and greets visitor
        /// </summary>
        private async void UnlockDoor(string visitorName)
        {
            // Greet visitor
            await speech.Read(SpeechContants.GeneralGreetigMessage(visitorName));

            //if (gpioAvailable)
            //{
            //    // Unlock door for specified ammount of time
            //    gpioHelper.UnlockDoor();
            //}
        }
Example #2
0
        /// <summary>
        /// Unlocks door and greets visitor SUCCESS!!!
        /// </summary>
        private async void UnlockDoor(string visitorName)
        {
            // Greet visitor
            await speech.Read(SpeechContants.GeneralGreetigMessage(visitorName));

            DetailsBlock.Text = XamlText.DetailsBlockSuccess(visitorName);

            if (gpioAvailable)
            {
                // Unlock door for specified ammount of time
                gpioHelper.UnlockDoor();
            }
        }
Example #3
0
        /// <summary>
        /// Unlocks door and greets visitor
        /// </summary>
        private async void UnlockDoor(string visitorName)
        {
            // Greet visitor
            var Pesan = Encoding.UTF8.GetBytes("DOOR_OPEN");

            client.Publish("mifmasterz/door/control", Pesan, MqttMsgBase.QOS_LEVEL_AT_MOST_ONCE, false);

            await speech.Read(SpeechContants.GeneralGreetigMessage(visitorName));

            /*
             * if(gpioAvailable)
             * {
             *  // Unlock door for specified ammount of time
             *  gpioHelper.UnlockDoor();
             * }*/
        }
Example #4
0
 /// <summary>
 /// Unlocks door and greets visitor
 /// </summary>
 private async void UnlockDoor(HSPerson visitor)
 {
     // Greet visitor
     await speech.Read(SpeechContants.GeneralGreetigMessage(visitor.Name));
 }
Example #5
0
        private async void ProcessCameraCapture(ImageAnalyzer e)
        {
            if (e == null)
            {
                this.cameraControl.RestartAutoCaptureCycle();
                return;
            }

            this.recognitionPersistence.PersisteRecognitionResults(e);

            this.imageFromCameraWithFaces.DataContext = e;
            this.imageFromCameraWithFaces.Visibility  = Visibility.Visible;



            e.FaceRecognitionCompleted += async(s, args) =>
            {
                try
                {
                    ImageAnalyzer results = s as ImageAnalyzer;


                    if (results != null && results.DetectedFaces != null)
                    {
                        foreach (Face detectedFace in results.DetectedFaces)
                        {
                            IdentifiedPerson faceIdIdentification = null;
                            if (results.IdentifiedPersons != null && results.IdentifiedPersons.Count <IdentifiedPerson>() > 0)
                            {
                                faceIdIdentification = results.IdentifiedPersons.FirstOrDefault(p => p.FaceId == detectedFace.FaceId);
                            }

                            string message = string.Empty;
                            if (faceIdIdentification != null)
                            {
                                // We able identify this person. Say his name
                                message = SpeechContants.GeneralGreetigMessage(faceIdIdentification.Person.Name);
                                await speech.Read(message);
                            }
                            else
                            {
                                HSFace face = new HSFace(detectedFace.FaceId, "", detectedFace.FaceAttributes);
                                if (face.Age > 0)
                                {
                                    // Unknown person!
                                    message = String.Format(SpeechContants.UnknownVisitorDetailMessage, face.Gender, face.Age);
                                    await speech.ReadSsml(message);
                                }
                            }
                        }
                    }

                    //Update visitors statistic
                    Task.Run(async() => { CalculateVisitorsStatistic(results); });

                    this.photoCaptureBalloonHost.Opacity = 1;

                    int    photoDisplayDuration = 10;
                    double decrementPerSecond   = 100.0 / photoDisplayDuration;
                    for (double i = 100; i >= 0; i -= decrementPerSecond)
                    {
                        this.resultDisplayTimerUI.Value = i;
                        await Task.Delay(1000);
                    }

                    this.photoCaptureBalloonHost.Opacity      = 0;
                    this.imageFromCameraWithFaces.DataContext = null;
                }
                finally
                {
                    this.cameraControl.RestartAutoCaptureCycle();
                }
            };
        }