This commit is contained in:
2026-05-07 17:54:42 +00:00
parent bc5a5a3a14
commit a1968add07
13 changed files with 38 additions and 12 deletions
@@ -80,7 +80,7 @@ public class BLEScanActivity extends ListActivity {
// Stops scanning after 10 seconds. // Stops scanning after 10 seconds.
private static final long SCAN_PERIOD = 10000; private static final long SCAN_PERIOD = 10000;
private int okColour = Color.BLUE; private int okColour = Color.parseColor("#9B59B6");
private int warnColour = Color.MAGENTA; private int warnColour = Color.MAGENTA;
private int alarmColour = Color.RED; private int alarmColour = Color.RED;
private int okTextColour = Color.WHITE; private int okTextColour = Color.WHITE;
@@ -26,7 +26,7 @@ public class FragmentOsdBaseClass extends Fragment {
Timer mUiTimer; Timer mUiTimer;
protected View mRootView; protected View mRootView;
protected int okColour = Color.BLUE; protected int okColour = Color.parseColor("#9B59B6");
protected int warnColour = Color.MAGENTA; protected int warnColour = Color.MAGENTA;
protected int alarmColour = Color.RED; protected int alarmColour = Color.RED;
protected int okTextColour = Color.WHITE; protected int okTextColour = Color.WHITE;
@@ -73,7 +73,7 @@ import java.util.TimerTask;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
static final String TAG = "MainActivity"; static final String TAG = "MainActivity";
private int okColour = Color.BLUE; private int okColour = Color.parseColor("#9B59B6");
private int warnColour = Color.MAGENTA; private int warnColour = Color.MAGENTA;
private int alarmColour = Color.RED; private int alarmColour = Color.RED;
private int okTextColour = Color.WHITE; private int okTextColour = Color.WHITE;
@@ -37,7 +37,7 @@ import java.util.TimerTask;
public class MainActivity2 extends AppCompatActivity { public class MainActivity2 extends AppCompatActivity {
private String TAG = "MainActivity2"; private String TAG = "MainActivity2";
private int okColour = Color.BLUE; private int okColour = Color.parseColor("#9B59B6");
private int warnColour = Color.MAGENTA; private int warnColour = Color.MAGENTA;
private int alarmColour = Color.RED; private int alarmColour = Color.RED;
private int okTextColour = Color.WHITE; private int okTextColour = Color.WHITE;
@@ -146,6 +146,7 @@ public class SdData implements Parcelable {
// 2 = contact detected // 2 = contact detected
// 3 = reserved/unknown // 3 = reserved/unknown
public int mHrSensorContactStatus = -1; public int mHrSensorContactStatus = -1;
public long mHRTimestamp = System.currentTimeMillis();
public boolean mO2SatAlarmStanding = false; public boolean mO2SatAlarmStanding = false;
public boolean mO2SatFaultStanding = false; public boolean mO2SatFaultStanding = false;
@@ -363,6 +363,7 @@ public class SdDataSourceBLE2 extends SdDataSource {
Log.v(TAG,"onCharacteristicUpdate() - Characteristic "+charUuidStr+" updated"); Log.v(TAG,"onCharacteristicUpdate() - Characteristic "+charUuidStr+" updated");
if (charUuidStr.equals(CHAR_HEART_RATE_MEASUREMENT)) { if (charUuidStr.equals(CHAR_HEART_RATE_MEASUREMENT)) {
Log.v(TAG, "HR Measurement"); Log.v(TAG, "HR Measurement");
int flags = parser.getUInt8(); int flags = parser.getUInt8();
@@ -395,6 +396,17 @@ public class SdDataSourceBLE2 extends SdDataSource {
+ ", stored=" + mSdData.mHR + ", stored=" + mSdData.mHR
+ ", contactStatus=" + sensorContactStatus + ", contactStatus=" + sensorContactStatus
+ ", notificationCount=" + mSdData.mHrNotificationCount); + ", notificationCount=" + mSdData.mHrNotificationCount);
Log.v(TAG, String.format("%s", "HR Measurement"));
// Parse the flags
int flags = parser.getUInt8();
final int unit = flags & 0x01;
final int sensorContactStatus = (flags & 0x06) >> 1;
final boolean energyExpenditurePresent = (flags & 0x08) > 0;
final boolean rrIntervalPresent = (flags & 0x10) > 0;
// Parse heart rate
mSdData.mHR = (unit == 0) ? parser.getUInt8() : parser.getUInt16();
mSdData.mHRTimestamp = System.currentTimeMillis();
Log.d(TAG,"Received HR="+mSdData.mHR);
} else if (charUuidStr.equals(CHAR_OSD_ACC_DATA) } else if (charUuidStr.equals(CHAR_OSD_ACC_DATA)
|| charUuidStr.equals(CHAR_INFINITIME_ACC_DATA)) { || charUuidStr.equals(CHAR_INFINITIME_ACC_DATA)) {
@@ -95,6 +95,8 @@ public class SensorValidationActivity extends AppCompatActivity {
private long currentHrLastUpdateMillisInSecond = 0; private long currentHrLastUpdateMillisInSecond = 0;
private int currentHrRawValue = -1; private int currentHrRawValue = -1;
private int currentHrSensorContactStatus = -1; private int currentHrSensorContactStatus = -1;
private long lastHrTimestamp = 0;
private final ArrayList<HeartRatePoint> hrPoints = new ArrayList<>();
private long hrStartNotificationCount = 0; private long hrStartNotificationCount = 0;
private long hrLastSeenNotificationCount = -1; private long hrLastSeenNotificationCount = -1;
@@ -558,7 +560,18 @@ private final ArrayList<HeartRatePoint> hrPoints = new ArrayList<>();
currentHrLastSeenNotificationCount = hrLastSeenNotificationCount; currentHrLastSeenNotificationCount = hrLastSeenNotificationCount;
} }
<<<<<<< HEAD
SdData sdData = mConnection.mSdServer.mSdData; SdData sdData = mConnection.mSdServer.mSdData;
=======
long hrTs = mConnection.mSdServer.mSdData.mHRTimestamp;
double hr = mConnection.mSdServer.mSdData.mHR;
currentHrReadCount++;
if (hr >= 0.0 && hrTs != lastHrTimestamp) {
lastHrTimestamp = hrTs;
currentHrSum += hr;
currentHrValidCount++;
}
>>>>>>> c175730 (Cosmetic changes)
currentHrReadCount++; currentHrReadCount++;
@@ -66,7 +66,7 @@ import java.util.TimerTask;
*/ */
public class StartupActivity extends AppCompatActivity { public class StartupActivity extends AppCompatActivity {
private static String TAG = "StartupActivity"; private static String TAG = "StartupActivity";
private int okColour = Color.BLUE; private int okColour = Color.parseColor("#9B59B6");
private int warnColour = Color.MAGENTA; private int warnColour = Color.MAGENTA;
private int alarmColour = Color.RED; private int alarmColour = Color.RED;
private int okTextColour = Color.WHITE; private int okTextColour = Color.WHITE;
@@ -20,10 +20,10 @@
<shape> <shape>
<corners android:radius="10dp"/> <corners android:radius="10dp"/>
<gradient <gradient
android:startColor="#0000ff" android:startColor="#9B59B6"
android:centerColor="#8080ff" android:centerColor="#8080ff"
android:centerY="0.5" android:centerY="0.5"
android:endColor="#0000ff" android:endColor="#9B59B6"
android:angle="270" android:angle="270"
/> />
</shape> </shape>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

@@ -139,7 +139,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
+3 -3
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#3F51B5</color> <color name="colorPrimary">#9B59B6</color>
<color name="colorPrimaryDark">#303F9F</color> <color name="colorPrimaryDark">#9B59B6</color>
<color name="colorAccent">#FF4081</color> <color name="colorAccent">#FF4081</color>
<color name="okBackgroundColor">#0000ff</color> <color name="okBackgroundColor">#9B59B6</color>
<color name="okTextColor">#ffffff</color> <color name="okTextColor">#ffffff</color>
</resources> </resources>
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">OpenSeizureDetector</string> <string name="app_name">FLOGA</string>
<string name="changelog"> <string name="changelog">
"\n "\n
\nV4.3.1 - Fixed user interface issues on Android-15 and Android-16 \nV4.3.1 - Fixed user interface issues on Android-15 and Android-16