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
64bbc916
Commit
64bbc916
authored
Sep 06, 2022
by
tongzifang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.1.1
parent
ee724c35
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
20 deletions
+14
-20
ZqToolActivity.kt
app/src/main/java/com/qimai/android/widget/ZqToolActivity.kt
+6
-6
build.gradle
zqtoolkit/build.gradle
+1
-1
ScaleHub.kt
zqtoolkit/src/main/java/com/qmai/zqtoolkit/ScaleHub.kt
+6
-11
ScaleAppType.kt
...t/src/main/java/com/qmai/zqtoolkit/config/ScaleAppType.kt
+1
-2
No files found.
app/src/main/java/com/qimai/android/widget/ZqToolActivity.kt
View file @
64bbc916
...
@@ -190,12 +190,12 @@ class ZqToolActivity : AppCompatActivity() {
...
@@ -190,12 +190,12 @@ class ZqToolActivity : AppCompatActivity() {
tvState
?.
text
=
"稳定"
tvState
?.
text
=
"稳定"
tvState
?.
setBackgroundColor
(
Color
.
GREEN
)
tvState
?.
setBackgroundColor
(
Color
.
GREEN
)
tvLivingWeight
?.
text
=
tvLivingWeight
?.
text
=
"实时重量"
+
it
.
weight
+
" 单位"
+
it
.
unit
+
"time:"
+
System
.
currentTimeMillis
()
"实时重量"
+
it
.
weight
+
" 单位"
+
it
.
unit
+
"time:"
+
System
.
currentTimeMillis
()
}
else
{
}
else
{
tvState
?.
setBackgroundColor
(
Color
.
RED
)
tvState
?.
setBackgroundColor
(
Color
.
RED
)
tvState
?.
text
=
"不稳定"
tvState
?.
text
=
"不稳定"
tvLivingWeight
?.
text
=
tvLivingWeight
?.
text
=
"实时重量"
+
it
.
weight
+
" 单位"
+
it
.
unit
+
"time:"
+
System
.
currentTimeMillis
()
"实时重量"
+
it
.
weight
+
" 单位"
+
it
.
unit
+
"time:"
+
System
.
currentTimeMillis
()
}
}
}
}
}
}
...
@@ -219,7 +219,7 @@ class ZqToolActivity : AppCompatActivity() {
...
@@ -219,7 +219,7 @@ class ZqToolActivity : AppCompatActivity() {
when
(
v
.
id
)
{
when
(
v
.
id
)
{
R
.
id
.
ButConnect
->
{
R
.
id
.
ButConnect
->
{
if
(!
m_bConnected
)
{
if
(!
m_bConnected
)
{
// ScaleHub.connect(this, ScaleInfo(1,
ScaleAppType.SHOP_ASSITANT_2C))
ScaleHub
.
connect
(
this
,
ScaleInfo
(
appType
=
ScaleAppType
.
SHOP_ASSITANT_2C
))
// Thread {
// Thread {
// if (zqeb.EB_Connect(
// if (zqeb.EB_Connect(
// String.format(
// String.format(
...
@@ -269,13 +269,13 @@ class ZqToolActivity : AppCompatActivity() {
...
@@ -269,13 +269,13 @@ class ZqToolActivity : AppCompatActivity() {
}
}
}
}
R
.
id
.
rb_zq
->
{
R
.
id
.
rb_zq
->
{
ScaleHub
.
initScale
(
QmScaleBrand
.
ZQEB
)
//
ScaleHub.initScale(QmScaleBrand.ZQEB)
}
}
R
.
id
.
rb_sunmi
->
{
R
.
id
.
rb_sunmi
->
{
ScaleHub
.
initScale
(
QmScaleBrand
.
SUNMI
)
//
ScaleHub.initScale(QmScaleBrand.SUNMI)
}
}
R
.
id
.
rb_dj
->
{
R
.
id
.
rb_dj
->
{
ScaleHub
.
initScale
(
QmScaleBrand
.
ACLAS
)
//
ScaleHub.initScale(QmScaleBrand.ACLAS)
}
}
R
.
id
.
ButSend
->
{
R
.
id
.
ButSend
->
{
if
(
m_bConnected
)
{
if
(
m_bConnected
)
{
...
...
zqtoolkit/build.gradle
View file @
64bbc916
...
@@ -30,7 +30,7 @@ android {
...
@@ -30,7 +30,7 @@ android {
}
}
}
}
group
'com.qmai.android.zqtoolkit'
group
'com.qmai.android.zqtoolkit'
version
'1.1.
0
'
version
'1.1.
1
'
gradlePublish
{
gradlePublish
{
...
...
zqtoolkit/src/main/java/com/qmai/zqtoolkit/ScaleHub.kt
View file @
64bbc916
...
@@ -41,18 +41,13 @@ object ScaleHub : ScaleBaseAction {
...
@@ -41,18 +41,13 @@ object ScaleHub : ScaleBaseAction {
// }
// }
fun
initScale
(
qmScaleBrand
:
QmScaleBrand
)
{
fun
manualInitSDK
(
scale
:
ScaleInfo
)
{
disconnect
()
disconnect
()
scaleKit
=
when
(
qmScaleBrand
)
{
scaleKit
=
when
(
scale
.
brand
?.
brand
)
{
QmScaleBrand
.
SUNMI
->
{
QmScaleBrand
.
ZQEB
.
brand
->
ZqScaleKit
SunmiScaleKit
QmScaleBrand
.
SUNMI
.
brand
->
SunmiScaleKit
}
QmScaleBrand
.
ACLAS
.
brand
->
AclasScaleKit
QmScaleBrand
.
ZQEB
->
{
else
->
null
ZqScaleKit
}
QmScaleBrand
.
ACLAS
->
{
AclasScaleKit
}
}
}
}
}
...
...
zqtoolkit/src/main/java/com/qmai/zqtoolkit/config/ScaleAppType.kt
View file @
64bbc916
...
@@ -5,7 +5,6 @@ package com.qmai.zqtoolkit.config
...
@@ -5,7 +5,6 @@ package com.qmai.zqtoolkit.config
* 2022/9/6
* 2022/9/6
*/
*/
enum
class
ScaleAppType
(
enum
class
ScaleAppType
{
)
{
SHOP_ASSITANT_2C
,
SHOP_ASSITANT_2B
;
SHOP_ASSITANT_2C
,
SHOP_ASSITANT_2B
;
}
}
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