fix state atutomation

This commit is contained in:
Pritimay Sarkar
2024-02-16 14:50:39 +05:30
parent 6e46c31bfc
commit d502e88da4
2 changed files with 11 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ enum class TestStatus(val code: Double) {
FIRST_EMPTY_AIR_READING_PRINT_COMPLETED(4.4),
EPROM_ADC_RETRIEVAL_STARTED(4.5),
EPROM_ADC_RETRIEVAL_COMPLETED(4.6),
BUFFER_STARTED(4.0),
BUFFER_STARTED(4.7),
BUFFER_COMPLETED(5.0),
BUFFER_PRINT_STARTED(6.0),
BUFFER_PRINT_COMPLETED(7.0),

View File

@@ -501,6 +501,7 @@ class HemoCubeFragment : Fragment() {
resultData.contains("REND") && this.testStatusCode < TestStatus.SAMPLE_PRINT_COMPLETED.code -> {
handleSampleCompleted()
handleSampleCompleted()
}
currentResultData.contains("REND")
@@ -599,6 +600,7 @@ class HemoCubeFragment : Fragment() {
fun finishReading() {
repeatReadingCount += 1
isTestOngoing = false
if (readingsPerSample == 1) {
activity?.runOnUiThread {
@@ -699,10 +701,10 @@ class HemoCubeFragment : Fragment() {
if (!hardwareId.isNullOrBlank()) {
updateDeviceId(hardwareId)
activity?.runOnUiThread {
binding.btnPlacebuffer.visibility = View.VISIBLE
}
hemoCubeViewModel.messages.postValue(getString(R.string.start))
// activity?.runOnUiThread {
// binding.btnPlacebuffer.visibility = View.VISIBLE
// }
// hemoCubeViewModel.messages.postValue(getString(R.string.start))
} else {
hemoCubeViewModel.messages.postValue("Config error")
}
@@ -719,10 +721,10 @@ class HemoCubeFragment : Fragment() {
fun assignDefaultDevice(configData: String) {
deviceHardwareId = "HCV-000-3001"
testStatusCode = TestStatus.CONFIG_COMPLETED.code
activity?.runOnUiThread {
binding.btnPlacebuffer.visibility = View.VISIBLE
}
hemoCubeViewModel.messages.postValue(getString(R.string.start))
// activity?.runOnUiThread {
// binding.btnPlacebuffer.visibility = View.VISIBLE
// }
// hemoCubeViewModel.messages.postValue(getString(R.string.start))
}
fun extractV2HardwareId(input: String): String? {