Added L command testing in HemoCubeFragment

This commit is contained in:
chandrashekhar reddy
2024-03-11 13:34:00 +05:30
parent d8cb0bd96e
commit 8ba574aeac
2 changed files with 10 additions and 4 deletions

View File

@@ -65,12 +65,14 @@
<activity
android:name="com.example.hpostesting.presentation.assurance.AssuranceControlsActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/Theme.HPOS.NoActionBar"/>
<activity
android:name="com.example.hpostesting.presentation.hemocube.HemocubeActivity"
android:exported="false"
android:noHistory="true"
android:screenOrientation="portrait"
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
android:theme="@style/Theme.HPOS.NoActionBar"
android:windowSoftInputMode="adjustPan" />

View File

@@ -125,10 +125,8 @@ class HemoCubeFragment : Fragment() {
it.visibility = View.GONE
}
binding.btnRetryCheckCuvette.setOnClickListener {
checkCuvettePresence()
activity?.runOnUiThread {
binding.btnRetryCheckCuvette.visibility = View.GONE
}
}
binding.btnPlacebuffer.setOnClickListener {
if (isBufferValueAvailable() || !Constants.BLANK_EVERY_TEST) {
@@ -432,7 +430,7 @@ class HemoCubeFragment : Fragment() {
this.testStatusCode = TestStatus.CUVETTE_PRESENT.code
showStartBufferButton()
}
resultData.contains("#AIN") && this.testStatusCode < TestStatus.CUVETTE_ABSENT.code -> {
resultData.contains("#AIN") && this.testStatusCode <= TestStatus.CUVETTE_ABSENT.code -> {
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_absent))
this.testStatusCode = TestStatus.CUVETTE_ABSENT.code
showRetryButtonForCuvette()
@@ -708,6 +706,8 @@ class HemoCubeFragment : Fragment() {
fun showStartBufferButton() {
activity?.runOnUiThread {
binding.btnRetryCheckCuvette.visibility = View.GONE
binding.btnPlacebuffer.visibility = View.VISIBLE
}
hemoCubeViewModel.messages.postValue(getString(R.string.start))
@@ -1161,6 +1161,10 @@ class HemoCubeFragment : Fragment() {
}
private fun checkCuvettePresence() {
activity?.runOnUiThread {
binding.btnRetryCheckCuvette.visibility = View.GONE
}
hemoCubeViewModel.progressBar.postValue(true)
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.CHECK_CUVETTE_COMMAND,