public void AirspeedTest()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.AreEqual(102.8, obj.Airspeed(2), 0.001);
        }
        public void t1_TemporalGrid()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Aircraft aircraft = new Aircraft("GP7270", "wing");

            noiseModel = new IntegratedNoiseModel(trajectory, aircraft);
            noiseModel.StartCalculation(INMCompleted);

            while (!completed)
            {
            }

            TemporalGrid temporalGrid  = noiseModel.TemporalGrid;
            int          numberOfGrids = temporalGrid.GetNumberOfGrids();

            Assert.AreNotEqual(0, numberOfGrids);

            Grid temp = new Grid(new double[1][] { new double[] { 0 } }, null);

            temporalGrid.AddGrid(temp);
            Assert.IsNotNull(temporalGrid.GetGrid(0));
            Assert.AreEqual(numberOfGrids + 1, temporalGrid.GetNumberOfGrids());
            Assert.AreEqual(temp, temporalGrid.GetGrid(numberOfGrids));

            completed = false;
        }
        public void HeadingTest()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.AreEqual(45.673, obj.Heading(4.2), 0.001);
        }
        public void Trajectory()
        {
            TrajectoryFileReader reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.IsNotNull(obj);
        }
        public void BankAngleInfinityTest()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.AreEqual(39.286, obj.BankAngle(10), 0.001);
        }
        public void BankAngleLessTest()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.AreEqual(0, obj.BankAngle(-20));
        }
Пример #7
0
        public void ContourKMLAnimatorStepTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var aircraft   = new Aircraft("GP7270", "wing");

            var noiseModel = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel.StartCalculation(INMCompleted);

            while (!completed)
            {
            }

            var labeledContours = new List <int> {
                65, 75, 80
            };

            var animator = new ContourKMLAnimator(noiseModel.TemporalGrid, trajectory, labeledContours);

            try
            {
                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml("<root>" + animator.KMLAnimationStep(0) + "</root>");
            }
            catch (XmlException ex)
            {
                Assert.Fail(ex.Message);
            }

            completed = false;
        }
        public void AnnoyanceKMLAnimatorConstructorTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var aircraft   = new Aircraft("GP7270", "wing");

            var noiseModel = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel.StartCalculation(INMCompleted);

            while (!completed)
            {
            }

            var population = new List <double[]> {
                new double[3] {
                    100, 200, 2.5
                },
                new double[3] {
                    110, 210, 3
                }
            };

            var animator = new AnnoyanceKMLAnimator(noiseModel.TemporalGrid, population);

            Assert.IsNotNull(animator);

            completed = false;
        }
        public void TiltTest()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.AreEqual(22.455, obj.Tilt(3.5), 0.001);
        }
Пример #10
0
        public void KMLAnimatorFullTest()
        {
            if (File.Exists(Globals.currentDirectory + "test.kml"))
            {
                File.Delete(Globals.currentDirectory + "test.kml");
            }

            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            var aircraft   = new Aircraft("GP7270", "wing");
            var noiseModel = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel.StartCalculation(calculationCompleted);
            while (!INMCompleted)
            {
            }

            TemporalGrid temporalGrid = noiseModel.TemporalGrid;

            var population = new List <double[]> {
                new double[3] {
                    104064, 475499, 2.5
                },
                new double[3] {
                    104262, 476470, 3
                }
            };

            var camera   = new FollowKMLAnimatorCamera(aircraft, trajectory);
            var sections = new List <KMLAnimatorSectionInterface>()
            {
                new AircraftKMLAnimator(aircraft, trajectory),
                new AirplotKMLAnimator(trajectory),
                new GroundplotKMLAnimator(trajectory),
                new ContourKMLAnimator(temporalGrid, trajectory, new List <int>()
                {
                    65, 70, 75
                }),
                new AnnoyanceKMLAnimator(temporalGrid, population)
            };
            var animator = new KMLAnimator(sections, camera);

            animator.AnimationToFile(trajectory.Duration, Globals.currentDirectory + "test.kml");

            String output = File.ReadAllText(Globals.currentDirectory + "test.kml");

            try
            {
                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(output);
            }
            catch (XmlException ex)
            {
                Assert.Fail(ex.Message);
            }

            INMCompleted = false;
        }
        public void TrajectoryLongLat()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.AreEqual(52.289, obj.Latitude(0.1), 0.001);
            Assert.AreEqual(4.737, obj.Longitude(0.1), 0.001);
        }
        public void AirplotKMLAnimatorConstructorTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var animator   = new AirplotKMLAnimator(trajectory);

            Assert.IsNotNull(animator);
        }
