修改菜品识别逻辑
This commit is contained in:
@@ -74,8 +74,9 @@ class SecondaryScreenPresentation(
|
||||
private lateinit var itemUserNutritionBinding: ItemUserNutritionBinding
|
||||
private lateinit var stepChangeCallback: (Int) -> Unit
|
||||
|
||||
// 上一次的计算热量结果
|
||||
private var lastWeight = 0.0
|
||||
|
||||
private var detectWeight = 0.0 //识别菜品时的重量
|
||||
private var lastWeight = 0.0 // 上一次的计算热量结果
|
||||
private val debouncer = Debouncer(500)
|
||||
private var recognitionTime: Long = 0L // 人脸识别时的时间
|
||||
private var recognitionWeight: Double = 0.0 // 人脸识别时的重量
|
||||
@@ -288,6 +289,10 @@ class SecondaryScreenPresentation(
|
||||
calculateNutrition(recognitionWeight - lastWeight)
|
||||
}
|
||||
|
||||
fun updateDetectWeight(weight: Double) {
|
||||
detectWeight = weight * 1000 // 将千克转成克
|
||||
}
|
||||
|
||||
/**
|
||||
* 余量取餐
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user