Compare commits
1 Commits
Bufferchec
...
samplebuff
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5966af95eb |
@@ -99,7 +99,8 @@ class HomeFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
private fun loadUserData() {
|
||||
val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false).orderBy("createdAt", Query.Direction.DESCENDING)
|
||||
// val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false).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
|
||||
|
||||
@@ -59,7 +59,7 @@ class HemoCubeFragment : Fragment() {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initViews()
|
||||
observeViewModel()
|
||||
checkAndStartProcess()
|
||||
// checkAndStartProcess()
|
||||
}
|
||||
|
||||
private fun initViews() {
|
||||
@@ -81,6 +81,19 @@ class HemoCubeFragment : Fragment() {
|
||||
binding.btnSubmit.isClickable = false
|
||||
|
||||
|
||||
binding.btnSamplestart.setOnClickListener {
|
||||
startSampleProcess()
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.btnPlacebuffer.setOnClickListener {
|
||||
checkAndStartProcess()
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
binding.btnKit.setOnClickListener {
|
||||
if (isTestOngoing) {
|
||||
val title = "WARNING"
|
||||
@@ -197,12 +210,12 @@ class HemoCubeFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun checkAndStartProcess() {
|
||||
if (isBufferValueAvailable()) {
|
||||
showBufferAlertDialog()
|
||||
} else {
|
||||
// if (isBufferValueAvailable()) {
|
||||
// showBufferAlertDialog()
|
||||
// } else {
|
||||
listenToHemoCube()
|
||||
startBufferProcess()
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
private fun isBufferValueAvailable(): Boolean {
|
||||
@@ -282,9 +295,18 @@ class HemoCubeFragment : Fragment() {
|
||||
resultData += fullReadOutput.toString()
|
||||
|
||||
when {
|
||||
stringData.contains("ERROR 500") -> showError500Dialog()
|
||||
stringData.contains("ERROR 500") ->
|
||||
// showError500Dialog()
|
||||
checkAndStartProcess()
|
||||
stringData.contains("ERROR 501") -> showError501Dialog()
|
||||
stringData.contains("#Buffer Completed") -> showStartSampleDialog()
|
||||
stringData.contains("#Buffer Completed") ->
|
||||
// showStartSampleDialog()
|
||||
activity?.runOnUiThread {
|
||||
binding.btnSamplestart.visibility = View.VISIBLE
|
||||
binding.btnSamplestart.isClickable = true
|
||||
}
|
||||
|
||||
|
||||
stringData.contains("#Sample Completed") -> {
|
||||
activity?.runOnUiThread {
|
||||
binding.btnSubmit.isEnabled = true
|
||||
|
||||
@@ -61,34 +61,34 @@
|
||||
|
||||
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- android:id="@+id/btn_samplestart"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginHorizontal="16dp"-->
|
||||
<!-- android:layout_marginTop="24dp"-->
|
||||
<!-- android:clickable="false"-->
|
||||
<!-- android:text="@string/Start_Sample"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/til_blood_group" />-->
|
||||
<Button
|
||||
android:visibility="gone"
|
||||
android:id="@+id/btn_samplestart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/Start_Sample"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/til_blood_group" />
|
||||
|
||||
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/btn_placebuffer"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginHorizontal="16dp"-->
|
||||
<!-- android:layout_marginTop="24dp"-->
|
||||
<!-- android:clickable="false"-->
|
||||
<!-- android:text="@string/place_buffer"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/btn_submit" />-->
|
||||
<Button
|
||||
android:id="@+id/btn_placebuffer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/place_buffer"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user