Пример #13
0
        public void FollowKMLAnimatorCameraConstructorTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var aircraft   = new Aircraft("GP7270", "wing");
            var camera     = new FollowKMLAnimatorCamera(aircraft, trajectory);

            Assert.IsNotNull(camera);
        }
        public void TrajectoryXYZ()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Assert.AreEqual(110640.78, obj.X(0.1), 0.001);
            Assert.AreEqual(478092.374, obj.Y(0.1), 0.001);
            Assert.AreEqual(14.3085, obj.Z(0.1), 0.001);
            Assert.AreEqual(52.289, obj.Latitude(0.1), 0.001);
            Assert.AreEqual(4.737, obj.Longitude(0.1), 0.001);
        }
        public void TrajectoryPoint()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Point3D point = obj.Point3D(0.05);

            Assert.IsNotNull(point);
            Assert.AreEqual(110649.39, point.X, 0.001);
            Assert.AreEqual(478097.687, point.Y, 0.001);
            Assert.AreEqual(12.488, point.Z, 0.001);
        }
        public void TrajectoryGeoPoint()
        {
            var reader = new TrajectoryFileReader(CoordinateUnit.metric);
            var obj    = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            GeoPoint3D geopoint = obj.GeoPoint(2.5);

            Assert.IsNotNull(geopoint);
            Assert.AreEqual(52.287, geopoint.Latitude, 0.001);
            Assert.AreEqual(4.731, geopoint.Longitude, 0.001);
            Assert.AreEqual(101.974, geopoint.Z, 0.001);
        }
        public void AirplotKMLAnimatorFinishTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var animator   = new AirplotKMLAnimator(trajectory);

            try
            {
                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml("<root>" + animator.KMLFinish() + "</root>");
            }
            catch (XmlException ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Пример #18
0
        public void AicraftKMLAnimatorFinishTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var aircraft   = new Aircraft("GP7270", "wing");
            var camera     = new FollowKMLAnimatorCamera(aircraft, trajectory);

            try
            {
                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(kmlRoot + camera.KMLFinish() + kmlRootClose);
            }
            catch (XmlException ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Пример #19
0
        public void AircraftKMLAnimatorStepTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var aircraft   = new Aircraft("GP7270", "wing");
            var animator   = new AircraftKMLAnimator(aircraft, trajectory);

            try
            {
                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml("<root>" + animator.KMLAnimationStep(0) + "</root>");
            }
            catch (XmlException ex)
            {
                Assert.Fail(ex.Message);
            }
        }
        public void GroundplotKMLAnimatorStepTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            var animator = new GroundplotKMLAnimator(trajectory);

            try
            {
                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(kmlRoot + animator.KMLAnimationStep(0) + kmlRootClose);
            }
            catch (XmlException ex)
            {
                Assert.Fail(ex.Message);
            }
        }
        public void t3_INMPositionFileCanBeCreatedTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            var aircraft = new Aircraft("GP7270", "wing");
            IntegratedNoiseModel noiseModel = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel.StartCalculation(INMCompleted);

            while (!completed)
            {
            }

            string positionFile = Globals.currentDirectory + "current_position.dat";

            Assert.True(File.Exists(positionFile), positionFile + " does not exist");

            completed = false;
        }
        public void t5_INMFullTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            var aircraft   = new Aircraft("GP7270", "wing");
            var noiseModel = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel.StartCalculation(INMCompleted);

            while (!completed)
            {
            }

            TemporalGrid temporalGrid = noiseModel.TemporalGrid;

            Assert.AreEqual(2, temporalGrid.GetNumberOfGrids());

            completed = false;
        }
Пример #23
0
        public void GridConverterSELData()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Aircraft aircraft       = new Aircraft("GP7270", "wing");
            var      noiseModel_SEL = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel_SEL.StartCalculation(testSEL);

            while (!testRunned_SEL)
            {
            }

            var          converter_SEL = new GridConverter(noiseModel_SEL.TemporalGrid, GridTransformation.SEL);
            TemporalGrid res           = converter_SEL.transform();

            Assert.AreEqual(30.67, Math.Round(res.GetGrid(1).Data[65][60], 2), 0.001);

            testRunned_SEL = false;
        }
Пример #24
0
        public void GridConverteMAXInterval()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Aircraft aircraft       = new Aircraft("GP7270", "wing");
            var      noiseModel_MAX = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel_MAX.StartCalculation(testMAX);

            while (!testRunned_MAX)
            {
            }

            var          converter_MAX = new GridConverter(noiseModel_MAX.TemporalGrid, GridTransformation.MAX);
            TemporalGrid res           = converter_MAX.transform();

            Assert.AreEqual(1, res.Interval);

            testRunned_MAX = false;
        }
Пример #25
0
        public void GridConverterSELNumberOfGrids()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");

            Aircraft aircraft       = new Aircraft("GP7270", "wing");
            var      noiseModel_SEL = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel_SEL.StartCalculation(testSEL);

            while (!testRunned_SEL)
            {
            }

            var          converter_SEL = new GridConverter(noiseModel_SEL.TemporalGrid, GridTransformation.SEL);
            TemporalGrid res           = converter_SEL.transform();

            Assert.IsNotNull(converter_SEL);

            Assert.AreEqual(2, res.GetNumberOfGrids());

            testRunned_SEL = false;
        }
        public void AicraftKMLAnimatorStepTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var aircraft   = new Aircraft("GP7270", "wing");

            var noiseModel = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel.StartCalculation(INMCompleted);

            while (!completed)
            {
            }

            var population = new List <double[]> {
                new double[3] {
                    110658, 478103, 2.5
                },
                new double[3] {
                    110700, 478050, 3
                }
            };

            var animator = new AnnoyanceKMLAnimator(noiseModel.TemporalGrid, population);

            try
            {
                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml("<root>" + animator.KMLAnimationStep(0) + "</root>");
            }
            catch (XmlException ex)
            {
                Assert.Fail(ex.Message);
            }

            completed = false;
        }
Пример #27
0
        public void ContourKMLAnimatorConstructorTest()
        {
            var reader     = new TrajectoryFileReader(CoordinateUnit.metric);
            var trajectory = reader.createTrajectoryFromFile(Globals.testdataDirectory + "test_track.dat");
            var aircraft   = new Aircraft("GP7270", "wing");

            var noiseModel = new IntegratedNoiseModel(trajectory, aircraft);

            noiseModel.StartCalculation(INMCompleted);

            while (!completed)
            {
            }

            var labeledContours = new List <int> {
                65, 75, 80
            };

            var animator = new ContourKMLAnimator(noiseModel.TemporalGrid, trajectory, labeledContours);

            Assert.IsNotNull(animator);

            completed = false;
        }