Browse Source

change log

dev
MTing 9 hours ago
parent
commit
5cbe618fe2
  1. 4
      app/src/main/java/com/ouxuan/oxface/abgate/ABGateManager.java
  2. 1
      app/src/main/java/com/ouxuan/oxface/abgate/GateUnavailableDialog.java
  3. 6
      app/src/main/java/com/ouxuan/oxface/device/GateABController.java
  4. 7
      app/src/main/java/com/ouxuan/oxface/device/OxUDP.java
  5. 1
      app/src/main/java/com/ouxuan/oxface/utils/LogManager.java

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

@ -144,12 +144,12 @@ public class ABGateManager {
OxUDP.UDPStateListener tempListener = new OxUDP.UDPStateListener() {
@Override
public void onGateStateUpdate(boolean gateAState, boolean gateBState, String rawData) {
LogManager.logInfo(TAG, "收到门状态更新 - A门: " + (gateAState ? "开启" : "关闭") +
LogManager.logInfo(TAG, "收到门状态更新666 - A门: " + (gateAState ? "开启" : "关闭") +
", B门: " + (gateBState ? "开启" : "关闭"));
// 逻辑A门关闭 AND B门关闭 时才为true
boolean bothGatesClosed = !gateAState && !gateBState;
LogManager.logInfo(TAG, "门状态检查结果: " + (bothGatesClosed ? "可用" : "不可用"));
LogManager.logInfo(TAG, "门状态检查结果666: " + (bothGatesClosed ? "可用" : "不可用"));
gateCheckFuture.complete(bothGatesClosed);
}

1
app/src/main/java/com/ouxuan/oxface/abgate/GateUnavailableDialog.java

@ -420,6 +420,7 @@ public class GateUnavailableDialog {
OxUDP.getInstance().setStateListener(new OxUDP.UDPStateListener() {
@Override
public void onGateStateUpdate(boolean gateAState, boolean gateBState, String rawData) {
LogManager.logInfo(TAG, "onGateStateUpdate触发: " + gateAState+" | "+gateBState);
if (aGateStateListener != null) {
aGateStateListener.onAGateStateChanged(gateAState);
}

6
app/src/main/java/com/ouxuan/oxface/device/GateABController.java

@ -960,7 +960,7 @@ public class GateABController {
boolean shouldShowDialog = false;
boolean oldShouldShow = false;
boolean newShouldShow = false;
// 检查状态是否发生变化
if (currentGateState.gateAOpen != gateAOpen ||
currentGateState.gateBOpen != gateBOpen ||
@ -976,7 +976,9 @@ public class GateABController {
currentGateState.udpConnected = udpConnected;
newShouldShow = currentGateState.shouldShowUnavailableDialog();
LogManager.logInfo(TAG, "updateGateState666-"+ "状态变化: " + stateChanged+ " |shouldShowDialog: " + shouldShowDialog + " |oldShouldShow: " + oldShouldShow+ " |newShouldShow: " + newShouldShow);
// 如果从正常状态变为需要显示弹窗状态则触发弹窗
if (!oldShouldShow && newShouldShow) {
shouldShowDialog = true;

7
app/src/main/java/com/ouxuan/oxface/device/OxUDP.java

@ -420,14 +420,14 @@ public class OxUDP {
if (responseArr.length > 28) {
String aStateValue = responseArr[28];
gateAState = "01".equals(aStateValue); // 01表示开启00表示关闭
Log.d(TAG, "A门状态值: " + aStateValue + " -> " + (gateAState ? "开启" : "关闭"));
Log.d(TAG, "A门状态值parseGateState: " + aStateValue + " -> " + (gateAState ? "开启" : "关闭"));
}
// 解析B门状态第29位数组索引29
if (responseArr.length > 29) {
String bStateValue = responseArr[29];
gateBState = "01".equals(bStateValue); // 01表示开启00表示关闭
Log.d(TAG, "B门状态值: " + bStateValue + " -> " + (gateBState ? "开启" : "关闭"));
Log.d(TAG, "B门状态值parseGateState: " + bStateValue + " -> " + (gateBState ? "开启" : "关闭"));
}
// 记录完整的响应数据用于调试
@ -442,7 +442,8 @@ public class OxUDP {
// Log.d(TAG, "门禁状态 - A门: " + (gateAState ? "开启" : "关闭") +
// ", B门: " + (gateBState ? "开启" : "关闭"));
Log.e(TAG, "parseGateState: isFirstStateUpdate:"+isFirstStateUpdate +" |lastGateAState:"+lastGateAState+" |lastGateBState:"+lastGateBState);
// 检查状态是否发生变化只有变化时才通知监听器
if (isFirstStateUpdate || gateAState != lastGateAState || gateBState != lastGateBState) {
Log.i(TAG, "门禁状态变化 - A门: " + (lastGateAState ? "开启" : "关闭") + " -> " + (gateAState ? "开启" : "关闭") +

1
app/src/main/java/com/ouxuan/oxface/utils/LogManager.java

@ -153,6 +153,7 @@ public class LogManager {
if (instance != null) {
instance.addLogEntry("WARN", tag, message, null);
}
android.util.Log.w(tag,message); //切换为logcat输入日志
}
/**

Loading…
Cancel
Save