Commit 28f5caf5 authored by tongzifang's avatar tongzifang

单位小写

parent c574501b
...@@ -193,12 +193,12 @@ class ZqToolActivity : AppCompatActivity() { ...@@ -193,12 +193,12 @@ class ZqToolActivity : AppCompatActivity() {
tvState?.text = "稳定" tvState?.text = "稳定"
tvState?.setBackgroundColor(Color.GREEN) tvState?.setBackgroundColor(Color.GREEN)
tvLivingWeight?.text = tvLivingWeight?.text =
"实时重量" + it.weight + "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 + "time:" + System.currentTimeMillis() "实时重量" + it.weight +" 单位" + it.unit+ "time:" + System.currentTimeMillis()
} }
} }
} }
......
...@@ -8,7 +8,7 @@ package com.qmai.zqtoolkit ...@@ -8,7 +8,7 @@ package com.qmai.zqtoolkit
data class LivingWeight( data class LivingWeight(
val isStable: Boolean, val isStable: Boolean,
val weight: String, val weight: String,
val unit: String, var unit: String,
val tare: String, val tare: String,
val isReadErr: Boolean val isReadErr: Boolean
) )
...@@ -62,6 +62,9 @@ abstract class ScaleBaseKit : ScaleBaseAction, ScaleUpdateAction { ...@@ -62,6 +62,9 @@ abstract class ScaleBaseKit : ScaleBaseAction, ScaleUpdateAction {
when { when {
stableWeight.size == STABLE_COUNT -> { stableWeight.size == STABLE_COUNT -> {
if (stableWeight.toSet().size == 1) { if (stableWeight.toSet().size == 1) {
//给业务的unit要小写
if (weight.unit.isNotEmpty())
weight.unit = weight.unit.lowercase()
_livingWeight.emit(weight) _livingWeight.emit(weight)
} }
stableWeight.clear() stableWeight.clear()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment