Commit 7da25ca7 authored by Kristin Muterspaw's avatar Kristin Muterspaw
Browse files

select a platform now displays a correct list of sensors.

parent f2bf60f3
......@@ -15,6 +15,7 @@ import java.util.ArrayList;
public class BenchSampleActivity extends Activity {
private static final String TAG = BenchSampleActivity.class.getSimpleName();
Spinner siteSpinner, sectorSpinner, spotSpinner, platformSpinner, sensorSpinner;
EditText sensorValue, sensorQuality, readingNotes;
ReadingsDatabase db;
......@@ -84,10 +85,6 @@ public class BenchSampleActivity extends Activity {
if (position != 0) {
site = parent.getItemAtPosition(position).toString();
sectorList.addAll(db.getSectors(site));
if (siteList.get(0).equals("Site")) {
siteList.remove(0);
}
siteList.remove(0);
}
}
......@@ -103,9 +100,6 @@ public class BenchSampleActivity extends Activity {
if (position != 0) {
sector = parent.getItemAtPosition(position).toString();
spotList.addAll(db.getSpots(site, sector));
if (sectorList.get(0).equals("Sector")) {
sectorList.remove(0);
}
}
}
......@@ -120,9 +114,6 @@ public class BenchSampleActivity extends Activity {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position != 0) {
spot = parent.getItemAtPosition(position).toString();
if (spotList.get(0).equals("Spot")) {
spotList.remove(0);
}
}
}
......@@ -137,10 +128,8 @@ public class BenchSampleActivity extends Activity {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position != 0) {
platform = parent.getItemAtPosition(position).toString();
sensorList = db.getSensors(platform);
if (platformList.get(0).equals("Platform")) {
platformList.remove(0);
}
Log.d(TAG, platform);
sensorList.addAll(db.getSensors(platform));
}
}
......
......@@ -506,6 +506,7 @@ public class ReadingsDatabase extends SQLiteOpenHelper {
c = db.query(T_SENSOR, new String[]{C_SENSORTYPE}, null, null, null, null, null);
}
while (c.moveToNext()){
Log.d(TAG, Integer.toString(c.getCount()));
values.add(c.getString(c.getColumnIndex("sensorType")));
}
c.close();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment