| | |
| | | private void recordPollingStateBeforeEntering() { |
| | | wasPollingRunning = chushihua.lunxun.isPolling(); |
| | | wasPollingPaused = chushihua.lunxun.isPaused(); |
| | | System.out.println("进入快速取卡页面,记录轮询状态 - 运行: " + wasPollingRunning + ", 暂停: " + wasPollingPaused); |
| | | //System.out.println("进入快速取卡页面,记录轮询状态 - 运行: " + wasPollingRunning + ", 暂停: " + wasPollingPaused); |
| | | } |
| | | |
| | | /** |
| | |
| | | private void pausePollingWhenEntering() { |
| | | if (chushihua.lunxun.isPolling() && !chushihua.lunxun.isPaused()) { |
| | | chushihua.lunxun.pausePolling(); |
| | | System.out.println("进入快速取卡页面,轮询已暂停"); |
| | | //System.out.println("进入快速取卡页面,轮询已暂停"); |
| | | } |
| | | } |
| | | |
| | |
| | | if (wasPollingRunning && !wasPollingPaused) { |
| | | if (chushihua.lunxun.isPolling() && chushihua.lunxun.isPaused()) { |
| | | chushihua.lunxun.resumePolling(); |
| | | System.out.println("退出快速取卡页面,轮询已恢复"); |
| | | //System.out.println("退出快速取卡页面,轮询已恢复"); |
| | | } |
| | | } else { |
| | | System.out.println("退出快速取卡页面,保持原有轮询状态 - 运行: " + wasPollingRunning + ", 暂停: " + wasPollingPaused); |
| | | //System.out.println("退出快速取卡页面,保持原有轮询状态 - 运行: " + wasPollingRunning + ", 暂停: " + wasPollingPaused); |
| | | } |
| | | } |
| | | |
| | |
| | | boolean sent = Sendmsg.sendMessage(command); |
| | | |
| | | if (sent) { |
| | | System.out.println("成功发送开门指令到卡槽 " + slotId); |
| | | //System.out.println("成功发送开门指令到卡槽 " + slotId); |
| | | } else { |
| | | System.err.println("发送开门指令到卡槽 " + slotId + " 失败"); |
| | | } |
| | |
| | | // 更新卡槽状态为无卡 |
| | | slotStatuses.set(index, SlotStatus.NO_CARD); |
| | | |
| | | // 调用 SlotManager 更新状态 |
| | | slotManager.setSlotHasCard(slotId, "0"); |
| | | // 调用 SlotManager 的changgehaska方法更新状态 |
| | | SlotManager.changgehaska(slotId, "1"); // "1"表示管理员操作 |
| | | |
| | | updateCardSlotsDisplay(); |
| | | updateStatistics(); |
| | |
| | | for (int i = 0; i < slotStatuses.size(); i++) { |
| | | if (slotStatuses.get(i) == SlotStatus.HAS_CARD) { |
| | | slotStatuses.set(i, SlotStatus.NO_CARD); |
| | | // 调用 SlotManager 更新状态 |
| | | slotManager.setSlotHasCard(i + 1, "0"); |
| | | // 调用 SlotManager 的changgehaska方法更新状态 |
| | | SlotManager.changgehaska(i + 1, "1"); // "1"表示管理员操作 |
| | | openedCount++; |
| | | } |
| | | } |