1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Trying to get eclipse project right

This commit is contained in:
James Cotton 2011-03-01 01:23:10 -06:00
parent 9d707cef5b
commit eed5705a6c
33 changed files with 62 additions and 180 deletions

8
.gitignore vendored
View File

@ -64,10 +64,16 @@ ground/uavobjgenerator/uavobjgenerator.pro.user
ground/uavobjects/uavobjects.pro.user
ground/ground.pro.user
# Ignore GNU global tags files
GPATH
GRTAGS
GSYMS
GTAGS
plane
quad
# Ignore auto generated java files
androidgcs/bin/
androidgcs/gen/
/.cproject
/.project

7
androidgcs/.classpath Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>

33
androidgcs/.project Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>androidgcs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,5 @@
#Tue Mar 01 01:16:25 CST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -3,16 +3,10 @@
package="org.openpilot.androidgcs"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="ObjectBrowser"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,4 +8,4 @@
# project structure.
# Project target.
target=android-8
target=android-7

View File

@ -1,31 +0,0 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package org.openpilot.androidgcs;
public final class R {
public static final class attr {
}
public static final class color {
public static final int all_black=0x7f050001;
public static final int all_white=0x7f050000;
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int objects=0x7f060000;
}
public static final class layout {
public static final int main=0x7f030000;
public static final int objectbrowser=0x7f030001;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/all_white">
<ExpandableListView android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/objects"></ExpandableListView>
</LinearLayout>

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">OpenPilot Android GCS</string>
<string name="app_name">OpieMobi</string>
<color name="all_white">#FFFFFF</color>
<color name="all_black">#000000</color>
<string name="hello">Hello World!</string>
<string name="app_name">OpenPilot GCS</string>
</resources>

View File

@ -1,99 +0,0 @@
/**
*
*/
package org.openpilot.androidgcs;
import android.widget.AbsListView;
import android.widget.TextView;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
/**
* @author jcotton81
*
*/
public class ObjBrowserExpandableListAdapter extends BaseExpandableListAdapter {
// Sample data set. children[i] contains the children (String[]) for
// groups[i].
private String[] groups = { "Parent1", "Parent2", "Parent3" };
private String[][] children = { { "Child1" },{ "Child2" }, { "Child3" },{ "Child4" }, { "Child5" } };
private Context context;
public ObjBrowserExpandableListAdapter(Context context) {
this.context = context;
}
public Object getChild(int groupPosition, int childPosition) {
return children[groupPosition][childPosition];
}
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
public int getChildrenCount(int groupPosition) {
int i = 0;
try {
i = children[groupPosition].length;
} catch (Exception e) {
}
return i;
}
public TextView getGenericView() {
// Layout parameters for the ExpandableListView
AbsListView.LayoutParams lp = new AbsListView.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, 64);
TextView textView = new TextView(context);
textView.setLayoutParams(lp);
// Center the text vertically
textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
// Set the text starting position
textView.setPadding(36, 0, 0, 0);
return textView;
}
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
TextView textView = getGenericView();
textView.setText(getChild(groupPosition, childPosition).toString());
return textView;
}
public Object getGroup(int groupPosition) {
return groups[groupPosition];
}
public int getGroupCount() {
return groups.length;
}
public long getGroupId(int groupPosition) {
return groupPosition;
}
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
TextView textView = getGenericView();
textView.setText(getGroup(groupPosition).toString());
return textView;
}
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}
public boolean hasStableIds() {
return true;
}
}

View File

@ -1,21 +0,0 @@
package org.openpilot.androidgcs;
import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
public class ObjectBrowser extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.objectbrowser);
ExpandableListAdapter mAdapter;
ExpandableListView epView = (ExpandableListView) findViewById(R.id.objects);
mAdapter = new ObjBrowserExpandableListAdapter(this);
epView.setAdapter(mAdapter);
}
}

View File

@ -2,13 +2,11 @@ package org.openpilot.uavtalk;
public class UAVMetaObject extends UAVObject {
public UAVMetaObject(int objID, Boolean isSingleInst, String name) {
super(objID, isSingleInst, name);
// TODO Auto-generated constructor stub
}
public UAVMetaObject(int objID, String mname, UAVDataObject obj) {
// TODO Auto-generated constructor stub
private UAVDataObject parent;
public UAVMetaObject(int objID, String mname, UAVDataObject parent) {
super(objID, true, mname);
this.parent = parent;
}
@Override