Exemplo n.º 1
0
        public AppWindow(IFilesParser fpForLearnCsv, IFilesParser fpForAnomalyCsv)
        {
            InitializeComponent();
            XMLPath = fpForLearnCsv.XMLpath;
            TimeConroller.setTimeControllerValues(fpForAnomalyCsv.getCSV());
            DllAlgorithmHandler.setValues(fpForAnomalyCsv.getXML_CSVMap(), fpForAnomalyCsv.XMLlist);
            DllAlgorithmHandler.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                TimeConroller.setTime(Int32.Parse(e.PropertyName));
            };
            TimeConroller.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                string   property       = e.PropertyName;
                string[] propertyValues = new string[2];
                propertyValues = property.Split('-');
                if (propertyValues[0] == "Time")
                {
                    FlightInfo.setTime(Int32.Parse(propertyValues[1]));
                    WheelController.setTime(Int32.Parse(propertyValues[1]));
                    GraphController.setTime(Int32.Parse(propertyValues[1]));
                }
                else if (propertyValues[0] == "ShouldStop")
                {
                    if (propertyValues[1] == "true")
                    {
                        FlightInfo.setShouldStop(true);
                        WheelController.setShouldStop(true);
                        GraphController.setShouldStop(true);
                    }
                    else
                    {
                        FlightInfo.setShouldStop(false);
                        WheelController.setShouldStop(false);
                        GraphController.setShouldStop(false);
                    }
                }
                else if (propertyValues[0] == "Pace")
                {
                    FlightInfo.setPace(Int32.Parse(propertyValues[1]));
                    WheelController.setPace(Int32.Parse(propertyValues[1]));
                    WheelController.setPace(Int32.Parse(propertyValues[1]));
                }
            };

            FlightInfo.setFlightValues(fpForAnomalyCsv.getXML_CSVMap());
            FlightInfo.run();
            WheelController.setMapValues(fpForAnomalyCsv.getXML_CSVMap());
            WheelController.run();
            GraphController.setMaps(fpForLearnCsv.getXML_CSVMap(), fpForLearnCsv.XMLlist, fpForAnomalyCsv.getXML_CSVMap());
            GraphController.run();
        }