增加无餐盘提醒

This commit is contained in:
mazengfei
2026-01-22 15:49:36 +08:00
parent d4f9ace67b
commit 5bc244dde5
3 changed files with 23 additions and 19 deletions
+2 -2
View File
@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-12-30T02:33:30.984909200Z">
<DropdownSelection timestamp="2026-01-22T07:28:00.026342Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="Default" identifier="serial=192.168.1.105:5555;connection=c501a2a1" />
<DeviceId pluginId="Default" identifier="serial=192.168.1.128:5555;connection=c168ec92" />
</handle>
</Target>
</DropdownSelection>
@@ -84,6 +84,7 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
private const val COLLECT_SUCCESS = "collect_success"
private const val RECOGNIZE_SUCCESS = "recognize_success"
private const val NO_PLATE_REMIND = "no_plate_remind";
fun goInitActivity() {
instance?.goInitActivity()
@@ -142,6 +143,7 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
val soundMap = hashMapOf<String, Int>()
soundMap[COLLECT_SUCCESS] = R.raw.collect_success
soundMap[RECOGNIZE_SUCCESS] = R.raw.recognize_success
soundMap[NO_PLATE_REMIND] = R.raw.no_plate_remind
SoundPoolUtil.getInstance().loadR(this, soundMap);
}
@@ -289,12 +291,7 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
if (similar > faceSuccessThreshold) {
//大 于识别阈值,作为识别成功判断
currentUserId = result?.faceEntity?.userName
if (tempUserId != currentUserId) {
SoundPoolUtil.getInstance().play(RECOGNIZE_SUCCESS, 0)
} else {
SoundPoolUtil.getInstance().play(COLLECT_SUCCESS, 0)
}
openPlate(currentUserId)
Debouncer(5000).debounce { openPlate(currentUserId) }
return
}
loadLogInfo("collectFace,recognizeUserId 人脸识别相似度为:${similar},失败次数为:${retryFailCount}")
@@ -328,7 +325,7 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
SoundPoolUtil.getInstance().play("success", 0)
}
// plateEnable = true
openPlate(currentUserId)
Debouncer(5000).debounce { openPlate(currentUserId) }
}
/**
@@ -357,16 +354,22 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
if (item == null) {
//暂无餐盘
loadLogInfo("collectFace,openPlate: 暂无餐盘,请联系管理人员,isCollectFace=$isCollectFace")
ToastUtils.showToast("暂无餐盘,请联系管理人员")
//ToastUtils.showToast("暂无餐盘,请联系管理人员")
SoundPoolUtil.getInstance().play(NO_PLATE_REMIND, 0)
goInitActivity()
return@getPlateData
}
if (tempUserId != currentUserId) {
SoundPoolUtil.getInstance().play(RECOGNIZE_SUCCESS, 0)
} else {
SoundPoolUtil.getInstance().play(COLLECT_SUCCESS, 0)
}
loadLogInfo("collectFace,openPlate: item3:${item}")
item.faceId = userId
item.updateTime = DateTimeUtils.getDateTimeString()
item.plateNumber = null
plateEnable = false
debouncer.debounce {
Debouncer(5000).debounce {
//打开柜子
PlateUtils.open(this, item.equipmentBoxCode, false)
}
@@ -376,7 +379,7 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
}
}
private val debouncer by lazy { Debouncer(3000) }
// private val debouncer by lazy { Debouncer(3000) }
private fun initArcView() {
//在布局结束后才做初始化操作
@@ -842,6 +845,7 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
// }, 5L, 5L, TimeUnit.MILLISECONDS
// )
}
private var isCollectFace = false
// private fun checkFaceBlock() {
// loadLogInfo("collectFace,currentUserId=${currentUserId}")
Binary file not shown.