Compare commits
21 Commits
dev-molbio
...
dev-for-V0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b897e7c583 | ||
|
|
3ef27be203 | ||
|
|
718b26c92d | ||
|
|
c61ed451f9 | ||
|
|
91361c7964 | ||
|
|
007db1ca7d | ||
|
|
b8721b7f27 | ||
|
|
ab26d0228d | ||
|
|
d2f9c3c3a7 | ||
|
|
d012b9edda | ||
|
|
721ac5d53c | ||
|
|
75acfc34bd | ||
|
|
d365bbcfe0 | ||
|
|
31ed1edd0b | ||
|
|
d62fafb129 | ||
|
|
2fbad8968e | ||
|
|
ecd7f20b08 | ||
|
|
8ba574aeac | ||
|
|
d8cb0bd96e | ||
|
|
75c6269e4a | ||
|
|
1e4f801774 |
@@ -19,8 +19,8 @@ android {
|
|||||||
applicationId "in.sminnovations.hpostesting.dev"
|
applicationId "in.sminnovations.hpostesting.dev"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 120
|
versionCode 121
|
||||||
versionName "2.1.120"
|
versionName "2.1.121"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ dependencies {
|
|||||||
|
|
||||||
// Barcode scanner
|
// Barcode scanner
|
||||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'com.github.yuriy-budiyev:code-scanner:2.3.0'
|
||||||
// Google ML Kit using play services
|
// Google ML Kit using play services
|
||||||
implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
|
implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,15 @@
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.BATTERY_STATS"
|
android:name="android.permission.BATTERY_STATS"
|
||||||
tools:ignore="ProtectedPermissions" />
|
tools:ignore="ProtectedPermissions" />
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.camera" />
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.camera"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
@@ -25,16 +26,19 @@
|
|||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="com.example.hpostesting.HPOSTestingApplication"
|
android:name="com.example.hpostesting.HPOSTestingApplication"
|
||||||
android:largeHeap="true"
|
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@mipmap/hpos_icon"
|
android:icon="@mipmap/hpos_icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
android:largeHeap="true"
|
||||||
android:roundIcon="@mipmap/hpos_icon_round"
|
android:roundIcon="@mipmap/hpos_icon_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.HPOSTesting"
|
android:theme="@style/Theme.HPOSTesting"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name="com.example.hpostesting.presentation.ScannerKitActvity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.deviceinfo.DeviceActivity"
|
android:name="com.example.hpostesting.presentation.deviceinfo.DeviceActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
@@ -60,21 +64,20 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.calibration.CalibrationActivity"
|
android:name="com.example.hpostesting.presentation.calibration.CalibrationActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"/>
|
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||||
|
|
||||||
<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:theme="@style/Theme.HPOS.NoActionBar"/>
|
android:screenOrientation="portrait"
|
||||||
|
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:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.trueheme.TrueHemeActivity"
|
android:name="com.example.hpostesting.presentation.trueheme.TrueHemeActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
@@ -82,7 +85,6 @@
|
|||||||
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" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.buffercheck.HemocubeBufferCheckActivity"
|
android:name="com.example.hpostesting.presentation.buffercheck.HemocubeBufferCheckActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
@@ -92,29 +94,31 @@
|
|||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.KitScanActivity"
|
android:name="com.example.hpostesting.presentation.KitScanActivity"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
|
android:windowSoftInputMode="stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.dashboard.DashboardActivity"
|
android:name="com.example.hpostesting.presentation.dashboard.DashboardActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/title_activity_dashboard"
|
android:label="@string/title_activity_dashboard"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
tools:ignore="AppLinkUrlError,MissingClass">
|
tools:ignore="AppLinkUrlError,MissingClass">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
<data android:scheme="content" />
|
<data android:scheme="content" />
|
||||||
<data android:scheme="file" />
|
<data android:scheme="file" />
|
||||||
<data android:mimeType="application/vnd.android.package-archive" />
|
<data android:mimeType="application/vnd.android.package-archive" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.example.hpostesting.presentation.testRight.UsbService"
|
android:name="com.example.hpostesting.util.UsbService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|
||||||
@@ -124,8 +128,9 @@
|
|||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
@@ -148,6 +153,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.MainActivity"
|
android:name="com.example.hpostesting.presentation.MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
||||||
@@ -161,8 +167,7 @@
|
|||||||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:stateNotNeeded="true"
|
android:stateNotNeeded="true"
|
||||||
tools:replace="android:screenOrientation" />
|
tools:replace="android:screenOrientation" /> <!-- ${applicationId} -->
|
||||||
<!-- ${applicationId}-->
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="${applicationId}.fileprovider"
|
android:authorities="${applicationId}.fileprovider"
|
||||||
@@ -172,7 +177,6 @@
|
|||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
android:resource="@xml/file_paths" />
|
android:resource="@xml/file_paths" />
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -38,6 +38,7 @@ object Constants {
|
|||||||
const val DEVICE_TYPE_HEMOCUBE = "HEMOCUBE"
|
const val DEVICE_TYPE_HEMOCUBE = "HEMOCUBE"
|
||||||
const val DEVICE_TYPE_TEST_RIGHT = "TEST_RIGHT"
|
const val DEVICE_TYPE_TEST_RIGHT = "TEST_RIGHT"
|
||||||
const val DEVICE_TYPE_TRUEHEME = "TRUEHEME"
|
const val DEVICE_TYPE_TRUEHEME = "TRUEHEME"
|
||||||
|
const val DEVICE_VERSION_TYPE = "V0"
|
||||||
|
|
||||||
const val DEVICE_VENDOR_ID = 1027
|
const val DEVICE_VENDOR_ID = 1027
|
||||||
const val HOMO_CUBE_ID = 29987
|
const val HOMO_CUBE_ID = 29987
|
||||||
@@ -55,6 +56,7 @@ object Constants {
|
|||||||
const val USER_ID = "usernameId"
|
const val USER_ID = "usernameId"
|
||||||
|
|
||||||
const val QUICK_CAPTURE_SOLUTION = "SOLUTION"
|
const val QUICK_CAPTURE_SOLUTION = "SOLUTION"
|
||||||
|
const val QUICK_CAPTURE_FOR_ADMIN = "ADMIN"
|
||||||
const val QUICK_CAPTURE_CONCENTRATION = "CONCENTRATION"
|
const val QUICK_CAPTURE_CONCENTRATION = "CONCENTRATION"
|
||||||
const val QUICK_CAPTURE_VOLUME = "VOLUME"
|
const val QUICK_CAPTURE_VOLUME = "VOLUME"
|
||||||
const val QUICK_CAPTURE_READING_PER_SAMPLE = "READING_PER_SAMPLE"
|
const val QUICK_CAPTURE_READING_PER_SAMPLE = "READING_PER_SAMPLE"
|
||||||
@@ -223,6 +225,16 @@ object Constants {
|
|||||||
"HCV-001-0048",
|
"HCV-001-0048",
|
||||||
"HCV-001-0049",
|
"HCV-001-0049",
|
||||||
"HCV-001-0050",
|
"HCV-001-0050",
|
||||||
|
"HCV-000-6001",
|
||||||
|
"HCV-000-6002",
|
||||||
|
"HCV-000-6003",
|
||||||
|
"HCV-000-6004",
|
||||||
|
"HCV-000-6005",
|
||||||
|
"HCV-000-6006",
|
||||||
|
"HCV-000-6007",
|
||||||
|
"HCV-000-6008",
|
||||||
|
"HCV-000-6009",
|
||||||
|
"HCV-000-6010",
|
||||||
)
|
)
|
||||||
|
|
||||||
const val password = "SMI@12345"
|
const val password = "SMI@12345"
|
||||||
|
|||||||
@@ -15,4 +15,5 @@ enum class HemoCubeCommands(val command: String) {
|
|||||||
SECOND_GAIN_COMMAND("U\r"),
|
SECOND_GAIN_COMMAND("U\r"),
|
||||||
THIRD_GAIN_COMMAND("V\r"),
|
THIRD_GAIN_COMMAND("V\r"),
|
||||||
FORTH_GAIN_COMMAND("W\r"),
|
FORTH_GAIN_COMMAND("W\r"),
|
||||||
|
CHECK_CUVETTE_COMMAND("L\r"),
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,12 @@ enum class TestStatus(val code: Double) {
|
|||||||
FIRST_EMPTY_AIR_READING_PRINT_COMPLETED(4.4),
|
FIRST_EMPTY_AIR_READING_PRINT_COMPLETED(4.4),
|
||||||
EPROM_ADC_RETRIEVAL_STARTED(4.5),
|
EPROM_ADC_RETRIEVAL_STARTED(4.5),
|
||||||
EPROM_ADC_RETRIEVAL_COMPLETED(4.6),
|
EPROM_ADC_RETRIEVAL_COMPLETED(4.6),
|
||||||
BUFFER_STARTED(4.7),
|
CUVETTE_ABSENT(4.7),
|
||||||
BUFFER_COMPLETED(5.0),
|
CUVETTE_PRESENT(4.8),
|
||||||
|
CUVETTE_ABSENTS(7.7),
|
||||||
|
CUVETTE_PRESENTS(7.8),
|
||||||
|
BUFFER_STARTED(4.9),
|
||||||
|
BUFFER_COMPLETED(5.1),
|
||||||
BUFFER_PRINT_STARTED(6.0),
|
BUFFER_PRINT_STARTED(6.0),
|
||||||
BUFFER_PRINT_COMPLETED(7.0),
|
BUFFER_PRINT_COMPLETED(7.0),
|
||||||
SAMPLE_STARTED(8.0),
|
SAMPLE_STARTED(8.0),
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import com.example.hpostesting.data.model.patient.UserData
|
|||||||
|
|
||||||
@Database(
|
@Database(
|
||||||
entities = [UserData::class, HemoCubeTestData::class, DeviceData::class, BufferCheckData::class],
|
entities = [UserData::class, HemoCubeTestData::class, DeviceData::class, BufferCheckData::class],
|
||||||
version = 29,
|
version = 30,
|
||||||
exportSchema = false
|
exportSchema = false
|
||||||
)
|
)
|
||||||
@TypeConverters(Converters::class)
|
@TypeConverters(Converters::class)
|
||||||
|
|||||||
@@ -11,4 +11,6 @@ interface LocalFileDataSource {
|
|||||||
fun exportDataToCSV(
|
fun exportDataToCSV(
|
||||||
fileName: String, dataList: List<HemoCubeTestData>,
|
fileName: String, dataList: List<HemoCubeTestData>,
|
||||||
): Boolean
|
): Boolean
|
||||||
|
fun backUpDataToCSV(fileName: String, dataList: List<HemoCubeTestData>)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -153,6 +153,127 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun backUpDataToCSV(fileName: String, dataList: List<HemoCubeTestData>) {
|
||||||
|
try {
|
||||||
|
val filePath = File(getExternalStorageDirectory(), fileName)
|
||||||
|
val writer = FileWriter(filePath)
|
||||||
|
val csvWriter = CSVWriter(writer)
|
||||||
|
// Write CSV header
|
||||||
|
val header = arrayOf(
|
||||||
|
"_id",
|
||||||
|
"name",
|
||||||
|
"incubationTime",
|
||||||
|
"bloodGroup",
|
||||||
|
"birthYear", // Include other fields from the data class
|
||||||
|
"state",
|
||||||
|
"abhaId",
|
||||||
|
"userImageURL",
|
||||||
|
"location",
|
||||||
|
"reportUploadTime",
|
||||||
|
"testType",
|
||||||
|
"testTime",
|
||||||
|
"testStatus",
|
||||||
|
"gender",
|
||||||
|
"localFlag", // Add more fields as necessary
|
||||||
|
"deviceId",
|
||||||
|
"appVersion",
|
||||||
|
"deviceSerialNumber",
|
||||||
|
"deviceType",
|
||||||
|
"kitSerial",
|
||||||
|
"resultData",
|
||||||
|
"led1Buffer",
|
||||||
|
"led2Buffer",
|
||||||
|
"led3Buffer",
|
||||||
|
"led4Buffer",
|
||||||
|
"led1Sample",
|
||||||
|
"led2Sample",
|
||||||
|
"led3Sample",
|
||||||
|
"led4Sample",
|
||||||
|
"led1Average",
|
||||||
|
"led2Average",
|
||||||
|
"led3Average",
|
||||||
|
"led4Average",
|
||||||
|
"abs1",
|
||||||
|
"abs2",
|
||||||
|
"abs3",
|
||||||
|
"abs4",
|
||||||
|
"deviceRatio",
|
||||||
|
"calculatedRatio",
|
||||||
|
"predictedDenovixRatio",
|
||||||
|
"coefficients",
|
||||||
|
"classificationResult",
|
||||||
|
"prdClassification",
|
||||||
|
"errorMessages",
|
||||||
|
"batteryLevel",
|
||||||
|
"batteryCapacity",
|
||||||
|
"batteryMaxCapacity",
|
||||||
|
"batteryTemperature",
|
||||||
|
"batteryVoltage"
|
||||||
|
)
|
||||||
|
csvWriter.writeNext(header)
|
||||||
|
|
||||||
|
// Filter and write data rows where testStatus is true
|
||||||
|
val filteredDataList = dataList.filter { it.testStatus == true }
|
||||||
|
for (data in filteredDataList) {
|
||||||
|
val row = arrayOf(
|
||||||
|
data._id,
|
||||||
|
data.name,
|
||||||
|
data.incubationTime,
|
||||||
|
data.bloodGroup,
|
||||||
|
data.birthYear, // Include other fields similarly
|
||||||
|
data.state,
|
||||||
|
data.abhaId,
|
||||||
|
data.userImageURL,
|
||||||
|
data.location?.toString(),
|
||||||
|
data.reportUploadTime ?: "",
|
||||||
|
data.testType ?: "",
|
||||||
|
data.testTime ?: "",
|
||||||
|
data.testStatus?.toString() ?: "",
|
||||||
|
data.gender,
|
||||||
|
data.localFlag.toString(),
|
||||||
|
data.deviceId ?: "",
|
||||||
|
data.appVersion ?: "",
|
||||||
|
data.deviceSerialNumber,
|
||||||
|
data.deviceType,
|
||||||
|
data.kitSerial,
|
||||||
|
data.resultData,
|
||||||
|
data.led1Buffer?.toString() ?: "",
|
||||||
|
data.led2Buffer?.toString() ?: "",
|
||||||
|
data.led3Buffer?.toString() ?: "",
|
||||||
|
data.led4Buffer?.toString() ?: "",
|
||||||
|
data.led1Sample?.toString() ?: "",
|
||||||
|
data.led2Sample?.toString() ?: "",
|
||||||
|
data.led3Sample?.toString() ?: "",
|
||||||
|
data.led4Sample?.toString() ?: "",
|
||||||
|
data.led1Average?.toString() ?: "",
|
||||||
|
data.led2Average?.toString() ?: "",
|
||||||
|
data.led3Average?.toString() ?: "",
|
||||||
|
data.led4Average?.toString() ?: "",
|
||||||
|
data.abs1?.toString() ?: "",
|
||||||
|
data.abs2?.toString() ?: "",
|
||||||
|
data.abs3?.toString() ?: "",
|
||||||
|
data.abs4?.toString() ?: "",
|
||||||
|
data.deviceRatio?.toString() ?: "",
|
||||||
|
data.calculatedRatio?.toString() ?: "",
|
||||||
|
data.predictedDenovixRatio?.toString() ?: "",
|
||||||
|
data.coefficients ?: "",
|
||||||
|
data.classificationResult,
|
||||||
|
data.prdClassification,
|
||||||
|
data.errorMessages,
|
||||||
|
data.batteryLevel,
|
||||||
|
data.batteryCapacity,
|
||||||
|
data.batteryMaxCapacity,
|
||||||
|
data.batteryTemperature,
|
||||||
|
data.batteryVoltage
|
||||||
|
)
|
||||||
|
csvWriter.writeNext(row)
|
||||||
|
}
|
||||||
|
writer.close()
|
||||||
|
} catch (e: IOException) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun getExternalStorageDirectory(): File {
|
private fun getExternalStorageDirectory(): File {
|
||||||
val folder = File(Environment.getExternalStorageDirectory(), "HposFolder")
|
val folder = File(Environment.getExternalStorageDirectory(), "HposFolder")
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ data class HemoCubeTestData(
|
|||||||
var quickCapture: Boolean = false,
|
var quickCapture: Boolean = false,
|
||||||
var solution: String? = "",
|
var solution: String? = "",
|
||||||
var concentration: String? = "",
|
var concentration: String? = "",
|
||||||
|
var filter: String? = "",
|
||||||
var volume: String? = "",
|
var volume: String? = "",
|
||||||
var isCSVCreated: Boolean = false,
|
var isCSVCreated: Boolean = false,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.hpostesting.presentation
|
package com.example.hpostesting.presentation
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
@@ -9,6 +10,7 @@ import android.util.Log
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
@@ -32,7 +34,7 @@ import com.zebra.scannercontrol.SDKHandler
|
|||||||
import `in`.sminnovations.hpostesting.R
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.ActivityKitScanBinding
|
import `in`.sminnovations.hpostesting.databinding.ActivityKitScanBinding
|
||||||
|
|
||||||
class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
class KitScanActivity : AppCompatActivity() {
|
||||||
|
|
||||||
private val TAG = "KitScanActivity"
|
private val TAG = "KitScanActivity"
|
||||||
private lateinit var binding: ActivityKitScanBinding
|
private lateinit var binding: ActivityKitScanBinding
|
||||||
@@ -42,22 +44,36 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
|||||||
var sdkHandler: SDKHandler? = null
|
var sdkHandler: SDKHandler? = null
|
||||||
var editBarcode: EditText? = null
|
var editBarcode: EditText? = null
|
||||||
var mScannerInfoList = ArrayList<DCSScannerInfo>()
|
var mScannerInfoList = ArrayList<DCSScannerInfo>()
|
||||||
|
companion object {
|
||||||
|
const val QR_REQUEST_CODE = 1
|
||||||
|
}
|
||||||
|
// private val barcodeLauncher = registerForActivityResult(
|
||||||
|
// ScanContract()
|
||||||
|
// ) { result: ScanIntentResult ->
|
||||||
|
// Log.d(TAG, result.contents)
|
||||||
|
// if (result.contents.isNullOrEmpty()) {
|
||||||
|
// Toast.makeText(this, R.string.cancelled_unable_scan, Toast.LENGTH_LONG).show()
|
||||||
|
// } else {
|
||||||
|
// Log.d(TAG, result.contents)
|
||||||
|
// processScannedData(result.contents)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private fun processScannedData(contents: String) {
|
||||||
|
// binding.nameEditText.setText(contents)
|
||||||
|
// }
|
||||||
|
|
||||||
private val barcodeLauncher = registerForActivityResult(
|
// In your calling activity
|
||||||
ScanContract()
|
var resultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||||
) { result: ScanIntentResult ->
|
if (result.resultCode == Activity.RESULT_OK) { // Handle the result
|
||||||
if (result.contents.isNullOrEmpty()) {
|
val qrCode = result.data?.getStringExtra("QRCode")
|
||||||
Toast.makeText(this, R.string.cancelled_unable_scan, Toast.LENGTH_LONG).show()
|
Toast.makeText(this, "scanned kit text:$qrCode",
|
||||||
} else {
|
Toast.LENGTH_LONG).show()
|
||||||
Log.d(TAG, result.contents)
|
// val editText = findViewById<com.google.android.material.textfield.TextInputEditText>(R.id.name_edit_text)
|
||||||
processScannedData(result.contents)
|
binding.nameEditText.setText(qrCode)
|
||||||
|
// Use data to retrieve extra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun processScannedData(contents: String) {
|
|
||||||
binding.nameEditText.setText(contents)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun attachBaseContext(newBase: Context?) {
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
LanguageManager.setLocale(newBase, languageCode)
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
@@ -65,33 +81,33 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun dcssdkEventScannerAppeared(dcsScannerInfo: DCSScannerInfo?) {}
|
// override fun dcssdkEventScannerAppeared(dcsScannerInfo: DCSScannerInfo?) {}
|
||||||
|
//
|
||||||
override fun dcssdkEventScannerDisappeared(i: Int) {}
|
// override fun dcssdkEventScannerDisappeared(i: Int) {}
|
||||||
|
//
|
||||||
override fun dcssdkEventCommunicationSessionEstablished(dcsScannerInfo: DCSScannerInfo?) {}
|
// override fun dcssdkEventCommunicationSessionEstablished(dcsScannerInfo: DCSScannerInfo?) {}
|
||||||
|
//
|
||||||
override fun dcssdkEventCommunicationSessionTerminated(i: Int) {}
|
// override fun dcssdkEventCommunicationSessionTerminated(i: Int) {}
|
||||||
// override fun dcssdkEventBarcode(p0: ByteArray?, p1: Int, p2: Int) {
|
//// override fun dcssdkEventBarcode(p0: ByteArray?, p1: Int, p2: Int) {
|
||||||
// TODO("Not yet implemented")
|
//// TODO("Not yet implemented")
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// override fun dcssdkEventImage(bytes: ByteArray?, i: Int) {}
|
||||||
|
//
|
||||||
|
// override fun dcssdkEventVideo(bytes: ByteArray?, i: Int) {}
|
||||||
|
//
|
||||||
|
// override fun dcssdkEventBinaryData(bytes: ByteArray?, i: Int) {}
|
||||||
|
//
|
||||||
|
// override fun dcssdkEventFirmwareUpdate(firmwareUpdateEvent: FirmwareUpdateEvent?) {}
|
||||||
|
//
|
||||||
|
// override fun dcssdkEventAuxScannerAppeared(
|
||||||
|
// dcsScannerInfo: DCSScannerInfo?,
|
||||||
|
// dcsScannerInfo1: DCSScannerInfo?,
|
||||||
|
// ) {
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
|
// override fun dcssdkEventConfigurationUpdate(configurationUpdateEvent: ConfigurationUpdateEvent?) {}
|
||||||
override fun dcssdkEventImage(bytes: ByteArray?, i: Int) {}
|
|
||||||
|
|
||||||
override fun dcssdkEventVideo(bytes: ByteArray?, i: Int) {}
|
|
||||||
|
|
||||||
override fun dcssdkEventBinaryData(bytes: ByteArray?, i: Int) {}
|
|
||||||
|
|
||||||
override fun dcssdkEventFirmwareUpdate(firmwareUpdateEvent: FirmwareUpdateEvent?) {}
|
|
||||||
|
|
||||||
override fun dcssdkEventAuxScannerAppeared(
|
|
||||||
dcsScannerInfo: DCSScannerInfo?,
|
|
||||||
dcsScannerInfo1: DCSScannerInfo?,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun dcssdkEventConfigurationUpdate(configurationUpdateEvent: ConfigurationUpdateEvent?) {}
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -151,8 +167,9 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
|||||||
setSupportActionBar(binding.toolbar)
|
setSupportActionBar(binding.toolbar)
|
||||||
|
|
||||||
binding.btnScanNow.setOnClickListener {
|
binding.btnScanNow.setOnClickListener {
|
||||||
// startScanningNow()
|
// startForResult.launch(Intent(this, ScannerKitActvity::class.java))
|
||||||
pullTrigger()
|
val intent = Intent(this, ScannerKitActvity::class.java)
|
||||||
|
resultLauncher.launch(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnGo.setOnClickListener {
|
binding.btnGo.setOnClickListener {
|
||||||
@@ -207,26 +224,26 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Setting up the SDK handler
|
//Setting up the SDK handler
|
||||||
sdkHandler = SDKHandler(this)
|
// sdkHandler = SDKHandler(this)
|
||||||
//Registers a particular object which conforms to IDcsSdkApiDelegate interface as a receiver of SDK notifications.
|
// //Registers a particular object which conforms to IDcsSdkApiDelegate interface as a receiver of SDK notifications.
|
||||||
sdkHandler!!.dcssdkSetDelegate(this)
|
// sdkHandler!!.dcssdkSetDelegate(this)
|
||||||
//this command is telling the sdk that we're going to be connecting to the scanner via USB
|
// //this command is telling the sdk that we're going to be connecting to the scanner via USB
|
||||||
sdkHandler!!.dcssdkSetOperationalMode(DCSSDKDefs.DCSSDK_MODE.DCSSDK_OPMODE_SNAPI)
|
// sdkHandler!!.dcssdkSetOperationalMode(DCSSDKDefs.DCSSDK_MODE.DCSSDK_OPMODE_SNAPI)
|
||||||
|
//
|
||||||
//deciding what kind of notifications we want to receive. Explained more in the function
|
// //deciding what kind of notifications we want to receive. Explained more in the function
|
||||||
//first we use bitmapping to set these values into the notifications_mask.
|
// //first we use bitmapping to set these values into the notifications_mask.
|
||||||
var notifications_mask = 0
|
// var notifications_mask = 0
|
||||||
// We would like to subscribe to all barcode events
|
// // We would like to subscribe to all barcode events
|
||||||
notifications_mask =
|
// notifications_mask =
|
||||||
notifications_mask or DCSSDKDefs.DCSSDK_EVENT.DCSSDK_EVENT_BARCODE.value
|
// notifications_mask or DCSSDKDefs.DCSSDK_EVENT.DCSSDK_EVENT_BARCODE.value
|
||||||
sdkHandler!!.dcssdkSubsribeForEvents(notifications_mask)
|
// sdkHandler!!.dcssdkSubsribeForEvents(notifications_mask)
|
||||||
mScannerInfoList.addAll(sdkHandler!!.dcssdkGetAvailableScannersList())
|
// mScannerInfoList.addAll(sdkHandler!!.dcssdkGetAvailableScannersList())
|
||||||
Log.e("scannersize", sdkHandler!!.dcssdkGetAvailableScannersList().size.toString())
|
// Log.e("scannersize", sdkHandler!!.dcssdkGetAvailableScannersList().size.toString())
|
||||||
if (mScannerInfoList.isNotEmpty()) {
|
// if (mScannerInfoList.isNotEmpty()) {
|
||||||
sdkHandler!!.dcssdkEstablishCommunicationSession(mScannerInfoList[0].scannerID)
|
// sdkHandler!!.dcssdkEstablishCommunicationSession(mScannerInfoList[0].scannerID)
|
||||||
} else {
|
// } else {
|
||||||
Toast.makeText(this,"Scanner Is not available In this device", Toast.LENGTH_LONG).show()
|
// Toast.makeText(this,"Scanner Is not available In this device", Toast.LENGTH_LONG).show()
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun pullTrigger() {
|
private fun pullTrigger() {
|
||||||
@@ -257,14 +274,14 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//this function is called if barcode is detected.
|
//this function is called if barcode is detected.
|
||||||
override fun dcssdkEventBarcode(barcodeData: ByteArray?, barcodeType: Int, fromScannerID: Int) {
|
// override fun dcssdkEventBarcode(barcodeData: ByteArray?, barcodeType: Int, fromScannerID: Int) {
|
||||||
val result = String(barcodeData!!)
|
// val result = String(barcodeData!!)
|
||||||
Log.d("BARCODE", result)
|
// Log.d("BARCODE", result)
|
||||||
runOnUiThread {
|
// runOnUiThread {
|
||||||
val editableResult: Editable = Editable.Factory.getInstance().newEditable(result)
|
// val editableResult: Editable = Editable.Factory.getInstance().newEditable(result)
|
||||||
binding.nameEditText.text = editableResult
|
// binding.nameEditText.text = editableResult
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private fun checkHemoCubeKitData(): Boolean {
|
private fun checkHemoCubeKitData(): Boolean {
|
||||||
return sharedPreference.getString(Constants.KIT_NUMBER, "")
|
return sharedPreference.getString(Constants.KIT_NUMBER, "")
|
||||||
@@ -303,21 +320,21 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startScanningNow() {
|
// private fun startScanningNow() {
|
||||||
val options = ScanOptions()
|
// val options = ScanOptions()
|
||||||
options.setDesiredBarcodeFormats(ScanOptions.QR_CODE)
|
// options.setDesiredBarcodeFormats(ScanOptions.QR_CODE)
|
||||||
options.setPrompt("Scan a barcode")
|
// options.setPrompt("Scan a barcode")
|
||||||
options.setCameraId(0) // Use a specific camera of the device
|
// options.setCameraId(0) // Use a specific camera of the device
|
||||||
|
//
|
||||||
options.setBeepEnabled(true)
|
// options.setBeepEnabled(true)
|
||||||
options.setBarcodeImageEnabled(true)
|
// options.setBarcodeImageEnabled(true)
|
||||||
|
//
|
||||||
options.setPrompt("Start Scanning")
|
// options.setPrompt("Start Scanning")
|
||||||
options.setOrientationLocked(false)
|
// options.setOrientationLocked(false)
|
||||||
// options.setTimeout(10000) // in ms
|
//// options.setTimeout(10000) // in ms
|
||||||
|
//
|
||||||
barcodeLauncher.launch(options)
|
// barcodeLauncher.launch(options)
|
||||||
}
|
// }
|
||||||
|
|
||||||
private fun checkDataNotNull(): Boolean {
|
private fun checkDataNotNull(): Boolean {
|
||||||
return if (DataHolder.selectedTest?._id == null) {
|
return if (DataHolder.selectedTest?._id == null) {
|
||||||
@@ -333,4 +350,13 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
// super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
// if (requestCode == QR_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
|
||||||
|
// val qrCode = data?.getStringExtra("QRCode")
|
||||||
|
//// val editText = findViewById<com.google.android.material.textfield.TextInputEditText>(R.id.name_edit_text)
|
||||||
|
// binding.nameEditText.setText(qrCode)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.example.hpostesting.presentation
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.widget.Toast
|
||||||
|
import com.budiyev.android.codescanner.AutoFocusMode
|
||||||
|
import com.budiyev.android.codescanner.CodeScanner
|
||||||
|
import com.budiyev.android.codescanner.CodeScannerView
|
||||||
|
import com.budiyev.android.codescanner.DecodeCallback
|
||||||
|
import com.budiyev.android.codescanner.ErrorCallback
|
||||||
|
import com.budiyev.android.codescanner.ScanMode
|
||||||
|
import `in`.sminnovations.hpostesting.R
|
||||||
|
|
||||||
|
class ScannerKitActvity : AppCompatActivity() {
|
||||||
|
private lateinit var codeScanner: CodeScanner
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_scanner_kit_actvity)
|
||||||
|
val scannerView = findViewById<CodeScannerView>(R.id.scanner_view)
|
||||||
|
|
||||||
|
codeScanner = CodeScanner(this, scannerView)
|
||||||
|
|
||||||
|
// Parameters (default values)
|
||||||
|
codeScanner.camera = CodeScanner.CAMERA_BACK // or CAMERA_FRONT or specific camera id
|
||||||
|
codeScanner.formats = CodeScanner.ALL_FORMATS // list of type BarcodeFormat,
|
||||||
|
// ex. listOf(BarcodeFormat.QR_CODE)
|
||||||
|
codeScanner.autoFocusMode = AutoFocusMode.SAFE // or CONTINUOUS
|
||||||
|
codeScanner.scanMode = ScanMode.SINGLE // or CONTINUOUS or PREVIEW
|
||||||
|
codeScanner.isAutoFocusEnabled = true // Whether to enable auto focus or not
|
||||||
|
codeScanner.isFlashEnabled = false // Whether to enable flash or not
|
||||||
|
|
||||||
|
// Callbacks
|
||||||
|
codeScanner.decodeCallback = DecodeCallback {
|
||||||
|
runOnUiThread {
|
||||||
|
Toast.makeText(this, "scanned text: ${it.text}",
|
||||||
|
Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
val resultIntent = Intent()
|
||||||
|
resultIntent.putExtra("QRCode", it.text)
|
||||||
|
setResult(Activity.RESULT_OK, resultIntent)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
codeScanner.errorCallback = ErrorCallback { // or ErrorCallback.SUPPRESS
|
||||||
|
runOnUiThread {
|
||||||
|
Toast.makeText(this, "Camera initialization error: ${it.message}",
|
||||||
|
Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerView.setOnClickListener {
|
||||||
|
codeScanner.startPreview()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
codeScanner.startPreview()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
codeScanner.releaseResources()
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
// You can do additional work here before calling super
|
||||||
|
super.onBackPressed() // This calls finish() behind the scenes for you
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -44,7 +44,6 @@ class AssuranceControlsFragment : Fragment() {
|
|||||||
|
|
||||||
private fun initViews() {
|
private fun initViews() {
|
||||||
// binding.btnSubmit.visibility = View.GONE
|
// binding.btnSubmit.visibility = View.GONE
|
||||||
|
|
||||||
val solutionSpinner: Spinner = binding.spinnerSolutions
|
val solutionSpinner: Spinner = binding.spinnerSolutions
|
||||||
val solutionOptions = arrayOf("Select solution", "Tartrazine", "Acid Red")
|
val solutionOptions = arrayOf("Select solution", "Tartrazine", "Acid Red")
|
||||||
val solutionAdapter =
|
val solutionAdapter =
|
||||||
@@ -123,6 +122,27 @@ class AssuranceControlsFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
val adminspinner: Spinner = binding.spinnerAdmin
|
||||||
|
val adminOptions = arrayOf("Select options", "Sickle-Cert-Buffer", "1 Abs Holo Filter", "0.25 Abs Holo Filter", "Air Blank")
|
||||||
|
val adminAdapter =
|
||||||
|
ArrayAdapter(requireContext(), R.layout.simple_spinner_item, adminOptions)
|
||||||
|
adminAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||||
|
adminspinner.adapter =adminAdapter
|
||||||
|
adminspinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||||
|
override fun onItemSelected(
|
||||||
|
parent: AdapterView<*>?,
|
||||||
|
view: View?,
|
||||||
|
position: Int,
|
||||||
|
id: Long,
|
||||||
|
) {
|
||||||
|
val selectedValue: String = adminOptions[position]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||||
|
}
|
||||||
|
}
|
||||||
// load saved values
|
// load saved values
|
||||||
val savedSolution =
|
val savedSolution =
|
||||||
sharedPreferences.getString(Constants.QUICK_CAPTURE_SOLUTION, "").toString()
|
sharedPreferences.getString(Constants.QUICK_CAPTURE_SOLUTION, "").toString()
|
||||||
@@ -139,11 +159,18 @@ class AssuranceControlsFragment : Fragment() {
|
|||||||
val volumePosition = getPositionOfValue(savedVolume, volumeOptions.toList())
|
val volumePosition = getPositionOfValue(savedVolume, volumeOptions.toList())
|
||||||
volumeSpinner.setSelection(volumePosition)
|
volumeSpinner.setSelection(volumePosition)
|
||||||
|
|
||||||
|
|
||||||
|
val foradmin =
|
||||||
|
sharedPreferences.getString(Constants.QUICK_CAPTURE_FOR_ADMIN, "").toString()
|
||||||
|
val adminPosition = getPositionOfValue(foradmin, adminOptions.toList())
|
||||||
|
adminspinner.setSelection(adminPosition)
|
||||||
|
|
||||||
binding.btnSubmit.setOnClickListener {
|
binding.btnSubmit.setOnClickListener {
|
||||||
val selectedSolution = binding.spinnerSolutions.selectedItem.toString()
|
val selectedSolution = binding.spinnerSolutions.selectedItem.toString()
|
||||||
val selectedConcentration = binding.spinnerConcentration.selectedItem.toString()
|
val selectedConcentration = binding.spinnerConcentration.selectedItem.toString()
|
||||||
|
|
||||||
// Check if any of the selections are default values
|
|
||||||
|
// Check if any of the selections are default values
|
||||||
if (selectedSolution == "Select solution") {
|
if (selectedSolution == "Select solution") {
|
||||||
Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
|
Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
|
||||||
return@setOnClickListener // Prevent further execution
|
return@setOnClickListener // Prevent further execution
|
||||||
@@ -153,6 +180,21 @@ class AssuranceControlsFragment : Fragment() {
|
|||||||
Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
|
Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
|
||||||
return@setOnClickListener // Prevent further execution
|
return@setOnClickListener // Prevent further execution
|
||||||
}
|
}
|
||||||
|
//for vizagh
|
||||||
|
// val selectedadminOption = binding.spinnerAdmin.selectedItem.toString()
|
||||||
|
// if (selectedadminOption == "Select options") {
|
||||||
|
// Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
|
||||||
|
// return@setOnClickListener // Prevent further execution
|
||||||
|
// }
|
||||||
|
// 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()
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DataHolder.hemoCubeTestData!!.quickCapture = true
|
DataHolder.hemoCubeTestData!!.quickCapture = true
|
||||||
val currentUnixTime = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
val currentUnixTime = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
Instant.now().epochSecond
|
Instant.now().epochSecond
|
||||||
@@ -162,11 +204,14 @@ class AssuranceControlsFragment : Fragment() {
|
|||||||
DataHolder.hemoCubeTestData!!._id = currentUnixTime.toString() + "SMI"
|
DataHolder.hemoCubeTestData!!._id = currentUnixTime.toString() + "SMI"
|
||||||
DataHolder.hemoCubeTestData!!.solution = binding.spinnerSolutions.selectedItem.toString()
|
DataHolder.hemoCubeTestData!!.solution = binding.spinnerSolutions.selectedItem.toString()
|
||||||
DataHolder.hemoCubeTestData!!.concentration = binding.spinnerConcentration.selectedItem.toString()
|
DataHolder.hemoCubeTestData!!.concentration = binding.spinnerConcentration.selectedItem.toString()
|
||||||
DataHolder.hemoCubeTestData!!.name = "${DataHolder.hemoCubeTestData!!.solution} ${DataHolder.hemoCubeTestData!!.concentration} ${DataHolder.hemoCubeTestData!!.volume}"
|
|
||||||
|
|
||||||
|
|
||||||
DataHolder.selectedTest = UserData()
|
DataHolder.selectedTest = UserData()
|
||||||
DataHolder.selectedTest?._id = DataHolder.hemoCubeTestData!!._id
|
DataHolder.selectedTest?._id = DataHolder.hemoCubeTestData!!._id
|
||||||
DataHolder.selectedTest?.name = DataHolder.hemoCubeTestData!!.name
|
DataHolder.selectedTest?.name = DataHolder.hemoCubeTestData!!.name
|
||||||
|
DataHolder.selectedTest?.name = binding.spinnerSolutions.selectedItem.toString() + " " +binding.spinnerConcentration.selectedItem.toString()
|
||||||
|
|
||||||
|
|
||||||
with(sharedPreferences.edit()) {
|
with(sharedPreferences.edit()) {
|
||||||
putString(Constants.QUICK_CAPTURE_SOLUTION, DataHolder.hemoCubeTestData!!.solution)
|
putString(Constants.QUICK_CAPTURE_SOLUTION, DataHolder.hemoCubeTestData!!.solution)
|
||||||
@@ -175,6 +220,7 @@ class AssuranceControlsFragment : Fragment() {
|
|||||||
DataHolder.hemoCubeTestData!!.concentration
|
DataHolder.hemoCubeTestData!!.concentration
|
||||||
)
|
)
|
||||||
putString(Constants.QUICK_CAPTURE_VOLUME, DataHolder.hemoCubeTestData!!.volume)
|
putString(Constants.QUICK_CAPTURE_VOLUME, DataHolder.hemoCubeTestData!!.volume)
|
||||||
|
putString(Constants.QUICK_CAPTURE_FOR_ADMIN, DataHolder.hemoCubeTestData!!.filter)
|
||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import androidx.core.view.get
|
|||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import com.example.hpostesting.data.constant.DataHolder
|
|||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import androidx.core.view.get
|
|||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
package com.example.hpostesting.presentation.dashboard
|
package com.example.hpostesting.presentation.dashboard
|
||||||
|
|
||||||
|
// Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||||
|
// Notice: All information contained herein is, and remains
|
||||||
|
// the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||||
|
// if any. The intellectual and technical concepts contained
|
||||||
|
// herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||||
|
// and its suppliers and may be covered by Indian and Foreign Patents,
|
||||||
|
// patents in process, and are protected by trade secret or copyright law.
|
||||||
|
// Dissemination of this information or reproduction of this material
|
||||||
|
// is strictly forbidden unless prior written permission is obtained
|
||||||
|
// from ShanMukha Innovations Pvt. Ltd.
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
import android.app.DownloadManager
|
import android.app.DownloadManager
|
||||||
@@ -279,7 +289,7 @@ class HomeFragment : Fragment() {
|
|||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
startActivity(Intent(requireContext(), KitScanActivity::class.java))
|
startActivity(Intent(requireContext(), KitScanActivity::class.java))
|
||||||
requireActivity().finish()
|
// requireActivity().finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -290,7 +300,7 @@ class HomeFragment : Fragment() {
|
|||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
startActivity(Intent(requireContext(), KitScanActivity::class.java))
|
startActivity(Intent(requireContext(), KitScanActivity::class.java))
|
||||||
requireActivity().finish()
|
// requireActivity().finish()
|
||||||
}
|
}
|
||||||
binding.btnQuickCapture.setOnClickListener {
|
binding.btnQuickCapture.setOnClickListener {
|
||||||
DataHolder.hemoCubeTestData = HemoCubeTestData()
|
DataHolder.hemoCubeTestData = HemoCubeTestData()
|
||||||
@@ -350,15 +360,16 @@ class HomeFragment : Fragment() {
|
|||||||
hemoCubeViewModel.login(createLoginRequestData(userID, password))
|
hemoCubeViewModel.login(createLoginRequestData(userID, password))
|
||||||
isTokenAvailable = true
|
isTokenAvailable = true
|
||||||
|
|
||||||
} else if (isTokenAvailable) {
|
|
||||||
isTokenAvailable = true
|
|
||||||
hemoCubeViewModel.startPeriodicCheckUpdate()
|
|
||||||
hemoCubeViewModel.checkUpdate(createCheckUpdateRequestData())
|
|
||||||
} else {
|
|
||||||
if (isTokenExpired(accessToken)) {
|
|
||||||
hemoCubeViewModel.login(createLoginRequestData(userID, password))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// else if (isTokenAvailable) {
|
||||||
|
// isTokenAvailable = true
|
||||||
|
// hemoCubeViewModel.startPeriodicCheckUpdate()
|
||||||
|
// hemoCubeViewModel.checkUpdate(createCheckUpdateRequestData())
|
||||||
|
// } else {
|
||||||
|
// if (isTokenExpired(accessToken)) {
|
||||||
|
// hemoCubeViewModel.login(createLoginRequestData(userID, password))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.example.hpostesting.data.constant.HemoCubeCommands
|
|||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.utils.DeviceCommunicationHandler
|
import com.example.hpostesting.presentation.utils.DeviceCommunicationHandler
|
||||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import com.example.hpostesting.data.constant.HemoCubeCommands
|
|||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.utils.DeviceCommunicationHandler
|
import com.example.hpostesting.presentation.utils.DeviceCommunicationHandler
|
||||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import androidx.core.view.get
|
|||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
@@ -35,7 +36,10 @@ import kotlin.math.log10
|
|||||||
|
|
||||||
@Suppress("MemberVisibilityCanBePrivate")
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
class HemoCubeFragment : Fragment() {
|
class HemoCubeFragment : Fragment() {
|
||||||
|
private var checkCuvette = false
|
||||||
|
private var checkCuvetteSam = false
|
||||||
|
private var borderlineMetric = 0.0
|
||||||
|
private var sampleClick = false
|
||||||
private lateinit var binding: FragmentHemoCubeReferenceBinding
|
private lateinit var binding: FragmentHemoCubeReferenceBinding
|
||||||
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
||||||
private lateinit var sharedPreferences: SharedPreferences
|
private lateinit var sharedPreferences: SharedPreferences
|
||||||
@@ -111,37 +115,67 @@ class HemoCubeFragment : Fragment() {
|
|||||||
binding.nameEditText.visibility = View.GONE
|
binding.nameEditText.visibility = View.GONE
|
||||||
binding.tvTitle.visibility = View.GONE
|
binding.tvTitle.visibility = View.GONE
|
||||||
binding.btnGo.visibility = View.GONE
|
binding.btnGo.visibility = View.GONE
|
||||||
binding.btnPlacebuffer.visibility = View.GONE
|
// binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
|
||||||
binding.tvName.text = "Name: ${testDetails?.name}\n ID: ${testDetails?._id}"
|
binding.tvName.text = "Name: ${testDetails?.name}\n ID: ${testDetails?._id}"
|
||||||
binding.tvSubtitle4.text = "Config"
|
binding.tvSubtitle4.text = "Config"
|
||||||
|
|
||||||
|
|
||||||
|
if (isBufferValueAvailable()) {
|
||||||
|
binding.btnPlacebuffer.apply {
|
||||||
|
setBackgroundColor(Color.GREEN) // Set button background color to green
|
||||||
|
text = "Fresh Buffer" // Change button text to "Buffer Exists"
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
binding.btnPlacebuffer.apply {
|
||||||
|
setBackgroundColor(Color.RED) // Set button background color to green
|
||||||
|
text = "No Buffer" // Change button text to "Buffer Exists"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
binding.btnSamplestart.setOnClickListener {
|
binding.btnSamplestart.setOnClickListener {
|
||||||
|
sampleClick = true
|
||||||
|
// if(checkCuvetteSam){
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
binding.tvSubtitle4.visibility = View.VISIBLE
|
||||||
// binding.tvSubtitle4.text = "Sample Started"
|
// binding.tvSubtitle4.text = "Sample Started"
|
||||||
}
|
}
|
||||||
startSampleProcess()
|
startSampleProcess()
|
||||||
it.visibility = View.GONE
|
// it.visibility = View.GONE
|
||||||
|
// }else{
|
||||||
|
// checkCuvettePresence()
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
binding.btnRetryCheckCuvette.setOnClickListener {
|
||||||
|
|
||||||
|
checkCuvettePresence()
|
||||||
|
}
|
||||||
binding.btnPlacebuffer.setOnClickListener {
|
binding.btnPlacebuffer.setOnClickListener {
|
||||||
if (isBufferValueAvailable() || !Constants.BLANK_EVERY_TEST) {
|
// if(checkCuvette){
|
||||||
showBufferAlertDialog()
|
|
||||||
} else {
|
startBufferProcess()
|
||||||
|
// if (isBufferValueAvailable() || !Constants.BLANK_EVERY_TEST) {
|
||||||
|
//// showBufferAlertDialog()
|
||||||
|
// } else {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
binding.tvSubtitle4.visibility = View.VISIBLE
|
||||||
// binding.tvSubtitle4.text = "Buffer Started"
|
// binding.tvSubtitle4.text = "Buffer Started"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkAndStartProcess()
|
// checkAndStartProcess()
|
||||||
it.visibility = View.GONE
|
|
||||||
}
|
// it.visibility = View.GONE
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// checkCuvettePresence()
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sharedPreferences.getString(Constants.USER_ID, "").toString() == "ADMIN") {
|
if (sharedPreferences.getString(Constants.USER_ID, "").toString() == "ADMIN") {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.tvDeviceMessages.visibility = View.VISIBLE
|
binding.tvDeviceMessages.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,9 +295,9 @@ class HemoCubeFragment : Fragment() {
|
|||||||
currentResultData = ""
|
currentResultData = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkAndStartProcess() {
|
// private fun checkAndStartProcess() {
|
||||||
startBufferProcess()
|
// startBufferProcess()
|
||||||
}
|
// }
|
||||||
|
|
||||||
private fun isBufferValueAvailable(): Boolean {
|
private fun isBufferValueAvailable(): Boolean {
|
||||||
return try {
|
return try {
|
||||||
@@ -314,7 +348,7 @@ class HemoCubeFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onClickPositiveButton() {
|
override fun onClickPositiveButton() {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.btnPlacebuffer.visibility = View.GONE
|
// binding.btnPlacebuffer.visibility = View.GONE
|
||||||
binding.btnSamplestart.visibility = View.VISIBLE
|
binding.btnSamplestart.visibility = View.VISIBLE
|
||||||
binding.tvSubtitle4.text = getString(R.string.place_sample)
|
binding.tvSubtitle4.text = getString(R.string.place_sample)
|
||||||
}
|
}
|
||||||
@@ -391,7 +425,7 @@ class HemoCubeFragment : Fragment() {
|
|||||||
resultData += stringData
|
resultData += stringData
|
||||||
currentResultData += stringData
|
currentResultData += stringData
|
||||||
hemoCubeViewModel.deviceMessages.postValue(currentResultData)
|
hemoCubeViewModel.deviceMessages.postValue(currentResultData)
|
||||||
|
Log.e("testStatus",this.testStatusCode.toString())
|
||||||
when {
|
when {
|
||||||
resultData.contains("SNE") && this.testStatusCode < TestStatus.CONFIG_COMPLETED.code -> {
|
resultData.contains("SNE") && this.testStatusCode < TestStatus.CONFIG_COMPLETED.code -> {
|
||||||
processV2HardwareId(resultData)
|
processV2HardwareId(resultData)
|
||||||
@@ -418,20 +452,62 @@ class HemoCubeFragment : Fragment() {
|
|||||||
(resultData.contains("#RC") && this.testStatusCode < TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code) -> {
|
(resultData.contains("#RC") && this.testStatusCode < TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code) -> {
|
||||||
this.testStatusCode = TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code
|
this.testStatusCode = TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code
|
||||||
hemoCubeViewModel.messages.postValue("EPROM ADC Loaded")
|
hemoCubeViewModel.messages.postValue("EPROM ADC Loaded")
|
||||||
showStartBufferButton()
|
//checkCuvettePresence()
|
||||||
|
}
|
||||||
|
resultData.contains("#CIN") && sampleClick && this.testStatusCode < TestStatus.CUVETTE_PRESENTS.code -> {
|
||||||
|
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_present))
|
||||||
|
this.testStatusCode = TestStatus.CUVETTE_PRESENTS.code
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
checkCuvetteSam = true
|
||||||
|
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
binding.btnSamplestart.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultData.contains("#AIN") && sampleClick && this.testStatusCode <= TestStatus.CUVETTE_ABSENTS.code -> {
|
||||||
|
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_absent))
|
||||||
|
this.testStatusCode = TestStatus.CUVETTE_ABSENTS.code
|
||||||
|
showRetryButtonForCuvette()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resultData.contains("#CIN") && this.testStatusCode < TestStatus.CUVETTE_PRESENT.code -> {
|
||||||
|
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_present))
|
||||||
|
this.testStatusCode = TestStatus.CUVETTE_PRESENT.code
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
checkCuvette = true
|
||||||
|
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||||
|
binding.btnPlacebuffer.visibility = View.VISIBLE
|
||||||
|
binding.btnSamplestart.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultData.contains("#AIN") && this.testStatusCode <= TestStatus.CUVETTE_ABSENT.code -> {
|
||||||
|
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_absent))
|
||||||
|
this.testStatusCode = TestStatus.CUVETTE_ABSENT.code
|
||||||
|
showRetryButtonForCuvette()
|
||||||
|
}
|
||||||
resultData.contains("#BS") && this.testStatusCode < TestStatus.BUFFER_STARTED.code -> {
|
resultData.contains("#BS") && this.testStatusCode < TestStatus.BUFFER_STARTED.code -> {
|
||||||
hemoCubeViewModel.messages.postValue(getString(R.string.buffer_started))
|
hemoCubeViewModel.messages.postValue(getString(R.string.buffer_started))
|
||||||
this.testStatusCode = TestStatus.BUFFER_STARTED.code
|
this.testStatusCode = TestStatus.BUFFER_STARTED.code
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
binding.btnSamplestart.isClickable = false
|
||||||
|
binding.btnSamplestart.isEnabled = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resultData.contains("#BC") && this.testStatusCode < TestStatus.BUFFER_COMPLETED.code -> {
|
resultData.contains("#BC") && this.testStatusCode < TestStatus.BUFFER_COMPLETED.code -> {
|
||||||
this.testStatusCode = TestStatus.BUFFER_COMPLETED.code
|
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
|
resultData = ""
|
||||||
|
// resultData.replace("#AIN","#BAIN",false)
|
||||||
|
Log.d("resultDataBC",resultData)
|
||||||
binding.tvSubtitle4.text = getString(R.string.buffer_completed)
|
binding.tvSubtitle4.text = getString(R.string.buffer_completed)
|
||||||
binding.btnSamplestart.visibility = View.VISIBLE
|
// binding.btnSamplestart.visibility = View.VISIBLE
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
binding.btnSamplestart.isClickable = true
|
||||||
|
binding.btnSamplestart.isEnabled = true
|
||||||
}
|
}
|
||||||
|
this.testStatusCode = TestStatus.BUFFER_COMPLETED.code
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(resultData.contains("#SS") || resultData.contains("#SS1")) && this.testStatusCode < TestStatus.SAMPLE_STARTED.code -> {
|
(resultData.contains("#SS") || resultData.contains("#SS1")) && this.testStatusCode < TestStatus.SAMPLE_STARTED.code -> {
|
||||||
@@ -439,11 +515,15 @@ class HemoCubeFragment : Fragment() {
|
|||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.tvSubtitle4.text = getString(R.string.sample_started)
|
binding.tvSubtitle4.text = getString(R.string.sample_started)
|
||||||
binding.btnSamplestart.visibility = View.GONE
|
binding.btnSamplestart.visibility = View.GONE
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(resultData.contains("#SC") || resultData.contains("#SC1")) && this.testStatusCode < TestStatus.SAMPLE_COMPLETED.code -> {
|
(resultData.contains("#SC") || resultData.contains("#SC1")) && this.testStatusCode < TestStatus.SAMPLE_COMPLETED.code -> {
|
||||||
this.testStatusCode = TestStatus.SAMPLE_COMPLETED.code
|
this.testStatusCode = TestStatus.SAMPLE_COMPLETED.code
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.btnSamplestart.visibility = View.GONE
|
||||||
|
}
|
||||||
hemoCubeViewModel.messages.postValue(
|
hemoCubeViewModel.messages.postValue(
|
||||||
getString(R.string.sample_completed) + "\n" + getString(R.string.gathering_data)
|
getString(R.string.sample_completed) + "\n" + getString(R.string.gathering_data)
|
||||||
)
|
)
|
||||||
@@ -600,6 +680,15 @@ class HemoCubeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showRetryButtonForCuvette() {
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
// binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
binding.btnRetryCheckCuvette.visibility = View.VISIBLE
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
binding.btnSamplestart.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun finishReading() {
|
fun finishReading() {
|
||||||
repeatReadingCount += 1
|
repeatReadingCount += 1
|
||||||
isTestOngoing = false
|
isTestOngoing = false
|
||||||
@@ -686,9 +775,20 @@ 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))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showStartSampleButton() {
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||||
|
|
||||||
|
binding.btnSamplestart.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
// hemoCubeViewModel.messages.postValue(getString(R.string.start))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun extractV1HardwareId(input: String): String? {
|
fun extractV1HardwareId(input: String): String? {
|
||||||
@@ -769,9 +869,17 @@ class HemoCubeFragment : Fragment() {
|
|||||||
val led2Average = log10(led2BufferForDevice.div(led2SampleForDevice))
|
val led2Average = log10(led2BufferForDevice.div(led2SampleForDevice))
|
||||||
val led3Average = log10(led3BufferForDevice.div(led3SampleForDevice))
|
val led3Average = log10(led3BufferForDevice.div(led3SampleForDevice))
|
||||||
val led4Average = log10(led4BufferForDevice.div(led4SampleForDevice))
|
val led4Average = log10(led4BufferForDevice.div(led4SampleForDevice))
|
||||||
val deviceRatio = led2Average / led1Average
|
//used for latest trueheme and v1
|
||||||
val borderlineMetric = (led1Average - led2Average) / deviceRatio
|
val deviceRatio: Double
|
||||||
|
if(Constants.DEVICE_VERSION_TYPE == "V0"){
|
||||||
|
//used for latest v0 devices
|
||||||
|
deviceRatio = led4Average / led1Average
|
||||||
|
borderlineMetric = (led1Average - led4Average) / deviceRatio
|
||||||
|
|
||||||
|
}else {
|
||||||
|
deviceRatio = led2Average / led1Average
|
||||||
|
borderlineMetric = (led1Average - led2Average) / deviceRatio
|
||||||
|
}
|
||||||
if (led1BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(0)
|
if (led1BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(0)
|
||||||
?.get(0)!!
|
?.get(0)!!
|
||||||
|| led2BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(
|
|| led2BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(
|
||||||
@@ -1138,13 +1246,29 @@ class HemoCubeFragment : Fragment() {
|
|||||||
Toast.makeText(requireContext(), getString(messageResId), Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), getString(messageResId), Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startBufferProcess() {
|
private fun checkCuvettePresence() {
|
||||||
hemoCubeViewModel.progressBar.postValue(true)
|
Toast.makeText(requireContext(),"Please wait...",Toast.LENGTH_LONG).show()
|
||||||
|
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.btnPlacebuffer.visibility = View.GONE
|
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hemoCubeViewModel.progressBar.postValue(true)
|
||||||
|
|
||||||
|
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.CHECK_CUVETTE_COMMAND,
|
||||||
|
object : UsbServiceListener {
|
||||||
|
override fun onUsbRead(data: ByteArray?) {}
|
||||||
|
|
||||||
|
override fun onUsbError(e: Exception?) {
|
||||||
|
hemoCubeViewModel.progressBar.postValue(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
private fun startBufferProcess() {
|
||||||
|
hemoCubeViewModel.progressBar.postValue(true)
|
||||||
|
// activity?.runOnUiThread {
|
||||||
|
// binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
// }
|
||||||
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.START_BUFFER_COMMAND,
|
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.START_BUFFER_COMMAND,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
override fun onUsbRead(data: ByteArray?) {}
|
override fun onUsbRead(data: ByteArray?) {}
|
||||||
@@ -1166,6 +1290,7 @@ class HemoCubeFragment : Fragment() {
|
|||||||
hemoCubeViewModel.progressBar.postValue(false)
|
hemoCubeViewModel.progressBar.postValue(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun sendFirstGainCommand() {
|
private fun sendFirstGainCommand() {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
testDetails?.kitSerial = kitSerial
|
testDetails?.kitSerial = kitSerial
|
||||||
}
|
}
|
||||||
testDetails?.testStatus = testStatus
|
testDetails?.testStatus = testStatus
|
||||||
|
// localFileDataSource.backUpDataToCSV("",testDetails)
|
||||||
try {
|
try {
|
||||||
if (isOnline) {
|
if (isOnline) {
|
||||||
parseData()
|
parseData()
|
||||||
@@ -160,8 +160,8 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
val resultList = MolbioV2ResultRequest(mutableListOf())
|
val resultList = MolbioV2ResultRequest(mutableListOf())
|
||||||
val pendingData = hemoCubeDao.getMolbioPending()
|
val pendingData = hemoCubeDao.getMolbioPending()
|
||||||
Log.d("molbio","pending size"+pendingData.size)
|
Log.d("molbio","pending size"+pendingData.size)
|
||||||
pendingData.forEach{
|
pendingData.forEach { userData ->
|
||||||
userData ->
|
if (userData.testStatus == true) {
|
||||||
val currentTimeFormatted = SimpleDateFormat(
|
val currentTimeFormatted = SimpleDateFormat(
|
||||||
"yyyy-MM-dd'T'HH:mm:ssZZZZZ",
|
"yyyy-MM-dd'T'HH:mm:ssZZZZZ",
|
||||||
Locale.getDefault()
|
Locale.getDefault()
|
||||||
@@ -186,6 +186,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resultList.results?.forEach { result ->
|
resultList.results?.forEach { result ->
|
||||||
result.rawData?.let { sanitizeDoubleValues(it) }
|
result.rawData?.let { sanitizeDoubleValues(it) }
|
||||||
@@ -226,7 +227,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
pendingData.forEach{
|
pendingData.forEach{
|
||||||
userData ->
|
userData ->
|
||||||
if (userData != null) {
|
if (userData != null) {
|
||||||
if (!userData.localFlag) {
|
if (!userData.localFlag && userData.testStatus == true) {
|
||||||
bulkAddResultTestToDb(userData)
|
bulkAddResultTestToDb(userData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -398,6 +399,8 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
testDetails?.solution = DataHolder.hemoCubeTestData?.solution
|
testDetails?.solution = DataHolder.hemoCubeTestData?.solution
|
||||||
testDetails?.concentration = DataHolder.hemoCubeTestData?.concentration
|
testDetails?.concentration = DataHolder.hemoCubeTestData?.concentration
|
||||||
testDetails?.volume = DataHolder.hemoCubeTestData?.volume
|
testDetails?.volume = DataHolder.hemoCubeTestData?.volume
|
||||||
|
testDetails?.filter = DataHolder.hemoCubeTestData?.filter
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addResultTestToDb() {
|
private fun addResultTestToDb() {
|
||||||
@@ -643,7 +646,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
val fileName = "HPOS${getCurrentDate()}.csv"
|
val fileName = "HPOS${getCurrentDate()}.csv"
|
||||||
if (localFileDataSource.exportDataToCSV(fileName, hemoCubeTestData)) {
|
if (localFileDataSource.exportDataToCSV(fileName, hemoCubeTestData)) {
|
||||||
hemoCubeTestData.forEach { data ->
|
hemoCubeTestData.forEach { data ->
|
||||||
data.localFlag = true
|
// data.localFlag = true
|
||||||
hemoCubeDao.updateCSVFieldById(
|
hemoCubeDao.updateCSVFieldById(
|
||||||
data._id,
|
data._id,
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import androidx.core.view.get
|
|||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import androidx.core.view.get
|
|||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import androidx.core.content.ContextCompat
|
|||||||
import androidx.core.view.get
|
import androidx.core.view.get
|
||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import com.example.hpostesting.data.constant.Constants
|
|||||||
import com.example.hpostesting.data.constant.LanguageManager
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeFragment
|
import com.example.hpostesting.presentation.hemocube.HemoCubeFragment
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.util.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.hpostesting.presentation.testRight
|
package com.example.hpostesting.util
|
||||||
|
|
||||||
import android.app.Service
|
import android.app.Service
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -3,8 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
tools:context=".presentation.KitScanActivity">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/app_bar_layout"
|
android:id="@+id/app_bar_layout"
|
||||||
|
|||||||
25
app/src/main/res/layout/activity_scanner_kit_actvity.xml
Normal file
25
app/src/main/res/layout/activity_scanner_kit_actvity.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.budiyev.android.codescanner.CodeScannerView
|
||||||
|
android:id="@+id/scanner_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:autoFocusButtonColor="@android:color/white"
|
||||||
|
app:autoFocusButtonVisible="true"
|
||||||
|
app:flashButtonColor="@android:color/white"
|
||||||
|
app:flashButtonVisible="true"
|
||||||
|
app:frameColor="@android:color/white"
|
||||||
|
app:frameCornersSize="50dp"
|
||||||
|
app:frameCornersRadius="0dp"
|
||||||
|
app:frameAspectRatioWidth="1"
|
||||||
|
app:frameAspectRatioHeight="1"
|
||||||
|
app:frameSize="0.75"
|
||||||
|
app:frameThickness="2dp"
|
||||||
|
app:frameVerticalBias="0.5"
|
||||||
|
app:maskColor="#77000000"/>
|
||||||
|
</FrameLayout>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?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.ScannerKitActvity">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner_solutions"
|
android:id="@+id/spinner_solutions"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
android:visibility="visible"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:background="@drawable/spinner_border"
|
android:background="@drawable/spinner_border"
|
||||||
@@ -50,6 +51,7 @@
|
|||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner_concentration"
|
android:id="@+id/spinner_concentration"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
android:visibility="visible"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginTop="48dp"
|
||||||
android:background="@drawable/spinner_border"
|
android:background="@drawable/spinner_border"
|
||||||
@@ -59,6 +61,20 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/spinner_solutions" />
|
app:layout_constraintTop_toBottomOf="@id/spinner_solutions" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spinner_admin"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="52dp"
|
||||||
|
android:background="@drawable/spinner_border"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/spinner_concentration" />
|
||||||
|
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner_volume"
|
android:id="@+id/spinner_volume"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -71,6 +87,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/spinner_concentration" />
|
app:layout_constraintTop_toBottomOf="@id/spinner_concentration" />
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_submit"
|
android:id="@+id/btn_submit"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -147,36 +147,52 @@
|
|||||||
app:layout_constraintHorizontal_bias="1.0"
|
app:layout_constraintHorizontal_bias="1.0"
|
||||||
app:layout_constraintStart_toEndOf="@id/et_abha_id"
|
app:layout_constraintStart_toEndOf="@id/et_abha_id"
|
||||||
app:layout_constraintTop_toTopOf="@id/et_abha_id" />
|
app:layout_constraintTop_toTopOf="@id/et_abha_id" />
|
||||||
<Button
|
<LinearLayout
|
||||||
android:visibility="gone"
|
android:id="@+id/ll_btns"
|
||||||
android:id="@+id/btn_samplestart"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="16dp"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:text="@string/Start_Sample"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
app:cornerRadius="16dp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_placebuffer" />
|
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_placebuffer"
|
android:id="@+id/btn_placebuffer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="150dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
|
android:visibility="visible"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:text="@string/place_buffer"
|
android:text="@string/place_buffer"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
app:cornerRadius="16dp"
|
app:cornerRadius="16dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
/>
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
<Button
|
||||||
|
android:id="@+id/btn_samplestart"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:text="@string/Start_Sample"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:cornerRadius="16dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_retry_check_cuvette"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:text="@string/retry"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:cornerRadius="16dp"
|
||||||
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_submit"
|
android:id="@+id/btn_submit"
|
||||||
@@ -189,9 +205,9 @@
|
|||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
app:cornerRadius="16dp"
|
app:cornerRadius="16dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
/>
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/error_message"
|
android:id="@+id/error_message"
|
||||||
@@ -206,7 +222,7 @@
|
|||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
app:layout_constraintTop_toBottomOf="@id/ll_btns" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_device_messages"
|
android:id="@+id/tv_device_messages"
|
||||||
@@ -217,9 +233,9 @@
|
|||||||
android:text="no device message"
|
android:text="no device message"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="11sp"
|
android:textSize="11sp"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/error_message" />
|
app:layout_constraintTop_toBottomOf="@id/ll_btns" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
|||||||
25
app/src/main/res/layout/qrscanner.xml
Normal file
25
app/src/main/res/layout/qrscanner.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.budiyev.android.codescanner.CodeScannerView
|
||||||
|
android:id="@+id/scanner_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:autoFocusButtonColor="@android:color/white"
|
||||||
|
app:autoFocusButtonVisible="true"
|
||||||
|
app:flashButtonColor="@android:color/white"
|
||||||
|
app:flashButtonVisible="true"
|
||||||
|
app:frameColor="@android:color/white"
|
||||||
|
app:frameCornersSize="50dp"
|
||||||
|
app:frameCornersRadius="0dp"
|
||||||
|
app:frameAspectRatioWidth="1"
|
||||||
|
app:frameAspectRatioHeight="1"
|
||||||
|
app:frameSize="0.75"
|
||||||
|
app:frameThickness="2dp"
|
||||||
|
app:frameVerticalBias="0.5"
|
||||||
|
app:maskColor="#77000000"/>
|
||||||
|
</FrameLayout>
|
||||||
@@ -272,4 +272,8 @@
|
|||||||
|
|
||||||
<string name="downloadcsv">सीएसवी डाउनलोड करें</string>
|
<string name="downloadcsv">सीएसवी डाउनलोड करें</string>
|
||||||
<string name="action_activity">Activities</string>
|
<string name="action_activity">Activities</string>
|
||||||
|
<string name="check_cuvette">Checking cuvette presence</string>
|
||||||
|
<string name="cuvette_present">Cuvette present</string>
|
||||||
|
<string name="cuvette_absent">Cuvette absent</string>
|
||||||
|
<string name="retry">Retry</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -271,6 +271,10 @@
|
|||||||
<string name="ok">ಸರಿ</string>
|
<string name="ok">ಸರಿ</string>
|
||||||
<string name="downloadcsv">CSV ಡೌನ್ಲೋಡ್ ಮಾಡಿ</string>
|
<string name="downloadcsv">CSV ಡೌನ್ಲೋಡ್ ಮಾಡಿ</string>
|
||||||
<string name="action_activity">Activities</string>
|
<string name="action_activity">Activities</string>
|
||||||
|
<string name="check_cuvette">Checking cuvette presence</string>
|
||||||
|
<string name="cuvette_present">Cuvette present</string>
|
||||||
|
<string name="cuvette_absent">Cuvette absent</string>
|
||||||
|
<string name="retry">Retry</string>
|
||||||
<!-- Add translations for other strings -->
|
<!-- Add translations for other strings -->
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
<string name="Firefox">Firefox</string>
|
<string name="Firefox">Firefox</string>
|
||||||
<string name="Files">Files</string>
|
<string name="Files">Files</string>
|
||||||
<string name="deviceinfo">Device Information</string>
|
<string name="deviceinfo">Device Information</string>
|
||||||
<string name="place_buffer">Start</string>
|
<string name="place_buffer">Start Buffer</string>
|
||||||
<string name="Start_Sample">Start Sample</string>
|
<string name="Start_Sample">Start Sample</string>
|
||||||
<string name="new_kit">New Kit</string>
|
<string name="new_kit">New Kit</string>
|
||||||
<string name="new_buffer">New Buffer</string>
|
<string name="new_buffer">New Buffer</string>
|
||||||
@@ -274,4 +274,8 @@
|
|||||||
<string name="app_language">App Language</string>
|
<string name="app_language">App Language</string>
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="action_activity">Activities</string>
|
<string name="action_activity">Activities</string>
|
||||||
|
<string name="check_cuvette">Checking cuvette presence</string>
|
||||||
|
<string name="cuvette_present">Cuvette present , you can start the test</string>
|
||||||
|
<string name="cuvette_absent">Cuvette is absent , please place the cuvette and retry again</string>
|
||||||
|
<string name="retry">Retry again</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user