Issues fixed
This commit is contained in:
@@ -114,8 +114,9 @@ object Constants {
|
||||
|
||||
val COEFFICIENTS: Map<String, List<List<Double>>> = mapOf(
|
||||
"HC-V1-005" to listOf(
|
||||
listOf(1.5, 0.0),
|
||||
listOf(0.0, 0.0)
|
||||
listOf(1.5),
|
||||
listOf(0.0)
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
@@ -396,7 +396,7 @@ class HemoCubeFragment : Fragment() {
|
||||
this.deviceRatio = deviceRatio
|
||||
this.calculatedRatio = calculateRatio(deviceRatio)
|
||||
// this.coefficients = currentDeviceData?.coefficients?.get(0).toString() + ", " + currentDeviceData?.coefficients?.get(1).toString()
|
||||
this.coefficients = Constants.COEFFICIENTS[deviceId]?.get(0)?.get(0).toString() + "," + Constants.COEFFICIENTS[deviceId]?.get(1)?.get(0).toString()
|
||||
this.coefficients = Constants.COEFFICIENTS[deviceId]?.get(0).toString() + "," + Constants.COEFFICIENTS[deviceId]?.get(1).toString()
|
||||
this.classificationResult = findResult(calculatedRatio)
|
||||
hemoCubeViewModel.messages.postValue(this.classificationResult)
|
||||
this.resultData = deviceLog
|
||||
@@ -498,8 +498,8 @@ class HemoCubeFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun calculateRatio(ratio: Double): Double {
|
||||
val coefficient1: Double = Constants.COEFFICIENTS[deviceSerialNo]?.get(0)?.get(0) ?: 0.0
|
||||
val coefficient2: Double = Constants.COEFFICIENTS[deviceSerialNo]?.get(1)?.get(0) ?: 0.0
|
||||
val coefficient1: Double = (Constants.COEFFICIENTS[deviceSerialNo]?.get(0) ?: 0.0) as Double
|
||||
val coefficient2: Double = (Constants.COEFFICIENTS[deviceSerialNo]?.get(1) ?: 0.0) as Double
|
||||
return coefficient1 * ratio + coefficient2
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user