changes made for v0 and V1 version
This commit is contained in:
@@ -38,6 +38,7 @@ object Constants {
|
||||
const val DEVICE_TYPE_HEMOCUBE = "HEMOCUBE"
|
||||
const val DEVICE_TYPE_TEST_RIGHT = "TEST_RIGHT"
|
||||
const val DEVICE_TYPE_TRUEHEME = "TRUEHEME"
|
||||
const val DEVICE_VERSION_TYPE = "V0"
|
||||
|
||||
const val DEVICE_VENDOR_ID = 1027
|
||||
const val HOMO_CUBE_ID = 29987
|
||||
|
||||
@@ -168,23 +168,33 @@ class AssuranceControlsFragment : Fragment() {
|
||||
binding.btnSubmit.setOnClickListener {
|
||||
val selectedSolution = binding.spinnerSolutions.selectedItem.toString()
|
||||
val selectedConcentration = binding.spinnerConcentration.selectedItem.toString()
|
||||
val selectedadminOption = binding.spinnerAdmin.selectedItem.toString()
|
||||
|
||||
// Check if any of the selections are default values
|
||||
// if (selectedSolution == "Select solution") {
|
||||
// Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
|
||||
// return@setOnClickListener // Prevent further execution
|
||||
// }
|
||||
//
|
||||
// if (selectedConcentration == "Select concentration") {
|
||||
// Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
|
||||
// return@setOnClickListener // Prevent further execution
|
||||
// }
|
||||
|
||||
if (selectedadminOption == "Select options") {
|
||||
Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
|
||||
// Check if any of the selections are default values
|
||||
if (selectedSolution == "Select solution") {
|
||||
Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
|
||||
return@setOnClickListener // Prevent further execution
|
||||
}
|
||||
|
||||
if (selectedConcentration == "Select concentration") {
|
||||
Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
|
||||
return@setOnClickListener // Prevent further execution
|
||||
}
|
||||
//for vizagh
|
||||
// val selectedadminOption = binding.spinnerAdmin.selectedItem.toString()
|
||||
// if (selectedadminOption == "Select options") {
|
||||
// Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
|
||||
// return@setOnClickListener // Prevent further execution
|
||||
// }
|
||||
// DataHolder.hemoCubeTestData!!.filter = binding.spinnerAdmin.selectedItem.toString()
|
||||
// if(binding.spinnerAdmin.selectedItem.toString().equals("Select options")){
|
||||
// Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
|
||||
// }else {
|
||||
// DataHolder.hemoCubeTestData!!.name = DataHolder.hemoCubeTestData!!.filter.toString()
|
||||
// }
|
||||
|
||||
|
||||
|
||||
DataHolder.hemoCubeTestData!!.quickCapture = true
|
||||
val currentUnixTime = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
Instant.now().epochSecond
|
||||
@@ -194,18 +204,14 @@ class AssuranceControlsFragment : Fragment() {
|
||||
DataHolder.hemoCubeTestData!!._id = currentUnixTime.toString() + "SMI"
|
||||
DataHolder.hemoCubeTestData!!.solution = binding.spinnerSolutions.selectedItem.toString()
|
||||
DataHolder.hemoCubeTestData!!.concentration = binding.spinnerConcentration.selectedItem.toString()
|
||||
DataHolder.hemoCubeTestData!!.filter = binding.spinnerAdmin.selectedItem.toString()
|
||||
if(binding.spinnerAdmin.selectedItem.toString().equals("Select options")){
|
||||
Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
|
||||
}else {
|
||||
DataHolder.hemoCubeTestData!!.name = DataHolder.hemoCubeTestData!!.filter.toString()
|
||||
}
|
||||
|
||||
|
||||
|
||||
DataHolder.selectedTest = UserData()
|
||||
DataHolder.selectedTest?._id = DataHolder.hemoCubeTestData!!._id
|
||||
DataHolder.selectedTest?.name = DataHolder.hemoCubeTestData!!.name
|
||||
DataHolder.selectedTest?.name = binding.spinnerSolutions.selectedItem.toString() + " " +binding.spinnerConcentration.selectedItem.toString()
|
||||
|
||||
|
||||
with(sharedPreferences.edit()) {
|
||||
putString(Constants.QUICK_CAPTURE_SOLUTION, DataHolder.hemoCubeTestData!!.solution)
|
||||
|
||||
@@ -38,6 +38,7 @@ import kotlin.math.log10
|
||||
class HemoCubeFragment : Fragment() {
|
||||
private var checkCuvette = false
|
||||
private var checkCuvetteSam = false
|
||||
private var borderlineMetric = 0.0
|
||||
private var sampleClick = false
|
||||
private lateinit var binding: FragmentHemoCubeReferenceBinding
|
||||
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
||||
@@ -135,23 +136,23 @@ class HemoCubeFragment : Fragment() {
|
||||
|
||||
binding.btnSamplestart.setOnClickListener {
|
||||
sampleClick = true
|
||||
if(checkCuvetteSam){
|
||||
// if(checkCuvetteSam){
|
||||
activity?.runOnUiThread {
|
||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
||||
// binding.tvSubtitle4.text = "Sample Started"
|
||||
}
|
||||
startSampleProcess()
|
||||
// it.visibility = View.GONE
|
||||
}else{
|
||||
checkCuvettePresence()
|
||||
}
|
||||
// }else{
|
||||
// checkCuvettePresence()
|
||||
// }
|
||||
}
|
||||
binding.btnRetryCheckCuvette.setOnClickListener {
|
||||
|
||||
checkCuvettePresence()
|
||||
}
|
||||
binding.btnPlacebuffer.setOnClickListener {
|
||||
if(checkCuvette){
|
||||
// if(checkCuvette){
|
||||
|
||||
startBufferProcess()
|
||||
// if (isBufferValueAvailable() || !Constants.BLANK_EVERY_TEST) {
|
||||
@@ -166,9 +167,9 @@ class HemoCubeFragment : Fragment() {
|
||||
|
||||
// it.visibility = View.GONE
|
||||
// }
|
||||
}else{
|
||||
checkCuvettePresence()
|
||||
}
|
||||
// }else{
|
||||
// checkCuvettePresence()
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -869,12 +870,16 @@ class HemoCubeFragment : Fragment() {
|
||||
val led3Average = log10(led3BufferForDevice.div(led3SampleForDevice))
|
||||
val led4Average = log10(led4BufferForDevice.div(led4SampleForDevice))
|
||||
//used for latest trueheme and v1
|
||||
// val deviceRatio = led2Average / led1Average
|
||||
// val borderlineMetric = (led1Average - led2Average) / deviceRatio
|
||||
//used for latest v0 devices
|
||||
val deviceRatio = led4Average / led1Average
|
||||
val borderlineMetric = (led1Average - led4Average) / deviceRatio
|
||||
val deviceRatio: Double
|
||||
if(Constants.DEVICE_VERSION_TYPE == "V0"){
|
||||
//used for latest v0 devices
|
||||
deviceRatio = led4Average / led1Average
|
||||
borderlineMetric = (led1Average - led4Average) / deviceRatio
|
||||
|
||||
}else {
|
||||
deviceRatio = led2Average / led1Average
|
||||
borderlineMetric = (led1Average - led2Average) / deviceRatio
|
||||
}
|
||||
if (led1BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(0)
|
||||
?.get(0)!!
|
||||
|| led2BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/spinner_solutions"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/spinner_border"
|
||||
@@ -51,7 +51,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/spinner_concentration"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="48dp"
|
||||
android:background="@drawable/spinner_border"
|
||||
@@ -65,7 +65,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/spinner_admin"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="52dp"
|
||||
android:background="@drawable/spinner_border"
|
||||
|
||||
Reference in New Issue
Block a user