Minor UI improvements to tidy it up a bit.
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="uk.org.openseizuredetector"
|
package="uk.org.openseizuredetector"
|
||||||
android:versionCode="42"
|
android:versionCode="43"
|
||||||
android:versionName="2.6.0"
|
android:versionName="2.6.1"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
>
|
>
|
||||||
|
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.SEND_SMS" />
|
<uses-permission android:name="android.permission.SEND_SMS" />
|
||||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||||
|
|||||||
@@ -160,6 +160,12 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Log.i(TAG, "onCreateOptionsMenu()");
|
Log.i(TAG, "onCreateOptionsMenu()");
|
||||||
getMenuInflater().inflate(R.menu.main_activity_actions, menu);
|
getMenuInflater().inflate(R.menu.main_activity_actions, menu);
|
||||||
mOptionsMenu = menu;
|
mOptionsMenu = menu;
|
||||||
|
if (mConnection.mSdServer.mSdDataSourceName != "Pebble") {
|
||||||
|
Log.v(TAG,"Disabling Pebble Specific Menu Items");
|
||||||
|
menu.findItem(R.id.action_instal_watch_app).setEnabled(false);
|
||||||
|
menu.findItem(R.id.action_launch_pebble_app).setEnabled(false);
|
||||||
|
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,15 +460,15 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
tv = (TextView) findViewById(R.id.battTv);
|
tv = (TextView) findViewById(R.id.battTv);
|
||||||
tv.setText("Watch Battery = " + String.valueOf(mConnection.mSdServer.mSdData.batteryPc) + "%");
|
tv.setText("Watch Battery = " + String.valueOf(mConnection.mSdServer.mSdData.batteryPc) + "%");
|
||||||
if (mConnection.mSdServer.mSdData.batteryPc <= 20) {
|
if (mConnection.mSdServer.mSdData.batteryPc <= 10) {
|
||||||
tv.setBackgroundColor(alarmColour);
|
tv.setBackgroundColor(alarmColour);
|
||||||
tv.setTextColor(alarmTextColour);
|
tv.setTextColor(alarmTextColour);
|
||||||
}
|
}
|
||||||
if (mConnection.mSdServer.mSdData.batteryPc > 20) {
|
if (mConnection.mSdServer.mSdData.batteryPc > 10) {
|
||||||
tv.setBackgroundColor(warnColour);
|
tv.setBackgroundColor(warnColour);
|
||||||
tv.setTextColor(warnTextColour);
|
tv.setTextColor(warnTextColour);
|
||||||
}
|
}
|
||||||
if (mConnection.mSdServer.mSdData.batteryPc >= 40) {
|
if (mConnection.mSdServer.mSdData.batteryPc >= 20) {
|
||||||
tv.setBackgroundColor(okColour);
|
tv.setBackgroundColor(okColour);
|
||||||
tv.setTextColor(okTextColour);
|
tv.setTextColor(okTextColour);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ public class SdDataSourceGarmin extends SdDataSource {
|
|||||||
private int SD_MODE_FILTER = 2; // Use digital filter rather than FFT.
|
private int SD_MODE_FILTER = 2; // Use digital filter rather than FFT.
|
||||||
private int SIMPLE_SPEC_FMAX = 10;
|
private int SIMPLE_SPEC_FMAX = 10;
|
||||||
|
|
||||||
|
private int ACCEL_SCALE_FACTOR = 1000; // Amount by which to reduce analysis results to scale to be comparable to analysis on Pebble.
|
||||||
|
|
||||||
private short mDebug;
|
private short mDebug;
|
||||||
private short mFreqCutoff = 12;
|
private short mFreqCutoff = 12;
|
||||||
private short mDisplaySpectrum;
|
private short mDisplaySpectrum;
|
||||||
@@ -433,9 +435,6 @@ public class SdDataSourceGarmin extends SdDataSource {
|
|||||||
* and populate the output data structure mSdData
|
* and populate the output data structure mSdData
|
||||||
*/
|
*/
|
||||||
private void doAnalysis() {
|
private void doAnalysis() {
|
||||||
// ******* POPULATE WITH DUMMY DATA *****
|
|
||||||
//makeTestData();
|
|
||||||
// **************************************
|
|
||||||
// FIXME - Use specified sampleFreq, not this hard coded one
|
// FIXME - Use specified sampleFreq, not this hard coded one
|
||||||
mSampleFreq = 25;
|
mSampleFreq = 25;
|
||||||
double freqRes = 1.0*mSampleFreq/mNSamp;
|
double freqRes = 1.0*mSampleFreq/mNSamp;
|
||||||
@@ -489,18 +488,20 @@ public class SdDataSourceGarmin extends SdDataSource {
|
|||||||
|
|
||||||
// Populate the mSdData structure to communicate with the main SdServer service.
|
// Populate the mSdData structure to communicate with the main SdServer service.
|
||||||
mDataStatusTime.setToNow();
|
mDataStatusTime.setToNow();
|
||||||
mSdData.specPower = (long)specPower;
|
mSdData.specPower = (long)specPower / ACCEL_SCALE_FACTOR;
|
||||||
mSdData.roiPower = (long)roiPower;
|
mSdData.roiPower = (long)roiPower / ACCEL_SCALE_FACTOR;
|
||||||
mSdData.dataTime.setToNow();
|
mSdData.dataTime.setToNow();
|
||||||
mSdData.maxVal = 0; // not used
|
mSdData.maxVal = 0; // not used
|
||||||
mSdData.maxFreq = 0; // not used
|
mSdData.maxFreq = 0; // not used
|
||||||
mSdData.haveData = true;
|
mSdData.haveData = true;
|
||||||
mSdData.alarmThresh = mAlarmThresh;
|
mSdData.alarmThresh = mAlarmThresh;
|
||||||
mSdData.alarmRatioThresh = mAlarmRatioThresh;
|
mSdData.alarmRatioThresh = mAlarmRatioThresh;
|
||||||
//mSdData.batteryPc = 50; // FIXME we should get the watch to send us battery status.
|
mSdData.alarmFreqMin = mAlarmFreqMin;
|
||||||
|
mSdData.alarmFreqMax = mAlarmFreqMax;
|
||||||
|
// note mSdData.batteryPc is set from settings data in updateFromJSON()
|
||||||
// FIXME - I haven't worked out why dividing by 1000 seems necessary to get the graph on scale - we don't seem to do that with the Pebble.
|
// FIXME - I haven't worked out why dividing by 1000 seems necessary to get the graph on scale - we don't seem to do that with the Pebble.
|
||||||
for(int i=0;i<SIMPLE_SPEC_FMAX;i++) {
|
for(int i=0;i<SIMPLE_SPEC_FMAX;i++) {
|
||||||
mSdData.simpleSpec[i] = (int)simpleSpec[i]/1000;
|
mSdData.simpleSpec[i] = (int)simpleSpec[i]/ACCEL_SCALE_FACTOR;
|
||||||
}
|
}
|
||||||
Log.v(TAG, "simpleSpec = " + Arrays.toString(mSdData.simpleSpec));
|
Log.v(TAG, "simpleSpec = " + Arrays.toString(mSdData.simpleSpec));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user