Merge branch 'variable-buffer-thresholds' into 'preprod'

add variable thresholds parameters across devices

See merge request sminnovations/hpos!13
This commit is contained in:
Pritimay Sarkar
2023-11-16 10:03:07 +00:00
2 changed files with 22 additions and 10 deletions

View File

@@ -93,6 +93,18 @@ object Constants {
),
)
const val INCUBATION_TIME_MIN = 15
const val INCUBATION_TIME_MAX = 30
val BUFFER_INTENSITY_THRESHOLDS: Map<String, List<List<Int>>> = mapOf<String, List<List<Int>>>(
"HCV-000-3001" to listOf(
listOf(24000, 24500),
listOf(21000, 24500),
listOf(21000, 24500),
listOf(21000, 24500),
),
"HCV-000-3002" to listOf(
listOf(21000, 24500),
listOf(21000, 24500),
listOf(21000, 24500),
listOf(21000, 24500),
)
)
}

View File

@@ -417,10 +417,10 @@ class HemoCubeFragment : Fragment() {
val led4Average = log10(led4BufferForDevice?.div(led4SampleForDevice!!) ?: 0.0)
val deviceRatio = led3Average / led1Average
if (led1BufferForDevice < Constants.BUFFER_LED_LOWER_BOUND
|| led2BufferForDevice < Constants.BUFFER_LED_LOWER_BOUND
|| led3BufferForDevice < Constants.BUFFER_LED_LOWER_BOUND
|| led4BufferForDevice < Constants.BUFFER_LED_LOWER_BOUND
if (led1BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(0)?.get(0)!!
|| led2BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(1)?.get(0)!!
|| led3BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(2)?.get(0)!!
|| led4BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(3)?.get(0)!!
) {
validationError = true
activity?.runOnUiThread {
@@ -429,10 +429,10 @@ class HemoCubeFragment : Fragment() {
}
}
if (led1BufferForDevice > Constants.BUFFER_LED_UPPER_BOUND
|| led2BufferForDevice > Constants.BUFFER_LED_UPPER_BOUND
|| led3BufferForDevice > Constants.BUFFER_LED_UPPER_BOUND
|| led4BufferForDevice > Constants.BUFFER_LED_UPPER_BOUND
if (led1BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(0)?.get(1)!!
|| led2BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(1)?.get(1)!!
|| led3BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(2)?.get(1)!!
|| led4BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(3)?.get(1)!!
) {
validationError = true
activity?.runOnUiThread {