Skip to content
This repository was archived by the owner on Mar 17, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Apps/Motion/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="edu.uml.cs.isense.motion"
android:versionCode="4"
android:versionName="1.0">
android:versionCode="5"
android:versionName="1.1">

<uses-sdk
android:minSdkVersion="9"
Expand Down
4 changes: 4 additions & 0 deletions Apps/Motion/src/edu/uml/cs/isense/motion/Motion.java
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ public void onActivityResult(int reqCode, int resultCode, Intent data) {
projNumB.setText("Project: " + projectNumber);
w.make("Sensors Needed for Project " + projectNumber + " are Enabled", Waffle.IMAGE_CHECK);

/*change sensor field*/
int field = data.getExtras().getInt(Presets.FIELD);
fields.setCurrentItem(field);

/*set rate*/
SharedPreferences ratePrefs = getSharedPreferences(MY_SAVED_PREFERENCES, 0);
SharedPreferences.Editor editor2 = ratePrefs.edit();
Expand Down
25 changes: 19 additions & 6 deletions Apps/Motion/src/edu/uml/cs/isense/motion/dialogs/Presets.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ public class Presets extends Activity{
public static final String PROJECT = "project";
public static final String LENGTH = "length";
public static final String RATE = "rate";
public static final String FIELD = "field";

public static final String ACCEL_PROJECT= "570";
public static final int ACCEL_PROJECT_RATE= 50;
public static final int ACCEL_PROJECT_LENGTH= 10;
public static final int ACCEL_CAROUSEL_POSITION = 1;

public static final String GPS_PROJECT= "13";
public static final int GPS_PROJECT_RATE = 1000;
public static final int GPS_PROJECT_LENGTH = -1; //-1 is push to stop
public static final int GPS_CAROUSEL_POSITION = 1;


@Override
Expand All @@ -28,10 +39,11 @@ public void onCreate(Bundle savedInstanceState) {
@Override
public void onClick(View v) {
Intent resultIntent = new Intent();
resultIntent.putExtra(RATE, 50);
resultIntent.putExtra(LENGTH, 10);
resultIntent.putExtra(PROJECT, "570");
resultIntent.putExtra(RATE, ACCEL_PROJECT_RATE);
resultIntent.putExtra(LENGTH, ACCEL_PROJECT_LENGTH);
resultIntent.putExtra(PROJECT, ACCEL_PROJECT);
setResult(Activity.RESULT_OK, resultIntent);
resultIntent.putExtra(FIELD, ACCEL_CAROUSEL_POSITION);
finish();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious as to what "0" (and later in the code "1") values have to do with the FIELD key. If it is defined as some preset, should it be a constant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the position of the carousel. 0 is the first position which is acceleration, 1 is the second position which is lat and lon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good - definitely want to make these constants then.

}

Expand All @@ -42,9 +54,10 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
Intent resultIntent = new Intent();
resultIntent.putExtra(RATE, 1000);
resultIntent.putExtra(LENGTH, -1);
resultIntent.putExtra(PROJECT, "13");
resultIntent.putExtra(RATE, GPS_PROJECT_RATE);
resultIntent.putExtra(LENGTH, GPS_PROJECT_LENGTH);
resultIntent.putExtra(PROJECT, GPS_PROJECT);
resultIntent.putExtra(FIELD, GPS_CAROUSEL_POSITION);
setResult(Activity.RESULT_OK, resultIntent);
finish();
}
Expand Down
4 changes: 2 additions & 2 deletions Apps/Writer/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.uml.cs.isense.writer"
android:versionCode="4"
android:versionName="1.0" >
android:versionCode="5"
android:versionName="1.1" >

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down