1.baud rate is added,

2. existing buffer popup is added,
3. submit button make visible
4.handlevalidresult function changes, added code for fetch ledbuffer1 to ledbuffer4 values and sample1 to sample4 values
This commit is contained in:
Mariya
2023-11-06 18:18:07 +05:30
parent 36eb659e3a
commit 27949352dd
3 changed files with 27 additions and 18 deletions

View File

@@ -190,14 +190,14 @@ class UserListAdapter(
// }
}
userCard.setOnClickListener {
// if (batLevel < 40) {
// Toast.makeText(
// view.context,
// "Battery level is low than 40%, please charge the device to continue testing",
// Toast.LENGTH_SHORT
// ).show()
// return@setOnClickListener
// }
if (batLevel < 40) {
Toast.makeText(
view.context,
"Battery level is low than 40%, please charge the device to continue testing",
Toast.LENGTH_SHORT
).show()
return@setOnClickListener
}
if (model.testStatus != null) {
if (model.testStatus!!) {
Toast.makeText(

View File

@@ -137,10 +137,10 @@ class HomeFragment : Fragment() {
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
val currentDate = Date()
val formattedDate = dateFormat.format(currentDate)
// val query = Firebase.firestore.collection("patientData")
// .whereGreaterThanOrEqualTo("createdAt", formattedDate)
// .orderBy("createdAt", Query.Direction.DESCENDING)
val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false)
val query = Firebase.firestore.collection("patientData")
.whereGreaterThanOrEqualTo("createdAt", formattedDate)
.orderBy("createdAt", Query.Direction.DESCENDING)
// val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false)
query.get().addOnSuccessListener {
if (it.documents.isEmpty()) {
binding.pendingTest.visibility = View.VISIBLE

View File

@@ -92,19 +92,22 @@ class HemoCubeFragment : Fragment() {
binding.tvSubtitle4.visibility = View.VISIBLE
binding.tvSubtitle4.text = "Place Sample"
}
if(binding.tvSubtitle4.text.toString().contains("Place Sample") ){
startSampleProcess()
it.visibility = View.GONE
}
}
binding.btnPlacebuffer.setOnClickListener {
activity?.runOnUiThread {
binding.tvSubtitle4.visibility = View.VISIBLE
binding.tvSubtitle4.text = "Place Buffer"
}
if (isBufferValueAvailable()){
showBufferAlertDialog()
}else{
activity?.runOnUiThread {
binding.tvSubtitle4.visibility = View.VISIBLE
binding.tvSubtitle4.text = "Place Buffer"
}
checkAndStartProcess()
it.visibility = View.GONE
}
}
@@ -261,6 +264,7 @@ class HemoCubeFragment : Fragment() {
}
}
stringData.contains("#SC") -> {
binding.btnSubmit.visibility = View.VISIBLE
fetchResult()
testingTrace.stop()
}
@@ -382,6 +386,7 @@ class HemoCubeFragment : Fragment() {
val led1Average = log10(led1BufferForDevice?.div(led1Sample!!) ?: 0.0)
val led2Average = log10(led2BufferForDevice?.div(led2Sample!!) ?: 0.0)
val led3Average = log10(led3BufferForDevice?.div(led3Sample!!) ?: 0.0)
val deviceRatio = led1Average / led2Average
// if (led1BufferForDevice!! > 20000 && led1BufferForDevice < 24000 && led2BufferForDevice!! > 20000 && led2BufferForDevice < 24000) {
// if (led1Sample!! < led1BufferForDevice && led1Sample < 24000 && led2Sample!! < led2BufferForDevice && led2Sample < 24000) {
@@ -404,9 +409,13 @@ class HemoCubeFragment : Fragment() {
// deviceId = deviceSerialNo
led1Buffer = led1BufferForDevice
led2Buffer = led2BufferForDevice
led3Buffer = led3BufferForDevice
led4Buffer = led4BufferForDevice
appVersion = version
this.led1Sample = led1Sample
this.led2Sample = led2Sample
this.led3Sample = led3Sample
this.led4Sample = led4Sample
this.led1Average = led1Average
this.led2Average = led2Average
this.deviceRatio = deviceRatio