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