diff --git a/android/res/layout/openrocketviewer.xml b/android/res/layout/openrocketviewer.xml index 8ddc4c4f1..e25ec6d8b 100644 --- a/android/res/layout/openrocketviewer.xml +++ b/android/res/layout/openrocketviewer.xml @@ -31,17 +31,6 @@ android:layout_height="wrap_content" android:orientation="vertical" > - - - - - - - - + android:text="Empty Mass" /> + + + + + + spinnerAdapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item); + for( String config: motorConfigs ) { + spinnerAdapter.add(rocket.getMotorConfigurationNameOrDescription(config)); + } + + configurationSpinner.setAdapter(spinnerAdapter); + Unit LengthUnit = UnitGroup.UNITS_LENGTH.getDefaultUnit(); Unit MassUnit = UnitGroup.UNITS_MASS.getDefaultUnit(); - Coordinate cg = RocketUtils.getCG(rocket); + Coordinate cg = RocketUtils.getCG(rocket, MassCalcType.NO_MOTORS); double length = RocketUtils.getLength(rocket); - ((TextView) findViewById(R.id.openrocketviewerRocketName)).setText( rocket.getName()); ((TextView)findViewById(R.id.openrocketviewerDesigner)).setText(rocket.getDesigner()); ((TextView)findViewById(R.id.openrocketviewerCG)).setText(LengthUnit.toStringUnit(cg.x) ); ((TextView)findViewById(R.id.openrocketviewerLength)).setText(LengthUnit.toStringUnit(length)); diff --git a/core/src/net/sf/openrocket/rocketcomponent/RocketUtils.java b/core/src/net/sf/openrocket/rocketcomponent/RocketUtils.java index 2e4b63b8a..71360b9a2 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/RocketUtils.java +++ b/core/src/net/sf/openrocket/rocketcomponent/RocketUtils.java @@ -25,9 +25,9 @@ public abstract class RocketUtils { return length; } - public static Coordinate getCG(Rocket rocket) { + public static Coordinate getCG(Rocket rocket, MassCalcType calcType) { MassCalculator massCalculator = new BasicMassCalculator(); - Coordinate cg = massCalculator.getCG(rocket.getDefaultConfiguration(), MassCalcType.LAUNCH_MASS); + Coordinate cg = massCalculator.getCG(rocket.getDefaultConfiguration(), calcType); return cg; }