1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

AndroidGCS: Add launcher button for tuning.

This commit is contained in:
James Cotton 2012-08-28 13:27:56 -05:00
parent 150af9eb60
commit fed39f3893
12 changed files with 2446 additions and 2330 deletions

View File

@ -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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 B

After

Width:  |  Height:  |  Size: 797 B

View File

@ -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"

View 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>

View File

@ -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>

View File

@ -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));
}
});
}
}

View 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) {
}
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB