add device ids
This commit is contained in:
@@ -170,6 +170,57 @@ object Constants {
|
|||||||
"HPP1-0124-0048",
|
"HPP1-0124-0048",
|
||||||
"HPP1-0124-0049",
|
"HPP1-0124-0049",
|
||||||
"HPP1-0124-0050",
|
"HPP1-0124-0050",
|
||||||
|
"HCV-001-0001",
|
||||||
|
"HCV-001-0002",
|
||||||
|
"HCV-001-0003",
|
||||||
|
"HCV-001-0004",
|
||||||
|
"HCV-001-0005",
|
||||||
|
"HCV-001-0006",
|
||||||
|
"HCV-001-0007",
|
||||||
|
"HCV-001-0008",
|
||||||
|
"HCV-001-0009",
|
||||||
|
"HCV-001-0010",
|
||||||
|
"HCV-001-0011",
|
||||||
|
"HCV-001-0012",
|
||||||
|
"HCV-001-0013",
|
||||||
|
"HCV-001-0014",
|
||||||
|
"HCV-001-0015",
|
||||||
|
"HCV-001-0016",
|
||||||
|
"HCV-001-0017",
|
||||||
|
"HCV-001-0018",
|
||||||
|
"HCV-001-0019",
|
||||||
|
"HCV-001-0020",
|
||||||
|
"HCV-001-0021",
|
||||||
|
"HCV-001-0022",
|
||||||
|
"HCV-001-0023",
|
||||||
|
"HCV-001-0024",
|
||||||
|
"HCV-001-0025",
|
||||||
|
"HCV-001-0026",
|
||||||
|
"HCV-001-0027",
|
||||||
|
"HCV-001-0028",
|
||||||
|
"HCV-001-0029",
|
||||||
|
"HCV-001-0030",
|
||||||
|
"HCV-001-0031",
|
||||||
|
"HCV-001-0032",
|
||||||
|
"HCV-001-0033",
|
||||||
|
"HCV-001-0034",
|
||||||
|
"HCV-001-0003",
|
||||||
|
"HCV-001-0035",
|
||||||
|
"HCV-001-0036",
|
||||||
|
"HCV-001-0037",
|
||||||
|
"HCV-001-0038",
|
||||||
|
"HCV-001-0039",
|
||||||
|
"HCV-001-0040",
|
||||||
|
"HCV-001-0041",
|
||||||
|
"HCV-001-0042",
|
||||||
|
"HCV-001-0043",
|
||||||
|
"HCV-001-0044",
|
||||||
|
"HCV-001-0045",
|
||||||
|
"HCV-001-0046",
|
||||||
|
"HCV-001-0047",
|
||||||
|
"HCV-001-0048",
|
||||||
|
"HCV-001-0049",
|
||||||
|
"HCV-001-0050",
|
||||||
)
|
)
|
||||||
|
|
||||||
const val password = "SMI@12345"
|
const val password = "SMI@12345"
|
||||||
|
|||||||
@@ -139,12 +139,14 @@ class HomeFragment : Fragment() {
|
|||||||
loadUserData()
|
loadUserData()
|
||||||
setSearch()
|
setSearch()
|
||||||
checkForLocalDBData()
|
checkForLocalDBData()
|
||||||
|
if (Constants.MOLBIO_INTEGRATION) {
|
||||||
checkForTokenAndUpdate()
|
checkForTokenAndUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
||||||
val resultList = MolbioV2ResultRequest(mutableListOf(MolbioV2Result()))
|
val resultList = MolbioV2ResultRequest(mutableListOf(MolbioV2Result()))
|
||||||
userDataList.forEach { userData ->
|
userDataList.forEach { userData ->
|
||||||
if (!userData.molbioFlag && isTokenAvailable) {
|
if (!userData.molbioFlag && isTokenAvailable && Constants.MOLBIO_INTEGRATION) {
|
||||||
resultList.results?.add(
|
resultList.results?.add(
|
||||||
MolbioV2Result(
|
MolbioV2Result(
|
||||||
rawData = userData,
|
rawData = userData,
|
||||||
@@ -160,7 +162,7 @@ class HomeFragment : Fragment() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (!userData.molbioFlag && isTokenAvailable) {
|
if (!userData.molbioFlag && isTokenAvailable && Constants.MOLBIO_INTEGRATION) {
|
||||||
userData.molbioFlag = true
|
userData.molbioFlag = true
|
||||||
hemoCubeViewModel.uploadResult(resultList)
|
hemoCubeViewModel.uploadResult(resultList)
|
||||||
}
|
}
|
||||||
@@ -846,7 +848,7 @@ class HomeFragment : Fragment() {
|
|||||||
userData.localFlag = true
|
userData.localFlag = true
|
||||||
hemoCubeViewModel.bulkAddResultTestToDb(userData)
|
hemoCubeViewModel.bulkAddResultTestToDb(userData)
|
||||||
}
|
}
|
||||||
if (!userData.molbioFlag && isTokenAvailable) {
|
if (!userData.molbioFlag && isTokenAvailable && Constants.MOLBIO_INTEGRATION) {
|
||||||
userData.molbioFlag = true
|
userData.molbioFlag = true
|
||||||
hemoCubeViewModel.uploadResult(resultList)
|
hemoCubeViewModel.uploadResult(resultList)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,16 +50,19 @@ class DeviceProvisionFragment : Fragment() {
|
|||||||
listenToHemoCube()
|
listenToHemoCube()
|
||||||
getDeviceId()
|
getDeviceId()
|
||||||
binding.btnSubmit.setOnClickListener {
|
binding.btnSubmit.setOnClickListener {
|
||||||
|
if (Constants.MOLBIO_INTEGRATION) {
|
||||||
viewModel.deviceProvision(
|
viewModel.deviceProvision(
|
||||||
DeviceProvisionRequest(
|
DeviceProvisionRequest(
|
||||||
email = Constants.deviceProvisionEmail,
|
email = Constants.deviceProvisionEmail,
|
||||||
password = Constants.deviceProvisionPassword,
|
password = Constants.deviceProvisionPassword,
|
||||||
serialNumber = sharedPreferences.getString(Constants.DEVICE_ID, "").toString(),
|
serialNumber = sharedPreferences.getString(Constants.DEVICE_ID, "")
|
||||||
|
.toString(),
|
||||||
uid = sharedPreferences.getString(Constants.DEVICE_ID, "").toString()
|
uid = sharedPreferences.getString(Constants.DEVICE_ID, "").toString()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun observeViewModel() {
|
private fun observeViewModel() {
|
||||||
|
|||||||
@@ -319,6 +319,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
||||||
fireBaseUpload.postValue("Success")
|
fireBaseUpload.postValue("Success")
|
||||||
testDetails.localFlag = true
|
testDetails.localFlag = true
|
||||||
|
if (Constants.MOLBIO_INTEGRATION) {
|
||||||
uploadResult(
|
uploadResult(
|
||||||
MolbioV2ResultRequest(
|
MolbioV2ResultRequest(
|
||||||
mutableListOf(
|
mutableListOf(
|
||||||
@@ -337,6 +338,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
hemoCubeDao.insertAll(testDetails)
|
hemoCubeDao.insertAll(testDetails)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
40
app/src/main/res/layout/activity_blank.xml
Normal file
40
app/src/main/res/layout/activity_blank.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!-- <androidx.appcompat.widget.Toolbar-->
|
||||||
|
<!-- android:id="@+id/my_toolbar"-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="?attr/actionBarSize"-->
|
||||||
|
<!-- android:background="?attr/colorPrimary"-->
|
||||||
|
<!-- app:titleTextColor="#FFFFFF"-->
|
||||||
|
<!-- android:elevation="4dp"-->
|
||||||
|
<!-- app:menu="@menu/my_menu"-->
|
||||||
|
<!-- android:theme="@style/ToolbarTheme"-->
|
||||||
|
<!-- app:popupTheme="@style/ThemeOverlay.AppCompat.Light"-->
|
||||||
|
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||||
|
<!-- app:layout_constraintTop_toTopOf="parent"/>-->
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fg_auto_dac"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
tools:context=".presentation.autodac.AutoDacActivity">
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
128
app/src/main/res/layout/fragment_blank.xml
Normal file
128
app/src/main/res/layout/fragment_blank.xml
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="com.example.hpostesting.presentation.autodac.AutoDacFragment">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:id="@+id/tv_title"-->
|
||||||
|
<!-- style="@style/title1"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_marginHorizontal="24dp"-->
|
||||||
|
<!-- android:text="@string/diagnostics"-->
|
||||||
|
<!-- android:layout_marginTop="16dp"-->
|
||||||
|
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||||
|
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_subtitle2"
|
||||||
|
style="@style/title2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="@string/auto_dac"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_subtitle3"
|
||||||
|
style="@style/title2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_subtitle4"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="380dp"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Start"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="11sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_subtitle3" />
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_submit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Start Auto DAC"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_read_dac"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Read Current DAC Values"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||||
|
|
||||||
|
<!-- <Button-->
|
||||||
|
<!-- android:id="@+id/btn_read"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:text="@string/read"-->
|
||||||
|
<!-- android:layout_margin="16dp"-->
|
||||||
|
<!-- android:clickable="false"-->
|
||||||
|
<!-- app:layout_constraintTop_toBottomOf="@id/btn_set_reference"-->
|
||||||
|
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||||
|
|
||||||
|
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_check"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:src="@drawable/check"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:elevation="12dp"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:indeterminateDrawable="@drawable/progressbar_drawable"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Reference in New Issue
Block a user