Пример #1
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

            //
        }
Пример #2
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;
                    }
                }
            }
        }
Пример #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;
        }
Пример #4
0
        private void RequestingInput()
        {
            //parse frame and ask for empty slot

            // When user silent for 10 seconds

            clsSlot sl = new clsSlot();
            sl = frame.slots;
            while (sl != null)
            {
                if (sl.value == "")
                {
                    Tts("Give a value for " + sl.name);
                    counter++;
                    break;
                }
                sl = sl.next;
            }

            if (counter == 3)
            {
                StopDialogue();
                //tmrTimeFrame.Enabled = false;
            }

            // DeleteExpiredData();
        }
Пример #5
0
        public clsFrame(string name_)
        {
            name = name_;
            switch (name)
            {
                case "call":
                    slots = new clsSlot();
                    slots.name = "name";
                    slots.type = "number";
                    slots.value = "";
                    slots.next = null;
                    break;
                case "message":
                case "reply":
                    slots = new clsSlot();
                    slots.name = "name";
                    slots.type = "number";
                    slots.value = "";
                    slots.next = null;
                    break;
                case "pairing":
                    slots = new clsSlot();
                    /*slots.name = "phone";
                    slots.type = "name";
                    slots.value = "";
                    Slot temp = new clsSlot();
                    temp.name = "pin";
                    temp.type= "number";
                    temp.value = "1234"; temp.next = null;
                    slots.next = temp; temp = null;*/
                    break;
                case "time":
                    break;

                case "repeat":
                    break;

                case "stop":
                    break;

                case "pause":
                    break;

                case "accept":
                    break;

                case "read":
                    break;

                case "redial":
                    break;

                case "addressbook":
                    break;

                case "callback":
                    break; // no slot, the number will be retrieved by the system

                case "incoming_call":

                    break;

                case "incoming_sms":

                    break;

                case "play":
                    slots = new clsSlot();
                    slots.name = "title";
                    slots.type = "title";
                    slots.value = "";
                    slots.next = null;
                    break;

                case "add":
                    slots = new clsSlot();
                    clsSlot temp = slots;
                    slots.name = "number";
                    slots.type = "number";
                    slots.value = "";

                    clsSlot nom = new clsSlot();
                    nom.name = "name";
                    nom.type = "name";
                    nom.value = "";
                    nom.next = null;
                    slots.next = nom;
                    break;

                case "remove":
                    slots = new clsSlot();
                    slots.name = "title";
                    slots.type = "title";
                    slots.value = "";
                    slots.next = null;
                    break;
            }
        }
Пример #6
0
        /*public clsFrame(string nom, slotType s)
        {
            name = n;
            slots = s.Clone ;
        }*/
        public bool isFilled()
        {
            bool ok = true;
            clsSlot sl = new clsSlot();
            sl = this.slots;
            while (sl != null)
            {
                if (sl.value == "") ok = false;

                sl = sl.next;
            }
            return ok;
        }