changes made for dropdownlist for pq , for iocl 122 version added, for E command , RS AND RC changed to ES and EC

This commit is contained in:
Mariya
2024-03-20 17:46:07 +05:30
parent a9c2a4c365
commit 688165eaad
4 changed files with 53 additions and 25 deletions

View File

@@ -16,11 +16,11 @@ android {
// dev -> development, quality -> qc, uat -> User Acceptance Testing, preprod -> preproduction, prod -> production, iocl -> iocl-iisc production
defaultConfig {
applicationId "in.sminnovations.hpostesting.dev"
applicationId "in.sminnovations.hpostesting.iocl"
minSdk 21
targetSdk 34
versionCode 121
versionName "2.1.121"
versionCode 122
versionName "2.1.122"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@@ -26,6 +26,7 @@ import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.Spinner
import android.widget.Toast
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import com.example.hpostesting.data.constant.DataHolder
import com.example.hpostesting.data.constant.Constants
@@ -58,7 +59,7 @@ class AssuranceControlsFragment : Fragment() {
private fun initViews() {
// binding.btnSubmit.visibility = View.GONE
val solutionSpinner: Spinner = binding.spinnerSolutions
val solutionOptions = arrayOf("Select solution", "Tartrazine", "Acid Red")
val solutionOptions = arrayOf("Select solution", "Tartrazine", "Acid Red","Sickle-Cert-Buffer", "1 Abs Holo Filter", "0.25 Abs Holo Filter", "Air Blank")
val solutionAdapter =
ArrayAdapter(requireContext(), R.layout.simple_spinner_item, solutionOptions)
solutionAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
@@ -70,9 +71,27 @@ class AssuranceControlsFragment : Fragment() {
position: Int,
id: Long,
) {
val selectedValue: String = solutionOptions[position]
if (!selectedValue.equals("Select solution")) {
DataHolder.hemoCubeTestData!!.solution = selectedValue
val selectedSolution: String = solutionOptions[position]
if (selectedSolution != "Select solution") {
DataHolder.hemoCubeTestData!!.solution = selectedSolution
// Update visibility and name based on selected solution
if(selectedSolution == "Tartrazine" || selectedSolution == "Acid Red"){
activity?.runOnUiThread {
binding.spinnerConcentration.visibility = View.VISIBLE
// Ensure the name is updated only after concentration is selected.
// You might need to adjust this logic based on how and when you want to update the name.
// For now, it simply shows that the visibility is being handled.
}
} else {
activity?.runOnUiThread {
binding.spinnerConcentration.visibility = View.GONE
}
}
} else {
activity?.runOnUiThread {
binding.spinnerConcentration.visibility = View.GONE
}
}
}
@@ -184,17 +203,26 @@ class AssuranceControlsFragment : Fragment() {
val selectedadminOption = binding.spinnerAdmin.selectedItem.toString()
// Check if any of the selections are default values
// if (selectedSolution == "Select solution") {
// Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
// return@setOnClickListener // Prevent further execution
// }
//
// if (selectedConcentration == "Select concentration") {
// Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
// return@setOnClickListener // Prevent further execution
// }
if (selectedSolution == "Select solution") {
Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
return@setOnClickListener // Prevent further execution
}else{
DataHolder.hemoCubeTestData!!.name = selectedSolution
}
if (selectedadminOption == "Select options") {
if (selectedConcentration == "Select concentration" && binding.spinnerConcentration.isVisible) {
Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
return@setOnClickListener // Prevent further execution
}else if(binding.spinnerConcentration.isVisible){
DataHolder.hemoCubeTestData!!.name = "$selectedSolution $selectedConcentration"
}else{
DataHolder.hemoCubeTestData!!.name = selectedSolution
}
if (selectedadminOption == "Select options" && binding.spinnerAdmin.isVisible) {
Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
return@setOnClickListener // Prevent further execution
}
@@ -208,11 +236,11 @@ class AssuranceControlsFragment : Fragment() {
DataHolder.hemoCubeTestData!!.solution = binding.spinnerSolutions.selectedItem.toString()
DataHolder.hemoCubeTestData!!.concentration = binding.spinnerConcentration.selectedItem.toString()
DataHolder.hemoCubeTestData!!.filter = binding.spinnerAdmin.selectedItem.toString()
if(binding.spinnerAdmin.selectedItem.toString().equals("Select options")){
Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
}else {
DataHolder.hemoCubeTestData!!.name = DataHolder.hemoCubeTestData!!.filter.toString()
}
// if(binding.spinnerAdmin.selectedItem.toString().equals("Select options") && binding.spinnerAdmin.isVisible){
// Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
// }else {
// DataHolder.hemoCubeTestData!!.name = DataHolder.hemoCubeTestData!!.filter.toString()
// }

View File

@@ -463,7 +463,7 @@ class HemoCubeFragment : Fragment() {
fetchResult()
}
//#EC for v0 and v1 and #RC for v2
(resultData.contains("#RC") && this.testStatusCode < TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code) -> {
(resultData.contains("#EC") && this.testStatusCode < TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code) -> {
this.testStatusCode = TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code
hemoCubeViewModel.messages.postValue("EPROM ADC Loaded")
//checkCuvettePresence()

View File

@@ -52,7 +52,7 @@
<Spinner
android:id="@+id/spinner_solutions"
android:layout_width="0dp"
android:visibility="gone"
android:visibility="visible"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:background="@drawable/spinner_border"
@@ -78,7 +78,7 @@
<Spinner
android:id="@+id/spinner_admin"
android:layout_width="0dp"
android:visibility="visible"
android:visibility="gone"
android:layout_height="wrap_content"
android:layout_marginTop="52dp"
android:background="@drawable/spinner_border"