pending translation strings of hemocube fragment added
This commit is contained in:
@@ -230,7 +230,7 @@ class HemoCubeFragment : Fragment() {
|
||||
activity?.runOnUiThread {
|
||||
binding.btnPlacebuffer.visibility = View.GONE
|
||||
binding.btnSamplestart.visibility = View.VISIBLE
|
||||
binding.tvSubtitle4.text = "Place Sample"
|
||||
binding.tvSubtitle4.text = R.string.place_sample.toString()
|
||||
}
|
||||
isUsingExistingBuffer = true
|
||||
}
|
||||
@@ -307,37 +307,36 @@ class HemoCubeFragment : Fragment() {
|
||||
activity?.runOnUiThread {
|
||||
binding.btnPlacebuffer.visibility = View.VISIBLE
|
||||
}
|
||||
hemoCubeViewModel.messages.postValue("Start")
|
||||
hemoCubeViewModel.messages.postValue(R.string.start.toString())
|
||||
}
|
||||
|
||||
stringData.contains("#BS") -> {
|
||||
hemoCubeViewModel.messages.postValue("Buffer Started")
|
||||
hemoCubeViewModel.messages.postValue(R.string.buffer_started.toString())
|
||||
}
|
||||
|
||||
stringData.contains("#BC") -> {
|
||||
activity?.runOnUiThread {
|
||||
binding.tvSubtitle4.text = "Buffer Completed"
|
||||
binding.tvSubtitle4.text = R.string.buffer_completed.toString()
|
||||
binding.btnSamplestart.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
stringData.contains("#SS") -> {
|
||||
activity?.runOnUiThread {
|
||||
binding.tvSubtitle4.text = "Sample Started"
|
||||
binding.tvSubtitle4.text = R.string.sample_started.toString()
|
||||
binding.btnSamplestart.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
stringData.contains("#SC") -> {
|
||||
hemoCubeViewModel.messages.postValue("Sample Completed \nGathering data")
|
||||
hemoCubeViewModel.messages.postValue(R.string.sample_completed.toString() +"\n" + R.string.gathering_data.toString())
|
||||
fetchResult()
|
||||
testingTrace.stop()
|
||||
}
|
||||
|
||||
resultData.contains("REND") -> {
|
||||
hemoCubeViewModel.messages.postValue(
|
||||
"Data collected \n" +
|
||||
" Processing data"
|
||||
R.string.data_collected_processing_data.toString()
|
||||
)
|
||||
val resultLines = resultData.split("\\s+(?=LB|LS)".toRegex())
|
||||
var bufferIntensity = resultLines[1].split(' ')[1].trim()
|
||||
@@ -410,7 +409,7 @@ class HemoCubeFragment : Fragment() {
|
||||
|
||||
private fun processResult() {
|
||||
try {
|
||||
hemoCubeViewModel.messages.postValue("processing result")
|
||||
hemoCubeViewModel.messages.postValue(R.string.processing_result.toString())
|
||||
val deviceLog = resultData
|
||||
|
||||
val pInfo = requireActivity().packageManager.getPackageInfo(
|
||||
@@ -431,7 +430,7 @@ class HemoCubeFragment : Fragment() {
|
||||
) {
|
||||
validationError = true
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text = "Error: Invalid Test. Improper buffer reading (low)"
|
||||
binding.errorMessage.text = R.string.error_improper_buffer_low.toString()
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
@@ -444,7 +443,7 @@ class HemoCubeFragment : Fragment() {
|
||||
validationError = true
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text =
|
||||
"Error: Invalid Test. Improper buffer reading (high)"
|
||||
R.string.error_improper_buffer_high.toString()
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
binding.btnSubmit.isEnabled = true
|
||||
binding.btnSubmit.isClickable = true
|
||||
@@ -472,7 +471,7 @@ class HemoCubeFragment : Fragment() {
|
||||
if (fittedAbs1!! <= fittedAbs2!!) {
|
||||
validationError = true
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text = "Error: Invalid Test. Problem with de-oxygenation"
|
||||
binding.errorMessage.text = R.string.error_invalid_test.toString()
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
@@ -480,7 +479,7 @@ class HemoCubeFragment : Fragment() {
|
||||
if (fittedAbs1 < 0 || fittedAbs2 < 0 || fittedAbs3 < 0 || fittedAbs4 < 0) {
|
||||
validationError = true
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text = "Error: Negative Abs. Retake Blank Reading"
|
||||
binding.errorMessage.text = R.string.error_negative_abs.toString()
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
@@ -541,7 +540,7 @@ class HemoCubeFragment : Fragment() {
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(
|
||||
requireContext(),
|
||||
"Error while processing device data",
|
||||
R.string.error_processing_device_data,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
Firebase.crashlytics.recordException(e)
|
||||
@@ -553,28 +552,28 @@ class HemoCubeFragment : Fragment() {
|
||||
hemoCubeViewModel.messages.postValue("result classification")
|
||||
if (calculatedRatio != null) {
|
||||
if (calculatedRatio < 0.05)
|
||||
return "Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume"
|
||||
return R.string.error_repeat_test_higher_volume.toString()
|
||||
if (calculatedRatio in 0.05..0.155)
|
||||
return "Normal"
|
||||
return R.string.normal.toString()
|
||||
if (calculatedRatio in 0.155..0.175)
|
||||
return "Negative Borderline. Repeat Test"
|
||||
return R.string.negative_borderline.toString()
|
||||
if (calculatedRatio in 0.175..0.22)
|
||||
return "Sickle Cell Trait"
|
||||
return R.string.sickle_cell_trait.toString()
|
||||
if (calculatedRatio in 0.22..0.25)
|
||||
return "Positive for Sickle Cell. HPLC for Confirmation"
|
||||
return R.string.positive_for_sickle_cell.toString()
|
||||
if (calculatedRatio in 0.25..0.35)
|
||||
return "Sickle Cell Disease"
|
||||
return R.string.sickle_cell_disease.toString()
|
||||
if (calculatedRatio > 0.35)
|
||||
return "Inconclusive. Repeat with test with lower volume of blood"
|
||||
return R.string.error_repeat_test_lower_volume.toString()
|
||||
} else {
|
||||
return "INVALID"
|
||||
return R.string.invalid.toString()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
showToast(R.string.error_classification)
|
||||
Firebase.crashlytics.recordException(e)
|
||||
return "ERROR"
|
||||
return R.string.error.toString()
|
||||
}
|
||||
return "INVALID"
|
||||
return R.string.invalid.toString()
|
||||
}
|
||||
|
||||
private fun absorbanceBasedClassification(predictedDenovixRatio: Double?): String {
|
||||
@@ -582,24 +581,24 @@ class HemoCubeFragment : Fragment() {
|
||||
hemoCubeViewModel.messages.postValue("result classification")
|
||||
if (predictedDenovixRatio != null) {
|
||||
if (predictedDenovixRatio in 0.0..0.16)
|
||||
return "Normal"
|
||||
return R.string.normal.toString()
|
||||
if (predictedDenovixRatio in 0.16..0.165)
|
||||
return "Negative Borderline"
|
||||
return R.string.negative_borderline.toString()
|
||||
if (predictedDenovixRatio in 0.165..0.235)
|
||||
return "Sickle Cell Trait"
|
||||
return R.string.sickle_cell_trait.toString()
|
||||
if (predictedDenovixRatio in 0.235..0.24)
|
||||
return "Positive Borderline"
|
||||
return R.string.positive_borderline.toString()
|
||||
if (predictedDenovixRatio in 0.24..1.0)
|
||||
return "Sickle Cell Disease"
|
||||
return R.string.sickle_cell_disease.toString()
|
||||
} else {
|
||||
return "INVALID"
|
||||
return R.string.invalid.toString()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
showToast(R.string.error_classification)
|
||||
Firebase.crashlytics.recordException(e)
|
||||
return "ERROR"
|
||||
return R.string.error.toString()
|
||||
}
|
||||
return "INVALID"
|
||||
return R.string.invalid.toString()
|
||||
}
|
||||
|
||||
private fun showToast(messageResId: Int) {
|
||||
|
||||
Reference in New Issue
Block a user