AndroidGCS: Add launcher button for tuning.
@ -38,6 +38,7 @@
|
||||
<activity android:name="Preferences" android:label="@string/preference_title" />
|
||||
<activity android:name="UAVLocation" android:label="@string/location_name" />
|
||||
<activity android:name="SystemAlarmActivity" android:label="System Alarms" />
|
||||
<activity android:name="TuningActivity" android:label="Tuning" />
|
||||
<activity android:name="ObjectEditor" android:label="ObjectEditor"
|
||||
android:theme="@android:style/Theme.Dialog" />
|
||||
<activity android:name="Logger" android:label="Logger"
|
||||
|
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 849 B |
BIN
androidgcs/res/drawable-hdpi/ic_tuning.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 797 B |
@ -77,6 +77,18 @@
|
||||
android:drawableTop="@drawable/ic_alarms"
|
||||
android:text="@string/alarms" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/launch_tuning"
|
||||
android:layout_width="132dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="0"
|
||||
android:layout_gravity="right"
|
||||
android:layout_row="6"
|
||||
android:layout_rowSpan="2"
|
||||
android:background="@android:color/transparent"
|
||||
android:drawableTop="@drawable/ic_tuning"
|
||||
android:text="@string/tuning" />
|
||||
|
||||
<Space
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="32dp"
|
||||
|
7
androidgcs/res/layout/tuning.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
|
||||
</ListView>
|
@ -32,4 +32,5 @@
|
||||
<string name="alarms">Alarms</string>
|
||||
<string name="txrate">TxRate: </string>
|
||||
<string name="rxrate">RxRate: </string>
|
||||
<string name="tuning">Tuning</string>
|
||||
</resources>
|
||||
|
@ -83,6 +83,15 @@ public class HomePage extends ObjectManagerActivity {
|
||||
startActivity(new Intent(HomePage.this, SystemAlarmActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
Button tuning = (Button) findViewById(R.id.launch_tuning);
|
||||
tuning.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
startActivity(new Intent(HomePage.this, TuningActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
43
androidgcs/src/org/openpilot/androidgcs/TuningActivity.java
Normal file
@ -0,0 +1,43 @@
|
||||
package org.openpilot.androidgcs;
|
||||
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
public class TuningActivity extends ObjectManagerActivity {
|
||||
private final String TAG = TuningActivity.class.getSimpleName();
|
||||
|
||||
private final boolean DEBUG = false;
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.tuning);
|
||||
}
|
||||
|
||||
@Override
|
||||
void onOPConnected() {
|
||||
super.onOPConnected();
|
||||
|
||||
if (DEBUG) Log.d(TAG, "onOPConnected()");
|
||||
|
||||
// Subscribe to updates from ManualControlCommand and show the values for crude feedback
|
||||
UAVDataObject stabilizationSettings = (UAVDataObject) objMngr.getObject("StabilizationSettings");
|
||||
if (stabilizationSettings != null)
|
||||
registerObjectUpdates(stabilizationSettings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the string description of manual control command
|
||||
*/
|
||||
@Override
|
||||
protected void objectUpdated(UAVObject obj) {
|
||||
if (obj.getName().compareTo("StabilizationSettings") == 0) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 849 B |
BIN
artwork/Android/hdpi/ic_tuning.png
Normal file
After Width: | Height: | Size: 1.9 KiB |