use calculated ratio for class and save coeffs

This commit is contained in:
Pritimay Sarkar
2023-10-30 23:25:45 +05:30
parent 8872e484a1
commit f4085545ea

View File

@@ -226,7 +226,7 @@ class HemoCubeBufferCheckFragment : Fragment() {
val led2Average = log10(led2BufferForDevice?.div(led2Sample!!) ?: 0.0)
val deviceRatio = led1Average / led2Average
val calculateRatio = calculateRatio(deviceRatio)
val classificationResult = findResult(deviceRatio)
val classificationResult = findResult(calculateRatio)
messages.postValue(classificationResult)
val bufferData = BufferCheckData(
deviceId= deviceId,
@@ -239,6 +239,7 @@ class HemoCubeBufferCheckFragment : Fragment() {
led2Sample = led2Sample,
deviceRatio = deviceRatio,
calculatedRatio = calculateRatio,
coefficients = currentDeviceData?.coefficients?.get(0).toString() + ", " + currentDeviceData?.coefficients?.get(1).toString(),
classificationResult = classificationResult,
deviceSerialNumber = sharedPreferences.getString(Constants.USER_ID, "").toString(),
testTime = SimpleDateFormat(