First go at adding support for 3d Data - it still expects 1D data to be provided and uses that - the 3d data is just passed through to the JSON strings stored in the database or sent by the web interface on request. NOT TESTED!!!!
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="uk.org.openseizuredetector"
|
||||
android:versionCode="100"
|
||||
android:versionName="4.0.4">
|
||||
android:versionCode="101"
|
||||
android:versionName="4.0.5a">
|
||||
<!-- android:allowBackup="false" -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
|
||||
@@ -80,6 +80,7 @@ public class SdData implements Parcelable {
|
||||
|
||||
|
||||
public double rawData[];
|
||||
public double rawData3D[];
|
||||
int mNsamp = 0;
|
||||
|
||||
/* Analysis results */
|
||||
@@ -109,6 +110,7 @@ public class SdData implements Parcelable {
|
||||
public SdData() {
|
||||
simpleSpec = new int[10];
|
||||
rawData = new double[N_RAW_DATA];
|
||||
rawData3D = new double[N_RAW_DATA * 3];
|
||||
dataTime = new Time(Time.getCurrentTimezone());
|
||||
}
|
||||
|
||||
@@ -204,6 +206,12 @@ public class SdData implements Parcelable {
|
||||
}
|
||||
jsonObj.put("rawData", rawArr);
|
||||
|
||||
JSONArray raw3DArr = new JSONArray();
|
||||
for (int i = 0; i < rawData3D.length; i++) {
|
||||
raw3DArr.put(rawData3D[i]);
|
||||
}
|
||||
jsonObj.put("rawData3D", raw3DArr);
|
||||
|
||||
retval = jsonObj.toString();
|
||||
} catch (Exception ex) {
|
||||
Log.v(TAG, "Error Creating Data Object - " + ex.toString());
|
||||
@@ -307,6 +315,13 @@ public class SdData implements Parcelable {
|
||||
rawArr.put(rawData[i]);
|
||||
}
|
||||
jsonObj.put("rawData", rawArr);
|
||||
|
||||
JSONArray raw3DArr = new JSONArray();
|
||||
for (int i = 0; i < rawData3D.length; i++) {
|
||||
raw3DArr.put(rawData3D[i]);
|
||||
}
|
||||
jsonObj.put("rawData3D", raw3DArr);
|
||||
|
||||
}
|
||||
|
||||
retval = jsonObj.toString();
|
||||
|
||||
@@ -254,6 +254,7 @@ public abstract class SdDataSource {
|
||||
String sdVersion;
|
||||
String sdName;
|
||||
JSONArray accelVals = null;
|
||||
JSONArray accelVals3D = null;
|
||||
Log.v(TAG, "updateFromJSON - " + jsonStr);
|
||||
|
||||
try {
|
||||
@@ -293,9 +294,20 @@ public abstract class SdDataSource {
|
||||
mSdData.rawData[i] = accelVals.getInt(i);
|
||||
}
|
||||
mSdData.mNsamp = accelVals.length();
|
||||
//mNSamp = accelVals.length();
|
||||
|
||||
accelVals3D = dataObject.getJSONArray("data3D");
|
||||
Log.v(TAG, "Received " + accelVals3D.length() + " acceleration 3D values, rawData Length is " + mSdData.rawData3D.length);
|
||||
if (accelVals3D.length() > mSdData.rawData3D.length) {
|
||||
mUtil.writeToSysLogFile("ERROR: Received " + accelVals3D.length() + " 3D acceleration values, but rawData3D storage length is "
|
||||
+ mSdData.rawData3D.length);
|
||||
}
|
||||
for (i = 0; i < accelVals3D.length(); i++) {
|
||||
mSdData.rawData3D[i] = accelVals3D.getInt(i);
|
||||
}
|
||||
|
||||
mWatchAppRunningCheck = true;
|
||||
doAnalysis();
|
||||
|
||||
if (mSdData.haveSettings == false) {
|
||||
retVal = "sendSettings";
|
||||
} else {
|
||||
|
||||
BIN
doc/Installation_Instructions_1.0.pptx
Normal file
BIN
doc/Installation_Instructions_1.0.pptx
Normal file
Binary file not shown.
Reference in New Issue
Block a user