feat(activity): 为 MasterScaleActivity 各秤格子新增清零点击事件,修复高频数据更新导致点击失效的问题
This commit is contained in:
@@ -141,12 +141,13 @@ object ScaleServiceManager {
|
||||
* @param deviceId 目标设备 ID
|
||||
* @param address 目标秤地址
|
||||
*/
|
||||
fun sendTare(deviceId: String, address: Int) {
|
||||
if (deviceId == GlobalData.deviceId) {
|
||||
fun sendTare(deviceId: String, address: Int): Boolean {
|
||||
return if (deviceId == GlobalData.deviceId) {
|
||||
com.shuwei.dish.match.utils.WeightUtil.tareTwo(address)
|
||||
true
|
||||
} else {
|
||||
val cmd = ScaleCommand(ScaleCommand.CMD_TARE, deviceId, address)
|
||||
wsClient?.sendCommand(deviceId, cmd)
|
||||
wsClient?.sendCommand(deviceId, cmd) ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user