Skip to content
Merged
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
15 changes: 8 additions & 7 deletions app/src/main/java/io/pslab/adapters/SensorLoggerListAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
import io.pslab.activity.WaveGeneratorActivity;
import io.pslab.models.AccelerometerData;
import io.pslab.models.BaroData;
import io.pslab.models.CompassData;
import io.pslab.models.GasSensorData;
import io.pslab.models.GyroData;
import io.pslab.models.CompassData;
import io.pslab.models.LogicAnalyzerData;
import io.pslab.models.LuxData;
import io.pslab.models.MultimeterData;
Expand Down Expand Up @@ -234,9 +234,9 @@ private void handleCardViewClick(SensorDataBlock block) {
gasSensorIntent.putExtra(KEY_LOG, true);
gasSensorIntent.putExtra(DATA_BLOCK, block.getBlock());
context.startActivity(gasSensorIntent);
} else if(block.getSensorType().equalsIgnoreCase(context.getString(R.string.sound_meter))) {
} else if (block.getSensorType().equalsIgnoreCase(context.getString(R.string.sound_meter))) {
Intent soundMeterIntent = new Intent(context, SoundMeterActivity.class);
soundMeterIntent.putExtra(KEY_LOG,true);
soundMeterIntent.putExtra(KEY_LOG, true);
soundMeterIntent.putExtra(DATA_BLOCK, block.getBlock());
context.startActivity(soundMeterIntent);
}
Expand All @@ -255,8 +255,8 @@ public void onClick(DialogInterface dialog, int whichButton) {
File.separator + block.getSensorType() +
File.separator + CSVLogger.FILE_NAME_FORMAT.format(block.getBlock()) + ".csv");
CustomSnackBar.showSnackBar(context.findViewById(android.R.id.content),
logDirectory.delete()?context.getString(R.string.log_deleted)
:context.getString(R.string.nothing_to_delete),null,null, Snackbar.LENGTH_LONG);
logDirectory.delete() ? context.getString(R.string.log_deleted)
: context.getString(R.string.nothing_to_delete), null, null, Snackbar.LENGTH_LONG);
if (block.getSensorType().equalsIgnoreCase(PSLabSensor.LUXMETER)) {
LocalDataLog.with().clearBlockOfLuxRecords(block.getBlock());
} else if (block.getSensorType().equalsIgnoreCase(PSLabSensor.BAROMETER)) {
Expand Down Expand Up @@ -302,6 +302,7 @@ public void onClick(DialogInterface dialog, int which) {
}

private void populateMapData(SensorDataBlock block) {

if (block.getSensorType().equalsIgnoreCase(PSLabSensor.LUXMETER)) {
RealmResults<LuxData> data = LocalDataLog.with().getBlockOfLuxRecords(block.getBlock());
JSONArray array = new JSONArray();
Expand Down Expand Up @@ -372,7 +373,7 @@ private void populateMapData(SensorDataBlock block) {
}
}
setMapDataToIntent(array);
} else if (block.getSensorType().equalsIgnoreCase(PSLabSensor.ACCELEROMETER_CONFIGURATIONS)) {
} else if (block.getSensorType().equalsIgnoreCase(PSLabSensor.ACCELEROMETER)) {
RealmResults<AccelerometerData> data = LocalDataLog.with().getBlockOfAccelerometerRecords(block.getBlock());
JSONArray array = new JSONArray();
for (AccelerometerData d : data) {
Expand Down Expand Up @@ -564,7 +565,7 @@ private void setMapDataToIntent(JSONArray array) {
} else {
map.putExtra("hasMarkers", false);
CustomSnackBar.showSnackBar(context.findViewById(android.R.id.content),
context.getString(R.string.no_location_data),null,null,Snackbar.LENGTH_LONG);
context.getString(R.string.no_location_data), null, null, Snackbar.LENGTH_LONG);
}
}

Expand Down