Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Widget
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Android Widget
Widget
Commits
b5a4f652
Commit
b5a4f652
authored
May 27, 2022
by
tongzifang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复zq sunmi 负数稳定
parent
2dfbd1ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
build.gradle
zqtoolkit/build.gradle
+1
-1
SunmiScaleKit.kt
...it/src/main/java/com/qmai/zqtoolkit/base/SunmiScaleKit.kt
+1
-2
ZqScaleKit.kt
...olkit/src/main/java/com/qmai/zqtoolkit/base/ZqScaleKit.kt
+7
-1
No files found.
zqtoolkit/build.gradle
View file @
b5a4f652
...
@@ -30,7 +30,7 @@ android {
...
@@ -30,7 +30,7 @@ android {
}
}
}
}
group
'com.qmai.android.zqtoolkit'
group
'com.qmai.android.zqtoolkit'
version
'1.0.7.
2
'
version
'1.0.7.
3
'
gradlePublish
{
gradlePublish
{
...
...
zqtoolkit/src/main/java/com/qmai/zqtoolkit/base/SunmiScaleKit.kt
View file @
b5a4f652
...
@@ -2,7 +2,6 @@ package com.qmai.zqtoolkit.base
...
@@ -2,7 +2,6 @@ package com.qmai.zqtoolkit.base
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.os.RemoteException
import
android.util.Log
import
android.util.Log
import
com.qmai.zqtoolkit.ConnectState
import
com.qmai.zqtoolkit.ConnectState
import
com.qmai.zqtoolkit.LivingWeight
import
com.qmai.zqtoolkit.LivingWeight
...
@@ -58,7 +57,7 @@ object SunmiScaleKit : ScaleBaseKit() {
...
@@ -58,7 +57,7 @@ object SunmiScaleKit : ScaleBaseKit() {
)
)
updateWeight
(
updateWeight
(
LivingWeight
(
LivingWeight
(
i2
==
1
,
i2
and
1
==
1
,
decimalFormat
.
format
((
i
*
1.0f
/
1000
).
toDouble
()),
decimalFormat
.
format
((
i
*
1.0f
/
1000
).
toDouble
()),
"kg"
,
"kg"
,
decimalFormat
.
format
((
i1
*
1.0f
/
1000
).
toDouble
()),
decimalFormat
.
format
((
i1
*
1.0f
/
1000
).
toDouble
()),
...
...
zqtoolkit/src/main/java/com/qmai/zqtoolkit/base/ZqScaleKit.kt
View file @
b5a4f652
...
@@ -2,6 +2,7 @@ package com.qmai.zqtoolkit.base
...
@@ -2,6 +2,7 @@ package com.qmai.zqtoolkit.base
import
android.content.Context
import
android.content.Context
import
android.util.Log
import
android.util.Log
import
com.blankj.utilcode.util.NumberUtils
import
com.qmai.zqtoolkit.ConnectState
import
com.qmai.zqtoolkit.ConnectState
import
com.qmai.zqtoolkit.LivingWeight
import
com.qmai.zqtoolkit.LivingWeight
import
com.qmai.zqtoolkit.base.scale.ScaleBaseKit
import
com.qmai.zqtoolkit.base.scale.ScaleBaseKit
...
@@ -9,6 +10,7 @@ import com.zqebsdk.zqebsdk
...
@@ -9,6 +10,7 @@ import com.zqebsdk.zqebsdk
import
com.zqprintersdk.PrinterConst
import
com.zqprintersdk.PrinterConst
import
kotlinx.coroutines.*
import
kotlinx.coroutines.*
import
kotlinx.coroutines.flow.*
import
kotlinx.coroutines.flow.*
import
java.math.BigDecimal
/**
/**
* author : tongzi
* author : tongzi
...
@@ -143,7 +145,11 @@ object ZqScaleKit : ScaleBaseKit() {
...
@@ -143,7 +145,11 @@ object ZqScaleKit : ScaleBaseKit() {
var
strUnitTare
=
strRet
[
2
].
replace
(
"[^a-z^A-Z]"
.
toRegex
(),
""
)
var
strUnitTare
=
strRet
[
2
].
replace
(
"[^a-z^A-Z]"
.
toRegex
(),
""
)
strTare
=
strRet
[
2
].
replace
(
strUnitTare
,
""
)
strTare
=
strRet
[
2
].
replace
(
strUnitTare
,
""
)
}
}
if
(
Integer
.
valueOf
(
strRet
[
0
])
==
0
)
{
//0是读取成功 2且读数<0也是稳定
if
(
Integer
.
valueOf
(
strRet
[
0
])
==
0
||
(
Integer
.
valueOf
(
strRet
[
0
])
==
2
&&
strWeight
.
isNotEmpty
()
&&
strWeight
.
toFloat
()
<
0
)
)
{
strState
=
"OK"
strState
=
"OK"
when
{
when
{
stableWeight
.
size
==
4
->
{
stableWeight
.
size
==
4
->
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment