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 <activity
android:name="com.example.hpostesting.presentation.assurance.AssuranceControlsActivity" android:name="com.example.hpostesting.presentation.assurance.AssuranceControlsActivity"
android:exported="false" android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/Theme.HPOS.NoActionBar"/> android:theme="@style/Theme.HPOS.NoActionBar"/>
<activity <activity
android:name="com.example.hpostesting.presentation.hemocube.HemocubeActivity" android:name="com.example.hpostesting.presentation.hemocube.HemocubeActivity"
android:exported="false" android:exported="false"
android:noHistory="true" android:noHistory="true"
android:screenOrientation="portrait"
android:parentActivityName="com.example.hpostesting.presentation.MainActivity" android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
android:theme="@style/Theme.HPOS.NoActionBar" android:theme="@style/Theme.HPOS.NoActionBar"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />

View File

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