Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            LoadProfile("Profile1");
            InitGUI();

            kinectStick = null;
            compiledProfile = null;
        }
Ejemplo n.º 2
0
        private void compilarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (saved)
            {
                if (compiledProfile == null)
                {
                    compiledProfile = ProfileCompiler.Compile(profile);

                    if (compiledProfile != null)
                    {
                        kinectStick = new KinectStickEngine(compiledProfile);

                        kinectStick.RecognizedInstruction += OnRecognizedInstruction;
                        kinectStick.RejectedInstruction += OnRejectedInstruction;
                        kinectStick.RecognizedPhrase += OnRecognizedPhrase;
                    }
                    else
                        MessageBox.Show("Error al compilar el perfil", "KinectStick - Compilación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    compiledProfile = ProfileCompiler.Compile(profile);

                    if (compiledProfile != null)
                        kinectStick.SetProfile(compiledProfile);
                    else
                        MessageBox.Show("Error al compilar el perfil", "KinectStick - Compilación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                if(!kinectStick.Ready)
                    MessageBox.Show("Error al configurar el engine: Error de conexión con Kinect o fallo en la carga del motor de reconocimiento de voz", "KinectStick - Compilación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                else
                    MessageBox.Show("Perfil compilado correctamente", "KinectStick - Compilación", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
                compilarToolStripMenuItem.Enabled = false;
        }