Ejemplo n.º 1
0
        public MainEngine(KinectSensor sensor, TextBox log)
        {
            this.tbLog = log;
            this.kinectSensor = sensor;

            calibrator = new Calibrator(this);
            objectManager = new ObjectManager(this);
            skeletonController = new SkeletonController(this);
            speechRecognizer = new SpeechRecognizer(this);
        }
Ejemplo n.º 2
0
        public void send(SpeechRecognizer.Orders order)
        {
            JObject myJson = null;

            switch (order)
            {
            case SpeechRecognizer.Orders.CALIBRATE:
                string markerSet = "[";

                for (int i = 0; i < markers.Length - 1; i++)
                {
                    markerSet += "\"" + markers[i] + "\", ";
                }

                markerSet += "\"" + markers[markers.Length - 1] + "\"]";

                myJson = JObject.Parse("{ \"type\": \"calibration:start\", \"message\": { \"markers\": " + markerSet + " } }");
                break;
            case SpeechRecognizer.Orders.MARK:
                myJson = JObject.Parse("{ \"type\": \"calibration:next_marker\", \"message\": { \"marker\": \"" + markers[count] + "\" } }");
                break;
            case SpeechRecognizer.Orders.DONE:
                myJson = JObject.Parse("{ \"type\": \"calibration:done\", \"message\": {} }");
                break;
            case SpeechRecognizer.Orders.WORK:
                myJson = JObject.Parse("{ \"type\": \"work:start\", \"message\": {} }");
                break;
            default: break;
            }

            if (myJson != null)
            {
            //System.Threading.Thread.Sleep(5000);
            count++;
            System.Diagnostics.Debug.WriteLine(myJson.ToString());
            Broadcast(myJson.ToString());
            }
        }