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