优化
This commit is contained in:
@@ -295,6 +295,8 @@ class MainScreenPresentation(
|
||||
}
|
||||
}
|
||||
|
||||
private var isGoRecognize = true
|
||||
|
||||
/**
|
||||
* 显示识别出的菜品信息
|
||||
*/
|
||||
@@ -316,6 +318,7 @@ class MainScreenPresentation(
|
||||
//独立支队
|
||||
loadUserNutritionData(userId)
|
||||
}
|
||||
step3Debouncer.reset()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -702,7 +705,7 @@ class MainScreenPresentation(
|
||||
private var lastAddWeight = 0
|
||||
private fun addFoodToOrder(weight: Int, foodInfo: FoodInfo) {
|
||||
Log.d(TAG, "addFoodToOrder: ${weight == lastAddWeight}")
|
||||
if (weight == lastAddWeight) return
|
||||
// if (weight == lastAddWeight) return
|
||||
lastAddWeight = weight
|
||||
if (weight <= 10) {
|
||||
//0-即放即取,1-余量计量
|
||||
@@ -922,9 +925,15 @@ class MainScreenPresentation(
|
||||
Timber.tag(TAG).d("resumeCamera isRecognition = $isRecognition")
|
||||
isRecognition = true
|
||||
if (rgbCameraHelper == null) {
|
||||
Timber.tag(TAG).d("resumeCamera isRecognition ---1")
|
||||
setupArcCamera()
|
||||
rgbCameraHelper!!.start()
|
||||
binding.root.postDelayed({
|
||||
if (rgbCameraHelper != null) {
|
||||
rgbCameraHelper!!.start()
|
||||
}
|
||||
}, 2000)
|
||||
} else if (rgbCameraHelper!!.isStopped) {
|
||||
Timber.tag(TAG).d("resumeCamera isRecognition ---2")
|
||||
rgbCameraHelper!!.start()
|
||||
}
|
||||
}
|
||||
@@ -1000,9 +1009,12 @@ class MainScreenPresentation(
|
||||
activity,
|
||||
Observer { compareResult: CompareResult ->
|
||||
if (currentStep != 2 || System.currentTimeMillis() - recognizeTime <= 2000) {
|
||||
//忽略非识别中及两秒内的再次识别
|
||||
//忽略非识别中及5秒内的再次识别
|
||||
return@Observer
|
||||
}
|
||||
// if (isGoRecognize.not()) {
|
||||
// return@Observer
|
||||
// }
|
||||
recognizeTime = System.currentTimeMillis()
|
||||
activity.runOnUiThread {
|
||||
activity.showWaitingDialog("加载中,请稍后……")
|
||||
|
||||
Reference in New Issue
Block a user