示例#1
0
        /// <summary>
        /// Exits AISA after greeting the user
        /// </summary>
        private void ExitAISA()
        {
            //Stop the AISA Recognition


            //Say the end greeting
            OpenSpeak.Speak(Greetings.End());

            AISAHandler.Pause();

            //Disappear the program
            var da = new DoubleAnimation(SystemParameters.PrimaryScreenHeight, TimeSpan.FromSeconds(1));

            da.EasingFunction = new QuinticEase();
            BeginAnimation(TopProperty, da);

            //Close the program in 2 seconds
            var dt = new DispatcherTimer();

            dt.Interval = TimeSpan.FromSeconds(2);
            dt.Tick    += (a, b) =>
            {
                Application.Current.Shutdown();
            };
            dt.Start();
        }
示例#2
0
文件: MCQ.xaml.cs 项目: oujunke/AISA
        public MCQ(string _class, string paper_index)
        {
            InitializeComponent();

            //Set the private fields
            classIndex = _class;
            Paper      = paper_index;

            //Set the paper name
            PaperName.Content = Context.currentPaper.name;

            //Show the first question
            UpdateQuestion(true);

            //Pause the AISA Handler for concurrent recognitions
            AISAHandler.Pause();

            //Setup the Speech Recognizer
            _recognizer.LoadGrammar(new Grammar(new GrammarBuilder(new Choices(new string[]
            {
                "A", "B", "C", "D", "One", "Two", "Three", "Four", "I don't know", "Skip", "No", "Next", "Previous", "Continue"
            }))));

            _recognizer.SpeechRecognized += _recognizer_SpeechRecognized;

            _recognizer.SetInputToDefaultAudioDevice();

            //Start the speech recognition process
            _recognizer.RecognizeAsync(RecognizeMode.Multiple);
        }
示例#3
0
        public void HideWindow()
        {
            //Disappear the program
            var da = new DoubleAnimation(SystemParameters.PrimaryScreenHeight, TimeSpan.FromMilliseconds(500));

            da.EasingFunction = new QuinticEase();
            BeginAnimation(TopProperty, da);

            AISAHandler.Pause();

            ViewControllerConnector.MainWindowHide();
        }
示例#4
0
        /// <summary>
        /// Fades the GetHelp object in
        /// </summary>
        private void Help()
        {
            if (!ViewControllerConnector.StartedCommandRecognition)
            {
                //Stop AISA recognition
                AISAHandler.Pause();

                //Set the visibility to true
                GetHelp.Visibility = Visibility.Visible;
                GetHelp.Opacity    = 0;

                //Animate the fading in of the object
                var da = new DoubleAnimation(1, TimeSpan.FromMilliseconds(500));
                da.EasingFunction = new QuinticEase();
                GetHelp.BeginAnimation(OpacityProperty, da);
            }
        }
示例#5
0
        public void StartPaper(string _class, string paper_index)
        {
            //Pause the AISA Handler
            AISAHandler.Pause();
            ViewControllerConnector.PaperStarted = true;

            var da = new DoubleAnimation(0.5, TimeSpan.FromSeconds(1));

            da.EasingFunction = new QuinticEase();

            //Set the opacity of the MainWindows to 0.5 in 1 second
            BeginAnimation(OpacityProperty, da);

            //Start a new MCQ
            var mcq = new MCQ(_class, paper_index);

            mcq.Show();
        }