Prepare for publishing
- Added README - Added proper javadoc comments
This commit is contained in:
@@ -39,7 +39,6 @@ import de.fhws.indoor.sensorreadout.loggers.OrderedLogger;
|
||||
import de.fhws.indoor.sensorreadout.sensors.GpsNew;
|
||||
import de.fhws.indoor.sensorreadout.sensors.GroundTruth;
|
||||
import de.fhws.indoor.sensorreadout.sensors.PedestrianActivity;
|
||||
import de.fhws.indoor.sensorreadout.sensors.PedestrianActivityButton;
|
||||
import de.fhws.indoor.sensorreadout.sensors.PhoneSensors;
|
||||
import de.fhws.indoor.sensorreadout.sensors.WiFi;
|
||||
import de.fhws.indoor.sensorreadout.sensors.WiFiRTT;
|
||||
|
||||
@@ -14,6 +14,9 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
/**
|
||||
* @author Markus Ebner
|
||||
*/
|
||||
public class MetadataFragment extends DialogFragment {
|
||||
|
||||
public interface ResultListener {
|
||||
|
||||
@@ -6,9 +6,8 @@ import de.fhws.indoor.sensorreadout.MainActivity;
|
||||
import de.fhws.indoor.sensorreadout.R;
|
||||
|
||||
/**
|
||||
* Created by Frank on 05.06.2016.
|
||||
* @author Frank Ebner
|
||||
*/
|
||||
|
||||
public class MyException extends RuntimeException {
|
||||
|
||||
public MyException(final String err, final Throwable t) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package de.fhws.indoor.sensorreadout.sensors;
|
||||
package de.fhws.indoor.sensorreadout;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
@@ -9,12 +9,18 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import de.fhws.indoor.sensorreadout.R;
|
||||
import de.fhws.indoor.sensorreadout.sensors.PedestrianActivity;
|
||||
|
||||
/**
|
||||
* Created by toni on 10/01/18.
|
||||
* Extended by Markus on 19/06/19
|
||||
* Button used in the UI to represent a specific activity.
|
||||
* <p>
|
||||
* These buttons are used by the user to live-tag the recording with information about the
|
||||
* currently performed physical activity.
|
||||
* </p>
|
||||
*
|
||||
* @author Toni Fetzer
|
||||
* @author Markus Ebner
|
||||
*/
|
||||
|
||||
public class PedestrianActivityButton extends LinearLayout {
|
||||
|
||||
private LinearLayout innerBtn;
|
||||
@@ -3,6 +3,9 @@ package de.fhws.indoor.sensorreadout;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
/**
|
||||
* @author Markus Ebner
|
||||
*/
|
||||
public class SettingsActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,9 @@ import androidx.preference.SwitchPreferenceCompat;
|
||||
|
||||
import de.fhws.indoor.sensorreadout.sensors.WiFiRTT;
|
||||
|
||||
/**
|
||||
* @author Markus Ebner
|
||||
*/
|
||||
public class SettingsFragment extends PreferenceFragmentCompat {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,13 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import de.fhws.indoor.sensorreadout.sensors.SensorType;
|
||||
|
||||
/**
|
||||
* Base-Class for all Logger implementations.
|
||||
* <p>
|
||||
* This class defines the public interface of all logging implementations.
|
||||
* </p>
|
||||
* @author Markus Ebner
|
||||
*/
|
||||
public abstract class Logger {
|
||||
|
||||
public static final long BEGINNING_TS = -1;
|
||||
|
||||
@@ -14,10 +14,15 @@ import de.fhws.indoor.sensorreadout.MyException;
|
||||
import de.fhws.indoor.sensorreadout.sensors.SensorType;
|
||||
|
||||
/**
|
||||
* log sensor data to RAM
|
||||
* only flush to file when finished
|
||||
* Simple (ordered) RAM Logger.
|
||||
* <p>
|
||||
* This logger stores all events in memory first.
|
||||
* Only when the logger is stopped does it sort them and flush them to the logfile.
|
||||
*
|
||||
* WARNING: overflows RAM on some smartphones, with large recordings
|
||||
* WARNING: This overflows the RAM if the recording gets too long.
|
||||
* If this happens, all the data is gone.
|
||||
* </p>
|
||||
* @author Frank Ebner
|
||||
*/
|
||||
public final class LoggerRAM extends Logger {
|
||||
|
||||
|
||||
@@ -16,8 +16,12 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import de.fhws.indoor.sensorreadout.MyException;
|
||||
|
||||
/**
|
||||
* live-reorder logged sensor data, and write to file
|
||||
* Created by Markus on 07.04.2020.
|
||||
* Live (ordered) logger.
|
||||
* <p>
|
||||
* This logger contains an internal caching structure that regularly sorts the contained entries
|
||||
* and commits the oldest ones to the logfile using the correct order.
|
||||
* </p>
|
||||
* @author Markus Ebner
|
||||
*/
|
||||
public final class OrderedLogger extends Logger {
|
||||
|
||||
|
||||
@@ -11,10 +11,15 @@ import java.util.concurrent.ArrayBlockingQueue;
|
||||
import de.fhws.indoor.sensorreadout.MyException;
|
||||
|
||||
/**
|
||||
* log sensor data to file
|
||||
* Created by Frank on 25.03.2015.
|
||||
* Re-Written by Markus on 20.06.2019.
|
||||
* Re-Written by Markus on 07.04.2020.
|
||||
* Live (unordered) Logger.
|
||||
* <p>
|
||||
* This logger takes the incomming events and commits them to the logfile in a background thread.
|
||||
*
|
||||
* WARNING: This produces files with non-monotonic increasing timestamps.
|
||||
* Reordering is required on the parser-side, or as post-processing step.
|
||||
* </p>
|
||||
* @author Frank Ebner
|
||||
* @author Markus Ebner
|
||||
*/
|
||||
public final class UnorderedLogger extends Logger {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import androidx.core.content.ContextCompat;
|
||||
import de.fhws.indoor.sensorreadout.MyException;
|
||||
|
||||
/**
|
||||
* Created by student on 20.03.17.
|
||||
* GPS sensor.
|
||||
*/
|
||||
@TargetApi(23)
|
||||
public class Gps extends mySensor implements LocationListener {
|
||||
|
||||
@@ -4,7 +4,11 @@ import android.app.Activity;
|
||||
import android.os.SystemClock;
|
||||
|
||||
/**
|
||||
* Created by Toni on 02.06.2015.
|
||||
* Virtual Ground-Truth sensor
|
||||
* <p>
|
||||
* This sensor inserts the ground-truth events generated by user-interaction.
|
||||
* </p>
|
||||
* @author Toni Fetzer
|
||||
*/
|
||||
public class GroundTruth extends mySensor {
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package de.fhws.indoor.sensorreadout.sensors;
|
||||
|
||||
/**
|
||||
* Created by Frank on 05.06.2016.
|
||||
* @author Frank Ebner
|
||||
*/
|
||||
|
||||
public class Helper {
|
||||
|
||||
/** remove all ":" within the MAC to reduce file footprint */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package de.fhws.indoor.sensorreadout.sensors;
|
||||
|
||||
/**
|
||||
* Created by toni on 10/01/18.
|
||||
* Enum mapping all supported Activities to their ids.
|
||||
* @author Toni Fetzer
|
||||
*/
|
||||
|
||||
public enum PedestrianActivity {
|
||||
|
||||
WALK(0),
|
||||
|
||||
@@ -16,9 +16,14 @@ import java.io.IOException;
|
||||
import de.fhws.indoor.sensorreadout.loggers.DataFolder;
|
||||
|
||||
/**
|
||||
* all available sensors
|
||||
* and what to do within one class
|
||||
* Sensor that surfaces all Sensors a phone has.
|
||||
* <p>
|
||||
* While the term "sensor" is used for all implementations, such as Wifi and iBeacon, the term
|
||||
* "sensor" in this context actually refers to a smartphone's sensors, such as
|
||||
* Accelerometer, Gyroscope, MagneticField, Light, Pressure, ...
|
||||
*
|
||||
* This Sensor implementation exports all sensors supported by the smartphone.
|
||||
* </p>
|
||||
*
|
||||
* Created by Toni on 25.03.2015.
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package de.fhws.indoor.sensorreadout.sensors;
|
||||
|
||||
/**
|
||||
* Created by toni on 02/06/16.
|
||||
* Enum mapping all supported events in the logfile to their corresponding ids.
|
||||
*
|
||||
* @author Toni Fetzer
|
||||
* @author Frank Ebner
|
||||
*/
|
||||
public enum SensorType {
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ import de.fhws.indoor.sensorreadout.MyException;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Frank on 25.03.2015.
|
||||
* Wifi sensor exporting scan/advertisement events.
|
||||
* @author Frank Ebner
|
||||
*/
|
||||
public class WiFi extends mySensor {
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Wifi RTT sensor exporting time-of-flight measurements.
|
||||
* @author Markus Bullmann
|
||||
*/
|
||||
public class WiFiRTT extends mySensor {
|
||||
|
||||
private final Activity act;
|
||||
|
||||
@@ -16,7 +16,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Frank on 25.03.2015.
|
||||
* Bluetooth iBeacon sensor.
|
||||
* @author Frank Ebner
|
||||
*/
|
||||
public class iBeacon extends mySensor {
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ package de.fhws.indoor.sensorreadout.sensors;
|
||||
import android.app.Activity;
|
||||
|
||||
/**
|
||||
* base-class for all Sensors
|
||||
* Base-class for all Sensors
|
||||
*
|
||||
* Created by Frank on 25.03.2015.
|
||||
* @author Frank Ebner
|
||||
*/
|
||||
public abstract class mySensor {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user