Beispiel #1
0
        private void Fusion()
        {
            clsInput temp = new clsInput();
            temp = InputPool;

            DeleteExpiredData();

            if (!dialogue) StartDialogue();

            while (temp != null)
            {
                if ((temp.GetPartOfSpeech() == "action") && frame == null)
                {
                    SelectFrame(temp.GetInfo());

                    state = 1; //  tries to fill that frame

                    //start task's timer
                    //tmrTimeFrame.Enabled = true;
                    counter = 0; //cancel after 3 attempts
                    RemoveInput(temp);
                }
                else
                {
                    /*if (frame != null)

                        if (frame.name == "call" && state == 31)
                            response = "Yes";
                    if (temp.GetPartOfSpeech() == "digit")
                        nbdigit++;
                    if (frame != null && !frame.isFilled())
                    {
                        if ((frame.name == "call" || frame.name == "message" )&& nbdigit>=10)
                            GetNumber();

                    }*/
                }
                if (frame != null && frame.name == "addressbook")
                {
                    if (temp.GetInfo().ToLower() == "next")
                    {
                        iContact++;
                        state = 4;
                    }
                    if (temp.GetInfo().ToLower() == "previous" || temp.GetInfo().ToLower() == "back")
                    {
                        iContact--;
                        state = 4;
                    }

                }
                temp = temp.next;
            }
            temp = null;

            //Dialogue();
        }
Beispiel #2
0
        private void FillingSlots()
        {
            clsInput temp = new clsInput();
            temp = InputPool;

            //reverse the parsing
            while (temp != null && frame != null)
            {
                clsSlot sl = new clsSlot();
                sl = frame.slots;
                while (sl != null && frame != null)
                {
                    if ((sl.name == temp.GetPartOfSpeech()))
                    {
                        sl.value = temp.GetInfo();
                        //tmrTimeFrame.Enabled = false;
                    }
                    sl = sl.next;
                }
                if (frame.name == "call" && temp.GetInfo() == "number")
                    state = 26;
                temp = temp.next;
            }
            temp = null;

            if (frame != null && frame.isFilled())
                state = 3; // check for number state 21

            //
        }
Beispiel #3
0
        /*
         * Any time a digit is detected, treat it apart (method)
         * enable the timer,
         * concatenate with the number till it react 10 digit/ make a beep
         * Cancel/Restart => reinitialise the number
         */
        public void GetNumber()
        {
            //parse input pool from the end and
            clsInput temp = new clsInput();
            temp = InputPool;

            nb = "";

            while (temp != null)
            {
                clsSlot sl = new clsSlot();
                sl = frame.slots;
                if ("digit" == temp.GetPartOfSpeech())
                {
                    nb += phone.GetDigit(temp.GetInfo());
                }

                temp = temp.next;
            }
            temp = null;

            ClearingDigits(); //remove all digit to avoid issues

            // check the number a perform the call
            state = 11;
        }
Beispiel #4
0
        private void tmrSilence_Tick(object sender, EventArgs e)
        {
            //when a silence is detected try to see if the input pool has a number
            clsInput temp = new clsInput();
            temp = InputPool;
            //check if the last number is a digit

            if (frame != null && !frame.isFilled())
            {
                if (frame.name == "call" || frame.name == "add" || frame.name == "message")
                {

                    //parse input pool from the end and

                    nb = "";

                    while (temp != null)
                    {
                        clsSlot sl = new clsSlot();
                        sl = frame.slots;
                        if ("digit" == temp.GetPartOfSpeech())
                        {
                            nb += phone.GetDigit(temp.GetInfo());
                        }

                        temp = temp.next;
                    }
                    temp = null;

                    // check the number a perform the call
                    state = 11;

                    //this.Enabled = false;
                }

                if (frame.name == "add")
                {
                    if (!frame.isFilled())
                    {
                        if (frame.slots.next.value == "")
                        {
                            Tts("Please enter the phone number of your new contact");
                            //ASRGrammar("digits");
                            state = 13;
                            //check number
                        }
                        else
                        {
                            if (frame.slots.value == "")
                            {
                                Tts("Please enter the name of your new contact");

                            }
                        }
                    }
                    else
                    {
                        state = 3;
                    }
                }
            }
        }
Beispiel #5
0
        void RemoveInput(clsInput val)
        {
            clsInput temp = new clsInput();
            temp = InputPool;
            if (temp.next == null) temp = null;
            else

                while (temp.next != null)
                {
                    string info = temp.GetInfo(); DateTime time = temp.GetTime();
                    if ((info == val.GetInfo()) && (time == val.GetTime()))
                    {
                        temp = temp.next.next;
                        break;
                    }
                    else
                        temp = temp.next;
                }
        }