From: kruland2607 Date: Fri, 10 Aug 2012 21:13:41 +0000 (+0000) Subject: Only show a few important events by default. X-Git-Tag: upstream/12.09^2~54 X-Git-Url: https://git.gag.com/?p=debian%2Fopenrocket;a=commitdiff_plain;h=12e431c4d4881c3f735d7d95ba11869f211cb9a9 Only show a few important events by default. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@970 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/android/src/net/sf/openrocket/android/simulation/SimulationChart.java b/android/src/net/sf/openrocket/android/simulation/SimulationChart.java index 601bf859..9fa41d7e 100644 --- a/android/src/net/sf/openrocket/android/simulation/SimulationChart.java +++ b/android/src/net/sf/openrocket/android/simulation/SimulationChart.java @@ -52,12 +52,12 @@ import android.graphics.Paint.Align; * */ public class SimulationChart implements Serializable { - + private final int simulationIndex; private transient FlightDataType series1; private transient FlightDataType series2; private transient List events; - + // Define 4 different colors and point styles to use for the series. // For now only 2 series are supported though. private final static int[] colors = new int[] { Color.BLUE, Color.YELLOW, Color.GREEN, Color.RED }; @@ -92,7 +92,7 @@ public class SimulationChart implements Serializable { public void setEvents( List events ) { this.events = events; } - + public List getEvents() { return events; } @@ -119,11 +119,19 @@ public class SimulationChart implements Serializable { if (series2== null) { series2 = flightDataBranch.getTypes()[2]; } - + if ( events == null ) { events = new ArrayList(); for ( FlightEvent event : flightDataBranch.getEvents() ) { - events.add(event); + switch( event.getType()) { + case LAUNCHROD: + case APOGEE: + case BURNOUT: + case EJECTION_CHARGE: + events.add(event); + default: + break; + } } } @@ -203,7 +211,7 @@ public class SimulationChart implements Serializable { double ymax = computeMaxValueWithPadding( series1values ); double xmax = Math.ceil( timevalues.get( timevalues.size()-1)); - + AndroidLogWrapper.d(SimulationChart.class,"ymax = " + ymax); renderer.setXAxisMax(xmax); renderer.setYAxisMax(ymax); @@ -228,7 +236,7 @@ public class SimulationChart implements Serializable { addXYSeries(dataset, series2.getName(), timevalues, series2values, 1); } XYChart chart = new LineChart(dataset, renderer); - + return chart; } @@ -258,7 +266,7 @@ public class SimulationChart implements Serializable { // next 100 if 1000 < max < 10,000 // next 1000 if max >= 10,000 double numdigits = Math.floor(Math.log10(max)); - + if ( numdigits <= 1.0 ) { return 10.0; } else if ( numdigits <= 3.0 ) { @@ -268,7 +276,7 @@ public class SimulationChart implements Serializable { } else { return 1000.0 * ( Math.ceil( max / 1000.0 )); } - + } - + }