From 16528bd165cc6740be736c4379756f9c2e967189 Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Thu, 16 Nov 2023 12:18:01 +0530 Subject: [PATCH] fix device constant error --- .../hpostesting/data/constant/Constants.kt | 17 ++++++++++------- .../data/model/patient/HemoCubeTestData.kt | 5 +++++ .../adapter/OfflineUserListAdapter.kt | 5 +++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt b/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt index 0de92e7..b64be12 100644 --- a/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt +++ b/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt @@ -80,16 +80,19 @@ object Constants { val DEVICE_CONFIGURATION: Map>> = mapOf>>( "HCV-000-3001" to listOf( - listOf(1.264817, -0.85965), // LED1 - listOf(0.581462456, -0.58502), // LED2 - listOf(0.184991, 0.184991), // LED3 + listOf(1.264817, -0.85965), // LED1, 435nm + listOf(0.581462456, -0.58502), // LED2, 415nm + listOf(0.184991, 0.001704), // LED3, 555nm listOf(1.0, 0.0) // LED4 ), "HCV-000-3002" to listOf( - listOf(1.264817, -0.85965), // LED1 - listOf(0.581462456, -0.58502), // LED2 - listOf(0.184991, 0.184991), // LED3 - listOf(1.0, 0.0) // LED4 + listOf(1.264817, -0.85965), + listOf(0.581462456, -0.58502), + listOf(0.184991, 0.001704), + listOf(1.0, 0.0) ), ) + + const val INCUBATION_TIME_MIN = 15 + const val INCUBATION_TIME_MAX = 30 } \ No newline at end of file diff --git a/app/src/main/java/com/example/hpostesting/data/model/patient/HemoCubeTestData.kt b/app/src/main/java/com/example/hpostesting/data/model/patient/HemoCubeTestData.kt index ca9c9ad..f410705 100644 --- a/app/src/main/java/com/example/hpostesting/data/model/patient/HemoCubeTestData.kt +++ b/app/src/main/java/com/example/hpostesting/data/model/patient/HemoCubeTestData.kt @@ -46,4 +46,9 @@ data class HemoCubeTestData( var coefficients: String? = "", var classificationResult: String = "", var prdClassification: String = "", + var batteryLevel: String = "", + var batteryCapacity: String = "", + var batteryMaxCapacity: String = "", + var batteryTemperature: String = "", + var batteryVoltage: String = "", ) diff --git a/app/src/main/java/com/example/hpostesting/presentation/adapter/OfflineUserListAdapter.kt b/app/src/main/java/com/example/hpostesting/presentation/adapter/OfflineUserListAdapter.kt index 59dc423..6acd933 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/adapter/OfflineUserListAdapter.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/adapter/OfflineUserListAdapter.kt @@ -9,6 +9,7 @@ import androidx.recyclerview.widget.AsyncListDiffer import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView import com.example.hpostesting.data.DataHolder +import com.example.hpostesting.data.constant.Constants import com.example.hpostesting.data.model.patient.HemoCubeTestData import com.example.hpostesting.data.model.patient.UserData import `in`.sminnovations.hpostesting.R @@ -74,13 +75,13 @@ class OfflineUserListAdapter(private val view: View, private val batLevel: Int) ).show() } else { if (userList.incubationTime != "") { - if (isBetween15And30Minutes(userList.incubationTime) < 15) { + if (isBetween15And30Minutes(userList.incubationTime) < Constants.INCUBATION_TIME_MIN) { Toast.makeText( view.context, "Incubation has not completed 15 minutes", Toast.LENGTH_SHORT ).show() - } else if (isBetween15And30Minutes(userList.incubationTime) > 30) { + } else if (isBetween15And30Minutes(userList.incubationTime) > Constants.INCUBATION_TIME_MAX) { Toast.makeText( view.context, "Incubation crossed 30 minutes, need to repeat the incubation",