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 { userCard.setOnClickListener {
// if (batLevel < 40) { if (batLevel < 40) {
// Toast.makeText( Toast.makeText(
// view.context, view.context,
// "Battery level is low than 40%, please charge the device to continue testing", "Battery level is low than 40%, please charge the device to continue testing",
// Toast.LENGTH_SHORT Toast.LENGTH_SHORT
// ).show() ).show()
// return@setOnClickListener return@setOnClickListener
// } }
if (model.testStatus != null) { if (model.testStatus != null) {
if (model.testStatus!!) { if (model.testStatus!!) {
Toast.makeText( Toast.makeText(

View File

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

View File

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