<TextView\r
android:layout_width="match_parent"\r
android:layout_height="match_parent"\r
- android:text="Rocket Name" />\r
+ android:text="Designer" />\r
\r
<TextView\r
- android:id="@+id/openrocketviewerRocketName"\r
+ android:id="@+id/openrocketviewerDesigner"\r
android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
android:text="" />\r
<TextView\r
android:layout_width="match_parent"\r
android:layout_height="match_parent"\r
- android:text="Designer" />\r
+ android:text="Length" />\r
\r
<TextView\r
- android:id="@+id/openrocketviewerDesigner"\r
+ android:id="@+id/openrocketviewerLength"\r
android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
android:text="" />\r
<TextView\r
android:layout_width="match_parent"\r
android:layout_height="match_parent"\r
- android:text="CG" />\r
+ android:text="Empty Mass" />\r
\r
<TextView\r
- android:id="@+id/openrocketviewerCG"\r
+ android:id="@+id/openrocketviewerMass"\r
android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
android:text="" />\r
<TextView\r
android:layout_width="match_parent"\r
android:layout_height="match_parent"\r
- android:text="Length" />\r
+ android:text="Stage Count" />\r
\r
<TextView\r
- android:id="@+id/openrocketviewerLength"\r
+ android:id="@+id/openrocketviewerStageCount"\r
android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
android:text="" />\r
\r
- <TextView\r
- android:layout_width="match_parent"\r
+ <Spinner android:layout_width="match_parent"\r
android:layout_height="match_parent"\r
- android:text="Mass" />\r
-\r
+ android:id="@+id/openrocketviewerConfigurationSpinner" \r
+ />\r
+ \r
<TextView\r
- android:id="@+id/openrocketviewerMass"\r
android:layout_width="match_parent"\r
- android:layout_height="wrap_content"\r
- android:text="" />\r
+ android:layout_height="match_parent"\r
+ android:text="Comment" />\r
\r
<TextView\r
android:layout_width="match_parent"\r
android:layout_height="match_parent"\r
- android:text="Stage Count" />\r
+ android:text="CG" />\r
\r
<TextView\r
- android:id="@+id/openrocketviewerStageCount"\r
+ android:id="@+id/openrocketviewerCG"\r
android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
android:text="" />\r
\r
- <TextView\r
- android:layout_width="match_parent"\r
- android:layout_height="match_parent"\r
- android:text="Comment" />\r
-\r
<TextView\r
android:id="@+id/openrocketviewerComment"\r
android:layout_width="match_parent"\r
import net.sf.openrocket.android.simulation.SimulationViewer;\r
import net.sf.openrocket.document.OpenRocketDocument;\r
import net.sf.openrocket.document.Simulation;\r
+import net.sf.openrocket.masscalc.MassCalculator.MassCalcType;\r
import net.sf.openrocket.rocketcomponent.Rocket;\r
import net.sf.openrocket.rocketcomponent.RocketComponent;\r
import net.sf.openrocket.rocketcomponent.RocketUtils;\r
import android.widget.ArrayAdapter;\r
import android.widget.ListAdapter;\r
import android.widget.ListView;\r
+import android.widget.Spinner;\r
import android.widget.TabHost;\r
import android.widget.TextView;\r
\r
\r
private ProgressDialog progress;\r
\r
+ private Spinner configurationSpinner;\r
private TreeViewList componentTree;\r
private ListView simulationList;\r
\r
spec.setIndicator("Simulations");\r
tabs.addTab(spec); \r
\r
- \r
+ configurationSpinner = (Spinner) findViewById(R.id.openrocketviewerConfigurationSpinner);\r
componentTree = (TreeViewList) findViewById(R.id.openrocketviewerComponentTree);\r
simulationList = (ListView) findViewById(R.id.openrocketviewerSimulationList);\r
\r
\r
setTitle(rocket.getName());\r
\r
+ String[] motorConfigs = rocket.getMotorConfigurationIDs();\r
+ ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item);\r
+ for( String config: motorConfigs ) {\r
+ spinnerAdapter.add(rocket.getMotorConfigurationNameOrDescription(config));\r
+ }\r
+ \r
+ configurationSpinner.setAdapter(spinnerAdapter);\r
+ \r
Unit LengthUnit = UnitGroup.UNITS_LENGTH.getDefaultUnit();\r
Unit MassUnit = UnitGroup.UNITS_MASS.getDefaultUnit();\r
\r
- Coordinate cg = RocketUtils.getCG(rocket);\r
+ Coordinate cg = RocketUtils.getCG(rocket, MassCalcType.NO_MOTORS);\r
double length = RocketUtils.getLength(rocket);\r
- ((TextView) findViewById(R.id.openrocketviewerRocketName)).setText( rocket.getName());\r
((TextView)findViewById(R.id.openrocketviewerDesigner)).setText(rocket.getDesigner());\r
((TextView)findViewById(R.id.openrocketviewerCG)).setText(LengthUnit.toStringUnit(cg.x) );\r
((TextView)findViewById(R.id.openrocketviewerLength)).setText(LengthUnit.toStringUnit(length));\r