Merge branch 'Homocube' of https://gitlab.com/sminnovations/hpos into Homocube
This commit is contained in:
@@ -47,5 +47,6 @@ object Constants {
|
|||||||
|
|
||||||
const val KIT_NUMBER = "KitNumber"
|
const val KIT_NUMBER = "KitNumber"
|
||||||
const val KIT_COUNT = "KitCount"
|
const val KIT_COUNT = "KitCount"
|
||||||
const val BUFFER_VALUE = "BufferValue"
|
const val BUFFER_VALUE_1 = "BufferValue1"
|
||||||
|
const val BUFFER_VALUE_2 = "BufferValue2"
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,8 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
with(sharedPreference.edit()) {
|
with(sharedPreference.edit()) {
|
||||||
putString(Constants.KIT_NUMBER, "")
|
putString(Constants.KIT_NUMBER, "")
|
||||||
putInt(Constants.KIT_COUNT, 0)
|
putInt(Constants.KIT_COUNT, 0)
|
||||||
putInt(Constants.BUFFER_VALUE, 0)
|
putInt(Constants.BUFFER_VALUE_1, 0)
|
||||||
|
putInt(Constants.BUFFER_VALUE_2, 0)
|
||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ class HemoCubeFragment : Fragment() {
|
|||||||
|
|
||||||
hemoCubeViewModel.getDeviceData("DEVICE1")
|
hemoCubeViewModel.getDeviceData("DEVICE1")
|
||||||
|
|
||||||
|
// hemoCubeViewModel.getDeviceData(sharedPreference.getString(Constants.USER_ID, "").toString())
|
||||||
|
|
||||||
hemoCubeViewModel.deviceData.observe(viewLifecycleOwner) {
|
hemoCubeViewModel.deviceData.observe(viewLifecycleOwner) {
|
||||||
deviceData = it
|
deviceData = it
|
||||||
Toast.makeText(requireContext(), calculateRatio(0.17).toString(), Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), calculateRatio(0.17).toString(), Toast.LENGTH_SHORT).show()
|
||||||
@@ -133,7 +135,8 @@ class HemoCubeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun checkBufferValue(): Boolean {
|
private fun checkBufferValue(): Boolean {
|
||||||
return sharedPreference.getInt(Constants.BUFFER_VALUE, 0) > 0
|
return sharedPreference.getInt(Constants.BUFFER_VALUE_1, 0) > 0
|
||||||
|
|| sharedPreference.getInt(Constants.BUFFER_VALUE_2, 0) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupButtonClickListeners() {
|
private fun setupButtonClickListeners() {
|
||||||
@@ -402,6 +405,6 @@ class HemoCubeFragment : Fragment() {
|
|||||||
// val c2 = deviceData?.coefficients?.get(1)!!
|
// val c2 = deviceData?.coefficients?.get(1)!!
|
||||||
val c1 = deviceData?.coefficients?.get(0)!!
|
val c1 = deviceData?.coefficients?.get(0)!!
|
||||||
val c2 = deviceData?.coefficients?.get(1)!!
|
val c2 = deviceData?.coefficients?.get(1)!!
|
||||||
return c1 * ratio - c2
|
return c1 * ratio + c2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user