Browse Source

add ab enable 1

devab
MTing 4 weeks ago
parent
commit
c967c00a42
  1. 20
      app/src/main/java/com/ouxuan/oxface/OXFaceOnlineActivity.java
  2. 9
      app/src/main/java/com/ouxuan/oxface/abgate/ABGateManager.java
  3. 15
      app/src/main/java/com/ouxuan/oxface/utils/VenueSceneUtils.java

20
app/src/main/java/com/ouxuan/oxface/OXFaceOnlineActivity.java

@ -1744,7 +1744,7 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi
LogManager.logInfo(TAG, "准备调用ABPeopleCheck方法");
boolean peopleCheckPassed = abGateManager.ABPeopleCheck();
LogManager.logInfo(TAG, "ABPeopleCheck方法返回结果: " + peopleCheckPassed);
peopleCheckPassed = true; //TODO test
// peopleCheckPassed = true; //TODO test
if (!peopleCheckPassed) {
LogManager.logWarning(TAG, "人数检测未通过,准备显示弹窗");
// 人数检测未通过显示弹窗
@ -1829,21 +1829,23 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi
if (gateConfig != null && gateConfig.gateOpenEnable) {
// 如果 gate_open_enable true直接开门不进行网络核销
LogManager.logInfo(TAG, "检测到离场场景,gate_enter_open_enable为true,直接开启B门");
showLoadingStatus("离场验证成功");
showLoadingStatus("门已打开,请直接离场");
// 直接开启B门
if (gateABController != null) {
LogManager.logInfo(TAG, "gate_enter_open_enable为true,直接开启B门");
gateABController.handleFaceRecognitionSuccess(false); // 参数保留兼容性实际都开B门
}
pauseCamera();
// 2秒后隐藏提示并开门
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
hideLoadingStatus();
// 直接开启B门
if (gateABController != null) {
LogManager.logInfo(TAG, "gate_enter_open_enable为true,直接开启B门");
gateABController.handleFaceRecognitionSuccess(false); // 参数保留兼容性实际都开B门
}
resumeCamera();
}
}, 2000);
}, 5000);
} else {
// gate_enter_open_enable false 或配置不存在按正常流程进行网络校验
if (isNetworkAvailable()) {

9
app/src/main/java/com/ouxuan/oxface/abgate/ABGateManager.java

@ -200,6 +200,15 @@ public class ABGateManager {
public boolean ABPeopleCheck() {
LogManager.logInfo(TAG, "执行AB门内人数检查");
// 首先检查gate_ab_enable配置如果为false则直接返回true
if (context != null) {
VenueSceneUtils.GateConfig gateConfig = VenueSceneUtils.getGateConfig(context);
if (gateConfig != null && !gateConfig.gateAbEnable) {
LogManager.logInfo(TAG, "gate_ab_enable为false,跳过人数检查,直接返回true");
return true;
}
}
// 检查485是否启用
if (!ox485.isGateCamera485OxOn()) {
String errorMsg = "485摄像头模式未启用";

15
app/src/main/java/com/ouxuan/oxface/utils/VenueSceneUtils.java

@ -144,13 +144,11 @@ public class VenueSceneUtils {
gateConfig.gateAbUdp = padConfig.getExtension() != null &&
padConfig.getExtension().getPadSetting() != null &&
padConfig.getExtension().getPadSetting().isGateAbUdp();
// 添加gate_open_enable配置
gateConfig.gateOpenEnable = padConfig.getExtension() != null &&
padConfig.getExtension().getPadSetting() != null &&
padConfig.getExtension().getPadSetting().isGateOpenEnable();
Log.d(TAG, "门禁配置 - EnterOpenEnable: " + gateConfig.gateEnterOpenEnable +
", AbGpio: " + gateConfig.gateAbGpio +
", AbUdp: " + gateConfig.gateAbUdp);
", AbUdp: " + gateConfig.gateAbUdp +
", AbEnable: " + gateConfig.gateAbEnable);
return gateConfig;
} else {
@ -167,19 +165,18 @@ public class VenueSceneUtils {
* 门禁配置信息类
*/
public static class GateConfig {
public boolean gateEnterOpenEnable = false; // 门禁进入开启使能暂时未知
public boolean gateEnterOpenEnable = false; // 门禁进入开启使能
public boolean gateAbGpio = false; // 门禁AB GPIO
public boolean gateAbUdp = false; // 门禁AB UDP
public boolean gateAbEnable = false; // ab门总开关
public boolean gateOpenEnable = false; //离场核销直接开门
@Override
public String toString() {
return "GateConfig{" +
"gateOpenEnable=" + gateOpenEnable +
"gateEnterOpenEnable=" + gateEnterOpenEnable +
", gateAbGpio=" + gateAbGpio +
", gateAbUdp=" + gateAbUdp +
", gateAbEnable=" + gateAbEnable +
'}';
}
}

Loading…
Cancel
Save