|
@ -791,6 +791,9 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
gateABController = GateABController.getInstance(); |
|
|
gateABController = GateABController.getInstance(); |
|
|
gateABController.initialize(this); |
|
|
gateABController.initialize(this); |
|
|
|
|
|
|
|
|
|
|
|
// 初始化门禁不可用弹窗 |
|
|
|
|
|
gateUnavailableDialog = new GateUnavailableDialog(this); |
|
|
|
|
|
|
|
|
// 检查是否开启AB门检测 |
|
|
// 检查是否开启AB门检测 |
|
|
checkGateCheckEnabled(); |
|
|
checkGateCheckEnabled(); |
|
|
|
|
|
|
|
@ -807,6 +810,12 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
public void onGateUnavailable(String reason) { |
|
|
public void onGateUnavailable(String reason) { |
|
|
LogManager.logWarning(TAG, "触发门禁不可用弹窗(触发时机1): " + reason); |
|
|
LogManager.logWarning(TAG, "触发门禁不可用弹窗(触发时机1): " + reason); |
|
|
|
|
|
|
|
|
|
|
|
// 检查门禁不可用弹窗是否已初始化 |
|
|
|
|
|
if (gateUnavailableDialog == null) { |
|
|
|
|
|
LogManager.logError(TAG, "门禁不可用弹窗未初始化,无法显示"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 检查是否应该显示弹窗 |
|
|
// 检查是否应该显示弹窗 |
|
|
boolean shouldShow = gateUnavailableDialog.checkShow(OXFaceOnlineActivity.this, isNetworkAvailable()); |
|
|
boolean shouldShow = gateUnavailableDialog.checkShow(OXFaceOnlineActivity.this, isNetworkAvailable()); |
|
|
if (shouldShow) { |
|
|
if (shouldShow) { |
|
@ -829,6 +838,14 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
public void onGateAvailable() { |
|
|
public void onGateAvailable() { |
|
|
LogManager.logInfo(TAG, "门禁恢复可用,隐藏弹窗并恢复摄像头预览"); |
|
|
LogManager.logInfo(TAG, "门禁恢复可用,隐藏弹窗并恢复摄像头预览"); |
|
|
|
|
|
|
|
|
|
|
|
// 检查门禁不可用弹窗是否已初始化 |
|
|
|
|
|
if (gateUnavailableDialog == null) { |
|
|
|
|
|
LogManager.logWarning(TAG, "门禁不可用弹窗未初始化,无法隐藏"); |
|
|
|
|
|
// 直接恢复摄像头预览 |
|
|
|
|
|
resumeCamera(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 隐藏门禁不可用弹窗 |
|
|
// 隐藏门禁不可用弹窗 |
|
|
if (gateUnavailableDialog != null && gateUnavailableDialog.isShowing()) { |
|
|
if (gateUnavailableDialog != null && gateUnavailableDialog.isShowing()) { |
|
|
gateUnavailableDialog.hide(); |
|
|
gateUnavailableDialog.hide(); |
|
@ -840,6 +857,11 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onGateStatusUpdate(boolean gateAOpen, boolean gateBOpen, boolean udpConnected) { |
|
|
public void onGateStatusUpdate(boolean gateAOpen, boolean gateBOpen, boolean udpConnected) { |
|
|
|
|
|
// 检查门禁不可用弹窗是否已初始化 |
|
|
|
|
|
if (gateUnavailableDialog == null) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 实时更新弹窗中的门状态显示 |
|
|
// 实时更新弹窗中的门状态显示 |
|
|
if (gateUnavailableDialog != null && gateUnavailableDialog.isShowing()) { |
|
|
if (gateUnavailableDialog != null && gateUnavailableDialog.isShowing()) { |
|
|
LogManager.logInfo(TAG, "更新弹窗中的门状态显示: A门-" + |
|
|
LogManager.logInfo(TAG, "更新弹窗中的门状态显示: A门-" + |
|
@ -865,9 +887,6 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
LogManager.logInfo(TAG, "AB门检测已关闭,跳过设置门状态监听器(触发时机1)"); |
|
|
LogManager.logInfo(TAG, "AB门检测已关闭,跳过设置门状态监听器(触发时机1)"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 初始化门禁不可用弹窗 |
|
|
|
|
|
gateUnavailableDialog = new GateUnavailableDialog(this); |
|
|
|
|
|
|
|
|
|
|
|
// 设置弹窗操作监听器 |
|
|
// 设置弹窗操作监听器 |
|
|
gateUnavailableDialog.setDialogListener(new GateUnavailableDialog.GateUnavailableDialogListener() { |
|
|
gateUnavailableDialog.setDialogListener(new GateUnavailableDialog.GateUnavailableDialogListener() { |
|
|
@Override |
|
|
@Override |
|
@ -956,6 +975,12 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
*/ |
|
|
*/ |
|
|
private void showNewGateUnavailableDialog(String reason) { |
|
|
private void showNewGateUnavailableDialog(String reason) { |
|
|
try { |
|
|
try { |
|
|
|
|
|
// 检查门禁不可用弹窗是否已初始化 |
|
|
|
|
|
if (gateUnavailableDialog == null) { |
|
|
|
|
|
LogManager.logError(TAG, "门禁不可用弹窗未初始化,无法显示: " + reason); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 执行checkShow()判断是否显示弹窗 |
|
|
// 执行checkShow()判断是否显示弹窗 |
|
|
boolean shouldShow = gateUnavailableDialog.checkShow(OXFaceOnlineActivity.this, isNetworkAvailable()); |
|
|
boolean shouldShow = gateUnavailableDialog.checkShow(OXFaceOnlineActivity.this, isNetworkAvailable()); |
|
|
if (shouldShow) { |
|
|
if (shouldShow) { |
|
@ -989,6 +1014,12 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
*/ |
|
|
*/ |
|
|
private void showNewPeopleCountDialog(boolean isLeaveScene, int peopleNum) { |
|
|
private void showNewPeopleCountDialog(boolean isLeaveScene, int peopleNum) { |
|
|
try { |
|
|
try { |
|
|
|
|
|
// 检查门禁不可用弹窗是否已初始化 |
|
|
|
|
|
if (gateUnavailableDialog == null) { |
|
|
|
|
|
LogManager.logError(TAG, "门禁不可用弹窗未初始化,无法显示人数异常弹窗"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 执行checkShow()判断是否显示弹窗 |
|
|
// 执行checkShow()判断是否显示弹窗 |
|
|
boolean shouldShow = gateUnavailableDialog.checkShow(OXFaceOnlineActivity.this, isNetworkAvailable()); |
|
|
boolean shouldShow = gateUnavailableDialog.checkShow(OXFaceOnlineActivity.this, isNetworkAvailable()); |
|
|
if (shouldShow) { |
|
|
if (shouldShow) { |
|
|