Example #1
0
        private void Initialize()
        {
            // Load the map control
            mapMgr = new ArcMapManager(this.mapGrid, this.layoutGrid, this.tocGrid);
            //mapMgr = new DSMapManager(this.mapGrid);
            //mapMgr.AddTOC(this.tocGrid);
            
            mapMgr.Initialize();
            MapPanel.Activate();
            
            //mapMgr.LoadMap(@"C:\Work\Data\GISLAB\Data\Oleader.mxd");
            //ArrayList inputLayers = new ArrayList();
            //inputLayers.Add("parcels");
            //inputLayers.Add("FloodAreas");
            //string outputFile = mapMgr.Overlay(inputLayers);

            //mapMgr.LoadMap(@"C:\Work\Data\GISLAB\Maps\test.mxd");
            //mapMgr.AddLayer(@"C:\Work\Data\World\country.shp");
            //mapMgr.AddLayer(@"C:\Work\Data\World\cities.shp");
            
            
            

            /*
            Hashtable result = mapMgr.GetFieldStatistics("parcels", "Acreage", true);
            this.statResultsWindow = new StatResultsWindow(result);
            this.statResultsWindow.Owner = this;
            this.statResultsWindow.Show();
            */

            /*
            Hashtable result = mapMgr.GetDataSummary("parcels", "Minimum.UseCode, Sum.Acreage", "UseCode", true);
            this.sumResultsWindow = new SummaryResultsWindow(result);
            this.sumResultsWindow.Owner = this;
            this.sumResultsWindow.Show();
            */
            mapMgr.PolygonDrawn += Polygon_Drawn;
            
            
            // Load the Kinect sensor
            kinectMgr = new KinectManager();
            kinectMgr.KinectStatusChanged += Kinects_StatusChanged;
            if (kinectMgr.LoadKinectSensor() == false)
            {
                Log("Kinect sensor is not ready!", "error");
                return;
            }
            else
            {
                
                Log("Kinect sensor is ready!", "info");
            }

            // Load the managers to display respective images
            kinectMgr.LoadColorManager(colorDisplay);
            kinectMgr.LoadDepthManager(depthDisplay);
            kinectMgr.LoadSkeletonDisplayManager(skeletonCanvas);

            // Load and start the speech recognition
            string grammarPath = System.IO.Path.Combine(Environment.CurrentDirectory, @"NUI\Speech\grammar.xml");
            kinectMgr.LoadSpeechRecognizer(grammarPath);
            kinectMgr.SpeechRecognized += Speech_Recognized;
            kinectMgr.StartSpeechRecognition();
            Log("Speech recognition is started!", "info");

            // Load and start the gesture recognition (not functing yet)
            kinectMgr.LoadGestureRecognizer();
            kinectMgr.GestureRecognzied += Gesture_Recognized;
            kinectMgr.StartGestureRecognition();
            Log("Gesture recognition is started!", "info");

            // Load the speech synthesizer
            speechSyn = new SpeechSynthesizer();
            speechSyn.SetOutputToDefaultAudioDevice();
            //speechSyn.SpeakStarted += new EventHandler<SpeakStartedEventArgs>(speechSyn_SpeakStarted);
            
            // Start the dialogue manager
            dlgMgr = new DialogueManager("CAGA", mapMgr, @"Dialogue\kb_caga.db");
            // use machine name + user name as id, user name as name
            dlgMgr.NewParticipant(Environment.MachineName + "-" + Environment.UserName, Environment.UserName);

            
        }
Example #2
0
 public SpeechSimWindow(KinectManager kinectMgr)
 {
     this._kinectMgr = kinectMgr;
     InitializeComponent();
 }