add resultData

This commit is contained in:
Pritimay Sarkar
2023-08-07 12:43:39 +05:30
parent afdaac7f1d
commit e5390df0f4

View File

@@ -275,6 +275,7 @@ class HemoCubeFragment : Fragment() {
DataHolder.hemoCubeTestData?.calculatedRatio =
calculateRatio(deviceRatio)
DataHolder.hemoCubeTestData?.resultData = resultData
resultRatio = deviceRatio?.toString()
if (!checkBufferValue()) {
with(sharedPreference.edit()) {
@@ -297,7 +298,6 @@ class HemoCubeFragment : Fragment() {
)
}
binding.progressBar.visibility = View.VISIBLE
// findNavController().navigate(R.id.action_hemocubeFragment_to_homeFragment)
} else {
resultRatio?.let { ratio ->
activity?.runOnUiThread {
@@ -308,7 +308,6 @@ class HemoCubeFragment : Fragment() {
hemoCubeViewModel.uploadHemoCubeResultToDatabase(
isOnline, true, kitSerial
)
// findNavController().navigate(R.id.action_hemocubeFragment_to_homeFragment)
}
Toast.makeText(
requireContext(),
@@ -338,7 +337,8 @@ class HemoCubeFragment : Fragment() {
override fun onUsbError(e: Exception?) {
hemoCubeViewModel.progressBar.postValue(false)
}
})
}
)
}
private fun startSample() {
@@ -351,7 +351,8 @@ class HemoCubeFragment : Fragment() {
override fun onUsbError(e: Exception?) {
hemoCubeViewModel.progressBar.postValue(false)
}
})
}
)
}
private fun getResult() {
@@ -363,7 +364,8 @@ class HemoCubeFragment : Fragment() {
override fun onUsbError(e: Exception?) {
hemoCubeViewModel.progressBar.postValue(false)
}
})
}
)
}
private fun calculateRatio(ratio: Double): Double {