Enabled battery history fragment of main activity
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
- Improved start-up checks for permissions
|
- Improved start-up checks for permissions
|
||||||
- Improved system re-start after changing settings (but still not perfect!)
|
- Improved system re-start after changing settings (but still not perfect!)
|
||||||
- Disabled the CNN algorithm by default as it is causing some false alarms (Issue #170)
|
- Disabled the CNN algorithm by default as it is causing some false alarms (Issue #170)
|
||||||
- Added watch signal strength trend graph to main activity
|
- Added watch signal strength history graph and watch battery hisory graph to main activity
|
||||||
V4.2.5 - Set BLE device time if the characteristic is available.
|
V4.2.5 - Set BLE device time if the characteristic is available.
|
||||||
V4.2.4 - Added checks and a FAULT condition for Bluetooth errors in Bluetooth Data Source
|
V4.2.4 - Added checks and a FAULT condition for Bluetooth errors in Bluetooth Data Source
|
||||||
V4.2.3 - Uses 3d accelerometer data to calculate magnitude if vector magnitude is not sent from data source.
|
V4.2.3 - Uses 3d accelerometer data to calculate magnitude if vector magnitude is not sent from data source.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class FragmentBatt extends FragmentOsdBaseClass {
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mLineChart = mRootView.findViewById(R.id.lineChart);
|
mLineChart = mRootView.findViewById(R.id.battLineChart);
|
||||||
mLineChart.getLegend().setEnabled(false);
|
mLineChart.getLegend().setEnabled(false);
|
||||||
XAxis xAxis = mLineChart.getXAxis();
|
XAxis xAxis = mLineChart.getXAxis();
|
||||||
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
||||||
@@ -76,8 +76,8 @@ public class FragmentBatt extends FragmentOsdBaseClass {
|
|||||||
xAxis.setTextColor(Color.WHITE);
|
xAxis.setTextColor(Color.WHITE);
|
||||||
|
|
||||||
YAxis yAxis = mLineChart.getAxisLeft();
|
YAxis yAxis = mLineChart.getAxisLeft();
|
||||||
yAxis.setAxisMinValue(40f);
|
yAxis.setAxisMinValue(0f);
|
||||||
yAxis.setAxisMaxValue(240f);
|
yAxis.setAxisMaxValue(100f);
|
||||||
yAxis.setDrawGridLines(true);
|
yAxis.setDrawGridLines(true);
|
||||||
yAxis.setDrawLabels(true);
|
yAxis.setDrawLabels(true);
|
||||||
yAxis.setTextColor(Color.WHITE);
|
yAxis.setTextColor(Color.WHITE);
|
||||||
@@ -111,6 +111,7 @@ public class FragmentBatt extends FragmentOsdBaseClass {
|
|||||||
double watchBattArr[] = mConnection.mSdServer.mSdData.watchBattBuff.getVals(); // This gives us a simple vector of hr values to plot.
|
double watchBattArr[] = mConnection.mSdServer.mSdData.watchBattBuff.getVals(); // This gives us a simple vector of hr values to plot.
|
||||||
int nPhoneBattArr = mConnection.mSdServer.mSdData.phoneBattBuff.getNumVals();
|
int nPhoneBattArr = mConnection.mSdServer.mSdData.phoneBattBuff.getNumVals();
|
||||||
double phoneBattArr[] = mConnection.mSdServer.mSdData.phoneBattBuff.getVals();
|
double phoneBattArr[] = mConnection.mSdServer.mSdData.phoneBattBuff.getVals();
|
||||||
|
Log.i(TAG,"updateUi() - nWatchBattArr="+nWatchBattArr+", nPhoneBattArr="+nPhoneBattArr);
|
||||||
if (Objects.nonNull(mConnection.mSdServer.mSdData.watchBattBuff) && nWatchBattArr > 0) {
|
if (Objects.nonNull(mConnection.mSdServer.mSdData.watchBattBuff) && nWatchBattArr > 0) {
|
||||||
Log.v(TAG, "hrWatchBattBuff.getNumVals=" + nWatchBattArr);
|
Log.v(TAG, "hrWatchBattBuff.getNumVals=" + nWatchBattArr);
|
||||||
lineDataSet.clear();
|
lineDataSet.clear();
|
||||||
|
|||||||
@@ -320,8 +320,8 @@ public class MainActivity2 extends AppCompatActivity {
|
|||||||
return new FragmentSystem();
|
return new FragmentSystem();
|
||||||
case 3:
|
case 3:
|
||||||
return new FragmentWatchSig();
|
return new FragmentWatchSig();
|
||||||
//case 4:
|
case 4:
|
||||||
// return new FragmentBatt();
|
return new FragmentBatt();
|
||||||
//case 4:
|
//case 4:
|
||||||
// return new FragmentDataSharing();
|
// return new FragmentDataSharing();
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ public class MainActivity2 extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return 4;
|
return 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -390,7 +390,6 @@ public abstract class SdDataSource {
|
|||||||
mSamplePeriod = (short) dataObject.getInt("analysisPeriod");
|
mSamplePeriod = (short) dataObject.getInt("analysisPeriod");
|
||||||
mSampleFreq = (short) dataObject.getInt("sampleFreq");
|
mSampleFreq = (short) dataObject.getInt("sampleFreq");
|
||||||
mSdData.batteryPc = (short) dataObject.getInt("battery");
|
mSdData.batteryPc = (short) dataObject.getInt("battery");
|
||||||
mSdData.watchBattBuff.add(mSdData.batteryPc);
|
|
||||||
|
|
||||||
Log.v(TAG, "updateFromJSON - mSamplePeriod=" + mSamplePeriod + " mSampleFreq=" + mSampleFreq);
|
Log.v(TAG, "updateFromJSON - mSamplePeriod=" + mSamplePeriod + " mSampleFreq=" + mSampleFreq);
|
||||||
mUtil.writeToSysLogFile("SDDataSource.updateFromJSON - Settings Received");
|
mUtil.writeToSysLogFile("SDDataSource.updateFromJSON - Settings Received");
|
||||||
@@ -475,6 +474,7 @@ public abstract class SdDataSource {
|
|||||||
// Update phone battery level - it is done here so it is called for all data sources.
|
// Update phone battery level - it is done here so it is called for all data sources.
|
||||||
mSdData.phoneBatteryPc = getPhoneBatteryLevel();
|
mSdData.phoneBatteryPc = getPhoneBatteryLevel();
|
||||||
mSdData.phoneBattBuff.add(mSdData.phoneBatteryPc);
|
mSdData.phoneBattBuff.add(mSdData.phoneBatteryPc);
|
||||||
|
mSdData.watchBattBuff.add(mSdData.batteryPc);
|
||||||
try {
|
try {
|
||||||
// FIXME - Use specified sampleFreq, not this hard coded one
|
// FIXME - Use specified sampleFreq, not this hard coded one
|
||||||
mSampleFreq = 25;
|
mSampleFreq = 25;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<com.github.mikephil.charting.charts.LineChart
|
<com.github.mikephil.charting.charts.LineChart
|
||||||
android:id="@+id/lineChart"
|
android:id="@+id/battLineChart"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user