Added CNN based seizure probability to OSDAlg fragment - addresses #189 and #182

This commit is contained in:
Graham Jones
2024-05-09 21:41:04 +01:00
parent 2782689caa
commit a2ae6b939c
3 changed files with 33 additions and 1 deletions

View File

@@ -103,6 +103,24 @@ public class FragmentOsdAlg extends FragmentOsdBaseClass {
pbDrawable = mContext.getDrawable(R.drawable.progress_bar_red);
pb.setProgressDrawable(pbDrawable);
////////////////////////////////////////////////////////////
// set progressbar seizure probability
////////////////////////////////////////////////////////////
long pSeizurePc;
pSeizurePc = (long) (mConnection.mSdServer.mSdData.mPseizure * 100);
pb = ((ProgressBar) mRootView.findViewById(R.id.pSeizureProgressBarM2));
pb.setMax(100);
pb.setProgress((int) pSeizurePc);
pbDrawable = mContext.getDrawable(R.drawable.progress_bar_blue);
if (pSeizurePc > 30)
pbDrawable = mContext.getDrawable(R.drawable.progress_bar_yellow);
if (pSeizurePc > 50)
pbDrawable = mContext.getDrawable(R.drawable.progress_bar_red);
//pb.getProgressDrawable().setColorFilter(colour, PorterDuff.Mode.SRC_IN);
pb.setProgressDrawable(pbDrawable);
////////////////////////////////////////////////////////////
// Produce graph
BarChart mChart = (BarChart) mRootView.findViewById(R.id.chart1);

View File

@@ -47,6 +47,20 @@
android:indeterminate="false"
android:minHeight="20dp" />
<TextView
android:id="@+id/pSeizureTvM2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/seizure_probability"
android:textColor="@color/okTextColor" />
<ProgressBar
android:id="@+id/pSeizureProgressBarM2"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/chart1"
android:layout_width="match_parent"

View File

@@ -461,7 +461,7 @@
<string name="NDATimeRemaining">"NDA Logging Time Remaining (hours): "</string>
<string name="stop_nda_menu_title">Stop NDA</string>
<string name="start_nda_menu_title">Start NDA</string>
<string name="seizure_probability">Seizure Probability (%)</string>
<string name="seizure_probability">Seizure Probability (from CNN) (%)</string>
<string name="eventid">EventId</string>
<string name="event_date">Event Date</string>
<string name="alarm_state">Alarm State</string>