Exemplo n.º 1
0
        public KinectStickEngine(CompiledProfile profile)
        {
            actualNode = null;
            instructionQueue = new List<CompiledSpeechPhrase>();
            joy = new VJoyWrapper();
            inputSimulator = new InputSimulator();
            this.profile = profile;

            ready = InitKinect() && LoadSpeechRecognitionEngine();
        }
Exemplo n.º 2
0
        public InstructionsTreeNode(InstructionsTreeNode parent)
        {
            this.parent = parent;
            this.phraseIndex=-1;
            this.childs=new ArrayList();
            this.command=null;

            if (parent == null)
                this.level = 0;
            else
                this.level = parent.Level + 1;
        }
Exemplo n.º 3
0
        public InstructionsTreeNode(int phraseIndex,InstructionsTreeNode parent,Command command=null)
        {
            this.phraseIndex = phraseIndex;
            this.parent = parent;
            this.command = null;
            this.childs = new ArrayList();

            if (parent == null)
                this.level = 0;
            else
                this.level = parent.Level + 1;
        }
Exemplo n.º 4
0
 public InstructionsTree(int rootPhraseIndex=-1, Command rootCommand = null)
 {
     root = new InstructionsTreeNode(rootPhraseIndex, null, rootCommand);
 }
Exemplo n.º 5
0
 public void AddChild(InstructionsTreeNode child)
 {
     child.parent = this;
     childs.Add(child);
 }
Exemplo n.º 6
0
 public void ResetInstructionPipeline()
 {
     actualNode=null;
     instructionQueue.Clear();
 }
Exemplo n.º 7
0
        private void InstructionFetch(int phraseIndex)
        {
            int i = 0;
            bool fetching=true;

            instructionQueue.Add(profile.phraseLibrary[phraseIndex]);

            //Si no hay una instrucción en curso, buscamos una que comience con el comando de voz captado:
            if (actualNode == null)
            {
                while (i < profile.instructionsTreeLibrary.GetLength(0) && fetching)
                {
                    if (profile.instructionsTreeLibrary[i].RootPrhaseIndex == phraseIndex)
                    {
                        actualNode = profile.instructionsTreeLibrary[i].Root;
                        fetching = false;
                    }
                    else
                        ++i;
                }

                if (actualNode != null)
                    InstructionAnalysis();
                else
                    instructionQueue.Clear();
            }
            else
            {
                actualNode = actualNode.SearchNode(phraseIndex);

                if (actualNode == null)
                {
                    LaunchRejectEvent(profile.phraseLibrary[phraseIndex]);
                    ResetInstructionPipeline();
                }
                else
                    InstructionAnalysis();
            }
        }