From ef78717c5b956a26b360de44f774fc2b804296c2 Mon Sep 17 00:00:00 2001
From: 张世豪 <979909237@qq.com>
Date: 星期四, 20 十一月 2025 20:56:36 +0800
Subject: [PATCH] 修改20251120
---
src/home/CardMachineUI.java | 55 +++++++++++--------------------------------------------
1 files changed, 11 insertions(+), 44 deletions(-)
diff --git a/src/home/CardMachineUI.java b/src/home/CardMachineUI.java
index 12e7f49..63c01cd 100644
--- a/src/home/CardMachineUI.java
+++ b/src/home/CardMachineUI.java
@@ -87,7 +87,7 @@
startUIUpdates(); // UI鍒锋柊瀹氭椂鍣�
startSerialStatusMonitoring(); // 涓插彛鐘舵�佺洃鎺�
- System.out.println("涓荤晫闈㈠垵濮嬪寲瀹屾垚");
+ //System.out.println("涓荤晫闈㈠垵濮嬪寲瀹屾垚");
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null,
@@ -133,7 +133,7 @@
try {
// 鍒濆鍖栧崱妲界鐞嗗櫒 - 蹇呴』棣栧厛鎵ц
slotManager = new SlotManager();
- System.out.println("鍗℃Ы绠$悊鍣ㄥ垵濮嬪寲瀹屾垚");
+ //System.out.println("鍗℃Ы绠$悊鍣ㄥ垵濮嬪寲瀹屾垚");
// 鐩存帴浣跨敤宸茬粡鍒濆鍖栫殑閰嶇疆绯荤粺
Chushihua configSystem = Chushihua.getInstance();
@@ -156,9 +156,9 @@
PICKUP_PASSWORD = configSystem.getMachineConfig().getFetchCardPassword();
}
- System.out.println("绯荤粺閰嶇疆鍒濆鍖栧畬鎴�");
- System.out.println("绠$悊鍛樺瘑鐮侀暱搴�: " + (ADMIN_PASSWORD != null ? ADMIN_PASSWORD.length() : "null"));
- System.out.println("鍙栧崱瀵嗙爜闀垮害: " + (PICKUP_PASSWORD != null ? PICKUP_PASSWORD.length() : "null"));
+ //System.out.println("绯荤粺閰嶇疆鍒濆鍖栧畬鎴�");
+ //System.out.println("绠$悊鍛樺瘑鐮侀暱搴�: " + (ADMIN_PASSWORD != null ? ADMIN_PASSWORD.length() : "null"));
+ //System.out.println("鍙栧崱瀵嗙爜闀垮害: " + (PICKUP_PASSWORD != null ? PICKUP_PASSWORD.length() : "null"));
} catch (Exception e) {
System.err.println("绯荤粺鍒濆鍖栧紓甯�: " + e.getMessage());
@@ -466,9 +466,6 @@
cardSlotsPanel.removeAll();
slotButtons.clear();
- int updatedSlots = 0;
- int errorSlots = 0;
-
for (int i = 1; i <= TOTAL_SLOTS; i++) {
final int slotId = i;
SlotStatus status = getSlotStatusFromManager(slotId);
@@ -476,10 +473,8 @@
// 娣诲姞璋冭瘯淇℃伅
Fkj slotInfo = slotManager.getSlotInfo(slotId);
if (slotInfo != null) {
- updatedSlots++;
} else {
System.err.println("鍗℃Ы " + slotId + " - 鑾峰彇淇℃伅澶辫触");
- errorSlots++;
}
JButton slotButton = new JButton(String.valueOf(slotId));
@@ -509,7 +504,7 @@
cardSlotsPanel.revalidate();
cardSlotsPanel.repaint();
- System.out.println("鍗℃Ы鏄剧ず鏇存柊瀹屾垚: " + updatedSlots + " 涓垚鍔�, " + errorSlots + " 涓け璐�");
+// //System.out.println("鍗℃Ы鏄剧ず鏇存柊瀹屾垚: " + updatedSlots + " 涓垚鍔�, " + errorSlots + " 涓け璐�");
}
private Color brighterColor(Color color) {
@@ -572,7 +567,6 @@
if (panel.getComponentCount() >= 2) {
JLabel textLabel = (JLabel) panel.getComponent(1);
if (textLabel.getText().startsWith("涓插彛:")) {
- String statusText = lunxun.isSerialConnected() ? "姝e父" : "鏂紑";
Color statusColor = lunxun.isSerialConnected() ?
new Color(52, 152, 219) : new Color(231, 76, 60);
@@ -591,8 +585,9 @@
boolean pickupSuccess = CardPickupDialog.showCardPickup(this, slotId, status);
if (pickupSuccess) {
- // 鍙栧崱鎴愬姛锛岀晫闈㈠凡缁忓湪瀵硅瘽妗嗕腑鏇存柊锛岃繖閲屼笉闇�瑕侀澶栨搷浣�
- System.out.println("鍗℃Ы " + slotId + " 鍙栧崱鎴愬姛");
+ // 鍙栧崱鎴愬姛锛岃皟鐢╟hanggehaska鏂规硶鏀瑰彉鍗℃Ы灞炴��
+ SlotManager.changgehaska(slotId, "1"); // "1"琛ㄧず绠$悊鍛樻搷浣�
+ //System.out.println("鍗℃Ы " + slotId + " 鍙栧崱鎴愬姛锛屽凡鏇存柊鍗℃Ы鐘舵��");
}
}
@@ -610,7 +605,7 @@
// 鍋滄杞鏌ヨ
if (lunxun.isPolling()) {
lunxun.stopPolling();
- System.out.println("搴旂敤绋嬪簭鍏抽棴锛岃疆璇㈡煡璇㈠凡鍋滄");
+ //System.out.println("搴旂敤绋嬪簭鍏抽棴锛岃疆璇㈡煡璇㈠凡鍋滄");
}
// 鍋滄涓插彛鍗忚瑙f瀽鍣紙鏂板锛�
@@ -637,34 +632,6 @@
return "涓插彛瑙f瀽鍣ㄦ湭鍒濆鍖�";
}
- /**
- * 鍒涘缓缇庡寲鎸夐挳
- */
- private JButton createStyledButton(String text, Color color) {
- JButton button = new JButton(text);
- button.setFont(new Font("Microsoft YaHei", Font.BOLD, 14));
- button.setBackground(color);
- button.setForeground(Color.WHITE);
- button.setFocusPainted(false);
- button.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20));
- button.setCursor(new Cursor(Cursor.HAND_CURSOR));
-
- // 榧犳爣鎮仠鏁堟灉
- button.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseEntered(java.awt.event.MouseEvent evt) {
- button.setBackground(brighterColor(color));
- }
-
- public void mouseExited(java.awt.event.MouseEvent evt) {
- button.setBackground(color);
- }
- });
-
- return button;
- }
-
-
-
/**
* 楠岃瘉鍙栧崱瀵嗙爜
*/
@@ -818,7 +785,7 @@
if (lunxun.checkSerialConnection()) {
boolean resumed = lunxun.setPollingPaused(false);
if (resumed) {
- System.out.println("鍒囨崲鍒颁富椤甸潰锛岃疆璇㈡煡璇㈠凡鎭㈠");
+ //System.out.println("鍒囨崲鍒颁富椤甸潰锛岃疆璇㈡煡璇㈠凡鎭㈠");
}
} else {
System.err.println("鍒囨崲鍒颁富椤甸潰锛屼覆鍙f湭杩炴帴锛屼繚鎸佽疆璇㈡殏鍋�");
--
Gitblit v1.9.3