优化余量计量模式下拿完所有数据时总重量不对的问题
This commit is contained in:
@@ -356,8 +356,12 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
log("registerDataChange weight 联合支付-余量计量")
|
log("registerDataChange weight 联合支付-余量计量")
|
||||||
if (weight <= WEIGHT_RESET_RECOGNIZE) {
|
if (weight <= WEIGHT_RESET_RECOGNIZE) {
|
||||||
log("registerDataChange weight 联合支付-余量计量,重量小于${WEIGHT_RESET_RECOGNIZE}g,step1FoodRecognizing")
|
log("registerDataChange weight 联合支付-余量计量,重量小于${WEIGHT_RESET_RECOGNIZE}g,step1FoodRecognizing")
|
||||||
if (presentation?.currentUserId.isNullOrBlank().not()) {
|
if (presentation?.currentUserId.isNullOrBlank().not() && presentation!!.jointPaymentQueryFinish) {
|
||||||
//联合支付+余量计量,已识别人脸的状态下,从秤上拿餐品后,不再读取数据,等待人脸离开提交订单
|
//联合支付+余量计量,已识别人脸的状态下,从秤上拿餐品后,不再读取数据,等待人脸离开提交订单
|
||||||
|
if (lastWeight != weight) {
|
||||||
|
presentation?.updateWeight(weight)
|
||||||
|
lastWeight = weight
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//秤上重量过小,显示识别中页面
|
//秤上重量过小,显示识别中页面
|
||||||
|
|||||||
@@ -185,7 +185,9 @@ class MainScreenPresentation(
|
|||||||
calculateNutrition(weight)
|
calculateNutrition(weight)
|
||||||
} else {
|
} else {
|
||||||
//余量计量
|
//余量计量
|
||||||
calculateNutrition(recognitionWeight - weight)
|
val value = recognitionWeight - weight
|
||||||
|
Timber.tag(TAG).e("updateWeight 余量计量:${recognitionWeight} - ${weight} = ${value}")
|
||||||
|
calculateNutrition(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastWeight = weight
|
lastWeight = weight
|
||||||
|
|||||||
Reference in New Issue
Block a user