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; }
protected void OneTrajectoryVisualisation() { // Create legend var legend = new LegendCreator(); legend.OutputLegendImage(); legend.OutputLegendTitle(); var sections = new List <KMLAnimatorSectionInterface>(); // Contour animator List <int> contoursOfInterest = (_view.VisualiseContoursOfInterest) ? _view.ContoursOfInterest : null; var contourAnimator = new ContourKMLAnimator(temporalGrid, trajectory, contoursOfInterest); if (_view.VisualiseGradient) { contourAnimator.SetGradientSettings((int)_view.LowestContourValue, (int)_view.HighestContourValue, (int)_view.ContourValueStep); } // Create sections sections.Add(new LegendKMLAnimator()); sections.Add(new AircraftKMLAnimator(trajectory.Aircraft, trajectory)); sections.Add(new AirplotKMLAnimator(trajectory)); sections.Add(new GroundplotKMLAnimator(trajectory)); sections.Add(contourAnimator); //new AnnoyanceKMLAnimator(temporalGrid, population.getPopulationData()) if (_view.Heatmap) { var population = new PopulationData(Globals.currentDirectory + "population.dat"); population.Chance = _view.PopulationFactor; var section = new HeatmapKMLAnimator(population); section.DotSize = _view.PopulationDotSize; section.DotFile = _view.PopulationDotFile; sections.Add(section); } // Create animator var camera = new FollowKMLAnimatorCamera(trajectory.Aircraft, trajectory); var animator = new KMLAnimator(sections, camera); animator.AnimationToFile(trajectory.Duration, Globals.webrootDirectory + "visualisation.kml"); _view.Invoke(delegate { _view.PreparationCalculationCompleted(); }); }
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; }
protected void MultipleTrajectoryVisualisation() { // Legend var legend = new LegendCreator(); // plot legend legend.OutputLegendImage(); legend.OutputLegendTitle(); // Create sections var sections = new List <KMLAnimatorSectionInterface>(); //sections.Add(new MaintainMultipleGroundPlotKMLAnimator(trajectories)); if (!VisualiseOptimisation) { // Contour animator List <int> contoursOfInterest = (_view.VisualiseContoursOfInterest) ? _view.ContoursOfInterest : null; var contourAnimator = new ContourKMLAnimator(temporalGrid, null, contoursOfInterest); if (_view.VisualiseGradient) { legend.SetSettings(_view.LowestContourValue, _view.HighestContourValue); contourAnimator.SetGradientSettings((int)_view.LowestContourValue, (int)_view.HighestContourValue, (int)_view.ContourValueStep); } contourAnimator.AltitudeOffset = (_view.MapFile != ""); sections.Add(new MultipleGroundplotKMLAnimator(trajectories)); sections.Add(new LegendKMLAnimator()); sections.Add(contourAnimator); } else { trajectories = TrajectoryFitness.trajectories; sections.Add(new FitnessGroundPlotKMLAnimator(trajectories)); } if (_view.MapFile != "") { sections.Add(new CustomMapKMLAnimator(_view.MapFile, _view.MapBottomLeft, _view.MapUpperRight)); } if (_view.Heatmap) { var population = new PopulationData(Globals.currentDirectory + "population.dat"); population.Chance = _view.PopulationFactor; var section = new HeatmapKMLAnimator(population); section.DotSize = _view.PopulationDotSize; section.DotFile = _view.PopulationDotFile; sections.Add(section); } var camera = new TopViewKMLAnimatorCamera( new GeoPoint3D(4.9773743, 52.2384423, _view.CameraAltitude) ); // Create animator /* * var camera = new TopViewKMLAnimatorCamera( * new GeoPoint3D(referencePoint.GeoPoint.Longitude, referencePoint.GeoPoint.Latitude, * _view.CameraAltitude) * ); */ var animator = new KMLAnimator(sections, camera); animator.Duration = 0; animator.AnimationToFile(trajectories.Count, Globals.webrootDirectory + "visualisation.kml"); _view.Invoke(delegate { _view.PreparationCalculationCompleted(); }); }